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:
@@ -8,6 +8,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'
|
||||
@@ -21,16 +22,11 @@ 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 .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
|
||||
|
||||
# Configuration
|
||||
RPC_URL="${RPC_URL_138:-http://192.168.11.250:8545}"
|
||||
WETH9_ADDRESS="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
||||
WETH9_ADDRESS="$(resolve_address_value WETH9_ADDRESS WETH9_ADDRESS 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)"
|
||||
|
||||
# Parse arguments
|
||||
PRIVATE_KEY="${1:-${PRIVATE_KEY:-}}"
|
||||
@@ -202,4 +198,3 @@ else
|
||||
log_info "Recommendation: Inspect contract bytecode and compare with standard WETH9"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user