The RToken.transferAccruedDust()
function is supposed to transfer dust amounts of the underlying token to certain recipient. It uses calculateDustAmount()
to get the amount of dust to transfer, but the calculation is incorrect.
Looking at this function we can see that the contract balance of crvUSD is unnecessarily divided by the liquidity index, which makes it lower than expected.
After that, we can see that totalSupply()
is multiplied by the liquidity index, but if we take a closer look inside totalSupply()
we can see that this value is already multiplied by the liquidtyIndex.
Inside calculateDustAmount()
totalRealBalance
is higher than expected and contractBalance
is lower than expected, which makes the function return wrong values.
Due to the fact that contractBalance
is lower than expected, the function will return 0 even if there is dust to transfer. This will make the transferAccruedDust()
function revert.
Update the calculateDustAmount()
function the following way:
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.