Skip to content

[contracts] Add a comprehensive DEX (AMM) contract with full SEP-41 compliance #1027

Description

@CelestinaBeing

Context

contracts/amm-pool/ exists but may not be fully SEP-41 compliant or complete. A reference DEX contract would showcase Sanctifier's analysis of a complex real-world contract.

Work

  • Complete contracts/amm-pool/ with: swap, add_liquidity, remove_liquidity, get_price functions
  • Ensure full SEP-41 token interface compliance for LP tokens
  • Add overflow protection on all arithmetic (Sanctifier must show 0 S003 findings)
  • Write extensive integration tests covering edge cases (zero liquidity, price impact, etc.)
  • Add a README.md explaining the AMM math

Acceptance criteria

  • sanctifier analyze contracts/amm-pool shows 0 critical or high findings
  • All SEP-41 functions present and tested
  • AMM math verified correct by Z3 invariant (k = x * y)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions