Open code423n4 opened 2 years ago
Prefix increments are cheaper than postfix increments.
tchkvsky
These functions use not using prefix increments (++x)
++x
Using prefix increment is more gas efficient
DexManagerFacet.sol
#L33
#L52
#L65
Swapper.sol
#L14
Manual review
Consider using prefix increments (++i) to save gas
We internally decided to ignore prefix increments for now.
Prefix increments are cheaper than postfix increments.
Handle
tchkvsky
Vulnerability details
These functions use not using prefix increments (
++x
)Impact
Using prefix increment is more gas efficient
Proof of Concept
DexManagerFacet.sol
#L33
#L52
#L65
Swapper.sol
#L14
Tools Used
Manual review
Recommendation
Consider using prefix increments (++i) to save gas