Omniscia Maverick Protocol Audit

MaverickV2IncentiveMatcherFactory Code Style Findings

MaverickV2IncentiveMatcherFactory Code Style Findings

MVM-01C: Ineffectual Usage of Safe Arithmetics

Description:

The linked mathematical operation is guaranteed to be performed safely by logical inference, such as surrounding conditionals evaluated in require checks or if-else constructs.

Example:

v2-rewards/contracts/MaverickV2IncentiveMatcherFactory.sol
67for (uint256 i = startIndex; i < endIndex; i++) {
68 returnElements[i - startIndex] = _allIncentiveMatcher[i];
69}

Recommendation:

Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statement to be wrapped in an unchecked code block thereby optimizing its execution cost.

Alleviation (07ad29f773f16bdfbae3d97d3a7c2f9d64866093):

The referenced operation has been properly wrapped in an unchecked code block, optimizing its gas cost whilst retaining its security guarantees via preceding statements.

MVM-02C: Suboptimal Struct Declaration Style

Description:

The linked declaration style of a struct is using index-based argument initialization.

Example:

v2-rewards/contracts/MaverickV2IncentiveMatcherFactory.sol
52incentiveMatcherParameters = IncentiveMatcherParameters(baseToken, veToken, rewardFactory);

Recommendation:

We advise the key-value declaration format to be utilized instead, greatly increasing the legibility of the codebase.

Alleviation (07ad29f773f16bdfbae3d97d3a7c2f9d64866093):

The key-value declaration style is now properly in use within the referenced struct declaration, addressing this exhibit in full.