Standardize deployment env and deployer handling

This commit is contained in:
defiQUG
2026-04-22 14:47:28 -07:00
parent 768168de5e
commit c3d4c786fa
51 changed files with 424 additions and 621 deletions

View File

@@ -30,22 +30,11 @@ fi
log_info "=== Deployment Status Check ==="
# Check .env file
if [ ! -f .env ]; then
log_error "❌ .env file not found"
echo "Please create .env file with required variables"
exit 1
fi
log_success "✅ .env file exists"
# Load environment variables
source .env
# Check RPC endpoint
RPC_URL="${RPC_URL:-${RPC_URL_138:-${CHAIN138_RPC_URL:-}}}"
if [ -z "$RPC_URL" ]; then
log_error "❌ RPC_URL not set in .env"
echo "Please set RPC_URL in .env file"
log_error "❌ Chain 138 RPC not configured"
echo "Set RPC_URL, RPC_URL_138, or CHAIN138_RPC_URL."
else
log_success "✅ RPC_URL configured: ${RPC_URL}"
@@ -68,9 +57,9 @@ else
fi
# Check PRIVATE_KEY
if [ -z "$PRIVATE_KEY" ]; then
log_error "❌ PRIVATE_KEY not set in .env"
echo "Please set PRIVATE_KEY in .env file"
if ! require_private_key_env > /dev/null 2>&1; then
log_error "❌ PRIVATE_KEY not configured"
echo "Set PRIVATE_KEY in smom-dbis-138/.env, repo .env, or ~/.secure-secrets/private-keys.env."
else
log_success "✅ PRIVATE_KEY configured"
fi
@@ -110,28 +99,28 @@ else
fi
# WETH10
if [ -z "$WETH10_ADDRESS" ] || [ "$WETH10_ADDRESS" = "0x0000000000000000000000000000000000000000" ]; then
if [ -z "${WETH10_ADDRESS:-}" ] || [ "${WETH10_ADDRESS:-}" = "0x0000000000000000000000000000000000000000" ]; then
log_warn "⏳ WETH10_ADDRESS: Not deployed"
else
log_success "✅ WETH10_ADDRESS: ${WETH10_ADDRESS}"
fi
# CCIPWETH9Bridge
if [ -z "$CCIPWETH9BRIDGE_ADDRESS" ] || [ "$CCIPWETH9BRIDGE_ADDRESS" = "0x0000000000000000000000000000000000000000" ]; then
if [ -z "${CCIPWETH9BRIDGE_ADDRESS:-}" ] || [ "${CCIPWETH9BRIDGE_ADDRESS:-}" = "0x0000000000000000000000000000000000000000" ]; then
log_warn "⏳ CCIPWETH9BRIDGE_ADDRESS: Not deployed"
else
log_success "✅ CCIPWETH9BRIDGE_ADDRESS: ${CCIPWETH9BRIDGE_ADDRESS}"
fi
# CCIPWETH10Bridge
if [ -z "$CCIPWETH10BRIDGE_ADDRESS" ] || [ "$CCIPWETH10BRIDGE_ADDRESS" = "0x0000000000000000000000000000000000000000" ]; then
if [ -z "${CCIPWETH10BRIDGE_ADDRESS:-}" ] || [ "${CCIPWETH10BRIDGE_ADDRESS:-}" = "0x0000000000000000000000000000000000000000" ]; then
log_warn "⏳ CCIPWETH10BRIDGE_ADDRESS: Not deployed"
else
log_success "✅ CCIPWETH10BRIDGE_ADDRESS: ${CCIPWETH10BRIDGE_ADDRESS}"
fi
# Oracle Aggregator
if [ -z "$ORACLE_AGGREGATOR_ADDRESS" ] || [ "$ORACLE_AGGREGATOR_ADDRESS" = "0x0000000000000000000000000000000000000000" ]; then
if [ -z "${ORACLE_AGGREGATOR_ADDRESS:-}" ] || [ "${ORACLE_AGGREGATOR_ADDRESS:-}" = "0x0000000000000000000000000000000000000000" ]; then
log_warn "⏳ ORACLE_AGGREGATOR_ADDRESS: Not deployed"
else
log_success "✅ ORACLE_AGGREGATOR_ADDRESS: ${ORACLE_AGGREGATOR_ADDRESS}"
@@ -164,11 +153,10 @@ fi
# Summary
log_info "=== Summary ==="
echo "Ready for contract deployment:"
if [ -n "$RPC_URL" ] && [ -n "$PRIVATE_KEY" ]; then
if [ -n "${RPC_URL:-}" ] && [ -n "${PRIVATE_KEY:-}" ]; then
log_success "✅ Prerequisites met"
echo "Run: ./scripts/deployment/deploy-contracts-ordered.sh"
else
log_error "❌ Prerequisites not met"
echo "Please configure RPC_URL and PRIVATE_KEY in .env"
fi