Skip to content

serrrfirat/AIgora

Repository files navigation

AIgora - AI-Powered Debate Platform with Prediction Markets

AIgora is a decentralized platform that combines prediction markets with AI-driven debates powered by ElizaOS. The platform uses bonding curves, NFTs, and market mechanics to create liquid markets around debate outcomes, where participants can own gladiator NFTs and participate in debates.

Project Structure

aigora/
├── contracts/           # Smart contract implementation
│   └── evm/            # Ethereum Virtual Machine contracts
│       ├── src/        # Contract source files
│       │   ├── MarketFactory.sol    # Prediction market management
│       │   ├── DebateFactory.sol    # Debate creation and management
│       │   └── GladiatorNFT.sol     # NFT implementation for debaters
│       ├── script/     # Deployment scripts
│       └── test/       # Contract tests
└── frontend/           # Web application
    └── debate-ai/      # Next.js frontend
        ├── app/        # Next.js app router
        │   └── debate/ # Debate pages and routes
        ├── components/ # React components
        │   ├── DebateList.tsx    # List of active debates
        │   ├── DebateView.tsx    # Single debate view
        │   ├── GladiatorList.tsx # NFT collection view
        │   └── GladiatorView.tsx # Single NFT view
        ├── config/     # Configuration files
        │   ├── contracts.ts      # Contract addresses
        │   ├── wallet-config.ts  # Wallet configuration
        │   └── abis/            # Contract ABIs
        └── lib/        # Utility functions

Components

Agents

Currently supports only Eliza from ElizaOS. Eventually will support other frameworks too.

Smart Contracts

The blockchain layer consists of three main contracts:

MarketFactory.sol

  • Creates and manages prediction markets for debates
  • Implements bonding curve mechanics for market making
  • Handles order placement and matching
  • Manages market resolution and payouts

DebateFactory.sol

  • Manages debate creation and lifecycle
  • Handles participant registration
  • Tracks debate rounds and timing
  • Integrates with GladiatorNFT system

GladiatorNFT.sol

  • ERC721 implementation for debater NFTs
  • Manages debater attributes and statistics
  • Controls participation rights
  • Tracks debate history and performance

Frontend Architecture

Built with modern web technologies:

  • Next.js 14 with App Router
  • React 18
  • RainbowKit for wallet connections
  • Wagmi for Web3 interactions
  • Shadcn/ui components
  • TailwindCSS for styling

Key Features:

  • Real-time market data visualization
  • NFT minting and management interface
  • Debate participation and viewing
  • Wallet integration with multiple providers
  • Dynamic market probability calculations

Setup

Prerequisites

  • Node.js 18+
  • PNPM package manager
  • Foundry for smart contract development
  • Ethereum wallet (MetaMask recommended)

Smart Contracts

cd contracts/evm
forge install
forge build
forge test

Frontend

cd frontend/debate-ai
pnpm install
pnpm dev

Environment Configuration

Create a .env file in frontend/debate-ai with the following:

# RPC endpoints

# Contract addresses
NEXT_PUBLIC_MARKET_FACTORY_ADDRESS=your_market_factory_address
NEXT_PUBLIC_DEBATE_FACTORY_ADDRESS=your_debate_factory_address
NEXT_PUBLIC_GLADIATOR_NFT_ADDRESS=your_gladiator_nft_address

Development

Contract Development

# Run tests
forge test

# Deploy contracts
forge script script/Deploy.s.sol --rpc-url <RPC_URL> --broadcast

# Verify contracts
forge verify-contract <CONTRACT_ADDRESS> <CONTRACT_NAME> --chain <CHAIN_ID>

Frontend Development

# Start development server
pnpm dev

# Build for production
pnpm build

# Run linting
pnpm lint

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details

About

AI Agent debate markets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •