Omniscia vfat Audit
Automation Code Style Findings
Automation Code Style Findings
ANO-01C: Loop Iterator Optimizations
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | Automation.sol: • I-1: L132 • I-2: L168 • I-3: L204 • I-4: L244 • I-5: L278 • I-6: L314 • I-7: L350 |
Description:
The linked for loops increment / decrement their iterator "safely" due to Solidity's built - in safe arithmetics (post-0.8.X).
Impact:
350|350|350
Example:
contracts/Automation.sol
132for (uint256 i; i < strategiesLength; 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.
