chore(scripts): use inventory + CCIP matrix in status/verify reports
Made-with: Cursor
This commit is contained in:
@@ -7,13 +7,10 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
source "$PROJECT_ROOT/scripts/lib/address-inventory.sh"
|
||||
source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh"
|
||||
|
||||
# Load environment variables if .env exists
|
||||
if [ -f "$PROJECT_ROOT/.env" ]; then
|
||||
source "$PROJECT_ROOT/.env"
|
||||
elif [ -f "$PROJECT_ROOT/../.env" ]; then
|
||||
source "$PROJECT_ROOT/../.env"
|
||||
fi
|
||||
load_explorer_runtime_env
|
||||
|
||||
# Configuration
|
||||
RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
|
||||
@@ -34,7 +31,7 @@ OUTPUT_FILE="${1:-docs/CCIP_STATUS_REPORT_$(date +%Y%m%d_%H%M%S).md}"
|
||||
|
||||
# Router status
|
||||
echo "### CCIP Router"
|
||||
ROUTER="0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e"
|
||||
ROUTER="$(resolve_address_value CCIP_ROUTER_ADDRESS CCIP_ROUTER_ADDRESS 0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e)"
|
||||
ROUTER_BYTECODE=$(cast code "$ROUTER" --rpc-url "$RPC_URL" 2>/dev/null || echo "")
|
||||
if [ -n "$ROUTER_BYTECODE" ] && [ "$ROUTER_BYTECODE" != "0x" ]; then
|
||||
echo "- **Status**: ✅ Deployed"
|
||||
@@ -58,8 +55,8 @@ OUTPUT_FILE="${1:-docs/CCIP_STATUS_REPORT_$(date +%Y%m%d_%H%M%S).md}"
|
||||
|
||||
# Bridge status
|
||||
echo "### Bridge Contracts"
|
||||
WETH9_BRIDGE="0x971cD9D156f193df8051E48043C476e53ECd4693"
|
||||
WETH10_BRIDGE="0xe0E93247376aa097dB308B92e6Ba36bA015535D0"
|
||||
WETH9_BRIDGE="$(resolve_address_value CCIPWETH9_BRIDGE CCIPWETH9_BRIDGE 0x971cD9D156f193df8051E48043C476e53ECd4693)"
|
||||
WETH10_BRIDGE="$(resolve_address_value CCIPWETH10_BRIDGE CCIPWETH10_BRIDGE 0xe0E93247376aa097dB308B92e6Ba36bA015535D0)"
|
||||
|
||||
WETH9_BRIDGE_BYTECODE=$(cast code "$WETH9_BRIDGE" --rpc-url "$RPC_URL" 2>/dev/null || echo "")
|
||||
WETH10_BRIDGE_BYTECODE=$(cast code "$WETH10_BRIDGE" --rpc-url "$RPC_URL" 2>/dev/null || echo "")
|
||||
@@ -79,22 +76,11 @@ OUTPUT_FILE="${1:-docs/CCIP_STATUS_REPORT_$(date +%Y%m%d_%H%M%S).md}"
|
||||
|
||||
# Destination configuration
|
||||
echo "### Bridge Destination Configuration"
|
||||
declare -A CHAIN_SELECTORS=(
|
||||
["BSC"]="11344663589394136015"
|
||||
["Polygon"]="4051577828743386545"
|
||||
["Avalanche"]="6433500567565415381"
|
||||
["Base"]="15971525489660198786"
|
||||
["Arbitrum"]="4949039107694359620"
|
||||
["Optimism"]="3734403246176062136"
|
||||
["Ethereum"]="5009297550715157269"
|
||||
)
|
||||
|
||||
TOTAL_DESTINATIONS=$(ccip_destination_count)
|
||||
WETH9_CONFIGURED=0
|
||||
WETH10_CONFIGURED=0
|
||||
TOTAL_DESTINATIONS=${#CHAIN_SELECTORS[@]}
|
||||
|
||||
for CHAIN_NAME in "${!CHAIN_SELECTORS[@]}"; do
|
||||
SELECTOR="${CHAIN_SELECTORS[$CHAIN_NAME]}"
|
||||
while IFS=$'\t' read -r _chain_name SELECTOR _weth9 _weth10 _rpc_url; do
|
||||
|
||||
DEST_WETH9=$(cast call "$WETH9_BRIDGE" "destinations(uint64)" "$SELECTOR" --rpc-url "$RPC_URL" 2>/dev/null || echo "")
|
||||
DEST_WETH9_CLEAN=$(echo "$DEST_WETH9" | grep -oE "^0x[0-9a-fA-F]{40}$" | head -1 || echo "")
|
||||
@@ -107,7 +93,7 @@ OUTPUT_FILE="${1:-docs/CCIP_STATUS_REPORT_$(date +%Y%m%d_%H%M%S).md}"
|
||||
if [ -n "$DEST_WETH10_CLEAN" ] && ! echo "$DEST_WETH10_CLEAN" | grep -qE "^0x0+$"; then
|
||||
((WETH10_CONFIGURED++)) || true
|
||||
fi
|
||||
done
|
||||
done < <(ccip_destination_rows)
|
||||
|
||||
echo "- **WETH9 Bridge**: $WETH9_CONFIGURED/$TOTAL_DESTINATIONS destinations configured"
|
||||
echo "- **WETH10 Bridge**: $WETH10_CONFIGURED/$TOTAL_DESTINATIONS destinations configured"
|
||||
@@ -164,4 +150,3 @@ OUTPUT_FILE="${1:-docs/CCIP_STATUS_REPORT_$(date +%Y%m%d_%H%M%S).md}"
|
||||
} > "$OUTPUT_FILE"
|
||||
|
||||
echo "Status report generated: $OUTPUT_FILE"
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
source "$PROJECT_ROOT/scripts/lib/address-inventory.sh"
|
||||
source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh"
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
@@ -20,58 +22,24 @@ 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 .env exists
|
||||
if [ -f "$PROJECT_ROOT/.env" ]; then
|
||||
source "$PROJECT_ROOT/.env"
|
||||
elif [ -f "$PROJECT_ROOT/../.env" ]; then
|
||||
source "$PROJECT_ROOT/../.env"
|
||||
fi
|
||||
load_explorer_runtime_env
|
||||
|
||||
# Configuration
|
||||
RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
|
||||
WETH9_BRIDGE="0x971cD9D156f193df8051E48043C476e53ECd4693"
|
||||
WETH10_BRIDGE="0xe0E93247376aa097dB308B92e6Ba36bA015535D0"
|
||||
WETH9_BRIDGE="$(resolve_address_value CCIPWETH9_BRIDGE CCIPWETH9_BRIDGE 0x971cD9D156f193df8051E48043C476e53ECd4693)"
|
||||
WETH10_BRIDGE="$(resolve_address_value CCIPWETH10_BRIDGE CCIPWETH10_BRIDGE 0xe0E93247376aa097dB308B92e6Ba36bA015535D0)"
|
||||
|
||||
# Destination chain configurations
|
||||
declare -A CHAIN_SELECTORS=(
|
||||
["BSC"]="11344663589394136015"
|
||||
["Polygon"]="4051577828743386545"
|
||||
["Avalanche"]="6433500567565415381"
|
||||
["Base"]="15971525489660198786"
|
||||
["Arbitrum"]="4949039107694359620"
|
||||
["Optimism"]="3734403246176062136"
|
||||
["Ethereum"]="5009297550715157269"
|
||||
)
|
||||
declare -A CHAIN_SELECTORS=()
|
||||
declare -A CHAIN_RPC_URLS=()
|
||||
declare -A CHAIN_BRIDGE_ADDRESSES_WETH9=()
|
||||
declare -A CHAIN_BRIDGE_ADDRESSES_WETH10=()
|
||||
|
||||
declare -A CHAIN_RPC_URLS=(
|
||||
["BSC"]="https://bsc-dataseed.binance.org"
|
||||
["Polygon"]="https://polygon-rpc.com"
|
||||
["Avalanche"]="https://api.avax.network/ext/bc/C/rpc"
|
||||
["Base"]="https://mainnet.base.org"
|
||||
["Arbitrum"]="https://arb1.arbitrum.io/rpc"
|
||||
["Optimism"]="https://mainnet.optimism.io"
|
||||
["Ethereum"]="https://eth.llamarpc.com"
|
||||
)
|
||||
|
||||
declare -A CHAIN_BRIDGE_ADDRESSES_WETH9=(
|
||||
["BSC"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e"
|
||||
["Polygon"]="0xa780ef19a041745d353c9432f2a7f5a241335ffe"
|
||||
["Avalanche"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e"
|
||||
["Base"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e"
|
||||
["Arbitrum"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e"
|
||||
["Optimism"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e"
|
||||
["Ethereum"]="0x2A0840e5117683b11682ac46f5CF5621E67269E3"
|
||||
)
|
||||
|
||||
declare -A CHAIN_BRIDGE_ADDRESSES_WETH10=(
|
||||
["BSC"]="0x105f8a15b819948a89153505762444ee9f324684"
|
||||
["Polygon"]="0xdab0591e5e89295ffad75a71dcfc30c5625c4fa2"
|
||||
["Avalanche"]="0x105f8a15b819948a89153505762444ee9f324684"
|
||||
["Base"]="0x105f8a15b819948a89153505762444ee9f324684"
|
||||
["Arbitrum"]="0x105f8a15b819948a89153505762444ee9f324684"
|
||||
["Optimism"]="0x105f8a15b819948a89153505762444ee9f324684"
|
||||
["Ethereum"]="0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03"
|
||||
)
|
||||
while IFS=$'\t' read -r chain_name selector weth9_bridge weth10_bridge rpc_url; do
|
||||
CHAIN_SELECTORS["$chain_name"]="$selector"
|
||||
CHAIN_RPC_URLS["$chain_name"]="$rpc_url"
|
||||
CHAIN_BRIDGE_ADDRESSES_WETH9["$chain_name"]="$weth9_bridge"
|
||||
CHAIN_BRIDGE_ADDRESSES_WETH10["$chain_name"]="$weth10_bridge"
|
||||
done < <(ccip_destination_rows)
|
||||
|
||||
CHAIN_NAME="${1:-}"
|
||||
|
||||
@@ -197,4 +165,3 @@ log_info ""
|
||||
log_info "========================================="
|
||||
log_info "Verification Complete"
|
||||
log_info "========================================="
|
||||
|
||||
|
||||
Reference in New Issue
Block a user