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

Loans array can be cached in memory when using it inside for loops

Summary

The loans data structure can be cached in memory in the for loops to save gas.

Vulnerability Details

In many functions where there is a for loop the loans array can be stored in memory to save some gas. I am talking only about the lines where we only read from the storage.

Impact

We save gas as reading from storage is an expensive operation.

Recommendations

Store the loans array in memory in the functions that read from it multiple times (is used inside a for loop).

Support

FAQs

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