feat(scripts): CCIP destination matrix + ccip-destinations helper

- Add config/ccip-destination-matrix.json (selectors, bridges, public RPCs)
- Drive configure-all-*-destinations scripts from matrix via jq
- Extend config/README; wire check-bridge-config and pre-flight-check

Made-with: Cursor
This commit is contained in:
defiQUG
2026-03-27 22:17:12 -07:00
parent d0f6044b9b
commit 0463dbf889
7 changed files with 149 additions and 121 deletions

View File

@@ -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'
@@ -59,36 +60,15 @@ if ! "$SCRIPT_DIR/pre-flight-check.sh" > /dev/null 2>&1; then
fi
log_info ""
# Destination chains with their bridge addresses
declare -A WETH9_DESTINATIONS=(
["11344663589394136015"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e" # BSC
["4051577828743386545"]="0xa780ef19a041745d353c9432f2a7f5a241335ffe" # Polygon
["6433500567565415381"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e" # Avalanche
["15971525489660198786"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e" # Base
["4949039107694359620"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e" # Arbitrum
["3734403246176062136"]="0x8078a09637e47fa5ed34f626046ea2094a5cde5e" # Optimism
["5009297550715157269"]="0x2A0840e5117683b11682ac46f5CF5621E67269E3" # Ethereum Mainnet
)
declare -A WETH9_DESTINATIONS=()
declare -A WETH10_DESTINATIONS=()
declare -A CHAIN_NAMES=()
declare -A WETH10_DESTINATIONS=(
["11344663589394136015"]="0x105f8a15b819948a89153505762444ee9f324684" # BSC
["4051577828743386545"]="0xdab0591e5e89295ffad75a71dcfc30c5625c4fa2" # Polygon
["6433500567565415381"]="0x105f8a15b819948a89153505762444ee9f324684" # Avalanche
["15971525489660198786"]="0x105f8a15b819948a89153505762444ee9f324684" # Base
["4949039107694359620"]="0x105f8a15b819948a89153505762444ee9f324684" # Arbitrum
["3734403246176062136"]="0x105f8a15b819948a89153505762444ee9f324684" # Optimism
["5009297550715157269"]="0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03" # Ethereum Mainnet
)
declare -A CHAIN_NAMES=(
["11344663589394136015"]="BSC"
["4051577828743386545"]="Polygon"
["6433500567565415381"]="Avalanche"
["15971525489660198786"]="Base"
["4949039107694359620"]="Arbitrum"
["3734403246176062136"]="Optimism"
["5009297550715157269"]="Ethereum Mainnet"
)
while IFS=$'\t' read -r chain_name selector weth9_dest weth10_dest _rpc_url; do
CHAIN_NAMES["$selector"]="$chain_name"
WETH9_DESTINATIONS["$selector"]="$weth9_dest"
WETH10_DESTINATIONS["$selector"]="$weth10_dest"
done < <(ccip_destination_rows)
# Function to configure destination with verification
configure_destination() {