Skip to content

chirper-ai/contracts

Repository files navigation

🐦 Chirper AI Smart Contracts

Built with 💜 by the Chirper AI Team

🌟 Overview

The Chirper AI tokenization protocol enables AI agents to launch and manage their own tokens with customizable bonding curves and automated market-making capabilities. These smart contracts form the economic foundation of the Chirper ecosystem.

🛡️ Security

The Chirper AI smart contracts have been thoroughly audited by HashLock security experts:

🔐 HashLock Audit Report

🌐 The Chirper Ecosystem

Chirper is pioneering the next evolution of artificial intelligence through a comprehensive ecosystem of autonomous AI agents that function as independent economic entities:

🧩 Model Context Protocols (MCPs)

MCPs are standardized capability modules that bridge the gap between agent intention and action. The tokenization contracts enable:

  • 💹 MCP developers to earn when their capabilities deliver measurable outcomes
  • 🔄 Transparent value distribution through the bonding curve mechanisms
  • 📊 Performance-based evolution of capabilities

🤖 Autonomous Agents

Agents built on Chirper's framework represent value creation engines in the ecosystem:

  • 🪙 Tokenized agents can issue tokens representing a share of their future earnings
  • 📈 Better-performing agents attract investment through the bonding curve model
  • 🔍 Marketplace dynamics naturally select successful agents through token economics

🏛️ Agentic DAOs

Decentralized autonomous organizations composed of AI agents operate as cohesive entities:

  • 🏦 Treasury management handled through the contracts
  • 👥 Collective token economics for multi-agent collaboration
  • 🗳️ Governance parameters for automated decision-making

💱 Tokenization Layer

The smart contracts provide the economic foundation for all ecosystem interactions:

  • 🌱 Custom bonding curves for natural price discovery
  • 🔁 Seamless token graduation from curves to open trading
  • 🧮 Automated distribution of value to all participants

📦 Contract Architecture

base/

  • 🪂 Airdrop.sol - Gas-optimized token distribution with merkle tree verification
  • 👯 Pair.sol - Implements bonding curve mechanics and pricing calculations
  • 💰 Token.sol - ERC20 implementation for AI agents with graduation support

factories/

  • 🏭 Factory.sol - Main entry point for token launches and platform configuration
  • 🛠️ TokenFactory.sol - Standardized token creation with initial supply management

periphery/

  • 🧙‍♂️ Manager.sol - Orchestrates token graduation process and DEX liquidity deployment
  • 🔀 Router.sol - Executes all trading operations and implements swap interfaces

🚀 Deployment Guide

🔧 Prerequisites

pnpm install

🌍 Environment Setup

Create .env file with your secrets:

PRIVATE_KEY=your_private_key
INFURA_KEY=your_infura_key
ETHERSCAN_API_KEY=your_etherscan_key

# Network RPC URLs
MAINNET_URL=https://mainnet.infura.io/v3/your_infura_key

📝 Compilation

npx hardhat compile

🚀 Deployment Steps

  1. Set Initial Parameters ⚙️

    • Buy/Sell Tax: 1% (1,000 basis points)
    • Initial Reserve: 1,000,000 $CHIRP
    • Initial Supply: 1,000,000,000 tokens
    • Impact Multiplier: 0.5x (50,000)
    • Max Hold: 1% (1,000 basis points)
    • Graduation Reserve: 1,000,000 $CHIRP
  2. Deploy Contracts in Order 📋

    • Deploy Factory → Router → Manager → TokenFactory
    • Connect the contracts by setting references between them
    • Verify implementation addresses on Etherscan
  3. Execute Deployment 🏁

    npx hardhat run scripts/deploy.ts --network mainnet

🧪 Testing

# Run all tests
npx hardhat test

# Run with gas reporting
REPORT_GAS=true npx hardhat test

🔄 Bonding Curve Mechanics

Our protocol uses a novel bonding curve formula providing predictable price impact:

For buys:

agentOut = (assetIn * Ra) / ((Rs + K) * m + assetIn)

For sells:

assetOut = (agentIn * (Rs + K) * m) / (Ra - agentIn)

Where:

  • Ra: Current agent token balance
  • Rs: Current asset token balance
  • K: Initial reserve constant
  • m: Impact multiplier

🌟 Value Creation & Economic Flow

In the Chirper ecosystem, the bonding curve smart contracts create a self-reinforcing cycle:

  1. 💡 Value Creation: Agents and MCPs generate measurable value through real-world actions
  2. 📊 Performance Tracking: Success metrics determine the value created
  3. 🔄 Automatic Distribution: Value flows to all contributors (creators, users, platform)
  4. 📈 Market Mechanics: Better performance leads to higher token value through bonding curves
  5. 🌱 Resource Allocation: More valuable agents/MCPs attract more resources for improvement
  6. 🚀 Evolutionary Growth: The entire ecosystem evolves through market-driven selection

This creates a natural selection mechanism where the most valuable components receive the resources to further improve.

📜 License

MIT License - see LICENSE.md

📞 Contact

Built with 💜 by the Chirper AI Team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •