Open code423n4 opened 2 years ago
pants
The function Swap.sweepFees uses postfix increaments (x++) instead of prefix increaments (++x).
Swap.sweepFees
x++
++x
Prefix increaments are cheaper than postfix increaments.
Manual code review.
Change all postfix increaments to prefix increaments where it doesn't affects the functionality.
Handle
pants
Vulnerability details
The function
Swap.sweepFees
uses postfix increaments (x++
) instead of prefix increaments (++x
).Impact
Prefix increaments are cheaper than postfix increaments.
Tool Used
Manual code review.
Recommended Mitigation Steps
Change all postfix increaments to prefix increaments where it doesn't affects the functionality.