- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
109 lines
3.8 KiB
Bash
Executable File
109 lines
3.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Verify Chain 138 bridge contracts on Blockscout
|
|
# Usage: ./verify-chain138-bridges-blockscout.sh
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
SOURCE_PROJECT="/home/intlc/projects/smom-dbis-138"
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
|
|
|
# Load environment variables
|
|
if [ -f "$SOURCE_PROJECT/.env" ]; then
|
|
source "$SOURCE_PROJECT/.env"
|
|
else
|
|
log_error ".env file not found in $SOURCE_PROJECT"
|
|
exit 1
|
|
fi
|
|
|
|
# Chain 138 configuration
|
|
RPC_URL_138="${RPC_URL_138:-https://rpc-core.d-bis.org}"
|
|
CCIP_ROUTER_138="${CCIP_CHAIN138_ROUTER:-0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e}"
|
|
WETH9_138="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
|
WETH10_138="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
|
LINK_TOKEN_138="${CCIP_CHAIN138_LINK_TOKEN:-0x514910771AF9Ca656af840dff83E8264EcF986CA}"
|
|
|
|
WETH9_BRIDGE_138="0x89dd12025bfCD38A168455A44B400e913ED33BE2"
|
|
WETH10_BRIDGE_138="0xe0E93247376aa097dB308B92e6Ba36bA015535D0"
|
|
|
|
log_info "========================================="
|
|
log_info "Verify Chain 138 Bridges on Blockscout"
|
|
log_info "========================================="
|
|
log_info ""
|
|
log_info "Blockscout API: https://explorer.d-bis.org/api"
|
|
log_info "RPC URL: $RPC_URL_138"
|
|
log_info ""
|
|
|
|
cd "$SOURCE_PROJECT"
|
|
|
|
# Verify CCIPWETH9Bridge
|
|
log_info "Step 1: Verifying CCIPWETH9Bridge..."
|
|
WETH9_CONSTRUCTOR_ARGS=$(cast abi-encode "constructor(address,address,address)" "$CCIP_ROUTER_138" "$WETH9_138" "$LINK_TOKEN_138" | sed 's/^0x//')
|
|
|
|
if forge verify-contract \
|
|
"$WETH9_BRIDGE_138" \
|
|
contracts/ccip/CCIPWETH9Bridge.sol:CCIPWETH9Bridge \
|
|
--chain-id 138 \
|
|
--rpc-url "$RPC_URL_138" \
|
|
--verifier blockscout \
|
|
--verifier-url https://explorer.d-bis.org/api \
|
|
--num-of-optimizations 200 \
|
|
--constructor-args "$WETH9_CONSTRUCTOR_ARGS" \
|
|
--compiler-version "0.8.20+commit.a1b79de6" \
|
|
--via-ir \
|
|
2>&1 | tee /tmp/weth9-bridge-138-verify.log; then
|
|
log_success "✓ CCIPWETH9Bridge verification submitted!"
|
|
log_info "View on Blockscout: https://explorer.d-bis.org/address/$WETH9_BRIDGE_138"
|
|
else
|
|
log_warn "⚠️ CCIPWETH9Bridge verification failed or already verified"
|
|
log_info "Check /tmp/weth9-bridge-138-verify.log for details"
|
|
fi
|
|
|
|
log_info ""
|
|
|
|
# Verify CCIPWETH10Bridge
|
|
log_info "Step 2: Verifying CCIPWETH10Bridge..."
|
|
WETH10_CONSTRUCTOR_ARGS=$(cast abi-encode "constructor(address,address,address)" "$CCIP_ROUTER_138" "$WETH10_138" "$LINK_TOKEN_138" | sed 's/^0x//')
|
|
|
|
if forge verify-contract \
|
|
"$WETH10_BRIDGE_138" \
|
|
contracts/ccip/CCIPWETH10Bridge.sol:CCIPWETH10Bridge \
|
|
--chain-id 138 \
|
|
--rpc-url "$RPC_URL_138" \
|
|
--verifier blockscout \
|
|
--verifier-url https://explorer.d-bis.org/api \
|
|
--num-of-optimizations 200 \
|
|
--constructor-args "$WETH10_CONSTRUCTOR_ARGS" \
|
|
--compiler-version "0.8.20+commit.a1b79de6" \
|
|
--via-ir \
|
|
2>&1 | tee /tmp/weth10-bridge-138-verify.log; then
|
|
log_success "✓ CCIPWETH10Bridge verification submitted!"
|
|
log_info "View on Blockscout: https://explorer.d-bis.org/address/$WETH10_BRIDGE_138"
|
|
else
|
|
log_warn "⚠️ CCIPWETH10Bridge verification failed or already verified"
|
|
log_info "Check /tmp/weth10-bridge-138-verify.log for details"
|
|
fi
|
|
|
|
log_info ""
|
|
log_success "========================================="
|
|
log_success "Verification Complete!"
|
|
log_success "========================================="
|
|
log_info ""
|
|
log_info "Blockscout Links:"
|
|
log_info " CCIPWETH9Bridge: https://explorer.d-bis.org/address/$WETH9_BRIDGE_138"
|
|
log_info " CCIPWETH10Bridge: https://explorer.d-bis.org/address/$WETH10_BRIDGE_138"
|
|
log_info ""
|
|
|