Omniscia Steer Protocol Audit

QuickSwapBaseLiquidityManager Code Style Findings

QuickSwapBaseLiquidityManager Code Style Findings

QSB-01C: Generic Typographic Mistakes

TypeSeverityLocation
Code StyleQuickSwapBaseLiquidityManager.sol:L66, L86, L203, L214, L350, L556, L564

Description:

The referenced lines contain typographical mistakes (i.e. private variable without an underscore prefix) or generic documentational errors (i.e. copy-paste) that should be corrected.

Example:

contracts/vault-types/QuickSwapLiquidityManagers/QuickSwapBaseLiquidityManager.sol
66/// @dev Address of Uniswap Factory

Recommendation:

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

Alleviation (0c3f85c7c11805ac412fe291f5681bef26da7244):

All referenced typographic mistakes have been corrected, addressing this exhibit.

QSB-02C: Inefficient Data Type

TypeSeverityLocation
Gas OptimizationQuickSwapBaseLiquidityManager.sol:L94, L550

Description:

The twapInterval variable within QuickSwapBaseLiquidityManager is set as an int56 variable improperly as it is mandated to always be positive by the QuickSwapBaseLiquidityManager::initialize function and is always cast to a uint32 variable by the QuickSwapBaseLiquidityManager::_checkVolatility function.

Example:

contracts/vault-types/QuickSwapLiquidityManagers/QuickSwapBaseLiquidityManager.sol
550uint32 _twapInterval = uint32(uint56(twapInterval));

Recommendation:

We advise it to be set to a uint32 variable, optimizing the code's gas cost and code style.

Alleviation (0c3f85c7c11805ac412fe291f5681bef26da7244):

The variable's data type has been properly reduced in accuracy, optimizing its usage and addressing this exhibit.

QSB-03C: Inexistent Error Messages

TypeSeverityLocation
Code StyleQuickSwapBaseLiquidityManager.sol:L168, L194, L195, L209, L220, L252-L257, L331, L332, L344, L416

Description:

The linked require checks have no error messages explicitly defined.

Example:

contracts/vault-types/QuickSwapLiquidityManagers/QuickSwapBaseLiquidityManager.sol
168require(shares > 0);

Recommendation:

We advise each to be set so to increase the legibility of the codebase and aid in validating the require checks' conditions.

Alleviation (0c3f85c7c11805ac412fe291f5681bef26da7244):

The Steer Protocol team evaluated this exhibit and opted to not introduce error messages so as to free up available bytecode space for other adaptations to the code as the contract is approaching its size limit.

Given that it is not practically possible to introduce these explicit errors due to size constraints, we consider this exhibit addressed.

QSB-04C: Inexplicable Value Literals

TypeSeverityLocation
Code StyleQuickSwapBaseLiquidityManager.sol:L331, L332

Description:

The referenced configurational limitations are inexplicable as they contain no documentation and represent seemingly arbitrary values.

Example:

contracts/vault-types/QuickSwapLiquidityManagers/QuickSwapBaseLiquidityManager.sol
331require(_maxTickChange > 9 && _maxTickChange < 2001);
332require(_twapInterval > 5 && _twapInterval < 600);

Recommendation:

We advise them to be properly documented and preferably relocated to contract-level constant variables that contain these annotations, greatly increasing the legibility of the codebase.

Alleviation (0c3f85c7c1):

The Steer Protocol team has stated that they do not wish to introduce constant declarations to the contract in fear of increasing its bytecode size.

All variables declared as constant are compilation artefacts and do not affect the contract's bytecode size. Additionally, the literal-based limitations imposed on the configurational _twapInterval and _maxTickChange variables remain undocumented, rendering this exhibit acknowledged.

Alleviation (b1b5eabd4d):

The referenced value literals have been adequately relocated to contract-level constant declarations, however, their documentation remains subpar. We consider this exhibit acknowledged safely based on the fact that the Steer Protocol team has adequately vetted the values they have specified for them.