Omniscia Maverick Protocol Audit
MaverickV2RewardFactory Code Style Findings
MaverickV2RewardFactory Code Style Findings
MVF-01C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | ![]() | MaverickV2RewardFactory.sol:L120 |
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/MaverickV2RewardFactory.sol
119for (uint256 i = startIndex; i < endIndex; i++) {120 returnElements[i - startIndex] = _rewards[i];121}
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.