The DebtToken contract contains a critical mathematical error in the calculation of balanceIncrease
during minting operations. The current implementation fails to properly account for the fact that scaledBalance
is already scaled by the current index inside balanceOf
function.
multiplying scaledBalance with index again is inflating the variable, which inflates balanceIncrease variable.
balance Increase= balance@index - balance@oldIndex
balance@index= scaledbalance
balance@oldIndex= (scaledBalance/index )* _userState[onBehalfOf].index
correct formula would be:
balanceIncrease = scaledBalance - (scaledBalance.rayMul(_userState[onBehalfOf].index).rayDiv(index)
)
With present formula of balanceIncrease, users are minted excessive Debt tokens than intended.
this is unfair to users.
Debt accounting is corrupted across the protocol.
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.