Consists of four main components: Automated Market Maker (AMM), Yield Farming, Game, and Faucet smart contracts. These components are tested using integration tests to ensure their functionality and reliability.
.
├── src/ # Core smart contract modules
│ ├── amm/ # Automated Market Maker contracts
│ ├── farms/ # Yield Farming contracts
│ ├── game/ # Game contracts
│ ├── faucet/ # Faucet contracts
│ └── lib.cairo # Main entry point
├── integration-tests/ # Integration test suite
│ ├── tests/ # Test files
│ ├── env.example # Environment variables template
│ └── package.json # Test dependencies
├── Scarb.toml # Project dependencies and configuration
└── README.md # Project documentation
- Factory: Manages the creation of trading pairs.
- Router: Facilitates token swaps and liquidity management.
- Pair: Represents a trading pair and handles liquidity and swaps based on the constant product formula.
- MockERC20: A mock implementation of the ERC20 token standard for testing purposes.
src/amm/lib.cairo
: The main entry point for the AMM modules.
- Powerplant: Manages the creation and configuration of reactors.
- Reactor: Handles reward distribution and user interactions.
- Conduit: Facilitates user deposits and withdrawals.
src/farms/lib.cairo
: The main entry point for the Yield Farming modules.
- GameFactory: Manages the creation and configuration of game sessions.
- GameRouter: Facilitates interactions with game sessions.
- GameSession: Handles game logic and user interactions.
src/game/lib.cairo
: The main entry point for the Game modules.
- RegularFaucet: Standard token distribution system.
- WhitelistedFaucet: Token distribution system with whitelist controls.
src/faucet/lib.cairo
: The main entry point for the Faucet modules.
The integration-tests
directory contains test scripts written using Mocha and Chai for assertions. These tests validate the functionality of all smart contracts.
- Copy
integration-tests/env.example
tointegration-tests/.env
and fill in the required environment variables. - Install dependencies:
cd integration-tests pnpm install
Use the following command to run all integration tests:
cd integration-tests
pnpm test
- StarkNet framework version 2.7.0
- OpenZeppelin contracts version 0.15.0
- snforge_std version 0.30.0 for development and testing
For detailed dependency information, refer to:
Scarb.toml
for Cairo dependenciesintegration-tests/package.json
for test dependencies