Incorrect totalRealBalance
calculation in calculateDustAmount
In RToken::calculateDustAmount(), we will calculate the dust amount and then transfer this part as the revenue.
According to the comment, current design is that the owner can take current balance - balance tied with rToken
as the dust amount. This means that we need to calculate current balance which is tied with all rTokens.
Currently, we use totalSupply() * liquidityIndex
as the current balance which is tied with all rTokens. This is incorrect. Because the totalSupply()
in RToken is super.totalSupply().rayMul(ILendingPool(_reservePool).getNormalizedIncome())
. It means that totalSupply()
is the total balance which is tied with rTokens, we don't need to multiple another getNormalizedIncome()
.
This will cause that we get one higher current balance which is tied with rTokens. And the owner may fail to get the expected dust.
This will cause that we get one higher current balance which is tied with rTokens. And the owner may fail to get the expected dust.
Manual
Take currentTotalSupply
as totalRealBalance
.
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.