Initializing amountScaled by Multiplying by index instead of dividing by it can lead to incorrect calculations.
In the RToken::burn function, scaledAmount represents the amount of RToken that should be burned. It is intended to be calculated by dividing amount by reserve.liquidityIndex. However, in the current implementation, this calculation is incorrectly performed by multiplying amount by reserve.liquidityIndex (see here).
Additionally, following the same approach in the mint function, the burn function needs to define a variable called balanceIncrease and account for its effect on amountScaled.
This results in incorrect calculations.
Manual review
To correctly compute amountScaled when accounting for index and balanceIncrease, it should be calculated as follows:
This way, amountScaled should be burned instead of the original amount.
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.