chore(scripts): align CCIP health/setup scripts with inventory loaders
Made-with: Cursor
This commit is contained in:
@@ -8,6 +8,7 @@ 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'
|
||||
@@ -104,18 +105,9 @@ RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
|
||||
WETH9_BRIDGE="$(resolve_address_value CCIPWETH9_BRIDGE CCIPWETH9_BRIDGE 0x971cD9D156f193df8051E48043C476e53ECd4693)"
|
||||
WETH10_BRIDGE="$(resolve_address_value CCIPWETH10_BRIDGE CCIPWETH10_BRIDGE 0xe0E93247376aa097dB308B92e6Ba36bA015535D0)"
|
||||
|
||||
declare -A CHAIN_SELECTORS=(
|
||||
["BSC"]="11344663589394136015"
|
||||
["Polygon"]="4051577828743386545"
|
||||
["Avalanche"]="6433500567565415381"
|
||||
["Base"]="15971525489660198786"
|
||||
["Arbitrum"]="4949039107694359620"
|
||||
["Optimism"]="3734403246176062136"
|
||||
["Ethereum"]="5009297550715157269"
|
||||
)
|
||||
TOTAL_DESTINATIONS=$(ccip_destination_count)
|
||||
|
||||
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 "")
|
||||
@@ -128,14 +120,14 @@ for CHAIN_NAME in "${!CHAIN_SELECTORS[@]}"; do
|
||||
if [ -n "$DEST_WETH10_CLEAN" ] && ! echo "$DEST_WETH10_CLEAN" | grep -qE "^0x0+$"; then
|
||||
((WETH10_CONFIGURED++)) || true
|
||||
fi
|
||||
done
|
||||
done < <(ccip_destination_rows)
|
||||
|
||||
log_info "Final Configuration Status:"
|
||||
log_info " WETH9 Bridge: $WETH9_CONFIGURED/7 destinations"
|
||||
log_info " WETH10 Bridge: $WETH10_CONFIGURED/7 destinations"
|
||||
log_info " WETH9 Bridge: $WETH9_CONFIGURED/$TOTAL_DESTINATIONS destinations"
|
||||
log_info " WETH10 Bridge: $WETH10_CONFIGURED/$TOTAL_DESTINATIONS destinations"
|
||||
log_info ""
|
||||
|
||||
if [ $WETH9_CONFIGURED -eq 7 ] && [ $WETH10_CONFIGURED -eq 7 ]; then
|
||||
if [ "$WETH9_CONFIGURED" -eq "$TOTAL_DESTINATIONS" ] && [ "$WETH10_CONFIGURED" -eq "$TOTAL_DESTINATIONS" ]; then
|
||||
log_success "✓ All destinations configured successfully!"
|
||||
log_info ""
|
||||
log_info "Next steps:"
|
||||
|
||||
Reference in New Issue
Block a user