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'
@@ -24,12 +25,7 @@ log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
log_step() { echo -e "${CYAN}[STEP]${NC} $1"; }
log_header() { echo -e "${MAGENTA}=========================================${NC}"; }
# 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
# Parse arguments
PRIVATE_KEY_ARG="${1:-}"
@@ -50,7 +46,7 @@ if [ -n "$PRIVATE_KEY_ARG" ]; then
elif [ -z "${PRIVATE_KEY:-}" ]; then
log_error "PRIVATE_KEY not provided"
log_info "Usage: $0 [private_key] [weth9_eth_mainnet] [weth10_eth_mainnet]"
log_info "Or set PRIVATE_KEY in .env file"
log_info "Or export PRIVATE_KEY before running"
exit 1
fi
@@ -160,4 +156,3 @@ log_info " 1. Review dry run results above"
log_info " 2. If all checks pass, bridge tokens:"
log_info " ./scripts/wrap-and-bridge-to-ethereum.sh [amount] [private_key]"
log_info ""