Testing Locally - Complete Guide
✅ What's Set Up
- Environment Variables: Updated with Sepolia contract addresses
- Contract Addresses: All contracts from Sepolia deployment
- Chain Configuration: Set to Sepolia (Chain ID: 11155111)
⚠️ Action Required: WalletConnect Project ID
You need to add your WalletConnect Project ID:
Get Project ID:
- Go to: https://cloud.walletconnect.com
- Sign in or create account
- Create a new project
- Copy the Project ID
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_hereRestart 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
- Open
localhost:3000 - Click "Connect Wallet" button
- Select your wallet (MetaMask, etc.)
- Approve connection in wallet
- 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
- ✅ Test all wallet connections
- ✅ Test contract interactions
- ✅ Fix any bugs found
- ✅ Then deploy to Vercel