The current implementation has multiple issues that could lead to incorrect debt accounting and potential economic vulnerabilitiy.
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/tokens/DebtToken.sol#L210
Wrong Amount Burning: The contract burns the raw amount instead of the scaled amount
Incorrect Index Usage: The function uses the lending pool's borrow index instead of the passed index parameter for balance increase calculation
Wrong Return Values: The function returns incorrect values in its tuple
The contract burns more tokens than it should (raw amount vs. scaled amount)
Incorrect interest accrual calculations
References
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
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.