Use unchecked blocks in code parts where overflow or underflow is not possible to save on gas
Gas savings: Solidity compiler from 0.8.0 upwards does default internal overflow and underflow checks for arithmetic.
This adds more computation to functions increasing gas costs. However its possible to use unchecked blocks in order to avoid these compiler operation checks in order to save on gas
Manual Analysis
Use the format below for all loops to ensure update i is in unchcheked block
for (uint256 i = 0; ...}
unchecked { ++i}
}
Use care and check if balance updates e.g
unchecked { balances[msg.sender] += _amount;} // only if sure _amount cant ever be too large or balances and e.g impact flash loans, token supply taken into account for specific tokens etc. Could potentially gain more gas savings from these updates as long as there is sureness they do not overflow
unchecked {index = index + _ratio;} // only if sure no possibility so high a _ratio e.g flashloan deposit etc
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.