Skip to content

AztecProtocol/staking-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Aztec Staking Dashboard

A web application for staking Aztec Token Positions (ATP) on the Aztec network. This repository contains both the frontend dashboard and the backend indexer.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         User Browser                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Staking Dashboard (React)                     β”‚
β”‚                     staking-dashboard/                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Wallet    β”‚  β”‚   Staking   β”‚  β”‚      Governance         β”‚  β”‚
β”‚  β”‚  Connect    β”‚  β”‚     UI      β”‚  β”‚       Voting            β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚                                      β”‚
           β”‚ RPC Calls                            β”‚ REST API
           β–Ό                                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Ethereum      β”‚                 β”‚     ATP Indexer (Ponder)    β”‚
β”‚    (Mainnet/     │◄────────────────│        atp-indexer/         β”‚
β”‚     Sepolia)     β”‚   Event Sync    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚  β”‚ GraphQL β”‚  β”‚ Postgres β”‚  β”‚
                                     β”‚  β”‚   API   β”‚  β”‚    DB    β”‚  β”‚
                                     β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Prerequisites

  • Node.js v20+
  • Yarn package manager
  • Docker (for running the indexer locally)
  • Git

Quick Start

Frontend Only (connects to production indexer)

# Navigate to frontend
cd staking-dashboard

# Copy environment file
cp .env.example .env

# Edit .env and add your WalletConnect project ID
# Get one at https://cloud.walletconnect.com/

# Install dependencies and start
yarn install
yarn dev

The app will be available at http://localhost:5173

Full Stack (frontend + local indexer)

# Terminal 1: Start the indexer
cd atp-indexer
cp .env.example .env
# Edit .env with your RPC URL and contract addresses
./bootstrap.sh dev

# Terminal 2: Start the frontend
cd staking-dashboard
cp .env.example .env
# Edit .env - set VITE_API_HOST=http://localhost:42068
yarn install
yarn dev

Configuration

Contract Addresses

Contract addresses can be provided via:

  1. Environment variables (recommended for CI/CD)
  2. CONTRACT_ADDRESSES_FILE environment variable pointing to a JSON file
  3. Local contract_addresses.json file in the project directory

Example contract_addresses.json:

{
  "atpFactory": "0x...",
  "atpFactoryAuction": "0x...",
  "atpRegistry": "0x...",
  "atpRegistryAuction": "0x...",
  "stakingRegistry": "0x...",
  "rollupAddress": "0x...",
  "atpWithdrawableAndClaimableStaker": "0x...",
  "genesisSequencerSale": "0x...",
  "governanceAddress": "0x...",
  "gseAddress": "0x...",
  "atpFactoryDeploymentBlock": "12345678"
}

For production contract addresses, see the Aztec documentation or contact the Aztec team.

Project Structure

staking-dashboard/
β”œβ”€β”€ .github/workflows/     # CI/CD workflows
β”œβ”€β”€ staking-dashboard/     # Frontend React application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # React components
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ contracts/     # Contract ABIs and addresses
β”‚   β”‚   └── lib/           # Utilities and helpers
β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   β”œβ”€β”€ terraform/         # Infrastructure as code
β”‚   └── bootstrap.sh       # Build and deploy script
β”œβ”€β”€ atp-indexer/           # Backend Ponder indexer
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ handlers/      # Event handlers
β”‚   β”‚   └── api/           # API routes
β”‚   β”œβ”€β”€ scripts/           # Utility scripts
β”‚   β”œβ”€β”€ terraform/         # Infrastructure as code
β”‚   β”œβ”€β”€ ponder.config.ts   # Ponder configuration
β”‚   β”œβ”€β”€ ponder.schema.ts   # Database schema
β”‚   └── bootstrap.sh       # Build and deploy script
β”œβ”€β”€ scripts/               # Shared scripts
β”‚   └── logging.sh         # Logging utilities
β”œβ”€β”€ LICENSE
β”œβ”€β”€ CONTRIBUTING.md
└── README.md

Development

Frontend (staking-dashboard/)

cd staking-dashboard

# Install dependencies
yarn install

# Start development server
yarn dev

# Type check
yarn tsc --noEmit

# Lint
yarn lint

# Build for production
yarn build

Backend (atp-indexer/)

cd atp-indexer

# Install dependencies
yarn install

# Generate provider metadata
yarn bootstrap

# Generate Ponder types
yarn codegen

# Start development server
yarn dev

Using Docker

# Frontend with Docker
cd staking-dashboard
./bootstrap.sh docker

# Indexer with Docker (includes PostgreSQL)
cd atp-indexer
docker compose up -d

Governance

The staking dashboard supports governance voting for ATP holders. Key features:

  • Proposal creation: Requires 258.75M tokens (2.5% of total supply)
  • Voting: Vote YES or NO on active proposals
  • Delegation: Delegate voting power to other addresses

See the frontend README for detailed governance testing instructions.

Deployment

Deployments are managed via GitHub Actions:

  • build.yaml: Runs on PRs to validate builds
  • deploy-staking-dashboard.yaml: Deploys frontend to staging/prod
  • deploy-indexer.yaml: Deploys indexer to staging/prod

Manual Deployment

# Deploy frontend
cd staking-dashboard
./bootstrap.sh deploy-staging  # or deploy-prod

# Deploy indexer
cd atp-indexer
./bootstrap.sh deploy-staging  # or deploy-prod

Required environment variables for deployment:

  • AWS_ACCOUNT, AWS_REGION
  • RPC_URL, CHAIN_ID
  • Contract addresses (see Configuration section)
  • WALLETCONNECT_PROJECT_ID

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors