The RToken::transfer
and RToken::transferFrom
function applies scaling when transferring tokens, but due to an additional scaling operation inside _update
, the transfer amount is scaled down twice. This leads to severe precision errors, significantly reducing transferred values.
Problem description
In RToken::transfer
, the transferred amount is scaled down using ILendingPool(_reservePool).getNormalizedIncome()
.
Inside _update
, which is called by super.transfer
, the amount is scaled down again using the same getNormalizedIncome()
.
This results in unintended double scaling, compounding precision loss and reducing the actual transferred amount beyond what is expected.
Affected Code in RToken
Steps to reproduce
Call transfer(recipient, amount)
on RToken
.
The amount is first scaled down in transfer
.
The scaled amount is then passed into _update
, which applies scaling again.
The recipient receives significantly fewer tokens than expected due to compounded precision loss.
Severe precision loss: The transferred amount is much smaller than intended.
Token devaluation: Users may unknowingly lose value due to compounded scaling errors.
Broken token mechanics: The fundamental transfer logic is flawed, leading to unexpected and inconsistent token behavior.
Manual Review
Modify RToken::transfer
and RToken::transferFrom
to avoid scaling down before calling super.transfer
:
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.