chore(scripts): use load_explorer_runtime_env + address-inventory helper

Align remaining shell scripts with shared env loading (no direct .env source).

Made-with: Cursor
This commit is contained in:
defiQUG
2026-03-27 22:10:38 -07:00
parent 7a7ce770c2
commit a2beda3db4
28 changed files with 130 additions and 246 deletions

View File

@@ -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/address-inventory.sh"
# Colors
RED='\033[0;31m'
@@ -22,12 +23,7 @@ log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
log_step() { echo -e "${CYAN}[STEP]${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
log_info "========================================="
log_info "Complete CCIP Setup Workflow"
@@ -59,11 +55,11 @@ log_step "Step 2: Configure All Bridge Destinations"
log_info ""
if [ -z "${PRIVATE_KEY:-}" ]; then
log_error "PRIVATE_KEY not found in .env file"
log_error "PRIVATE_KEY not available in effective environment"
exit 1
fi
log_info "Using PRIVATE_KEY from .env file"
log_info "Using PRIVATE_KEY from effective environment"
log_info ""
if ! "$SCRIPT_DIR/configure-all-destinations-auto.sh"; then
@@ -105,8 +101,8 @@ WETH9_CONFIGURED=0
WETH10_CONFIGURED=0
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)"
declare -A CHAIN_SELECTORS=(
["BSC"]="11344663589394136015"
@@ -161,4 +157,3 @@ else
log_info " Review output above for details"
exit 1
fi