In the DebtToken's burn function, the accrued interest adjustment is calculated by applying the debt index twice on an already indexed balance, leading to an excessive token burn. This may force users to burn more tokens than they should, causing repayment discrepancies.
The burn function retrieves the user’s balance using the overridden balanceOf method, which already includes the normalized debt. It then computes the accrued interest by multiplying this balance by both the new and old indexes. This redundant multiplication inflates the calculated balanceIncrease, thereby overstating the debt to be repaid.
Excessive Token Deduction: Users could lose more tokens during repayment than intended, misaligning their debt obligations.
Repayment Mismatch: Over-calculation of interest may lead to discrepancies in the repayment process and overall debt tracking.
Manual Review
Correct the accrued interest calculation by using the raw balance from the underlying ERC20 implementation. For instance, change the calculation as follows:
This modification ensures the debt index is applied only once, preventing an exaggerated token burn.
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.