Files
smom-dbis-138/scripts/deployment/deploy-all-ready-chains.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

93 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Deploy to all ready chains (7 chains, 31 contracts)
# This script deploys contracts to chains with sufficient wallet balances
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$PROJECT_ROOT"
# Source environment
if [ -f .env ]; then
source .env
fi
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}Multichain Deployment - Ready Chains${NC}"
echo -e "${BLUE}========================================${NC}"
echo ""
# Check prerequisites
if [ -z "${PRIVATE_KEY:-}" ]; then
echo -e "${RED}✗ PRIVATE_KEY not set in .env${NC}"
exit 1
fi
echo -e "${GREEN}✓ Prerequisites check passed${NC}"
echo ""
# Deployment function
deploy_chain() {
local chain_name=$1
local rpc_name=$2
local chain_id=$3
local script_name=$4
echo -e "${YELLOW}Deploying to ${chain_name}...${NC}"
echo " RPC: ${rpc_name}"
echo " Chain ID: ${chain_id}"
echo ""
forge script "${script_name}" \
--rpc-url "${rpc_name}" \
--chain-id "${chain_id}" \
--private-key "${PRIVATE_KEY}" \
--broadcast \
--verify \
-vvvv || {
echo -e "${RED}✗ Deployment to ${chain_name} failed${NC}"
return 1
}
echo -e "${GREEN}${chain_name} deployment complete${NC}"
echo ""
}
# Deploy to ready chains
echo -e "${BLUE}Starting deployments...${NC}"
echo ""
# 1. Ethereum Mainnet (CCIPLogger only)
deploy_chain "Ethereum Mainnet" "mainnet" "1" "script/DeployCCIPLoggerOnly.s.sol:DeployCCIPLoggerOnly"
# 2. BSC (all contracts)
deploy_chain "BSC" "bsc" "56" "script/DeployAll.s.sol:DeployAll"
# 3. Polygon (all contracts)
deploy_chain "Polygon" "polygon" "137" "script/DeployAll.s.sol:DeployAll"
# 4. Avalanche (all contracts)
deploy_chain "Avalanche" "avalanche" "43114" "script/DeployAll.s.sol:DeployAll"
# 5. Base (all contracts)
deploy_chain "Base" "base" "8453" "script/DeployAll.s.sol:DeployAll"
# 6. Arbitrum (all contracts)
deploy_chain "Arbitrum" "arbitrum" "42161" "script/DeployAll.s.sol:DeployAll"
# 7. Optimism (all contracts)
deploy_chain "Optimism" "optimism" "10" "script/DeployAll.s.sol:DeployAll"
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN}All Deployments Complete!${NC}"
echo -e "${GREEN}========================================${NC}"