Use unchecked
where possible
++i/i++
should be unchecked{++i}/unchecked{i++}
when it is not possible for them to overflow, as is the case when used in for and while loops.
The unchecked
is a solidity 0.8 feature. This can save 30-40 gas per loop
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L118
https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L353
Refactor the code to achieve gas savings, 30-40 gas per loop
Manual review
Use unchecked
where possible
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.