calculateDustAmount is used to calculate the dust amount in the contract. However, the logic used for the computation is wrong.
The calculateDustAmount()
function contains two scaling errors:
The contract's actual token balance is incorrectly scaled down:
This operation wrongly divides the actual token balance by the normalized income, when the balance represents the real amount and should not be scaled.
2) The total supply is scaled twice:
Since currentTotalSupply
is obtained from totalSupply()
, which already includes scaling by normalized income, which results in double-scaling the value.
Since it is scaling up the totalSupply
and scaling down contractBalance
, this incorrect logic will lead to the owner withdrawing an amount that is not dust as dust which will affect user withdrawals and borrowing
Manual
Implement the correct logic
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.