Omniscia Bonq Audit

arbitrage-pool Code Style Findings

arbitrage-pool Code Style Findings

ARB-01C: Generic Typographic Mistakes

Description:

The referenced lines contain typographical mistakes or generic documentational errors (i.e. copy-paste) that should be corrected.

Example:

contracts/arbitrage-pool.sol
19/// @dev strores APtoken address for each token

Recommendation:

We advise them to be corrected enhancing the legibility of the codebase.

Alleviation:

The Bonq Protocol team has fixed the documentation errors.

ARB-02C: Redundant Logical Check

Description:

The linked logical check is redundant as it is indirectly performed by the transferFrom operation that follows it.

Example:

contracts/arbitrage-pool.sol
77require(apToken.balanceOf(msg.sender) >= _amount, "3b329 user has no APToken");
78// firstly transfer AP token, then calculating collateral amount
79apToken.transferFrom(msg.sender, address(this), _amount);

Recommendation:

We advise it to be safely omitted from the codebase.

Alleviation:

The Bonq Protocol team has removed the redundant check.

ARB-03C: Variable Mutability Specifier (Immutable)

Description:

The linked variable is assigned to only once during the contract's constructor.

Example:

contracts/arbitrage-pool.sol
32// solhint-disable-next-line func-visibility
33constructor(address _factory) {
34 factory = ITroveFactory(_factory);
35}

Recommendation:

We advise it to be set as immutable greatly optimizing its read-access gas cost.

Alleviation:

The Bonq Protocol team has marked the factory variable as immutable.