15,000 USDC
View results
Submission Details
Severity: gas

cache the length of the array before the loop is more gas efficient

caching the length of the array before enter the for loop save gas

for (uint256 i = 0; i < s_collateralTokens.length; i++) {

Recommendations

uint256 length = s_collateralTokens.length ;
for (uint256 i = 0; i < length; i++) {

Support

FAQs

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