# ChainID 138 Bridge Deployment - Execution Guide **Last Updated:** 2026-01-31 **Document Version:** 1.0 **Status:** Active Documentation --- **Date**: 2026-01-18 **Status**: ✅ **READY FOR EXECUTION** **Purpose**: Complete guide for deploying all bridges on ChainID 138 --- ## 🚀 Quick Start ### Prerequisites 1. **Access to Hardwired System** - Must be on internal network (192.168.11.0/24) - Access to Core RPC: `http://192.168.11.211:8545` 2. **Environment Setup** ```bash cd /home/intlc/projects/proxmox source smom-dbis-138/.env ``` 3. **Verify Access** ```bash cast chain-id --rpc-url http://192.168.11.211:8545 # Should return: 138 ``` --- ## 📋 Deployment Options ### Option 1: Complete Automated Deployment (Recommended) **Single command deploys everything**: ```bash cd /home/intlc/projects/proxmox ./scripts/deploy-all-bridges-standalone.sh ``` **What it does**: 1. ✅ Pre-flight checks (RPC, balance, chain ID) 2. ✅ Calculates optimal gas prices 3. ✅ Deploys WETH9 Bridge 4. ✅ Deploys WETH10 Bridge 5. ✅ Configures Mainnet destinations 6. ✅ Deploys LINK Token (CREATE2) 7. ✅ Verifies all deployments 8. ✅ Saves addresses to file **Output**: All deployed addresses saved to `/tmp/chain138-deployed-addresses-*.txt` --- ### Option 2: Step-by-Step Deployment #### Step 1: Pre-Flight Checks ```bash cd /home/intlc/projects/proxmox ./scripts/check-chain138-deployment-readiness.sh ``` **Expected**: All checks pass (0 errors) #### Step 2: Deploy WETH9 Bridge ```bash source smom-dbis-138/.env RPC="http://192.168.11.211:8545" MAX_FEE=$(bash scripts/calculate-chain138-gas-price.sh) BASE_FEE=$(cast rpc eth_getBlockByNumber latest false --rpc-url "$RPC" | \ grep -o '"baseFeePerGas":"[^"]*"' | cut -d'"' -f4 | cast --to-dec) AVAILABLE=$((MAX_FEE - BASE_FEE)) PRIORITY=$((AVAILABLE / 10)) cd smom-dbis-138 forge script script/DeployCCIPWETH9Bridge.s.sol:DeployCCIPWETH9Bridge \ --rpc-url "$RPC" \ --broadcast \ --private-key "$PRIVATE_KEY" \ --with-gas-price "$MAX_FEE" \ --priority-gas-price "$PRIORITY" \ --slow \ -vv ``` **Save the deployed address** (will be printed in output) #### Step 3: Deploy WETH10 Bridge ```bash forge script script/DeployCCIPWETH10Bridge.s.sol:DeployCCIPWETH10Bridge \ --rpc-url "$RPC" \ --broadcast \ --private-key "$PRIVATE_KEY" \ --with-gas-price "$MAX_FEE" \ --priority-gas-price "$PRIORITY" \ --slow \ -vv ``` **Save the deployed address** #### Step 4: Configure Destinations ```bash # Set bridge addresses from previous steps WETH9_BRIDGE="0x..." # From Step 2 WETH10_BRIDGE="0x..." # From Step 3 # Mainnet configuration MAINNET_SELECTOR="5009297550715157269" MAINNET_WETH9="0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6" MAINNET_WETH10="0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e" # Configure WETH9 Bridge cast send "$WETH9_BRIDGE" \ "addDestination(uint64,address)" \ "$MAINNET_SELECTOR" \ "$MAINNET_WETH9" \ --rpc-url "$RPC" \ --private-key "$PRIVATE_KEY" \ --max-fee-per-gas "$MAX_FEE" \ --priority-fee-per-gas "$PRIORITY" \ -vv # Configure WETH10 Bridge cast send "$WETH10_BRIDGE" \ "addDestination(uint64,address)" \ "$MAINNET_SELECTOR" \ "$MAINNET_WETH10" \ --rpc-url "$RPC" \ --private-key "$PRIVATE_KEY" \ --max-fee-per-gas "$MAX_FEE" \ --priority-fee-per-gas "$PRIORITY" \ -vv ``` #### Step 5: Deploy LINK Token (CREATE2) ```bash forge script script/DeployLinkToCanonicalAddress.s.sol:DeployLinkToCanonicalAddress \ --rpc-url "$RPC" \ --broadcast \ --private-key "$PRIVATE_KEY" \ --with-gas-price "$MAX_FEE" \ --priority-gas-price "$PRIORITY" \ --slow \ -vv ``` **Verify**: ```bash LINK_ADDRESS="0x514910771AF9Ca656af840dff83E8264EcF986CA" cast code "$LINK_ADDRESS" --rpc-url "$RPC" | wc -c # Should be > 1000 bytes ``` --- ## ✅ Verification Steps After deployment, verify all contracts: ```bash RPC="http://192.168.11.211:8545" # Verify WETH9 Bridge WETH9_BRIDGE="0x..." # Your deployed address cast code "$WETH9_BRIDGE" --rpc-url "$RPC" | wc -c cast call "$WETH9_BRIDGE" "admin()(address)" --rpc-url "$RPC" cast call "$WETH9_BRIDGE" "ccipRouter()(address)" --rpc-url "$RPC" cast call "$WETH9_BRIDGE" "getDestinationChains()(uint64[])" --rpc-url "$RPC" # Verify WETH10 Bridge WETH10_BRIDGE="0x..." # Your deployed address cast code "$WETH10_BRIDGE" --rpc-url "$RPC" | wc -c cast call "$WETH10_BRIDGE" "admin()(address)" --rpc-url "$RPC" cast call "$WETH10_BRIDGE" "ccipRouter()(address)" --rpc-url "$RPC" cast call "$WETH10_BRIDGE" "getDestinationChains()(uint64[])" --rpc-url "$RPC" # Verify LINK Token LINK_ADDRESS="0x514910771AF9Ca656af840dff83E8264EcF986CA" cast code "$LINK_ADDRESS" --rpc-url "$RPC" | wc -c cast call "$LINK_ADDRESS" "name()(string)" --rpc-url "$RPC" cast call "$LINK_ADDRESS" "symbol()(string)" --rpc-url "$RPC" ``` --- ## 📝 Update Environment Files After successful deployment, update `.env` files: ```bash # Add to smom-dbis-138/.env echo "CCIPWETH9BRIDGE_ADDRESS=$WETH9_BRIDGE" >> smom-dbis-138/.env echo "CCIPWETH10BRIDGE_ADDRESS=$WETH10_BRIDGE" >> smom-dbis-138/.env echo "CCIP_FEE_TOKEN=$LINK_ADDRESS" >> smom-dbis-138/.env ``` --- ## 🔧 Troubleshooting ### "Replacement transaction underpriced" **Solution**: Clear broadcast cache and retry with higher gas price ```bash cd smom-dbis-138 rm -rf broadcast/DeployCCIPWETH9Bridge.s.sol/138/run-latest.json # Retry with higher gas price (2-3 gwei) ``` ### "Cannot connect to RPC" **Solution**: Verify you're on the internal network and RPC is running ```bash ping 192.168.11.211 curl -X POST http://192.168.11.211:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' ``` ### "Insufficient balance" **Solution**: Fund deployer account ```bash # Check balance cast balance "$DEPLOYER" --rpc-url "$RPC" # Need > 1 ETH for deployments ``` --- ## 📊 Expected Results ### Successful Deployment Output ``` ✓ WETH9 Bridge deployed at: 0x... ✓ WETH10 Bridge deployed at: 0x... ✓ LINK Token deployed at: 0x514910771AF9Ca656af840dff83E8264EcF986CA ✓ Destinations configured ✓ All verifications passed ``` ### Addresses File Saved to: `/tmp/chain138-deployed-addresses-YYYYMMDD-HHMMSS.txt` Contains: - WETH9 Bridge address - WETH10 Bridge address - LINK Token address - Mainnet configuration --- ## 🎯 Next Steps After Deployment 1. **Update Documentation** - Update all `.env` files - Update deployment status docs - Update bridge addresses in frontend config 2. **Test Bidirectional Transfers** - Test ChainID 138 → Mainnet - Test Mainnet → ChainID 138 - Verify CCIP messages process correctly 3. **Monitor Deployments** - Check transaction receipts - Verify contract code - Test contract functions --- **Last Updated**: 2026-01-18 **Status**: ✅ Ready for execution from hardwired system