Skip to content

Meta-Pool/avax-gaming-lst-hub

Repository files navigation

Cross-Chain Governance on Avalanche

A decentralized governance system demonstrating cross-subnet coordination using Avalanche's Interchain Messaging (ICM/Teleporter).

Governance happens on C-Chain. Execution happens on BEAM. Policy decisions made by DAO token holders on C-Chain control how assets are managed on the BEAM subnet.


πŸ“š Documentation

Document Description
PROOF_OF_WORK.md Complete system overview with deployed contracts and verification commands
HOW_TO_RUN_THE_DEMO.md Step-by-step deployment and demo execution guide
VERIFICATION_GUIDE.md Contract verification instructions for block explorers
SWITCH_TO_MOCK_CLIENT.md Guide for switching between mock and real cross-chain policy clients

πŸ—οΈ Architecture

C-Chain (Governance Layer)

  • mpDAO Token β€” ERC20 governance token with capped supply and burn mechanism
  • VotingPower β€” Stake/lock mpDAO to gain voting power (time-weighted)
  • PolicyGovernor β€” Epoch-based voting with quorum requirements
  • PolicyServer β€” Cross-chain message handler for policy distribution

BEAM Subnet (Execution Layer)

  • StBEAMVault β€” ERC-4626 compliant liquid staking vault
  • MockPolicyClient β€” Policy consumer (demo mode, no Teleporter dependency)
  • WBEAM β€” Wrapped BEAM token

Flow

  1. Users vote on validator delegation weights using mpDAO voting power
  2. PolicyGovernor finalizes policy each epoch (7 days)
  3. BEAM vault reads policy and distributes deposits across validator buckets
  4. Bucket accounting simulates how funds would be delegated to validators

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Funded wallet on Avalanche Fuji Testnet (C-Chain and BEAM)

Installation

npm install
npx hardhat compile

Configuration

Copy .env.example to .env and configure:

cp .env.example .env

Required variables:

PRIVATE_KEY=0x...
RPC_CCHAIN_TESTNET=https://api.avax-test.network/ext/bc/C/rpc
RPC_BEAM_TESTNET=https://build.onbeam.com/rpc/testnet
SNOWTRACE_API_KEY=your_api_key  # Optional but recommended

Verify Network Connectivity

npm run smoke:cchain
npm run smoke:beam

πŸ“‹ Key Commands

Deployment (see HOW_TO_RUN_THE_DEMO.md)

# C-Chain deployments
npm run deploy:mpdao
npm run deploy:voting-power
npm run deploy:policy-governor

# BEAM deployments
npm run deploy:beam-vault

Inspection

# Read C-Chain governance state
npm run read:cchain-policy

# Read BEAM vault and buckets
npm run read:beam-vault

# Check balances
CHECK_ADDRESS=0x... npm run check_mpdao_balance.js --network cchain_testnet
CHECK_ADDRESS=0x... npm run check_beam_balances.js --network beam_testnet

Contract Verification

# Verify all C-Chain contracts
npm run verify:cchain

# Verify specific contract only (saves API calls)
VERIFY_ONLY=policyGovernor npm run verify:cchain

Policy Client Management

# Switch vault to use MockPolicyClient (demo mode)
npm run vault:use-mock

# Switch to real PolicyClient (requires Teleporter)
npm run vault:use-real

🎯 Deployed Contracts

C-Chain (Fuji Testnet)

Contract Address Explorer
mpDAO Token 0x31e0752Deb99f1fCE9701Dc5611A1652189dEdC3 View
VotingPower 0xFd7ad3deF7768f0b69F4d2cA0Cea094d715b0583 View
PolicyGovernor 0x19Af9A1F3f276e4F4A708Aca04E5B2Ea1520D08E View
PolicyServer 0x4A8C4229642215aB4F035Bc4A732cB918E74B283 View

BEAM Testnet

Contract Address Explorer
WBEAM 0x244AfCd5a0bc8A4400c6702C6a2A7717945c5e70 View
StBEAMVault 0x16A289aF7727Bfc3A2c4bda7993568D8A3148c48 View
MockPolicyClient 0xFd7ad3deF7768f0b69F4d2cA0Cea094d715b0583 View

πŸ”‘ Key Features

  • βœ… ERC-20 Governance Token with capped supply and burn mechanism
  • βœ… Time-Weighted Voting β€” Lock tokens longer for more voting power
  • βœ… Epoch-Based Governance β€” 7-day voting periods with quorum requirements
  • βœ… ERC-4626 Vault β€” Standard compliant liquid staking on BEAM
  • βœ… Policy-Driven Distribution β€” Governance decisions control asset allocation
  • βœ… Anti-Manipulation Safeguards β€” Epoch timing rules prevent last-minute manipulation
  • βœ… Upgradeable Architecture β€” ERC-1967 proxy pattern for future enhancements

πŸ› οΈ Development

Compile Contracts

npx hardhat compile

Run Tests

npx hardhat test

Clean Build Artifacts

npm run clean

πŸ“„ License

MIT


🀝 Contributing

This is a hackathon proof-of-concept. For production use, additional security audits and testing are required.

About

Meta Pool Governance for Avalanche πŸ”Ί Gaming LST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors