In the _withdrawFromVault
function, there is a critical issue where the contract fails to approve the CurveUSD token for the Curve Vault before attempting to withdraw the requested amount. The curveVault.withdraw
function requires the CurveUSD token to be approved before it can burn the tokens and transfer back the requested amount. Without the proper approval, the withdrawal will fail, causing the system to malfunction.
Issue:
The function _withdrawFromVault
directly calls curveVault.withdraw
without first approving the CurveUSD token for the withdrawal. The Curve Vault needs approval to handle the tokens being burned and transferred back to the system. Since the approval is not done, the transaction will fail, preventing the withdrawal.
Affected Code:
Transaction Failure:
Without the proper approval, the withdrawal process from the Curve Vault will fail. This prevents the user from receiving the requested amount of tokens.
Manual inspection of the contract's liquidity management logic.
Approve Tokens Before Withdrawing:
Ensure that the CurveUSD token is approved for the Curve Vault before the withdrawal is initiated. This can be done by calling the approve
function for the required amount of tokens.
Example fix:
Ensure Approval for Token Transfer:
Before withdrawing from the Curve Vault, verify that the necessary approval is granted to the Curve Vault for the withdrawal operation. This ensures the system functions as intended and prevents errors during the withdrawal process.
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.