High-Level Architecture

Contract Architecture

The Ai-Mi system uses a Factory + Proxy pattern to manage token deployment, bonding mechanics, and lifecycle transitions.

Key Components

  • AiMiFactory.sol – The main contract used to launch new Ai-Mi agents. It deploys both the token (AgentToken) and bonding curve (BondingCurve) contracts.

  • AgentToken.sol – An upgradeable ERC20 token contract. Transfers are locked until the token graduates from the bonding phase.

  • BondingCurve.sol – Manages the pricing, purchasing, and selling of tokens using a bonding curve. It also handles graduation to Uniswap once token sales are complete.

How it Works

When a user wants to launch a new Ai-Mi (e.g., $AMY), they interact with AiMiFactory.sol. This contract automatically deploys:

  1. A new AgentToken.sol instance initialized with the token name (e.g., Ai-Mi Official) and ticker (e.g., $AMY).

  2. A BondingCurve.sol instance which controls the initial distribution of tokens via bonding curve pricing.

The bonding curve contract holds 80% of the token supply and makes it available for public purchase.

The remaining 15% is reserved and automatically migrated to Uniswap when the bonding curve phase ends.

5% of all $AGENT is sent to a vault stored for future rewards to stakers.

Lifecycle Overview

  1. Launch: Users call AiMiFactory.sol to create a new Ai-Mi agent.

    1. All associated metadata used in the creation flow is managed via the secure Ai-Mi backend which utilises data to train and create a AI agent for the Ai-Mi.

  2. Trade on Bonding Curve: Users interact with the unique BondingCurve.sol contract to buy tokens.

  3. Trade on Uniswap: Once the bonding curve supply is exhausted, the remaining tokens are paired with ETH and migrated to Uniswap. Users can then trade the token on the relevant Uniswap pair.

    1. The Ai-Mi's are automatically graduated to Uniswap V3 as of 03/07/25.

Each token follows the standard ERC20 interface. Developers can always reference the token's smart contract address via the associated AgentToken.sol instance deployed by the factory.

Last updated