Copy the content below to create your .env file in the root of the hedgepod/ directory.
- Create a file named
.envin the root directory (hedgepod/.env) - Copy all the content below into that file
- Replace placeholder values with your actual keys
- NEVER commit the
.envfile to git! (It's already in.gitignore)
# =====================================================
# 🦔 HedgePod Environment Variables
# =====================================================
# Copy this file to .env and fill in your actual values
# NEVER commit the .env file to git!
# =====================================================
# =====================================================
# DEPLOYER WALLET (REQUIRED FOR DEPLOYMENT)
# =====================================================
# Your deployer wallet private key
# Get from MetaMask: Account Details -> Export Private Key
# ⚠️ KEEP THIS SECRET! Never share or commit to git!
DEPLOYER_PRIVATE_KEY=your_private_key_here_without_0x_prefix
# Alternative name (for compatibility)
PRIVATE_KEY=your_private_key_here_without_0x_prefix
# =====================================================
# RPC ENDPOINTS - TESTNETS (Recommended for testing)
# =====================================================
# Get free API keys from: https://www.alchemy.com/
# Or use public RPCs (may be slower/rate-limited)
# Base Sepolia (Recommended first deployment)
BASE_SEPOLIA_RPC=https://base-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Celo Alfajores (World Chain integration)
CELO_ALFAJORES_RPC=https://alfajores-forno.celo-testnet.org
# Polygon Amoy (Mumbai replacement)
POLYGON_AMOY_RPC=https://rpc-amoy.polygon.technology
# Zircuit Testnet
ZIRCUIT_RPC=https://zircuit1-testnet.p2pify.com
# =====================================================
# RPC ENDPOINTS - MAINNETS (Use after testnet success)
# =====================================================
# World Chain (480)
WORLD_CHAIN_RPC=https://worldchain-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Base (8453)
BASE_RPC=https://base-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Celo (42220)
CELO_RPC=https://celo-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Polygon (137)
POLYGON_RPC=https://polygon-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Arbitrum One (42161)
ARBITRUM_RPC=https://arb-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Optimism (10)
OPTIMISM_RPC=https://opt-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# Avalanche C-Chain (43114)
AVALANCHE_RPC=https://api.avax.network/ext/bc/C/rpc
# =====================================================
# BLOCK EXPLORER API KEYS (For contract verification)
# =====================================================
# Get API keys from respective block explorer sites
# BaseScan: https://basescan.org/apis
BASESCAN_API_KEY=your_basescan_api_key_here
# PolygonScan: https://polygonscan.com/apis
POLYGONSCAN_API_KEY=your_polygonscan_api_key_here
# Arbiscan: https://arbiscan.io/apis
ARBISCAN_API_KEY=your_arbiscan_api_key_here
# Optimistic Etherscan: https://optimistic.etherscan.io/apis
OPTIMISTIC_ETHERSCAN_API_KEY=your_optimism_api_key_here
# Snowtrace (Avalanche): https://snowtrace.io/apis
SNOWTRACE_API_KEY=your_snowtrace_api_key_here
# CeloScan: https://celoscan.io/apis
CELOSCAN_API_KEY=your_celoscan_api_key_here
# World Chain Explorer
WORLDCHAIN_API_KEY=your_worldchain_api_key_here
# =====================================================
# FRONTEND - WALLET CONNECTION
# =====================================================
# WalletConnect Project ID (for RainbowKit)
# Get from: https://cloud.walletconnect.com/
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here
# =====================================================
# SPONSOR API KEYS (Optional but recommended)
# =====================================================
# Pyth Network
# Get from: https://pyth.network/
PYTH_HERMES_URL=https://hermes.pyth.network
# 1inch API (REQUIRED for $1K Prize - Utilize 1inch APIs)
# Get from: https://portal.1inch.dev/
# Used for: Swap quotes, routing, price feeds
NEXT_PUBLIC_ONEINCH_API_KEY=your_1inch_api_key_here
# Coinbase CDP
# Get from: https://portal.cdp.coinbase.com/
CDP_API_KEY=your_cdp_api_key_here
CDP_API_SECRET=your_cdp_api_secret_here
# World App / MiniKit
# Get from: https://developer.worldcoin.org/
WORLD_APP_ID=your_world_app_id_here
NEXT_PUBLIC_WORLD_APP_ID=your_world_app_id_here
# Privy (for gas sponsorship)
# Get from: https://dashboard.privy.io/
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id_here
PRIVY_APP_SECRET=your_privy_app_secret_here
# =====================================================
# GAS REPORTING & ANALYTICS (Optional)
# =====================================================
# Enable gas reporting in tests
REPORT_GAS=false
# CoinMarketCap API (for gas price in USD)
# Get from: https://coinmarketcap.com/api/
COINMARKETCAP_API_KEY=your_coinmarketcap_api_key_here
# =====================================================
# DEPLOYMENT CONFIGURATION (Optional)
# =====================================================
# Default gas price (in gwei)
GAS_PRICE=20
# Gas limit multiplier (1.2 = 20% buffer)
GAS_MULTIPLIER=1.2
# Deployment confirmation blocks
CONFIRMATIONS=2
# =====================================================
# SUPABASE (Database - REQUIRED for agent tracking)
# =====================================================
# Get from: https://supabase.com/ → Your Project → Settings → API
# Frontend variables (public)
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key-here
# Backend variables (private - service key)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your-service-role-key-here
# =====================================================
# ADDITIONAL SERVICES (Optional)
# =====================================================
# The Graph
GRAPH_API_KEY=your_graph_api_key_here
# Pinata (IPFS)
PINATA_API_KEY=your_pinata_api_key_here
PINATA_SECRET_KEY=your_pinata_secret_key_here
# Alchemy Notify (webhooks)
ALCHEMY_NOTIFY_TOKEN=your_alchemy_notify_token_here
# =====================================================
# DEVELOPMENT & TESTING (Optional)
# =====================================================
# Node environment
NODE_ENV=development
# Enable debug logging
DEBUG=false
# Skip contract size check
SKIP_SIZE_CHECK=false
# Enable optimizer
OPTIMIZER_ENABLED=true
# Optimizer runs
OPTIMIZER_RUNS=200For basic deployment, you only need these 3 variables:
# 1. Your deployer wallet private key
DEPLOYER_PRIVATE_KEY=your_private_key_here
# 2. Base Sepolia RPC (get free from Alchemy)
BASE_SEPOLIA_RPC=https://base-sepolia.g.alchemy.com/v2/YOUR_ALCHEMY_API_KEY
# 3. WalletConnect for frontend (get free from WalletConnect)
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id_here- Go to https://www.alchemy.com/
- Sign up for free account
- Create a new app for each network
- Copy the API key from your dashboard
- Add to
.env:BASE_SEPOLIA_RPC=https://base-sepolia.g.alchemy.com/v2/YOUR_KEY
- Go to https://cloud.walletconnect.com/
- Sign up and create a project
- Copy your Project ID
- Add to
.env:NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
- Go to https://basescan.org/
- Sign up and go to API Keys section
- Create a new API key
- Add to
.env:BASESCAN_API_KEY=your_key
- Open MetaMask
- Click on your account
- Go to "Account Details"
- Click "Export Private Key"
- Enter password and copy key
- Add to
.env:DEPLOYER_PRIVATE_KEY=your_key
Before deploying, you need testnet ETH:
| Network | Faucet URL | Amount |
|---|---|---|
| Base Sepolia | https://www.alchemy.com/faucets/base-sepolia | 0.05 ETH |
| Celo Alfajores | https://faucet.celo.org/alfajores | 0.5 CELO |
| Polygon Amoy | https://faucet.polygon.technology/ | 0.1 MATIC |
| Multi-chain | https://faucet.quicknode.com/ | Various |
- ✅ Never commit
.envfile to git (already in.gitignore) - ✅ Use a dedicated deployer wallet (not your main wallet)
- ✅ Fund only what you need for deployment (~0.1 ETH for testnets)
- ✅ Keep private keys encrypted when not in use
- ✅ Rotate API keys periodically
- ✅ Don't share your
.envfile with anyone
Your frontend also needs a separate .env.local file in the frontend/ directory:
# frontend/.env.local
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_hereAfter creating your .env file, test it:
# Check if environment variables are loaded
cd hedgepod
npx hardhat console --network baseSepolia
# In the console:
> console.log(network.name)
'baseSepolia'- Check that
.envfile exists in root directory - Verify the variable name is exactly
DEPLOYER_PRIVATE_KEY - No spaces around the
=sign
- Check that your Alchemy API key is correct
- Make sure URL format is:
https://base-sepolia.g.alchemy.com/v2/YOUR_KEY - Try the URL in your browser to verify it works
- Get testnet ETH from faucets listed above
- Check your deployer wallet balance on block explorer
- Deployment Guide:
docs/DEPLOYMENT_QUICKSTART.md - Submission Guide:
docs/SUBMISSION.md - Alchemy Docs: https://docs.alchemy.com/
- Hardhat Docs: https://hardhat.org/
🦔 You're ready to deploy!