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

## [G-08] ++i/i++ SHOULD BE UNCHECKED{++i}/UNCHECKED{i++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR- AND WHILE-LOOPS

Summary

[G-08] ++i/i++ SHOULD BE UNCHECKED{++i}/UNCHECKED{i++} WHEN IT IS NOT POSSIBLE FOR THEM TO OVERFLOW, AS IS THE CASE WHEN USED IN FOR- AND WHILE-LOOPS

Unchecked operations as the ++i on for loops are cheaper than checked one.

file: /src/Lender.sol
233 for (uint256 i = 0; i < borrows.length; i++) {

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L233

file: /src/Lender.sol
293 for (uint256 i = 0; i < loanIds.length; i++) {

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L293

file: /src/Lender.sol
549 for (uint256 i = 0; i < loanIds.length; i++) {

https://github.com/Cyfrin/2023-07-beedle/blob/main/src/Lender.sol#L549

Support

FAQs

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