The DebtToken's mint function incorrectly calculates interest by using an already interest-adjusted balance to compute additional interest, leading to overstated debt amounts due to compound interest being applied twice.
The mint() function on DebtToken compounds interest twice:
This already includes interest adjustment
calculates interest again using already adjusted balance
mints the inflated amount:
Example scenario:
Initial State:
User has 100 debt tokens
Old index = 1.0
New index = 1.5
Current Implementation:
scaledBalance = balanceOf():
Returns 100 1.5 = 150 (already includes interest)
balanceIncrease calculation:
150*1.5 = 225 (applies interest again)
150*1.0 = 150
balanceIncrease = 225 - 150 = 75
New debt = 100 + 75 = 175
mints 175 debtToken
Should Be:
* Use unscaled balance (100)
* balanceIncrease = (100 1.5) - (100 1.0) = 50
* New debt = 100 + 50 = 150
Users accrue significantly more debt than they should because the contract applies interest calculations twice on the same balance, leading to inflated debt positions and potentially unfair liquidations.
Manual Review
Use unscaled balance for interest calculations
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.