Validate mainnet deployment readiness WITHOUT deploying any contracts or spending gas.
- ✅ Verifies connection to QIE Mainnet (Chain ID: 1990)
- ✅ Tests RPC connectivity and responsiveness
- ✅ Retrieves current gas price
- ✅ Validates network is operational
- ✅ Checks required variables (PRIVATE_KEY, etc.)
- ✅ Validates private key format
- ✅ Validates address formats for optional variables
- ✅ Warns about missing optional configurations
- ✅ Validates deployer address
- ✅ Checks account balance
- ✅ Estimates deployment cost
- ✅ Verifies sufficient funds
- ✅ Verifies all contracts compile successfully
- ✅ Checks bytecode is generated
- ✅ Validates contract factories are available
- ✅ Simulates contract deployments (gas estimation only)
- ✅ Validates constructor parameters
- ✅ Estimates gas for each contract
- ✅ NO ACTUAL TRANSACTIONS SENT
- ✅ Scans for hardcoded testnet values
- ✅ Verifies no testnet chain IDs in mainnet config
- ✅ Checks for testnet RPC URLs
- ✅ Ensures clean separation
- ✅ Provides pass/fail summary
- ✅ Lists all warnings
- ✅ Gives final verdict
-
Set up
.envfile incontracts/directory with:PRIVATE_KEY=0x... QIE_MAINNET_RPC_URL=https://rpc1mainnet.qie.digital/ QIE_MAINNET_CHAIN_ID=1990 # Optional: NCRD_TOKEN_ADDRESS=0x... # If deploying staking BACKEND_ADDRESS=0x... # If granting role AI_SIGNER_ADDRESS=0x... # For LendingVault LOAN_TOKEN_ADDRESS=0x0 # 0x0 for native QIE
-
Ensure contracts are compiled:
cd contracts npx hardhat compile
cd contracts
npx hardhat run scripts/dry-run-mainnet.ts --network qieMainnet� AETHER-SCORE Mainnet Deployment Dry-Run
============================================================
This script validates deployment readiness WITHOUT deploying.
📡 [1/7] Validating Network Configuration...
✅ PASS Network Chain ID
Connected to QIE Mainnet (Chain ID: 1990)
✅ PASS RPC Connectivity
RPC is responsive. Latest block: 12345
✅ PASS Gas Price
Gas price: 1.00 Gwei
� [2/7] Validating Environment Variables...
✅ PASS Env: PRIVATE_KEY
Private key format valid (masked: 0x1234...5678)
✅ PASS Env: QIE_MAINNET_RPC_URL
QIE Mainnet RPC URL is set
...
📊 DRY-RUN SUMMARY
============================================================
✅ Passed: 25
� Failed: 0
⚠� Warnings: 2
============================================================
✅ ALL CHECKS PASSED - Ready for mainnet deployment!
You can proceed with: npx hardhat run scripts/deploy-mainnet.ts --network qieMainnet
============================================================
- ✅ Network Chain ID = 1990
- ✅ RPC connectivity working
- ✅ PRIVATE_KEY is set and valid
- ✅ Deployer balance ≥ 1.0 QIEV3
- ✅ All contracts compile
- ✅ Deployment simulation succeeds
- ✅ No testnet dependencies in mainnet config
- ⚠� Optional env vars not set (NCRD_TOKEN_ADDRESS, etc.)
- ⚠� Low balance warnings (if still sufficient)
- ⚠� Testnet env vars present (as long as not used)
- � Wrong network
- � RPC connection failed
- � Missing required env vars
- � Invalid address formats
- � Insufficient balance
- � Contract compilation errors
- � Deployment simulation failures
- Chain ID verification (must be 1990)
- RPC endpoint connectivity
- Latest block retrieval
- Gas price retrieval
Required:
PRIVATE_KEY- Deployer private key (validates format)
Optional (but validated if set):
NCRD_TOKEN_ADDRESS- For staking deploymentBACKEND_ADDRESS- For role grantAI_SIGNER_ADDRESS- For LendingVaultLOAN_TOKEN_ADDRESS- Loan token (defaults to 0x0 for native)
- CreditPassportNFT compilation
- LendingVault compilation
- AETHER-SCOREStaking compilation (if token address set)
- Gas estimation for each contract
- Constructor parameter validation
- Transaction building (not sending)
- Hardhat config scan for testnet values
- Environment variable scan
- Network configuration validation
Fix: Ensure you're using --network qieMainnet flag
Fix:
- Check
QIE_MAINNET_RPC_URLin.env - Verify RPC endpoint is accessible
- Try alternative RPC:
https://rpc2mainnet.qie.digital/
Fix: Add PRIVATE_KEY=0x... to contracts/.env
Fix: Private key must be 0x + 64 hex characters (66 total)
Fix: Add QIEV3 to deployer wallet (minimum 1.0 QIEV3 recommended)
Fix: Run npx hardhat compile first
Status: Ready for deployment Action: Proceed with actual deployment
Status: Ready with caveats Action: Review warnings, proceed if acceptable
Status: Not ready Action: Fix all failures before deploying
-
No Transactions Sent
- Only gas estimation
- No contract deployments
- No state changes
-
Read-Only Operations
- Network queries only
- Balance checks
- Contract compilation checks
-
Validation Only
- No actual deployment
- No gas spent
- Safe to run multiple times
- Review the summary output
- Verify estimated gas costs
- Ensure sufficient balance
- Proceed with actual deployment:
npx hardhat run scripts/deploy-mainnet.ts --network qieMainnet
- Review each warning
- Decide if optional configs are needed
- Set optional env vars if required
- Re-run dry-run to verify
- Fix each failure
- Re-run dry-run
- Verify all checks pass
- Then proceed with deployment
============================================================
📊 DRY-RUN SUMMARY
============================================================
✅ Passed: 25
� Failed: 0
⚠� Warnings: 1
✅ ALL CHECKS PASSED - Ready for mainnet deployment!
You can proceed with: npx hardhat run scripts/deploy-mainnet.ts --network qieMainnet
============================================================
This means:
- ✅ All critical validations passed
- ⚠� One optional warning (likely missing optional env var)
- ✅ Safe to proceed with deployment
You can run the dry-run multiple times safely:
- No gas spent
- No transactions sent
- No state changes
- Useful for validating fixes
Recommended: Run dry-run after any configuration changes before actual deployment.