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

[GAS-3] Use `storage` instead of `memory` for structs/arrays

Summary

Using memory copies the struct or array in memory. Use storage to save the location in storage and have cheaper reads:

Vulnerability Details

Instances (12):

File: src/Fees.sol
​
30: ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
​
File: src/Lender.sol
​
117: Loan memory loan = loans[loanId];
​
238: Pool memory pool = pools[poolId];
​
249: Loan memory loan = Loan({
​
296: Loan memory loan = loans[loanId];
​
363: Loan memory loan = loans[loanId];
​
367: Pool memory pool = pools[poolId];
​
441: Loan memory loan = loans[loanId];
​
467: Loan memory loan = loans[loanId];
​
552: Loan memory loan = loans[loanId];
​
606: Loan memory loan = loans[loanId];
​
611: Pool memory pool = pools[poolId];
​

Impact

Tools Used

Recommendations

Support

FAQs

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

Give us feedback!