At RToken::calculateDustAmount(), totalRealBalance calculation is wrong. This is because rayMul() is multiplied 2 times.
It should only be applied once.
One of the mulDiv() is applied in the very same function here.
But the amount being multiplied comes from a totalSupply() call, which also multiplied, here is the call. And here is the totalsupply logic that also multiplies.
Incorrect dust calculations. Accounting some dust as obligations to the lenders.
This is because if there is some dust amount, it is calculated from the total supply times the liquidity index, and this is multiplied twice, thus calculating more obligations than the real ones.
Then the obligations are substracted in the return value of the function here. And here you can see that calculate dust amounts function is used when transferring the dust out.
Only apply rayMul() once on the totalRealBalance calculation.
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.