lenderFee
and borrowerFee
can be packed into smaller data types to save gas.
The current storage layout for Lender.sol
is as follow:
All of these slots are initialized to non-zero during construction, incurring 21000 gas each for using a Gsset operation (for 63000 gas in total).
Note that lenderFee
and borrowerFee
cannot exceed and , respectively. Therefore we can use smaller data types to pack all of those values into one slot.
This converts two Gsset (21000 gas) into two Gsreset (2900 gas), for a total of 34200 gas per lendings created.
Saves 34200 gas per lendings created.
Manual review
Use the recommended storage packing.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.