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:
@@ -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}"
|
||||
GAS_MULTIPLIER="${GAS_MULTIPLIER:-1.5}" # Use 1.5x current gas for faster inclusion
|
||||
|
||||
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
|
||||
|
||||
@@ -151,4 +147,3 @@ else
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user