8.1 KiB
Complete Bridge Setup Guide
Date: $(date)
Purpose: Complete guide for setting up and using the bridge system
Overview
This guide covers the complete setup and usage of the WETH9/WETH10 bridging system from ChainID 138 to Ethereum Mainnet and other chains.
Quick Start
1. Complete Setup (Recommended)
Run the master setup script:
./scripts/setup-complete-bridge.sh [private_key] [weth9_eth_mainnet] [weth10_eth_mainnet]
This will:
- ✅ Check all prerequisites
- ✅ Verify WETH9/WETH10 contracts
- ✅ Configure all bridge destinations
- ✅ Verify configuration
- ✅ Run dry run test
2. Manual Setup
If you prefer step-by-step:
# Step 1: Check current status
./scripts/check-bridge-config.sh
# Step 2: Configure all destinations
./scripts/configure-all-bridge-destinations.sh [private_key]
# Step 3: Configure Ethereum Mainnet (if needed)
./scripts/fix-bridge-errors.sh [private_key] [ethereum_mainnet_bridge_address]
# Step 4: Verify
./scripts/check-bridge-config.sh
./scripts/dry-run-bridge-to-ethereum.sh 0.1 [address]
Available Scripts
Bridge Configuration
-
check-bridge-config.sh- Check which destinations are configured
- No private key needed
- Usage:
./scripts/check-bridge-config.sh
-
configure-all-bridge-destinations.sh- Configure all known destinations
- Requires private key
- Usage:
./scripts/configure-all-bridge-destinations.sh [private_key] [weth9_eth] [weth10_eth]
-
fix-bridge-errors.sh- Fix Ethereum Mainnet specifically
- Requires private key and bridge address
- Usage:
./scripts/fix-bridge-errors.sh [private_key] [bridge_address]
Bridge Operations
-
dry-run-bridge-to-ethereum.sh- Simulate bridging without sending transactions
- Requires address (or private key)
- Usage:
./scripts/dry-run-bridge-to-ethereum.sh [amount] [address_or_key]
-
wrap-and-bridge-to-ethereum.sh- Actually wrap ETH and bridge to Ethereum Mainnet
- Requires private key
- Usage:
./scripts/wrap-and-bridge-to-ethereum.sh [amount] [private_key]
Verification
-
verify-weth9-ratio.sh- Verify 1:1 ratio with real transaction
- Requires private key
- Usage:
./scripts/verify-weth9-ratio.sh [private_key] [amount]
-
test-weth9-deposit.sh- Comprehensive test suite
- Requires private key
- Usage:
./scripts/test-weth9-deposit.sh [private_key] [amounts...]
Contract Inspection
-
inspect-weth9-contract.sh- Inspect WETH9 contract
- No private key needed
- Usage:
./scripts/inspect-weth9-contract.sh
-
inspect-weth10-contract.sh- Inspect WETH10 contract
- No private key needed
- Usage:
./scripts/inspect-weth10-contract.sh
-
compare-weth9-standard.sh- Compare with standard WETH9
- No private key needed
- Usage:
./scripts/compare-weth9-standard.sh
Token Information
-
get-token-info.sh- Get correct token information
- No private key needed
- Usage:
./scripts/get-token-info.sh [weth9|weth10|both]
-
fix-wallet-display.sh- Wallet display fix instructions
- No private key needed
- Usage:
./scripts/fix-wallet-display.sh [weth9|weth10|both]
Master Script
setup-complete-bridge.sh- Complete setup automation
- Requires private key
- Usage:
./scripts/setup-complete-bridge.sh [private_key] [weth9_eth] [weth10_eth]
Complete Workflow
Phase 1: Initial Setup
-
Check Current Status
./scripts/check-bridge-config.sh -
Verify Contracts
./scripts/inspect-weth9-contract.sh ./scripts/inspect-weth10-contract.sh -
Get Token Information
./scripts/get-token-info.sh both
Phase 2: Configure Bridges
-
Configure All Destinations
./scripts/configure-all-bridge-destinations.sh [private_key] -
Configure Ethereum Mainnet (if address available)
./scripts/fix-bridge-errors.sh [private_key] [ethereum_mainnet_bridge_address] -
Verify Configuration
./scripts/check-bridge-config.sh
Phase 3: Test and Verify
-
Run Dry Run
./scripts/dry-run-bridge-to-ethereum.sh 0.1 [address] -
Verify 1:1 Ratio (optional)
./scripts/verify-weth9-ratio.sh [private_key] 0.001 -
Run Test Suite (optional)
./scripts/test-weth9-deposit.sh [private_key] 0.001 0.01 0.1
Phase 4: Bridge Tokens
- Bridge to Ethereum Mainnet
./scripts/wrap-and-bridge-to-ethereum.sh 1.0 [private_key]
Contract Addresses Reference
ChainID 138 (Source)
- WETH9:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 - WETH10:
0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f - WETH9 Bridge:
0x89dd12025bfCD38A168455A44B400e913ED33BE2 - WETH10 Bridge:
0xe0E93247376aa097dB308B92e6Ba36bA015535D0
Destination Chains
| Chain | Selector | WETH9 Bridge | WETH10 Bridge |
|---|---|---|---|
| BSC | 11344663589394136015 | 0x8078a09637e47fa5ed34f626046ea2094a5cde5e |
0x105f8a15b819948a89153505762444ee9f324684 |
| Polygon | 4051577828743386545 | 0xa780ef19a041745d353c9432f2a7f5a241335ffe |
0xdab0591e5e89295ffad75a71dcfc30c5625c4fa2 |
| Avalanche | 6433500567565415381 | 0x8078a09637e47fa5ed34f626046ea2094a5cde5e |
0x105f8a15b819948a89153505762444ee9f324684 |
| Base | 15971525489660198786 | 0x8078a09637e47fa5ed34f626046ea2094a5cde5e |
0x105f8a15b819948a89153505762444ee9f324684 |
| Arbitrum | 4949039107694359620 | 0x8078a09637e47fa5ed34f626046ea2094a5cde5e |
0x105f8a15b819948a89153505762444ee9f324684 |
| Optimism | 3734403246176062136 | 0x8078a09637e47fa5ed34f626046ea2094a5cde5e |
0x105f8a15b819948a89153505762444ee9f324684 |
| Ethereum Mainnet | 5009297550715157269 | TBD | TBD |
Troubleshooting
Issue: All Destinations Missing
Solution: Run configuration script:
./scripts/configure-all-bridge-destinations.sh [private_key]
Issue: Ethereum Mainnet Not Configured
Solution: Configure with bridge address:
./scripts/fix-bridge-errors.sh [private_key] [ethereum_mainnet_bridge_address]
Issue: WETH9 Display Shows Wrong Amount
Solution: Use token metadata or fix wallet:
./scripts/fix-wallet-display.sh weth9
./scripts/get-token-info.sh weth9
Issue: Dry Run Shows Errors
Solution:
- Check bridge configuration:
./scripts/check-bridge-config.sh - Fix missing destinations:
./scripts/configure-all-bridge-destinations.sh [key] - Re-run dry run:
./scripts/dry-run-bridge-to-ethereum.sh [amount] [address]
Documentation Index
Setup and Configuration
- Complete Setup Guide - This document
- Fix Bridge Errors - Fix guide
- Complete Bridge Fix Guide - Complete fix guide
Verification
- WETH9 1:1 Ratio Verification - Ratio verification
- Verification Results - Verification results
- Complete Verification Report - Complete report
Issues and Fixes
- WETH9/WETH10 Issues and Fixes - Issues guide
- All Issues Fixed - Issues summary
- Review and Fixes Complete - Review summary
Operations
- Wrap and Bridge to Ethereum - Bridge guide
- Quick Reference - Quick reference
- Dry Run Results - Dry run results
Summary
✅ Complete System
- ✅ All scripts created and verified
- ✅ All parsing issues fixed
- ✅ All configuration scripts ready
- ✅ Complete documentation
- ✅ Master setup script available
🚀 Ready to Use
Run the master setup script to configure everything:
./scripts/setup-complete-bridge.sh [private_key] [weth9_eth_mainnet] [weth10_eth_mainnet]
Or use individual scripts for step-by-step setup.
Last Updated: $(date)