Balances are scaled twice in a row, minting too much debt tokens to the user.
Inside mint we use scaledBalance to calculate the balance increase, where we scaled it by the index - scaledBalance.rayMul(index) in order to convert it from debtToken to rToken and calculate the increase in interest before minting this together with the amount.
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/DebtToken.sol#L150
However the issue is that balance already scales that amount to rToken, by using rayMul
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/DebtToken.sol#L223
In the end we scale the balance twice before taking the index diff which will result in higher amounts of tokens being minted to the borrower, thus making him repay too much debt.
Borrower pays more debt than it owns us
Manual review
Don't scale the balance twice.
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.