15,000 USDC
View results
Submission Details
Severity: gas
Valid

use unchecked ++i in loops

Summary

use unchecked ++i in for loops to save gas.

Vulnerability Details

In for loops, since the iterator is already bound by the length of the array. There is no need for the compiler to check whether an increment in the iterator overflows. Hence, in for loops use the following:

unchecked {
++i;
}

Tools Used

Manual review

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.