The debt increases incorrectly when a user borrows
Whenever a user borrows, we have the following code:
It aims to accrue debt, but it is done incorrectly as balanceOf()
already returns the amount with the accrued debt:
Thus, a wrong scaledBalance
is used for the computation which leads to an inflated interest for the borrower (upon borrowing for a second time as otherwise there would be no interest for him). Scaled balance is supposed to be the balance without the index multiplication but it holds a wrong value as balanceOf()
does not actually return the scaled balance.
Note that this is a different finding from the one in burn()
as while the issues are similar, they are in different functions and fixing one does not fix the other.
Borrowers will pay more interest.
Manual Review
Use the scaled balance instead
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.