The DebtToken.mint()
function has a check if the usageIndex has increased from the last minting/burning.
We can see that if the user has already borrowed and the usageIndex has increased, the user will receive a increased amount of debt tokens to account for the increase in usageIndex.
The problem is that balanceOf(user) returns the amount of debt tokens multiplied by the usageIndex
When the user borrows again and then the balanceIncrease is calculated, we can observe that the balanceOf() is multiplied again by the index:
Technically, the function does:
Same issue is also found in RToken.mint()
.
The user will receive newUsageIndex
times more debt tokens than they should have.
The balanceOf()
function should return the amount of debt tokens without multiplying by the usageIndex
.
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.