Smart contracts for GnoSwap AMM DEX on Gno.land.
- GNU Make and Python 3.11+ for the package-test wrapper
- The GnoSwap Gno fork, with its matching
gnoexecutable onPATH - Docker and the
docker-composecommand for integration tests
gnoswap/
├── contract/ # Smart contracts
│ ├── p/ # Packages (libraries)
│ │ └── gnoswap/
│ │ ├── gnsmath/v1/ # AMM math utilities
│ │ ├── int256/v1/ # 256-bit signed integers
│ │ ├── uint256/v1/ # 256-bit unsigned integers
│ │ ├── rbac/v1/ # Role-based access control
│ │ └── consts/v1/ # Protocol constants
│ │
│ └── r/ # Realms (contracts)
│ ├── gnoswap/
│ │ ├── pool/ # Pool proxy, storage, and v1/
│ │ ├── position/ # LP position proxy, storage, and v1/
│ │ ├── router/ # Swap proxy, storage, and v1/
│ │ ├── staker/ # Liquidity mining proxy, storage, and v1/
│ │ ├── gov/ # Governance/staker proxies and v1/; xGNS
│ │ ├── launchpad/ # Launchpad proxy, storage, and v1/
│ │ ├── protocol_fee/ # Fee proxy, storage, and v1/
│ │ ├── community_pool/v1/ # Treasury transfers
│ │ ├── access/v1/ # Access control
│ │ ├── emission/ # GNS emission distribution
│ │ ├── gns/ # GNS token
│ │ ├── gnft/ # Position NFT and metadata
│ │ ├── halt/v1/ # Emergency pause
│ │ ├── rbac/v1/ # RBAC realm
│ │ ├── referral/v1/ # Referral system
│ │ └── test_token/ # Test tokens
│ └── scenario/ # Scenario/filetest packages
│
├── tests/ # Test suites
│ ├── integration/ # Integration tests
│ └── deploy/ # Deployment scripts
│
└── scripts/ # Utility scripts
Run these commands from the repository root:
make test PKG=gno.land/r/gnoswap/pool/v1
make test PKG=gno.land/r/gnoswap/pool/v1 RUN=TestCreatePoolPKG is required. The wrapper runs setup.py to link this checkout into
WORKDIR/gno/examples, then invokes the gno executable on PATH. WORKDIR
defaults to tmp; if its gno directory is absent, the wrapper clones the
GnoSwap Gno fork there. To use an existing toolchain checkout:
make test WORKDIR=/path/to/toolchain-parent PKG=gno.land/p/gnoswap/gnsmath/v1make test PKG=gno.land/r/gnoswap/scenario/pool
make test PKG=gno.land/r/gnoswap/scenario/routermake integration-test-build
make integration-test-list
make integration-test-run TEST=pool_create_pool_and_mint
make integration-testGnoSwap implements multiple layers of security across all contracts. For security concerns or vulnerability reports, see SECURITY.md.
Licensed under the GNU Affero General Public License v3.0. See LICENSE for details.
Contributions are welcome! Please follow existing patterns, include tests, and maintain documentation.