When a user deposits, withdraws or borrows through the LendingPool
the liquidity is rebalanced, by either depositing the difference of the desired buffer (which is 20% of all deposits) and the current buffer (crvUSD
balance of the RToken
contract), or withrdawing the shortage between the two buffers from a Curve crvUSD vault. However everytime assets are tried to be withdrawn from the Curve vault the call will revert.
Everytime there is a deposit, withdraw or borrow call the internal LendingPool::_ensureLiquidity(), _rebalanceLiquidity()
are invoked. Ensure liquidty is to withdraw the required assets from the Curve vault, rebalance liquidity also withdraws from the Curve vault, but only if the targeted buffer is more than the current buffer:
Now let's look at the problem part:
Now if we look at the vault's withdraw()
implementation, address(this)
is specified as receiver and msg.sender
is specified as owner of the shares. We can see that it will try to burn the msg.sender
's shares and transfer the underlying assets to address(this)
. In this case the caller is the msg.sender
, which is the user, however the user doesn't hold any shares. The shares are minted to the Lending pool (address(this)
):
As can be seen in the code above, address(this)
is specified as the shares receiver. Here is a link to the Curve vault's deposit() function. Since all the shares are minted to the Lending Pool, that means all withrawals from the Curve vault will revert everytime.
Medium
, DoS of core functions like deposit, withdraw, borrow
Manual Review
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.