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

save storage slot

Summary

cache the state variables

Vulnerability Details

can store the lenderFee and the borrowerFee at one storage slot since they have max values
max lenderFee is 5000
max borrowerFee is 500
so uint48 is very efficient for them and this store 3 state variable into one storge
uint48 lenderFee
uint48 borrowerFee
address feeReceiver

Impact

the gas saved is 20000*2

Tools Used

Recommendations

uint48 is very efficient for them and this store 3 state variable into one storge
uint48 lenderFee
uint48 borrowerFee
address feeReceiver

Support

FAQs

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