The Lender::giveLoan()
and Lender::buyLoan()
lack updating the loan's auctionLength
parameter to match the new pool. Either a borrower or a lender can lose their benefits.
The giveLoan()
and buyLoan()
do not update the loan's auctionLength
parameter to match the new pool while updating other parameters.
The giveLoan() updates the loan's other params, but the auctionLength
: https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L416-L420
The buyLoan() updates the loan's other params, but the auctionLength
: https://github.com/Cyfrin/2023-07-beedle/blob/658e046bda8b010a5b82d2d85e824f3823602d27/src/Lender.sol#L518-L522
In the case of giveLoan()
, if the new pool has a longer auction length than the previous pool, a borrower will lose benefits from the longer auction length (the new pool cannot have a shorter auction length in this case).
Similarly, in the case of buyLoan()
, a borrower will lose their benefits if the new pool has a longer auction length than the previous pool. On the other hand, if the new pool has a shorter auction length than the previous pool, a lender (the new pool's owner) may lose their benefits instead.
Manual Review
I recommend updating the auctionLength
parameter in both the giveLoan()
and buyLoan()
, as shown below.
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.