The balance calculation in calculateDustAmount
is incorrect.
In calculateDustAmount
function, we expect to calculate the dust balance, it means current balance in this RToken contract - all funds which belong to lenders
. The owner can transfer this part of dust direclty.
In calculationDustAmount()
, we calculate the contractBalance
with balanceOf(address(this)).rayDiv(getNormalizedIncome)
. This is incorrect. Because IERC20(_assetAddress).balanceOf(address(this))
already means that the current balance for underlying assets. We should not calculate the scaled amount.
This will cause contractBalance
will be less than expected. The owner may fail to withdraw these dust.
Manual
Use IERC20(_assetAddress).balanceOf(address(this))
as contractBalance
directly.
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.