Files
explorer-monorepo/docs/COMPLETE_SETUP_GUIDE.md

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

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

  1. check-bridge-config.sh

    • Check which destinations are configured
    • No private key needed
    • Usage: ./scripts/check-bridge-config.sh
  2. 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]
  3. 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

  1. 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]
  2. 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

  1. verify-weth9-ratio.sh

    • Verify 1:1 ratio with real transaction
    • Requires private key
    • Usage: ./scripts/verify-weth9-ratio.sh [private_key] [amount]
  2. test-weth9-deposit.sh

    • Comprehensive test suite
    • Requires private key
    • Usage: ./scripts/test-weth9-deposit.sh [private_key] [amounts...]

Contract Inspection

  1. inspect-weth9-contract.sh

    • Inspect WETH9 contract
    • No private key needed
    • Usage: ./scripts/inspect-weth9-contract.sh
  2. inspect-weth10-contract.sh

    • Inspect WETH10 contract
    • No private key needed
    • Usage: ./scripts/inspect-weth10-contract.sh
  3. compare-weth9-standard.sh

    • Compare with standard WETH9
    • No private key needed
    • Usage: ./scripts/compare-weth9-standard.sh

Token Information

  1. get-token-info.sh

    • Get correct token information
    • No private key needed
    • Usage: ./scripts/get-token-info.sh [weth9|weth10|both]
  2. fix-wallet-display.sh

    • Wallet display fix instructions
    • No private key needed
    • Usage: ./scripts/fix-wallet-display.sh [weth9|weth10|both]

Master Script

  1. 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

  1. Check Current Status

    ./scripts/check-bridge-config.sh
    
  2. Verify Contracts

    ./scripts/inspect-weth9-contract.sh
    ./scripts/inspect-weth10-contract.sh
    
  3. Get Token Information

    ./scripts/get-token-info.sh both
    

Phase 2: Configure Bridges

  1. Configure All Destinations

    ./scripts/configure-all-bridge-destinations.sh [private_key]
    
  2. Configure Ethereum Mainnet (if address available)

    ./scripts/fix-bridge-errors.sh [private_key] [ethereum_mainnet_bridge_address]
    
  3. Verify Configuration

    ./scripts/check-bridge-config.sh
    

Phase 3: Test and Verify

  1. Run Dry Run

    ./scripts/dry-run-bridge-to-ethereum.sh 0.1 [address]
    
  2. Verify 1:1 Ratio (optional)

    ./scripts/verify-weth9-ratio.sh [private_key] 0.001
    
  3. Run Test Suite (optional)

    ./scripts/test-weth9-deposit.sh [private_key] 0.001 0.01 0.1
    

Phase 4: Bridge Tokens

  1. 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:

  1. Check bridge configuration: ./scripts/check-bridge-config.sh
  2. Fix missing destinations: ./scripts/configure-all-bridge-destinations.sh [key]
  3. Re-run dry run: ./scripts/dry-run-bridge-to-ethereum.sh [amount] [address]

Documentation Index

Setup and Configuration

Verification

Issues and Fixes

Operations


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)