The current implementation of the StabilityPool
allows users to deposit and withdraw rToken
, but due to the use of scaled amounts in both the deposit()
and withdraw()
functions, users cannot withdraw the total amount of rToken
they originally deposited. This discrepancy arises because the RToken.transferFrom()
function uses normalized amounts, leading to inconsistencies in the amounts users can withdraw compared to what they deposited.
In the StabilityPool
, the deposit()
and withdraw()
functions handle rToken
deposits and withdrawals using scaled amounts, which are adjusted based on the liquidity index. The relevant code snippets are as follows:
The RToken.transferFrom()
function normalizes the amount transferred using the liquidity index:
Since the deposit()
function uses the raw amount
for the transfer, and the withdraw()
function uses the rcrvUSDAmount
(which is also a scaled amount), users find that the amount they can withdraw is less than what they initially deposited.
Due to this vulnerability, users are unable to withdraw the total amount of rToken
they deposited in the stability pool. This can lead to frustration and loss of trust in the stability pool's functionality, potentially deterring users from engaging with the protocol.
Manual Review
It is recommended to ensure that both the deposit and withdrawal functions use normalized amounts for rToken
. This will allow users to withdraw the total amount they deposited without discrepancies.
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.