Skip to content

Conversation

@SynnekOG
Copy link

Pull Request

Summary

This PR enhances LiquidityManagerV2 by introducing new error handling and adding important constant variables to improve safety, clarity, and maintainability.

Changes

  • Errors

    • Added LiquidityManager__InvalidTickRange to enforce tick validation.
    • Added LiquidityManager__LiquidityLocked to prevent operations during locked states.
  • Constants

    • MAX_LIQUIDITY_THRESHOLD = 1000 * 1e6 → cap for liquidity.
    • MIN_LIQUIDITY_THRESHOLD = 10 * 1e6 → minimum to prevent dust attacks.
    • MAX_VESTING_DURATION = 365 days → maximum vesting period.
    • MIN_VESTING_DURATION = 30 days → minimum vesting requirement.
    • SLIPPAGE_PRECISION = 10000 → basis points for slippage control.
    • FEE_PRECISION = 1000000 → precision constant for protocol fees.

Motivation

  • Strengthen validation and error handling for liquidity operations.
  • Prevent unsafe edge cases (e.g., dust liquidity, excessive vesting).
  • Introduce standardized constants for slippage and fees to ensure consistency across contract logic.

Notes

  • No changes to existing state variables or logic flow.
  • All updates are additive and backward-compatible.

@Neros0 Neros0 self-requested a review September 14, 2025 00:24
@Neros0 Neros0 added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 14, 2025
@Neros0 Neros0 merged commit e32e123 into CraftMeme:main Sep 14, 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