RToken
is an interest bearing token, as such, it should appreciate in value vs the reserve asset crvUSD
. When a user deposits crvUSD
they are minted rToken
and that token should be interest bearing and the interest accumulated, able to be redeemed by the user. The interest is calculated using the liquidityIndex
.
But the user never receives this interest, whenever they withdraw their crvUSD back and burn rTokens, they get exactly the amount of rTokens that they burn, meaning they never receive any interest.
The user withdraws crvUSD by burning rTokens through this process:
call LendingPool::withdraw
- specifying the amount of reserveToken
to withdraw
ReservePool::withdraw
-> RToken::burn
The issue is in RToken::burn
side note : in ReservePool::withdraw
there is documentation that shows that the amount of rTokens burned should be the scaled amount needed to burn. Also, the return value from calling mint
in the RToken
contract is expecting the scaled amount of rTokens burned.
In RToken::burn
amount
is the user requested amount of reserveAsset
to receive
amount
is used (the same value) for the amount to burn of rTokens
and the amount of reserveAsset
transferred to the user.
Because of this, the user receives 0 interest that they have earned from holding rToken
.
The amount of rToken
to be burned should be scaled by the index
.
This scaled amount will represent the appreciation in value of rToken
and the interest the user has earned.
Less rToken
shoud be burned for the amount of reserveAsset
that the user receives because the rToken
should have appreciated in value and that would represent the interest the user earned.
There is clear documentation that the protocol is expecting to burn the scaled amount of rTokens
but that is never done.
The user receives no interest that has been generated from depositing the reserveAsset and receiving the minted rTokens.
This removes any incentive for anyone to deposit into the protocol to receive rToken as they will get no reward for it, leaving the protocol unnattractive and having no reason for a user to deposit and provide liquidity to the protocol.
manual review
Scale the amount of rTokens
to burn for the amount
of reserveAsset being withdrawn. Ensuring the user receives the interest that they have accumulated.
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.