The RToken
applies index scaling on each mint and burn action, by overwriting the ERC20 _update()
function and applying rayDiv
. This is to ensure proper deposit interest accrual. The contract also overwrites the transfer()
and transferFrom()
functions, where it also applies rayDiv
to the amount. This leads to double scaling and invalid transfers.
Let's look at the overwritten function:
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/RToken.sol#L212-L226
We can see that the amount is initially scaled and passed down to super.transfer/super.transferFrom
functions. However, these functions invoke the _update()
function as well, which here is overwritten to scale again:
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/RToken.sol#L307-L311
From the above, we can see that when transfers occur, recipients will receive fewer tokens than intended.
Improper token transfers.
Manual review.
Remove the rayDiv
scaling from the overwritten transfer
and transferFrom
functions in RToken
.
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.