Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: medium
Invalid

Missing Approval Before Withdrawing from Curve Vault in _withdrawFromVault

Summary

In the _withdrawFromVault function, the contract does not approve the CurveUSD token before initiating a withdrawal from the Curve vault. The curveVault.withdraw function requires prior approval to burn and transfer tokens back to the system. Without proper approval, the transaction will fail, preventing successful liquidity withdrawal.

Vulnerability Details

Issue

  • The _withdrawFromVault function directly calls curveVault.withdraw without first approving the CurveUSD token.

  • Since the Curve vault requires an approval before handling tokens, the withdrawal process will revert due to missing authorization.

Affected Code

curveVault.withdraw(amount, address(this), msg.sender, 0, new address);
  • Incorrect: The contract does not call approve before initiating the withdrawal.

  • Correct: Approval should be granted before attempting the withdrawal.

Impact

Transaction Failure

  • The withdrawal process fails, preventing the contract from retrieving liquidity.

  • This can cause operational disruptions in fund management, affecting withdrawals and liquidity rebalancing.

Tools Used

  • Manual inspection of the contract's liquidity management logic.

Recommendations

Approve Tokens Before Withdrawing

  • Ensure that the CurveUSD token is approved for the Curve Vault before the withdrawal is initiated.

Example Fix

IERC20(curUSD).approve(address(curveVault), amount);
curveVault.withdraw(amount, address(this), address(this), 0, new address);
  • This ensures that the Curve vault can successfully process the withdrawal request.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!