Omniscia Bonq Audit
arbitrage-pool Code Style Findings
arbitrage-pool Code Style Findings
ARB-01C: Generic Typographic Mistakes
Type | Severity | Location |
---|---|---|
Code Style | arbitrage-pool.sol:L19, L21 |
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
Type | Severity | Location |
---|---|---|
Gas Optimization | arbitrage-pool.sol:L77 |
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 amount79apToken.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)
Type | Severity | Location |
---|---|---|
Gas Optimization | arbitrage-pool.sol:L25 |
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-visibility33constructor(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
.