Files
smom-dbis-138/scripts/deployment/generate-mainnet-deployment-plan.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

92 lines
3.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Generate comprehensive Mainnet deployment plan
set -e
cd "$(dirname "$0")/../.."
echo "=== Mainnet Deployment Plan ==="
# Color codes
# Get wallet balance
WALLET_BALANCE=$(./scripts/deployment/check-mainnet-balances.sh 2>&1 | grep -oP 'Balance: \K[0-9.]+' | head -1)
# Get gas prices
GAS_OUTPUT=$(./scripts/deployment/get-mainnet-gas-prices.sh 2>&1)
CONSERVATIVE_GAS=$(echo "$GAS_OUTPUT" | grep -oP 'Recommended Gas Price.*: \K[0-9.]+' | head -1)
log_info "Current Status:"
echo " Wallet Balance: $WALLET_BALANCE ETH"
echo " Gas Price: $CONSERVATIVE_GAS Gwei"
log_success "Remaining Contracts for Mainnet Deployment:"
# Contract information
cat << 'CONTRACTS'
1. CCIPLogger
- Location: contracts/ccip-integration/CCIPLogger.sol
- Framework: Hardhat
- Estimated Cost: ~0.008 ETH
- Dependencies: None
- Priority: HIGH (can deploy independently)
2. CCIPWETH9Bridge
- Location: contracts/ccip/CCIPWETH9Bridge.sol
- Framework: Foundry
- Estimated Cost: ~0.006 ETH
- Dependencies: CCIPRouter
- Priority: MEDIUM (requires CCIPRouter)
3. CCIPWETH10Bridge
- Location: contracts/ccip/CCIPWETH10Bridge.sol
- Framework: Foundry
- Estimated Cost: ~0.006 ETH
- Dependencies: CCIPRouter
- Priority: MEDIUM (requires CCIPRouter)
CONTRACTS
log_warn "Deployment Prioritization:"
TOTAL_COST=0.020
if (( $(echo "$WALLET_BALANCE >= $TOTAL_COST" | bc -l 2>/dev/null || echo "0") )); then
log_success "✅ Sufficient balance for all deployments"
echo "Recommended deployment order:"
echo " 1. CCIPLogger (no dependencies)"
echo " 2. CCIPWETH9Bridge (after CCIPRouter)"
echo " 3. CCIPWETH10Bridge (after CCIPRouter)"
else
log_error "⚠️ Insufficient balance for all deployments"
NEEDED=$(echo "$TOTAL_COST - $WALLET_BALANCE" | bc 2>/dev/null || echo "0")
echo " Additional ETH needed: $NEEDED ETH"
echo "Prioritized deployment order (based on available balance):"
# Calculate what can be deployed
if (( $(echo "$WALLET_BALANCE >= 0.008" | bc -l 2>/dev/null || echo "0") )); then
echo " 1. ✅ CCIPLogger ($(echo "$WALLET_BALANCE - 0.008" | bc) ETH remaining)"
REMAINING=$(echo "$WALLET_BALANCE - 0.008" | bc 2>/dev/null || echo "0")
if (( $(echo "$REMAINING >= 0.006" | bc -l 2>/dev/null || echo "0") )); then
echo " 2. ✅ CCIPWETH9Bridge ($(echo "$REMAINING - 0.006" | bc) ETH remaining)"
REMAINING=$(echo "$REMAINING - 0.006" | bc 2>/dev/null || echo "0")
if (( $(echo "$REMAINING >= 0.006" | bc -l 2>/dev/null || echo "0") )); then
echo " 3. ✅ CCIPWETH10Bridge"
else
echo " 3. ❌ CCIPWETH10Bridge (insufficient funds)"
fi
else
echo " 2. ❌ CCIPWETH9Bridge (insufficient funds)"
echo " 3. ❌ CCIPWETH10Bridge (insufficient funds)"
fi
else
echo " 1. ❌ CCIPLogger (insufficient funds)"
echo " 2. ❌ CCIPWETH9Bridge (insufficient funds)"
echo " 3. ❌ CCIPWETH10Bridge (insufficient funds)"
fi
fi
log_info "Next Steps:"
echo " 1. Run: ./scripts/deployment/compile-test-mainnet-contracts.sh"
echo " 2. Review: ./scripts/deployment/prioritize-mainnet-deployments.sh"
echo " 3. Deploy: Follow prioritized order above"