The Lending pool has an option to clear accumulated dust amounts from the RToken by calling:
As we can see it first calculates the dust amount by calling calculateDustAmount:
First it retrieves the actual balance of the crvUSD in the RToken, then calculates the total real balance by retrieving the totalSupply:
However the total supply is already scaled by the liquidity index. But when calculating the real balance, it scales it again:
currentTotalSupply.rayMul(ILendingPool(_reservePool).getNormalizedIncome()); by the liquidity index. That means contractBalance will always be less than computed totalRealBalance, which will always return 0, because the real balance is scaled 2x by the index.
Dust amount can never be taken out from the RToken.
Manual Review
It should use rayDiv when calculating the real balance.
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.