Skip to content

Conversation

@2PykeETH
Copy link

PR Description

Summary

This PR introduces the addLiquidity external function to LiquidityManagerV2, enabling users to provide liquidity to pools with enhanced validations and safeguards.

What's Changed

  • ➕ Added addLiquidity external function.
    • Includes full NatSpec documentation for parameters and usage.
    • Handles token order normalization.
    • Integrates protocol fee calculation and collection.
    • Validates tick ranges, slippage, deadlines, and token support.
    • Prevents interactions with uninitialized or emergency-locked pools.
  • 🔒 Applied safety checks with nonReentrant, whenNotPaused, and custom modifiers.
  • 🧮 Added liquidity calculation logic via _calculateLiquidity.
  • 📊 Updated user/provider records with _updateLiquidityProvider and _createPosition.
  • 📢 Introduced new event emission: LiquidityAdded.

Why

  • Expands the core functionality of LiquidityManagerV2 to allow active liquidity provision.
  • Provides robust validation and safety checks to protect users and the protocol.
  • Enhances transparency through event logging and NatSpec documentation.

Impact

  • ✅ Users can now add liquidity directly via contract calls.
  • 🔧 Protocol automatically enforces fee deductions, slippage checks, and safety constraints.
  • 📈 Improves the foundation for future liquidity management features.

@Neros0 Neros0 self-requested a review September 16, 2025 15:24
@Neros0 Neros0 added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 16, 2025
@Neros0 Neros0 merged commit 64f407c 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