The refinance
function does not properly update the poolBalance
for the pool which the loan is being refinanced into. More specifically, it decreases the poolbalance
by more than it should, which means the lender of that pool will directly lose funds.
The refinance
function is defined as follows (here I am only keeping the logic relevant for this bug):
As you can see, for some amount of debt, which a borrower specifies when they are refinancing a loan, twice that amount is decremented from the poolBalance
of the lender pool which they are refinancing into. This is improper logic and will lead to debt
amount of loss of funds for the owner of that lender pool.
Lenders for the pools being refinanced into from the refinance
function will directly lose funds
Manual review
Remove the following line of code from the refinance
function, L698:
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.