Admin can't transfer accrued dust amounts from rToken contract because the asset and rToken are incorrectly scaled. Dust is permanently locked in rToken contract.
Admin can call LendignPool::transferAccruedDust to transfer accrued dust to a specified recipient. rToken::transferAccruedDust is invoked and dust amount is calculated.
i. asset.balanceOf() returns the amount of assets the rToken contract holds. contractBalance is calculated as assetBalance / normalizedIncome.
ii. totalSupply() is overridden and returns the amounts deposited including the accrued interest:
iii. totalRealBalance is calculated as rToken::totalSupply * normalizedIncome
On one hand contractBalance is wrongly divided by normalizedIncome and on the other hand currentTotalSupply is wrongly multiplied by normalizedIncome
Let's take the following example:
normalized income = 1.1
assets held by rToken contract = 1210
total supply of rToken = 1000
Both assets and rToken totalSupply are expressed in non-scaled amounts (actual value which can be withdrawed).
calculateDustAmount() compares the following values:
contractBalance = 1210 / 1.1 = 1100
totalRealBalance = 1000 * 1.1 = 1100
The values are equal, calculateDustAmount returns 0 and no dust is collected.
As the normalizedIncome increases with accrued interest, the contractBalance will become progressively smaller than the totalRealBalance, permanently locking the accumulated dust.
Dust is permanently locked in contract even if protocol implemented the function to collect it.
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.