The balance increase calculation in both RToken and DebtToken is incorrect because it uses balanceOf() which already returns the balance multiplied by the current index, leading to inflated interest calculations.
In both RToken and DebtToken, when calculating the balance increase (accrued interest) on the mint and burn function, the contracts use balanceOf() which already returns a scaled balance (raw balance * index from the lending pool)
DebtToken:
RToken:
The issue is that:
balanceOf() returns the balance already multiplied by the current index from the lending pool
The balance increase calculation then multiplies this already-scaled balance by the index again
This leads to substantially inflated interest calculations
High. This double multiplication of indices leads to:
Significantly inflated interest calculations
Incorrect debt accounting in DebtToken
Incorrect interest distribution in RToken
Affects all users with existing positions when new operations occur
Use super.balanceOf() to get the raw balance before scaling:
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.