The dust amount is the difference between the underlying tokens deposited by the borrowers in the reserve from repaid loans minus the liqudiity + accrued interests from lenders. The code currently fails to properly calculate this difference:
Where currentTotalSupply
is already scaled and totalRealBalance
is scaling the supply again and the contract balance shouldn't be divided by the liquidity index since it reflects an actual balance of the underlying asset (it doesn't accrue interest).
Manual review.
Do not scale contract balance and use currentTotalSupply
instead of totalRealBalance
.
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.