Existing struct layout is wanting for better optimization.
The variable ordering and size in existing structs can be optimized. As an example, consider the Loan struct. Inside it, the fields interestRate
, startTimestamp
, auctionStartTimestamo
and auctionLength
can be stored in smaller uints. All four of these can be stored in uint64
instead of uint256
. Reason being, the interest rate is a small value, and all time-stamp related fields will never realistically need more than type(uint64).max
which is 18446744073709551615
seconds.
Gas
Manual Review
Optimize struct variables. After our aforementioned optimizations, the Loan
struct would look like this:
We saved 2 storage slots with this simple optimization.
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.