buyLoan()
in Lender.sol
should access its instantiated memory variables instead of storage
loans[loanId].debt
and loans[loanId].collateral
(lines 528 and 529) access storage when memory variables with their values have already been instantiated. 2 warm SLOADs (100 gas each) can be replaced with 2 MLOADS (3 gas each) for savings of 194 gas. Additionally, the gas cost of reading from an array is saved.
Greater than 194 gas is saved.
Change loans[loanId].debt
to totalDebt
and loans[loanId].collateral
to loan.collateral
(lines 528 and 529).
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.