During withdrawals from the Curve vault, the protocol incorrectly specifies the msg.sender (user) as the owner of the shares to burn and the LendingPool (address(this)) as the receiver of the withdrawn assets. This is incorrect because:
Shares Ownership: Curve vault shares are minted to the LendingPool (address(this)) during deposits, so the LendingPool should be the owner of the shares to burn during withdrawals.
Receiver of Assets: The withdrawn assets should be sent to the RToken contract, not the LendingPool, as users burn their RTokens to redeem the underlying assets (crvUSD).
This misconfiguration prevents the RToken contract from receiving the withdrawn assets, leading to insufficient liquidity for users to burn their RTokens and redeem crvUSD.
Deposit Flow:
When a user deposits crvUSD, the funds are sent to the RToken contract.
A portion of the funds (based on the liquidity buffer ratio) is kept in the RToken contract, and the remainder is deposited into the Curve vault.
Curve vault shares are minted to the LendingPool (address(this)), as the LendingPool is the entity interacting with the vault.
Withdrawal Flow:
When a user requests a withdrawal, the protocol checks the available liquidity in the RToken contract.
If the RToken contract lacks sufficient liquidity, the protocol attempts to withdraw the required amount from the Curve vault.
The _withdrawFromVault function calls the Curve vault's withdraw method with the following parameters:
solidity
Copy
address(this): Specifies the LendingPool as the receiver of the shares to burn.
msg.sender: Specifies the user as the owner of the withdrawn assets.
Issue: The LendingPool (address(this)) is the address with the actual shares. The withdrawn assets are sent to the user (msg.sender) instead of the RToken contract. This is incorrect because:
The RToken contract needs to receive the withdrawn assets to fulfill the user's redemption request.
The user burns their RTokens to redeem crvUSD from the RToken contract, not directly from the Curve vault.
The RToken contract does not receive the withdrawn assets, leading to insufficient liquidity for users to burn their RTokens and redeem crvUSD. The withdrawal transaction reverts, and users cannot withdraw their funds.
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.