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

`_calculateInterest()` in `Lender.sol` can be refactored to save gas

Summary

_calculateInterest() parameter(s) can be refactored to save gas

Vulnerability Details

Because _calculateInterest() only accesses 3 properties of its Loan parameter, and the Loan struct contains 10 properties in total, it's more gas efficient to only pass those 3 accessed properties to _calculateInterest.

Impact

Gas saved

Tools Used

Recommendations

Refactor Lender.sol so that _calculateInterest is only passed the 3 properties it needs, instead of an entire Loan struct.

Support

FAQs

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