Skip to content

BRAINCHN/arc-testnet-example1

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

113 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ AI Cognitive Token (AiC) - Arc Testnet Hackathon

๐Ÿ† AI Agents on Arc with USDC Hackathon Submission

Learn. Earn. Spend. Save. Bridge.

An AI-powered educational platform where users earn AiC (AI Cognitive) tokens with a programmatic 1:1 peg to USDC on Circle's Arc blockchain. Complete with virtual card spending and banking integration for true financial freedom.

๐Ÿค Circle Partner Alliance Request

This project includes Virtual Visa Card and Fintech Banking features that will be requested from Circle Partner Alliance to complete the fiat-to-crypto ecosystem integration. See CIRCLE_PARTNERSHIP_REQUEST.md for details.


๐Ÿš€ What is AIC Token?

AIC (AI Cognitive Token) is a blockchain-native reward token that:

  • Earned through gameplay: Type blockchain vocabulary words correctly
  • AI-validated: OpenAI validates accuracy, speed, and cognitive skill
  • Programmatically pegged to USDC: Built-in AMM provides liquidity
  • Unlimited earning potential: Vocabulary is unlimited, creating deep liquidity
  • Real market value: Swap AIC โ†’ USDC โ†’ Any chain via Bridge Kit

๐ŸŽฏ Hackathon Innovation Tracks

โœ… On-chain Actions (DeFi)

  • Automated AIC minting upon game completion
  • AMM-based swap mechanism (AIC/USDC)
  • Real-time liquidity pool management

โœ… Content Payments

  • Pay-per-performance model for educational content
  • AI validates learning outcomes
  • Instant micropayments in AIC tokens

โœ… Real-World Assets (RWA)

  • AIC represents cognitive skill (real-world asset)
  • Tokenized learning achievements
  • Programmatic value transfer based on performance

๐Ÿ”ฅ Key Features

1. AI-Powered Validation

  • OpenAI GPT-4 validates word submissions
  • Analyzes accuracy, speed, and cognitive patterns
  • Detects cheating and intentional errors
  • Calculates fair rewards (100-500 AIC per word)

2. Arc's Native FX Engine Pegging

  • Built on Arc's programmable Layer 1 infrastructure
  • 1:1 USDC peg via Arc's native FX engine
  • No external liquidity pools needed
  • USDC as native gas token (few cents per transaction)
  • Sub-second finality with instant settlement

3. Unlimited Liquidity

  • Vocabulary words are unlimited
  • Continuous player engagement = constant AIC minting
  • Deep liquidity pool forms naturally
  • Market value established through gameplay volume

4. Cross-Chain Integration

  • Swap AIC โ†’ USDC on Arc
  • Bridge USDC to Ethereum, Base, Arbitrum, etc.
  • Circle Bridge Kit integration
  • CCTP for secure transfers

5. Arc-Native Architecture

  • USDC as native gas token (6 decimals)
  • Arc's FX engine for programmatic stablecoin conversion
  • Sub-second finality via Malachite consensus
  • Predictable, dollar-denominated fees
  • Production-ready for mainnet
  • Built on Circle's "Economic OS for the internet"

6. ๐Ÿ’ณ Virtual Visa Card (Circle Partner Alliance Request)

  • Spend USDC anywhere Visa is accepted (70M+ merchants)
  • Instant crypto-to-fiat conversion at point of sale
  • 5% AiC cashback on all purchases
  • Real-time card management and security

7. ๐Ÿฆ Fintech Banking System (Circle Partner Alliance Request)

  • ACH transfers (free, 1-3 days)
  • Wire transfers (international support)
  • Instant withdrawals (seconds)
  • Direct deposit integration
  • Complete fiat on/off-ramp solution

๐Ÿ—๏ธ Technical Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     USER PLAYS GAME                         โ”‚
โ”‚                  Types Vocabulary Words                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  AI VALIDATION (OpenAI)                     โ”‚
โ”‚   โ€ข Accuracy Analysis   โ€ข Speed Check   โ€ข Cheat Detection  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              AIC TOKEN MINTING (On-Chain)                   โ”‚
โ”‚         ERC20 Contract โ†’ mintGameReward()                   โ”‚
โ”‚            Reward: 100-500 AIC tokens                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 AIC BALANCE IN WALLET                       โ”‚
โ”‚              View in MetaMask / Dashboard                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚             SWAP AIC โ†’ USDC (On-Chain AMM)                  โ”‚
โ”‚     AICSwap Contract โ†’ swapAICForUSDC()                     โ”‚
โ”‚          Programmatic 1:1 Peg Mechanism                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              USDC IN WALLET (Real Value!)                   โ”‚
โ”‚                  Ready for bridging                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚        BRIDGE TO OTHER CHAINS (Circle Bridge Kit)          โ”‚
โ”‚    Arc โ†’ Ethereum, Base, Arbitrum, Polygon, etc.           โ”‚
โ”‚              Use anywhere in DeFi!                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“‹ Smart Contracts

AIC Token (ERC20)

Location: contracts/AICToken.sol

  • Standard: ERC20 with minting capability
  • Decimals: 6 (matches USDC on Arc)
  • Minting: Authorized minters only (game validators)
  • Supply: Initial 1M + unlimited game rewards
  • Burn: Users can burn tokens

Key Functions:

mintGameReward(address player, uint256 amount, string submissionId)
burn(uint256 amount)
addMinter(address minter)

AIC Swap (AMM)

Location: contracts/AICSwap.sol

  • Model: Constant Product (x * y = k)
  • Fee: 0.3% per swap
  • Slippage: Configurable (default 5%)
  • Liquidity: Add/remove permissionlessly

Key Functions:

swapAICForUSDC(uint256 aicIn, uint256 minUsdcOut)
swapUSDCForAIC(uint256 usdcIn, uint256 minAicOut)
addLiquidity(uint256 aicAmount, uint256 usdcAmount)
getAICPrice() // Current market price

๐Ÿ› ๏ธ Tech Stack

Blockchain

  • Arc Testnet (Chain ID: 5042002)
  • Circle USDC (Native gas + swap pair)
  • Viem (Ethereum interactions)
  • OpenZeppelin (Smart contract standards)

Frontend

  • React + TypeScript
  • Tailwind CSS (Modern UI)
  • Lucide React (Icons)

Backend

  • Supabase (Database + Auth)
  • Edge Functions (Serverless validation)
  • OpenAI GPT-4 (AI validation)

Integration

  • Circle Bridge Kit (Cross-chain transfers)
  • MetaMask (Wallet connection)
  • Arc Explorer (Transaction verification)

๐Ÿ“ฆ Setup Instructions

1. Clone & Install

git clone <your-repo>
cd <project>
npm install

2. Deploy Smart Contracts

See DEPLOYMENT_GUIDE.md for detailed instructions.

Quick Deploy:

  1. Open Remix IDE
  2. Deploy AICToken.sol to Arc Testnet
  3. Deploy AICSwap.sol with token addresses
  4. Add minter permission for backend
  5. Add initial liquidity (AIC/USDC)

3. Update .env

# Add deployed contract addresses
VITE_AIC_TOKEN_ADDRESS=0x_YOUR_AIC_TOKEN_ADDRESS
VITE_AIC_SWAP_ADDRESS=0x_YOUR_SWAP_ADDRESS
VITE_USDC_ADDRESS=0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238

# Backend minter wallet
GAME_MINTER_PRIVATE_KEY=0x_YOUR_BACKEND_PRIVATE_KEY

4. Run Development Server

npm run dev

5. Build for Production

npm run build

๐ŸŽฎ How to Play

For Players:

  1. Connect Wallet

  2. Play Game

    • Read vocabulary word
    • Type it accurately
    • Get AI validation score
    • Earn AIC tokens (100-500 per word)
  3. Check Earnings

    • View AIC balance in wallet
    • See total earned in dashboard
    • Track transaction history
  4. Swap to USDC

    • Go to Swap tab
    • Enter AIC amount
    • Get quote with 0.3% fee
    • Confirm swap
    • Receive USDC instantly
  5. Bridge to Other Chains

    • Go to Bridge tab
    • Select destination chain
    • Transfer USDC via CCTP
    • Use anywhere!

๐Ÿงช Testing on Arc Testnet

Verify All Transactions:

Arc Explorer: https://testnet.arcscan.app

Test Flow:

  1. Mint AIC Tokens (play game)

    • Transaction: mintGameReward()
    • Verify on explorer
    • Check wallet balance
  2. Approve AIC for Swap

    • Transaction: approve(swapAddress, amount)
    • Required before swap
  3. Swap AIC โ†’ USDC

    • Transaction: swapAICForUSDC()
    • Check USDC received
    • Verify price accuracy
  4. Bridge USDC Cross-Chain

    • Use Bridge Kit
    • CCTP transfer
    • Receive on destination chain

๐Ÿ’ก Tokenomics: Why AIC Has Value

Arc's Programmatic Pegging Model

  1. Arc Network's Native FX Infrastructure

    • AIC leverages Arc's built-in FX engine
    • Programmatic 1:1 peg to USDC at protocol level
    • No manual liquidity pools required
    • Automated conversion between stablecoins
  2. Unlimited Supply from Gameplay

    • Vocabulary words are infinite
    • Players continuously earn AIC
    • Constant minting = growing value
  3. Market Value via Arc Protocol

    • Arc's FX engine maintains price stability
    • Instant delivery-versus-payment (DvP)
    • Institutional-grade settlement
  4. Real Utility

    • Educational performance = real value
    • Cognitive skills tokenized
    • Transferable, tradeable, valuable

Mainnet Economics (Future)

When Arc launches mainnet (2026):

  • Deploy production AIC token
  • Migrate liquidity pool
  • Real USDC pairing
  • Players swap massive AIC earnings โ†’ Real USDC
  • Bridge to any chain
  • Trade anywhere in DeFi

๐Ÿ” Security Features

  • โœ… OpenZeppelin audited contracts
  • โœ… ReentrancyGuard on all swaps
  • โœ… Slippage protection
  • โœ… Authorized minters only
  • โœ… AI cheat detection
  • โœ… RLS policies on database
  • โœ… Edge function validation

๐Ÿ“Š Database Schema

Tables:

  • users: Wallet addresses, total earnings
  • word_submissions: Game results, AI scores
  • token_transactions: All AIC mints/swaps
  • vocabulary_words: Word bank with difficulty

๐ŸŒ Deployment

Frontend

  • Build: npm run build
  • Deploy to Vercel/Netlify/Cloudflare Pages

Smart Contracts

  • Use Remix IDE
  • Deploy to Arc Testnet
  • Verify on Arc Explorer

Backend

  • Supabase Edge Functions
  • Auto-deployed on git push

๐Ÿ† Hackathon Demo Video

[Link to demo video showing full flow]

What to Show Judges:

  1. โœ… Play game, earn AIC tokens
  2. โœ… AI validation in action
  3. โœ… Check balance in MetaMask
  4. โœ… Swap AIC โ†’ USDC
  5. โœ… Verify ALL transactions on Arc Explorer
  6. โœ… Bridge USDC to another chain
  7. โœ… Show liquidity pool statistics

๐Ÿ”ฎ Future Roadmap

Phase 1: Testnet (NOW)

  • โœ… AIC token deployment
  • โœ… Swap mechanism
  • โœ… Game integration
  • โœ… Bridge integration

Phase 2: Mainnet (2026)

  • Deploy to Arc Mainnet
  • Real USDC liquidity
  • Production economics
  • Marketing push

Phase 3: Expansion

  • Multi-language support
  • Mobile apps
  • Educational partnerships
  • DeFi integrations

Phase 4: Ecosystem

  • AIC lending/borrowing
  • NFT achievements
  • Leaderboards with stakes
  • Tournament mode

๐Ÿค Team

Built for Circle's AI Agents on Arc with USDC Hackathon


๐Ÿ“œ License

MIT License - Built with Circle's Arc blockchain


๐Ÿ”— Links


๐Ÿ“ง Support

Questions? Issues? Reach out:

  • GitHub Issues
  • Arc Discord
  • Circle Developer Forum

๐ŸŽ‰ Ready to WIN the Hackathon!

This project demonstrates: โœ… Real working prototype on Arc Testnet โœ… AI-powered payment system โœ… Programmatic USDC pegging โœ… Cross-chain functionality โœ… Production-ready architecture โœ… All transactions verifiable on-chain

Let's build the future of AI + blockchain payments! ๐Ÿš€

About

AI-powered vocabulary game on Arc Testnet. Earn AIC tokens, swap to USDC, bridge to any chain. Built with Circle Bridge Kit, OpenAI validation, and React.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 86.7%
  • Solidity 6.3%
  • HTML 5.5%
  • Other 1.5%