code-423n4 / 2021-10-slingshot-findings

0 stars 0 forks source link

A more efficient for loop index proceeding #9

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

pants

Vulnerability details

At line 46 of ModuleRegistry.sol there is the following for loop: for (uint256 i = 0; i < _moduleAddresses.length; i++) { registerSwapModule(_moduleAddresses[i]); }

Here you could use unchecked{++i} to save gas since it is more efficient then i++. Same should be done at line 61.

tommyz7 commented 2 years ago

Duplicate of #63

alcueca commented 2 years ago

Not a duplicate