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,15 +23,10 @@ log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
log_header() { echo -e "${CYAN}[HEADER]${NC} $1"; }
# Load environment variables
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
RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
LINK_TOKEN="0x326C977E6efc84E512bB9C30f76E30c160eD06FB"
LINK_TOKEN="$(resolve_address_value LINK_TOKEN LINK_TOKEN 0x326C977E6efc84E512bB9C30f76E30c160eD06FB)"
log_header "========================================="
log_header "Complete Prerequisites for Bridge Funding"
@@ -83,7 +79,7 @@ log_header "Step 2: Check Account LINK Balance"
log_info ""
if [ -z "${PRIVATE_KEY:-}" ]; then
log_error "PRIVATE_KEY not found in .env"
log_error "PRIVATE_KEY not available in effective environment"
exit 1
fi
@@ -158,4 +154,3 @@ log_success "✓ Bridge contracts funded"
log_info ""
log_info "You can now proceed with bridge operations!"
log_info ""