Open code423n4 opened 2 years ago
for
https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/index-coop-notional-trade-module/contracts/protocol/modules/v1/NotionalTradeModule.sol#L238-L240
for(uint256 i = 0; i < modules.length; i++) { try IDebtIssuanceModule(modules[i]).registerToIssuanceModule(_setToken) {} catch {} }
Gas could be saved by:
Example:
length = modules.length; for(uint256 i; i < length;) { try IDebtIssuanceModule(modules[i]).registerToIssuanceModule(_setToken) {} catch {} unchecked { ++i; } }
Gas Report
[G-01]
for
loop gas optimisationhttps://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/index-coop-notional-trade-module/contracts/protocol/modules/v1/NotionalTradeModule.sol#L238-L240
Gas could be saved by:
Example: