Skip to content

Conversation

@SynnekOG
Copy link

Pull Request

Summary

This PR extends LiquidityManagerV2 with new liquidity management functionality, including liquidity removal and emergency withdrawals. These additions improve user control, safety, and protocol resilience.

Changes

  • Added
    • removeLiquidity external function:
      • Allows providers to withdraw liquidity from a pool.
      • Includes parameters for slippage protection (amount0Min, amount1Min) and deadline enforcement.
      • Prevents withdrawals when liquidity is still locked.
      • Emits LiquidityRemoved event.
    • initiateEmergencyWithdraw external function:
      • Enables providers to request emergency withdrawal with a delay mechanism.
      • Updates provider state with emergencyWithdrawTime.
      • Emits EmergencyWithdrawInitiated event.
  • Formatting
    • Applied forge fmt for style consistency.

Motivation

  • removeLiquidity: Gives users the ability to reclaim their funds with slippage protection and safety checks.
  • initiateEmergencyWithdraw: Adds a safeguard mechanism for liquidity providers in case of protocol issues or emergencies.

Next Steps

  • Implement full Uniswap V4 integration for precise liquidity accounting.
  • Add unit tests for:
    • Successful liquidity removal.
    • Liquidity locked reverts.
    • Slippage threshold reverts.
    • Emergency withdrawal delay enforcement.

@Neros0 Neros0 self-requested a review September 16, 2025 16:11
@Neros0 Neros0 added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 16, 2025
@Neros0 Neros0 merged commit 5771ce8 into CraftMeme:main Sep 16, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants