Omniscia Boson Protocol Audit
FundsHandlerFacet Code Style Findings
FundsHandlerFacet Code Style Findings
FHF-01C: Loop Iterator Optimizations
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | FundsHandlerFacet.sol:L186, L224 |
Description:
The linked for loops increment / decrement their iterator "safely" due to Solidity's built - in safe arithmetics (post-0.8.X).
Example:
contracts/protocol/facets/FundsHandlerFacet.sol
186for (uint i = 0; i < _limit; 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 (2b9f60b6c3323fd234b570089ceff924cdb5851c):
The referenced loop iterator increment statements have been properly relocated to the end of each for loop's body and wrapped in an unchecked code block, optimizing their execution cost.
