Configuration Date: November 16, 2025 Status: β PRODUCTION READY - Both Testnet and Mainnet
Account Abstraction (ERC-4337) has been successfully configured for both Rogue Testnet and Rogue Mainnet with automatic environment detection. The system seamlessly switches between testnet (localhost:4000) and mainnet (production) configurations.
π Account Abstraction Deployment Verification
π
2025-11-16
Testnet: β
PASSED - All 10 checks passed
Mainnet: β
PASSED - All 10 checks passed
π All networks are ready for Account Abstraction!
Triggered when: window.location.origin == "http://localhost:4000"
| Component | Address | Status |
|---|---|---|
| Chain ID | 71499284269 |
Active |
| RPC URL | https://testnet-rpc.roguechain.io |
β |
| Explorer | https://testnet-explorer.roguechain.io/ |
β |
| EntryPoint | 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 |
β Canonical v0.6.0 |
| ManagedAccountFactory | 0x39CeCF786830d1E073e737870E2A6e66fE92FDE9 |
β Staked: 1.0 ROGUE |
| Paymaster | 0xd4ECb9C22e0c7495e167698cb8D0D9c84F65c02a |
β Deposit: 9,998.12 ROGUE |
| AccountExtension | 0xdDd603b68BC40D16F4570A33198241991c56D304 |
β Registered |
| Bundler Wallet | 0xd75A64aDf49E180e6f4B1f1723ed4bdA16AFA06f |
β Balance: 10,000 ROGUE |
| Bundler URL | https://rogue-bundler.fly.dev |
Environment: testnet |
Triggered when: window.location.origin != "http://localhost:4000"
| Component | Address | Status |
|---|---|---|
| Chain ID | 560013 |
Active |
| RPC URL | https://rpc.roguechain.io/rpc |
β |
| Explorer | https://roguescan.io |
β |
| EntryPoint | 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 |
β Canonical v0.6.0 |
| ManagedAccountFactory | 0xfbbe1193496752e99BA6Ad74cdd641C33b48E0C3 |
β Staked: 1.0 ROGUE |
| Paymaster | 0x804cA06a85083eF01C9aE94bAE771446c25269a6 |
β Deposit: 1,000,000 ROGUE |
| AccountExtension | 0xB447e3dBcf25f5C9E2894b9d9f1207c8B13DdFfd |
β Registered |
| Bundler Wallet | 0xd75A64aDf49E180e6f4B1f1723ed4bdA16AFA06f |
β Balance: 1,000,000 ROGUE |
| Bundler URL | https://rogue-bundler.fly.dev |
Environment: mainnet |
File: assets/js/home_hooks.js
if (window.location.origin != "http://localhost:4000") {
// Mainnet (Production) - Chain ID: 560013
id = 560013
blockExplorer = "https://roguescan.io"
rpc = "https://rpc.roguechain.io/rpc"
factoryAddress = "0xfbbe1193496752e99BA6Ad74cdd641C33b48E0C3"
paymasterAddress = "0x804cA06a85083eF01C9aE94bAE771446c25269a6"
entryPoint = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
} else {
// Testnet (Localhost) - Chain ID: 71499284269
id = 71499284269
blockExplorer = "https://testnet-explorer.roguechain.io/"
rpc = "https://testnet-rpc.roguechain.io"
factoryAddress = "0x39CeCF786830d1E073e737870E2A6e66fE92FDE9"
paymasterAddress = "0xd4ECb9C22e0c7495e167698cb8D0D9c84F65c02a"
entryPoint = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
}File: bundler/chain-spec.json
{
"id": 71499284269,
"entry_point_addresses": {
"v0_6": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
},
"supports_eip1559": true
}File: bundler/chain-spec-mainnet.json
{
"id": 560013,
"entry_point_addresses": {
"v0_6": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
},
"supports_eip1559": true
}File: bundler/entrypoint.sh
# Determine environment and set RPC URL and chain spec accordingly
# Default to testnet if ROGUE_ENV is not set
ROGUE_ENV=${ROGUE_ENV:-testnet}
if [ "$ROGUE_ENV" = "mainnet" ]; then
echo "=== MAINNET CONFIGURATION ==="
NODE_RPC="https://rpc.roguechain.io/rpc"
CHAIN_SPEC="/app/chain-spec-mainnet.json"
else
echo "=== TESTNET CONFIGURATION ==="
NODE_RPC="https://testnet-rpc.roguechain.io"
CHAIN_SPEC="/app/chain-spec.json"
fiFile: bundler/Dockerfile
# Copy chain specs (testnet and mainnet), Caddyfile, and entrypoint script
# Cache bust: 2025-11-16-mainnet-support
COPY chain-spec.json /app/chain-spec.json
COPY chain-spec-mainnet.json /app/chain-spec-mainnet.json
COPY Caddyfile /app/Caddyfile
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh# No environment variable needed - defaults to testnet
flyctl deploy# Set environment variable for mainnet
flyctl secrets set ROGUE_ENV=mainnet
# Deploy
flyctl deploy# Switch to mainnet
flyctl secrets set ROGUE_ENV=mainnet
flyctl deploy
# Switch back to testnet
flyctl secrets unset ROGUE_ENV
flyctl deploy# Build the image
docker build -t rogue-bundler:latest ./bundler
# Run with testnet config (default)
docker run -p 3000:3000 \
-e BUILDER_PRIVATE_KEY="your_private_key" \
rogue-bundler:latest# Run with mainnet config
docker run -p 3000:3000 \
-e BUILDER_PRIVATE_KEY="your_private_key" \
-e ROGUE_ENV=mainnet \
rogue-bundler:latestFile: scripts/verify-aa-deployment.js
Run verification for both networks:
node scripts/verify-aa-deployment.jsOutput:
π Account Abstraction Deployment Verification
π
2025-11-16T18:50:48.743Z
Testnet: β
PASSED
Mainnet: β
PASSED
π All networks are ready for Account Abstraction!
- Frontend uses testnet addresses when on localhost:4000
- Bundler connects to testnet RPC when ROGUE_ENV is not set
- Factory stake confirmed: 1.0 ROGUE
- Paymaster deposit confirmed: 9,998+ ROGUE
- AccountExtension registered with factory
- Bundler wallet has sufficient balance (10,000 ROGUE)
- Frontend uses mainnet addresses when NOT on localhost:4000
- Bundler connects to mainnet RPC when ROGUE_ENV=mainnet
- Factory stake confirmed: 1.0 ROGUE
- Paymaster deposit confirmed: 1,000,000 ROGUE
- AccountExtension registered with factory
- Bundler wallet has sufficient balance (1,000,000 ROGUE)
| Resource | Amount | Purpose |
|---|---|---|
| Factory Stake | 1.0 ROGUE | EntryPoint requirement |
| Paymaster Stake | 1.0 ROGUE | EntryPoint requirement |
| Paymaster Deposit | 9,998.12 ROGUE | Gas sponsorship |
| Bundler Balance | 10,000 ROGUE | Transaction submission |
| Total Allocated | 20,000+ ROGUE | Testing & Development |
| Resource | Amount | Purpose |
|---|---|---|
| Factory Stake | 1.0 ROGUE | EntryPoint requirement |
| Paymaster Stake | 1.0 ROGUE | EntryPoint requirement |
| Paymaster Deposit | 1,000,000 ROGUE | Gas sponsorship (production) |
| Bundler Balance | 1,000,000 ROGUE | Transaction submission |
| Total Allocated | 2,000,002 ROGUE | Production Operations |
- β Testnet and Mainnet use completely separate contracts
- β Different factory addresses prevent cross-network confusion
- β Different paymaster addresses ensure proper accounting
- β Environment detection is automatic and reliable
- π BUILDER_PRIVATE_KEY: Required for bundler operation
- Testnet: Same key can be used (low value)
- Mainnet: Use a dedicated, secure key (high value)
- π Deployer Key: Has admin rights on factories
- Keep secure - required for extension management
- Factory admin: Can add/remove extensions
- Paymaster owner: Can withdraw deposits
- Bundler wallet: Only needs transaction submission rights
# Check deposit balance (using verification script)
node scripts/verify-aa-deployment.jsAlert when:
- Testnet: < 1,000 ROGUE
- Mainnet: < 100,000 ROGUE
# Check bundler balance (using verification script)
node scripts/verify-aa-deployment.jsAlert when:
- Testnet: < 1,000 ROGUE
- Mainnet: < 100,000 ROGUE
- Both require 1.0 ROGUE minimum stake
- Monitor
depositInfoon EntryPoint - Alert if
staked == false
// Call EntryPoint.depositTo(paymasterAddress)
// Send ROGUE with transaction# Send ROGUE to bundler wallet address
# 0xd75A64aDf49E180e6f4B1f1723ed4bdA16AFA06f// Deploy new extension
// Call factory.addExtension(extension, metadata)- Run Phoenix server:
mix phx.server - Open browser:
http://localhost:4000 - Check console logs for configuration
- Should show: Chain ID: 71499284269
- Factory:
0x39CeCF786830d1E073e737870E2A6e66fE92FDE9
- Deploy to production server
- Open browser:
https://your-production-url.com - Check console logs for configuration
- Should show: Chain ID: 560013
- Factory:
0xfbbe1193496752e99BA6Ad74cdd641C33b48E0C3
cd bundler
docker build -t rogue-bundler:test .
docker run -p 3000:3000 \
-e BUILDER_PRIVATE_KEY="0x..." \
rogue-bundler:test
# Check logs for:
# "=== TESTNET CONFIGURATION ==="
# "Node RPC: https://testnet-rpc.roguechain.io"docker run -p 3000:3000 \
-e BUILDER_PRIVATE_KEY="0x..." \
-e ROGUE_ENV=mainnet \
rogue-bundler:test
# Check logs for:
# "=== MAINNET CONFIGURATION ==="
# "Node RPC: https://rpc.roguechain.io/rpc"- Log in with email on frontend
- Click "Test Paymaster" button (if available)
- Check console for UserOperation flow
- Verify transaction on block explorer
- Confirm gas was sponsored by paymaster
Solution:
// Check window.location.origin in browser console
console.log(window.location.origin);
// Expected:
// Localhost: "http://localhost:4000" β Testnet
// Production: "https://your-domain.com" β MainnetSolution:
# Check Fly.io environment variable
flyctl secrets list
# If ROGUE_ENV is not set β Testnet
# If ROGUE_ENV=mainnet β Mainnet
# Set it explicitly:
flyctl secrets set ROGUE_ENV=mainnet # or unset for testnetCause: Factory address mismatch between frontend and bundler
Solution:
- Verify factory address in
home_hooks.jsmatches network - Verify bundler chain spec has correct chain ID
- Clear browser cache and localStorage
- Redeploy bundler with correct chain spec
Cause: Bundler not running with --unsafe flag
Solution:
- Bundler
entrypoint.shalready includes--unsafe - Verify Rundler v0.9.2 is being used
- Check Fly.io logs:
flyctl logs
Cause: AccountExtension not registered with factory
Solution:
# Verify extension registration
node scripts/verify-aa-deployment.js
# Should show: "β
Extension registered with factory"
# If not, re-run addExtension transaction- ERC4337_MAINNET_CONTRACTS.md - Mainnet deployment details
- ACCOUNT_ABSTRACTION_SETUP.md - Complete AA setup guide
- ERC4337_DEPLOYMENT_GUIDE.md - Deployment procedures
- Official ERC-4337 Spec
- Thirdweb Smart Wallets
- Rundler Documentation
-
Confirm bundler environment variable is set correctly
# For mainnet deployment: flyctl secrets set ROGUE_ENV=mainnet # For testnet deployment: flyctl secrets unset ROGUE_ENV
-
Verify
BUILDER_PRIVATE_KEYis set on Fly.ioflyctl secrets list | grep BUILDER_PRIVATE_KEY -
Review Fly.io app configuration
flyctl config show
# 1. Set mainnet environment
flyctl secrets set ROGUE_ENV=mainnet
# 2. Deploy
flyctl deploy
# 3. Check logs
flyctl logs
# 4. Verify it's using mainnet
# Logs should show: "=== MAINNET CONFIGURATION ==="# 1. Remove mainnet environment variable
flyctl secrets unset ROGUE_ENV
# 2. Deploy
flyctl deploy
# 3. Check logs
flyctl logs
# 4. Verify it's using testnet
# Logs should show: "=== TESTNET CONFIGURATION ==="-
Check Fly.io logs for correct network
flyctl logs --app rogue-bundler
-
Test bundler endpoint
curl https://rogue-bundler.fly.dev/health
-
Run verification script
node scripts/verify-aa-deployment.js
-
Test a real transaction from the frontend
-
Frontend (
home_hooks.js)- Automatic environment detection based on URL
- Testnet contracts for localhost:4000
- Mainnet contracts for production URLs
-
Bundler Configuration (
entrypoint.sh)- Environment variable support (
ROGUE_ENV) - Automatic RPC and chain spec selection
- Defaults to testnet if not specified
- Environment variable support (
-
Chain Specifications
- Separate chain specs for testnet and mainnet
- Both included in Docker image
-
Verification Tools
- Automated verification script for both networks
- Checks all contracts, stakes, deposits, and balances
Testnet: β
ALL CHECKS PASSED (10/10)
Mainnet: β
ALL CHECKS PASSED (10/10)
Both testnet and mainnet Account Abstraction infrastructure is fully configured, verified, and ready for deployment.
The system will automatically use the correct network based on:
- Frontend: URL detection (localhost = testnet, production = mainnet)
- Bundler:
ROGUE_ENVenvironment variable (default = testnet)
Configuration completed: November 16, 2025 Status: β READY FOR FLY.IO DEPLOYMENT Total networks: 2 (Testnet + Mainnet) Total contracts deployed: 8 (4 per network) Total ROGUE allocated: 2,020,002 ROGUE
π Awaiting user confirmation to deploy to Fly.io