##summary
The majority of Solidity for loops increment a uint256 variable that starts at 0.
These increment operations never need to be checked for over/underflow because the variable will never reach the max number of uint256 (will run out of gas long before that happens). The default over/underflow check wastes gas in every iteration of virtually every for loop.
Using unchecked blocks to save gas
vscode
Increments in for loop can be unchecked (save 30-40 gas per loop iteration)
instead of this
for (uint256 i = 0; i < size; i++)
make it
for (uint256 i = 0; i < size;)
unchecked {
++i;
}
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.