Skip to content

Testing Locally - Complete Guide

✅ What's Set Up

  1. Environment Variables: Updated with Sepolia contract addresses
  2. Contract Addresses: All contracts from Sepolia deployment
  3. Chain Configuration: Set to Sepolia (Chain ID: 11155111)

⚠️ Action Required: WalletConnect Project ID

You need to add your WalletConnect Project ID:

  1. Get Project ID:

  2. Update .env.local:

    bash
    # Edit packages/dapp/.env.local
    # Replace YOUR_PROJECT_ID with your actual Project ID
    NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_actual_project_id_here
  3. Restart DApp:

    bash
    # Stop current server (Ctrl+C in terminal)
    npm run dapp:dev

🧪 Testing Checklist

1. Website (localhost:3001)

  • [ ] Page loads correctly
  • [ ] Links work
  • [ ] No console errors

2. DApp (localhost:3000)

  • [ ] Page loads
  • [ ] Wallet connect button appears
  • [ ] Click "Connect Wallet"
  • [ ] Wallet modal opens
  • [ ] Can select MetaMask or other wallet
  • [ ] Connection succeeds
  • [ ] Wallet address displays
  • [ ] Can view token balance
  • [ ] Can navigate to different pages

3. Wallet Connection Test

  1. Open localhost:3000
  2. Click "Connect Wallet" button
  3. Select your wallet (MetaMask, etc.)
  4. Approve connection in wallet
  5. Should see:
    • ✅ Connected status
    • ✅ Your wallet address
    • ✅ Network (Sepolia)

4. Contract Interaction Test

  • [ ] View CR8 Token balance
  • [ ] View staking info
  • [ ] Try staking (if you have tokens)
  • [ ] View agent registry
  • [ ] Check portfolio

🔍 Debugging

Check Browser Console

Open DevTools (F12) and check:

  • No red errors
  • Wallet connection logs
  • Contract address logs

Check Network Tab

  • Requests to RPC should succeed
  • No 404 errors for contract calls

Common Issues

"Invalid project ID"

  • WalletConnect Project ID not set correctly
  • Restart server after updating .env.local

"Failed to connect"

  • Check if wallet is installed
  • Check if wallet is unlocked
  • Try different wallet

"Contract not found"

  • Verify contract addresses in .env.local
  • Check network is Sepolia
  • Verify contracts are deployed on Sepolia

"RPC Error"

  • Check internet connection
  • Sepolia RPC might be rate-limited
  • Try switching RPC endpoint

📝 Current Configuration

Chain: Sepolia Testnet (Chain ID: 11155111)

Contracts:

  • CR8 Token: 0xE808092649524be59337815D57cd2CFa457E2263
  • CR8 Staking: 0x64352520ac1F83f1447cF72E42819010D2359537
  • Token Vesting: 0xCCcadaD8Bd3C32811e3dd194128d4E3A90e2f315
  • Agent Deposit: 0xB3E801EAce32f616c67B0Ac29Cd0eb1677587C28

🚀 Next Steps After Local Testing

  1. ✅ Test all wallet connections
  2. ✅ Test contract interactions
  3. ✅ Fix any bugs found
  4. ✅ Then deploy to Vercel

CR8 Platform Documentation