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

Gas in-efficient for loops

Summary

All the for loops in the contracts are gas inefficient.

Vulnerability Details

  1. Unnecessary overflow check is being performed on the loop variable.

Impact

Gas savings

Tools Used

Manual review

Recommendations

Use unchecked block for loop variable increment

function repay(uint256[] calldata loanIds) public {
uint256 i;
while ( i < loanIds.length ) {
...... more code
unchecked{
++i;
}
}
}

Support

FAQs

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