Files
smom-dbis-138/scripts/deployment/get-wallet-address.sh
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

82 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Get wallet address from private key in .env file
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# Colors
# Load environment variables
if [ -f "$PROJECT_ROOT/.env" ]; then
source "$PROJECT_ROOT/.env"
else
log_error "Error: .env file not found"
exit 1
fi
log_info "=== Wallet Address from .env Private Key ==="
# Check if cast is available
if ! command -v cast &> /dev/null; then
log_error "Error: cast (Foundry) not found. Please install Foundry."
exit 1
fi
# Get private key from .env
if [ -z "$PRIVATE_KEY" ]; then
log_error "Error: PRIVATE_KEY not set in .env"
exit 1
fi
# Derive address
WALLET_ADDRESS=$(cast wallet address --private-key "$PRIVATE_KEY" 2>/dev/null || echo "")
if [ -z "$WALLET_ADDRESS" ]; then
log_error "Error: Could not derive address from private key"
echo "Please check that PRIVATE_KEY is valid (should start with 0x and be 66 characters)"
exit 1
fi
log_success "Wallet Address: $WALLET_ADDRESS"
# Show funding requirements
log_info "=== Funding Requirements ==="
log_warn "Ethereum Mainnet:"
echo " Minimum: 0.025 ETH"
echo " Recommended: 0.05 ETH (with buffer)"
echo " Purpose: Gas fees for bridge deployment"
log_warn "ChainID 138:"
echo " Minimum: 1 ETH"
echo " Recommended: 2 ETH (with buffer)"
echo " Purpose: Gas fees for bridge deployment"
# Show balances if RPC is available
if [ -n "$RPC_URL" ]; then
log_info "=== Current Balances ==="
# Check Mainnet balance
if [ -n "$MAINNET_RPC_URL" ]; then
MAINNET_RPC="$MAINNET_RPC_URL"
else
MAINNET_RPC="https://eth.llamarpc.com"
fi
MAINNET_BALANCE=$(cast balance "$WALLET_ADDRESS" --rpc-url "$MAINNET_RPC" 2>/dev/null || echo "0")
MAINNET_ETH=$(cast --to-unit "$MAINNET_BALANCE" ether 2>/dev/null || echo "0")
echo -e "Mainnet ETH: ${GREEN}$MAINNET_ETH ETH${NC}"
# Check ChainID 138 balance
CHAIN138_BALANCE=$(cast balance "$WALLET_ADDRESS" --rpc-url "$RPC_URL" 2>/dev/null || echo "0")
CHAIN138_ETH=$(cast --to-unit "$CHAIN138_BALANCE" ether 2>/dev/null || echo "0")
echo -e "ChainID 138 ETH: ${GREEN}$CHAIN138_ETH ETH${NC}"
fi
log_info "=== Quick Copy ==="
echo "Wallet Address:"
echo "$WALLET_ADDRESS"
echo "Copy this address to fund your wallet for deployment."