The calculateDustAmount function in RToken.sol mistakenly divides the contract balance by the liquidity index, leading to an underestimated token balance.
The incorrect calculation is found here:
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/tokens/RToken.sol#L319
Since the contract balance is already a raw value, dividing by the normalized income reduces its value unnecessarily.
This miscalculation may cause incorrect surplus fund calculations, preventing proper fund management and could lead to unclaimed tokens sitting in the contract.
Manual code review
Remove the unnecessary division and use the raw balance 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.