userBalance
is scaled and amount
is non-scaled. So we cant simply campare them and one of them needs conversion to the other.
In the DebtToken::burn
function, the amount
variable represents the amount of crvUSD that the user wants to withdraw, while userBalance
refers to the balance of RToken that the user possesses. These two values are not comparable because the RToken amount and the crvUSD amount do not have a 1:1 ratio.
This leads to incorrect calculations.
Manual review.
Convert userBalance
to a non-scaled amount by multiplying it by the index before making the comparison.
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.