chore(scripts): align CCIP health/setup scripts with inventory loaders

Made-with: Cursor
This commit is contained in:
defiQUG
2026-03-27 22:21:15 -07:00
parent 3bd95e1932
commit e229c82fdf
4 changed files with 28 additions and 70 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'
@@ -148,14 +149,9 @@ fi
# Check 5: Fee Calculation
log_info ""
log_info "5. Fee Calculation Check"
declare -A CHAINS=(
["BSC"]="11344663589394136015"
["Ethereum"]="5009297550715157269"
)
FEE_CALCULATED=0
for CHAIN_NAME in "${!CHAINS[@]}"; do
SELECTOR="${CHAINS[$CHAIN_NAME]}"
for CHAIN_NAME in BSC Ethereum; do
SELECTOR="$(ccip_destination_field_by_name "$CHAIN_NAME" selector)"
FEE=$(cast call "$WETH9_BRIDGE" "calculateFee(uint64,uint256)" "$SELECTOR" "$AMOUNT_WEI" --rpc-url "$RPC_URL" 2>/dev/null || echo "0")
if [ "$FEE" != "0" ] && [ -n "$FEE" ]; then