Omniscia vfat Audit

MultiFarmStrategy Code Style Findings

MultiFarmStrategy Code Style Findings

MFS-01C: Loop Iterator Optimizations

TypeSeverityLocation
Gas OptimizationMultiFarmStrategy.sol:
I-1: L313
I-2: L321
I-3: L338
I-4: L348

Description:

The linked for loops increment / decrement their iterator "safely" due to Solidity's built - in safe arithmetics (post-0.8.X).

Example:

contracts/strategies/MultiFarmStrategy.sol
313for (uint256 i = 0; i < claims.length; i++) {

Recommendation:

We advise the increment / decrement operations to be performed in an unchecked code block as the last statement within each for loop to optimize their execution cost.

Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):

The referenced loop iterator increment statements have been relocated at the end of each respective for loop's body and have been unwrapped in an unchecked code block, optimizing their gas cost.