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'
@@ -20,19 +21,14 @@ log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${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
# Configuration
RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
EXPECTED_LINK_ADDRESS="0x326C977E6efc84E512bB9C30f76E30c160eD06FB"
EXPECTED_LINK_ADDRESS="$(resolve_address_value LINK_TOKEN LINK_TOKEN 0x326C977E6efc84E512bB9C30f76E30c160eD06FB)"
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
@@ -257,7 +253,7 @@ if [ -n "$DEPLOYED_ADDRESS" ] && [ "$DEPLOYED_ADDRESS" != "0x0000000000000000000
log_info ""
log_info "Next steps:"
log_info "1. Update .env file with LINK token address"
log_info "1. Update config/address-inventory.json with LINK token address"
log_info "2. Fund bridge contracts: ./scripts/fund-bridge-contracts.sh 10"
log_info "3. Verify contract on explorer: https://explorer.d-bis.org/address/$DEPLOYED_ADDRESS"
@@ -272,4 +268,3 @@ else
log_error "$DEPLOY_OUTPUT"
exit 1
fi