Open code423n4 opened 2 years ago
From readme:
Interestingly enough, while the specific link mentioned by the warden wouldn't save 100 gas, using unchecked on that code and the for loop would.
While I'm not a fan of unchecked due to syntax, I think the finding is valid and above the sponsors require of at last 100 gas
Fair enough, thank you.
Handle
WatchPug
Vulnerability details
For the arithmetic operations that will never over/underflow, using the unchecked directive (Solidity v0.8 has default overflow/underflow checks) can save some gas from the unnecessary internal over/underflow checks.
For example:
rewardsLength - 1
will never underflow.