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

Array length is not cached

Summary

Array length is not cached

Vulnerability Details

Solidity compiler reads array length every iteration if not cached. Storage array requires an extra sload operation (100 gas), memory array requires an extra mload operation (3 gas).

Impact

will save 3 gas

Tools Used

manually

Recommendations

cach array length

Support

FAQs

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