Omniscia Steer Protocol Audit
IntegralBaseLiquidityManager Code Style Findings
IntegralBaseLiquidityManager Code Style Findings
IBL-01C: Incorrect Specification of Gap
Type | Severity | Location |
---|---|---|
Standard Conformity | IntegralBaseLiquidityManager.sol:L619 |
Description:
The gap
variable declared by the IntegralBaseLiquidityManager
is set as 37
in length when the contract consumes 10
storage slots per its structure.
Example:
contracts/vault-types/Algebrav4LiquidityManagers/IntegralBaseLiquidityManager.sol
90/// @dev Address of vault registry91/// Address strategist can collect strategist fees, but is not stored here.92address internal vaultRegistry;93
94/// @notice Addresses of Token0 and Token195IERC20 public token0;96IERC20 public token1;97
98/// @notice Address of Algebra pool99IAlgebraPool public pool;100
101///@notice address of Algebra pool's plugin102IVolatilityOracle public plugin;103
104/// @dev For depositing105/// Roughly corresponds to a 5% diff between current price and twap price106int24 public maxTickChange;107
108/// @dev Number of seconds to get the time-weighted average over109uint32 public twapInterval;110
111//For mint Callback Protection112bool internal mintCallBackProtection;113
114//For swap Callback Protection115bool internal swapCallBackProtection;116mapping(string => uint256) public accruedFees0;117mapping(string => uint256) public accruedFees1;118
119address internal feeManager;120uint256 public totalFees0;121uint256 public totalFees1;
Recommendation:
We advise the gap
to be corrected to 40
, properly summing up to 50
slots in total per contract.
Alleviation (e31556397b9d321737ff47809b572383dda4a2aa):
The gap
variable's length has been updated to 41
as the local plugin
member has been removed from the contract, addressing this exhibit.
IBL-02C: Redundant Usage of SafeMath
Type | Severity | Location |
---|---|---|
Language Specific | IntegralBaseLiquidityManager.sol:L2, L45 |
Description:
The linked contract utilizes SafeMath
when it is compiled with a pragma
version of 0.8.X
.
Example:
contracts/vault-types/Algebrav4LiquidityManagers/IntegralBaseLiquidityManager.sol
45using SafeMath for uint256;
Recommendation:
Given that safe arithmetics are toggled on by default in these versions, we advise the usage of SafeMath
to be omitted from the codebase as it incurs an additional gas cost at verbosal benefit.
Alleviation (e31556397b9d321737ff47809b572383dda4a2aa):
The redundant usage of SafeMath
has been safely removed as advised.