diff --git a/scripts/configure-all-bridge-destinations.sh b/scripts/configure-all-bridge-destinations.sh index 0bd4508..80bc861 100755 --- a/scripts/configure-all-bridge-destinations.sh +++ b/scripts/configure-all-bridge-destinations.sh @@ -55,16 +55,17 @@ while IFS=$'\t' read -r chain_name selector weth9_dest weth10_dest _rpc_url; do done < <(ccip_destination_rows) # Preserve the manual flow: Ethereum stays TBD unless explicitly provided. -WETH9_DESTINATIONS["5009297550715157269"]="TBD" -WETH10_DESTINATIONS["5009297550715157269"]="TBD" +ETHEREUM_MAINNET_SELECTOR="${ETHEREUM_MAINNET_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" +WETH9_DESTINATIONS["$ETHEREUM_MAINNET_SELECTOR"]="TBD" +WETH10_DESTINATIONS["$ETHEREUM_MAINNET_SELECTOR"]="TBD" if [ -n "$WETH9_ETH_MAINNET" ] && echo "$WETH9_ETH_MAINNET" | grep -qE "^0x[0-9a-fA-F]{40}$"; then - WETH9_DESTINATIONS["5009297550715157269"]="$WETH9_ETH_MAINNET" + WETH9_DESTINATIONS["$ETHEREUM_MAINNET_SELECTOR"]="$WETH9_ETH_MAINNET" log_info "Using provided WETH9 Ethereum Mainnet address: $WETH9_ETH_MAINNET" fi if [ -n "$WETH10_ETH_MAINNET" ] && echo "$WETH10_ETH_MAINNET" | grep -qE "^0x[0-9a-fA-F]{40}$"; then - WETH10_DESTINATIONS["5009297550715157269"]="$WETH10_ETH_MAINNET" + WETH10_DESTINATIONS["$ETHEREUM_MAINNET_SELECTOR"]="$WETH10_ETH_MAINNET" log_info "Using provided WETH10 Ethereum Mainnet address: $WETH10_ETH_MAINNET" fi diff --git a/scripts/configure-ethereum-mainnet-destination.sh b/scripts/configure-ethereum-mainnet-destination.sh index 5575f55..3db1bd2 100755 --- a/scripts/configure-ethereum-mainnet-destination.sh +++ b/scripts/configure-ethereum-mainnet-destination.sh @@ -7,6 +7,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh" # Colors RED='\033[0;31m' @@ -39,7 +40,7 @@ if [ -z "$PRIVATE_KEY" ]; then fi # Ethereum Mainnet configuration -ETHEREUM_MAINNET_SELECTOR="5009297550715157269" +ETHEREUM_MAINNET_SELECTOR="${ETHEREUM_MAINNET_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" WETH9_MAINNET_BRIDGE="0x2A0840e5117683b11682ac46f5CF5621E67269E3" WETH10_MAINNET_BRIDGE="0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03" @@ -245,4 +246,3 @@ log_info "" log_info "To verify all destinations:" log_info " ./scripts/check-bridge-config.sh" log_info "" - diff --git a/scripts/configure-ethereum-mainnet-with-high-gas.sh b/scripts/configure-ethereum-mainnet-with-high-gas.sh index 3754cac..3c40dca 100755 --- a/scripts/configure-ethereum-mainnet-with-high-gas.sh +++ b/scripts/configure-ethereum-mainnet-with-high-gas.sh @@ -7,6 +7,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh" source "$PROJECT_ROOT/scripts/lib/address-inventory.sh" # Colors @@ -37,7 +38,7 @@ GAS_PRICE_GWEI="${1:-50}" GAS_PRICE_WEI=$(echo "$GAS_PRICE_GWEI * 1000000000" | bc 2>/dev/null || echo "50000000000") # Ethereum Mainnet configuration -ETHEREUM_MAINNET_SELECTOR="5009297550715157269" +ETHEREUM_MAINNET_SELECTOR="${ETHEREUM_MAINNET_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" WETH9_MAINNET_BRIDGE="0x2A0840e5117683b11682ac46f5CF5621E67269E3" WETH10_MAINNET_BRIDGE="0xb7721dD53A8c629d9f1Ba31a5819AFe250002b03" diff --git a/scripts/dry-run-bridge-to-ethereum.sh b/scripts/dry-run-bridge-to-ethereum.sh index 4db7135..01cd48c 100755 --- a/scripts/dry-run-bridge-to-ethereum.sh +++ b/scripts/dry-run-bridge-to-ethereum.sh @@ -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' @@ -29,7 +30,7 @@ load_explorer_runtime_env RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}" WETH9_ADDRESS="$(resolve_address_value WETH9_ADDRESS WETH9_ADDRESS 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)" WETH9_BRIDGE="$(resolve_address_value CCIPWETH9_BRIDGE CCIPWETH9_BRIDGE 0x971cD9D156f193df8051E48043C476e53ECd4693)" -ETHEREUM_MAINNET_SELECTOR="5009297550715157269" +ETHEREUM_MAINNET_SELECTOR="${ETHEREUM_MAINNET_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" # Parse arguments AMOUNT="${1:-1.0}" diff --git a/scripts/fix-bridge-errors.sh b/scripts/fix-bridge-errors.sh index 7fa29e6..cf02c68 100755 --- a/scripts/fix-bridge-errors.sh +++ b/scripts/fix-bridge-errors.sh @@ -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' @@ -29,7 +30,7 @@ load_explorer_runtime_env 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)" -ETHEREUM_MAINNET_SELECTOR="5009297550715157269" +ETHEREUM_MAINNET_SELECTOR="${ETHEREUM_MAINNET_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" # Parse arguments PRIVATE_KEY_ARG="${1:-}" diff --git a/scripts/full-readiness-check.sh b/scripts/full-readiness-check.sh index 96debc5..f3288d6 100755 --- a/scripts/full-readiness-check.sh +++ b/scripts/full-readiness-check.sh @@ -5,6 +5,7 @@ set -uo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh" source "$PROJECT_ROOT/scripts/lib/address-inventory.sh" # Colors @@ -176,7 +177,7 @@ echo "" # 7. Bridge Destination Configuration log_header "7. Bridge Destination Configuration" -ETHEREUM_SELECTOR="5009297550715157269" +ETHEREUM_SELECTOR="${ETHEREUM_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" if [ -n "$WETH9_BRIDGE_CODE" ] && [ "$WETH9_BRIDGE_CODE" != "0x" ]; then DEST=$(cast call "$WETH9_BRIDGE" "destinations(uint64)" "$ETHEREUM_SELECTOR" --rpc-url "$RPC_URL" 2>/dev/null || echo "") DEST_HEX=$(echo "$DEST" | sed 's/0x//') diff --git a/scripts/lib/ccip-destinations.sh b/scripts/lib/ccip-destinations.sh index 096a126..83174e4 100644 --- a/scripts/lib/ccip-destinations.sh +++ b/scripts/lib/ccip-destinations.sh @@ -36,3 +36,8 @@ ccip_destination_field_by_name() { '.chains[] | select(.name == $name) | .[$field] // empty' \ "$CCIP_DESTINATION_MATRIX_FILE" } + +ccip_destination_selector_by_name() { + local chain_name="${1:-}" + ccip_destination_field_by_name "$chain_name" selector +} diff --git a/scripts/test-end-to-end-bridge.sh b/scripts/test-end-to-end-bridge.sh index c052c64..22246ff 100755 --- a/scripts/test-end-to-end-bridge.sh +++ b/scripts/test-end-to-end-bridge.sh @@ -7,6 +7,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh" # Colors RED='\033[0;31m' @@ -30,7 +31,7 @@ fi # Configuration RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}" AMOUNT_ETH="${1:-0.001}" -DESTINATION_SELECTOR="5009297550715157269" # Ethereum Mainnet +DESTINATION_SELECTOR="${DESTINATION_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" # Ethereum Mainnet log_info "=========================================" log_info "End-to-End Bridge Test" @@ -146,4 +147,3 @@ fi log_info "" log_success "✓ Pre-flight checks completed" log_info "" - diff --git a/scripts/verify-complete-ccip-setup.sh b/scripts/verify-complete-ccip-setup.sh index 2687fb9..dd689d3 100755 --- a/scripts/verify-complete-ccip-setup.sh +++ b/scripts/verify-complete-ccip-setup.sh @@ -7,8 +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" +source "$PROJECT_ROOT/scripts/lib/address-inventory.sh" # Colors RED='\033[0;31m' @@ -225,7 +225,7 @@ fi # D.2: Fee Calculation log_info "" log_info "D.2: Fee Calculation" -ETHEREUM_SELECTOR="5009297550715157269" +ETHEREUM_SELECTOR="${ETHEREUM_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" FEE_RESULT=$(cast call "$ROUTER" "getFee(uint64,bytes)" "$ETHEREUM_SELECTOR" "0x" --rpc-url "$RPC_URL" 2>/dev/null || echo "") if [ -n "$FEE_RESULT" ] && [ "$FEE_RESULT" != "0x" ]; then check_pass "Fee calculation accessible" diff --git a/scripts/verify-fee-calculation.sh b/scripts/verify-fee-calculation.sh index a512b22..e754bed 100755 --- a/scripts/verify-fee-calculation.sh +++ b/scripts/verify-fee-calculation.sh @@ -7,6 +7,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +source "$PROJECT_ROOT/scripts/lib/ccip-destinations.sh" # Colors RED='\033[0;31m' @@ -34,7 +35,7 @@ LINK_TOKEN="0x514910771AF9Ca656af840dff83E8264EcF986CA" # Default values AMOUNT_ETH="${1:-0.001}" -DEST_SELECTOR="${2:-5009297550715157269}" # Ethereum Mainnet +DEST_SELECTOR="${2:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" # Ethereum Mainnet log_info "=========================================" log_info "Fee Calculation Verification" @@ -147,4 +148,3 @@ else log_info " 3. Fee calculation is handled by a separate contract" fi log_info "" - diff --git a/scripts/wrap-and-bridge-to-ethereum.sh b/scripts/wrap-and-bridge-to-ethereum.sh index cf86de8..16709c3 100755 --- a/scripts/wrap-and-bridge-to-ethereum.sh +++ b/scripts/wrap-and-bridge-to-ethereum.sh @@ -9,6 +9,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' @@ -28,7 +29,7 @@ load_explorer_runtime_env RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}" WETH9_ADDRESS="$(resolve_address_value WETH9_ADDRESS WETH9_ADDRESS 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)" WETH9_BRIDGE="$(resolve_address_value CCIPWETH9_BRIDGE CCIPWETH9_BRIDGE 0x971cD9D156f193df8051E48043C476e53ECd4693)" -ETHEREUM_MAINNET_SELECTOR="5009297550715157269" +ETHEREUM_MAINNET_SELECTOR="${ETHEREUM_MAINNET_SELECTOR:-$(ccip_destination_selector_by_name "Ethereum Mainnet")}" # Parse arguments AMOUNT="${1:-}" diff --git a/test-results/e2e-explorer-frontend-Expl-96d5e-g-Bridge-route-bridge-loads-chromium/error-context.md b/test-results/e2e-explorer-frontend-Expl-96d5e-g-Bridge-route-bridge-loads-chromium/error-context.md deleted file mode 100644 index ace3909..0000000 --- a/test-results/e2e-explorer-frontend-Expl-96d5e-g-Bridge-route-bridge-loads-chromium/error-context.md +++ /dev/null @@ -1,79 +0,0 @@ -# Page snapshot - -```yaml -- generic [active] [ref=e1]: - - navigation [ref=e2]: - - generic [ref=e3]: - - generic [ref=e4]: - - generic [ref=e5]:  - - generic [ref=e6]: - - generic [ref=e7]: SolaceScanScout - - generic [ref=e8]: The Defi Oracle Meta Explorer - - generic [ref=e9]: - - generic [ref=e10]: Search blockchain explorer - - textbox "Search blockchain explorer" [ref=e11]: - - /placeholder: Address, tx hash, block number, or token/contract name... - - button "Search" [ref=e12] [cursor=pointer]: - - generic [ref=e13]:  - - generic [ref=e14]: Search by address (0x...40 hex), transaction hash (0x...64 hex), block number, or token/contract name - - text:  - - list [ref=e15]: - - listitem [ref=e16]: - - button "Explore" [ref=e17] [cursor=pointer]: - - generic [ref=e18]:  - - generic [ref=e19]: Explore - - generic [ref=e20]:  - - listitem [ref=e21]: - - button "Tools" [ref=e22] [cursor=pointer]: - - generic [ref=e23]:  - - generic [ref=e24]: Tools - - generic [ref=e25]:  - - listitem [ref=e26]: - - link "Chain 138 MetaMask Snap" [ref=e27] [cursor=pointer]: - - /url: /snap/ - - generic [ref=e28]:  - - generic [ref=e29]: MetaMask Snap - - text:   - - generic [ref=e30]: - - combobox "Language" [ref=e31]: - - option "EN" [selected] - - option "DE" - - option "FR" - - button "Toggle dark mode" [ref=e32] [cursor=pointer]: - - generic [ref=e33]:  - - generic:  - - status [ref=e34] - - generic [ref=e35]: - - generic [ref=e36]: - - generic [ref=e37]: - - generic [ref=e38]: - - heading " Gas & Network" [level=2] [ref=e39]: - - generic [ref=e40]:  - - text: Gas & Network - - button "Refresh gas and network" [ref=e41] [cursor=pointer]: - - generic [ref=e42]:  - - text: Refresh - - generic [ref=e43]: - - generic [ref=e44]: - - generic [ref=e45]: Current base fee - - generic [ref=e46]: — - - generic [ref=e47]: "TPS: —" - - generic [ref=e48]: "Block time: —" - - generic [ref=e49]: "Failed (recent): —" - - generic [ref=e51]: Gas history (last 10 blocks) - - generic [ref=e53]: - - generic [ref=e54]: - - heading "Latest Blocks" [level=2] [ref=e55] - - button "View all blocks" [ref=e56] [cursor=pointer]: View All - - generic [ref=e58]: - - generic [ref=e59]:  - - text: Loading blocks... - - generic [ref=e60]: - - generic [ref=e61]: - - heading "Latest Transactions" [level=2] [ref=e62] - - button "View all transactions" [ref=e63] [cursor=pointer]: View All - - generic [ref=e65]: - - generic [ref=e66]:  - - text: Loading transactions... - - text:                              -``` \ No newline at end of file diff --git a/test-results/e2e-explorer-frontend-Expl-96d5e-g-Bridge-route-bridge-loads-chromium/test-failed-1.png b/test-results/e2e-explorer-frontend-Expl-96d5e-g-Bridge-route-bridge-loads-chromium/test-failed-1.png deleted file mode 100644 index 4338353..0000000 Binary files a/test-results/e2e-explorer-frontend-Expl-96d5e-g-Bridge-route-bridge-loads-chromium/test-failed-1.png and /dev/null differ