Files
smom-dbis-138/scripts/deployment/deploy-bridges-chain138.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

64 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Deploy bridges on Chain-138
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
log_info "=== Deploying Bridges on Chain-138 ==="
# Load environment
if [ -f "$PROJECT_ROOT/.env" ]; then
source "$PROJECT_ROOT/.env"
fi
CHAIN138_RPC="${RPC_URL:-https://rpc.d-bis.org}"
PRIVATE_KEY="${PRIVATE_KEY}"
if [[ ! "$PRIVATE_KEY" =~ ^0x ]]; then
PRIVATE_KEY="0x$PRIVATE_KEY"
fi
WETH9_ADDRESS="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
WETH10_ADDRESS="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9F"
CCIP_ROUTER="${CCIP_ROUTER:-}"
CCIP_FEE_TOKEN="${CCIP_FEE_TOKEN:-0x0000000000000000000000000000000000000000}"
if [ -z "$CCIP_ROUTER" ]; then
log_warn "⚠️ CCIP_ROUTER not set in .env"
echo "Please set CCIP_ROUTER to the Chain-138 CCIP Router address"
exit 1
fi
echo "Deploying CCIPWETH9Bridge..."
export CCIP_ROUTER
export CCIP_FEE_TOKEN
WETH9_BRIDGE=$(forge script script/DeployCCIPWETH9Bridge.s.sol --rpc-url "$CHAIN138_RPC" --broadcast --private-key "$PRIVATE_KEY" --legacy 2>&1 | grep -E "Deployed to:|Contract deployed at:" | tail -1 | sed 's/.*at: //' | awk '{print $1}' | tr -d '\n' || echo "")
if [ -n "$WETH9_BRIDGE" ] && [ "$WETH9_BRIDGE" != "" ]; then
log_success "✅ CCIPWETH9Bridge deployed: $WETH9_BRIDGE"
if grep -q "CCIPWETH9_BRIDGE_CHAIN138=" "$PROJECT_ROOT/.env" 2>/dev/null; then
sed -i "s|CCIPWETH9_BRIDGE_CHAIN138=.*|CCIPWETH9_BRIDGE_CHAIN138=$WETH9_BRIDGE|" "$PROJECT_ROOT/.env"
else
echo "CCIPWETH9_BRIDGE_CHAIN138=$WETH9_BRIDGE" >> "$PROJECT_ROOT/.env"
fi
else
log_warn "⚠️ Deployment may have failed"
fi
echo "Deploying CCIPWETH10Bridge..."
WETH10_BRIDGE=$(forge script script/DeployCCIPWETH10Bridge.s.sol --rpc-url "$CHAIN138_RPC" --broadcast --private-key "$PRIVATE_KEY" --legacy 2>&1 | grep -E "Deployed to:|Contract deployed at:" | tail -1 | sed 's/.*at: //' | awk '{print $1}' | tr -d '\n' || echo "")
if [ -n "$WETH10_BRIDGE" ] && [ "$WETH10_BRIDGE" != "" ]; then
log_success "✅ CCIPWETH10Bridge deployed: $WETH10_BRIDGE"
if grep -q "CCIPWETH10_BRIDGE_CHAIN138=" "$PROJECT_ROOT/.env" 2>/dev/null; then
sed -i "s|CCIPWETH10_BRIDGE_CHAIN138=.*|CCIPWETH10_BRIDGE_CHAIN138=$WETH10_BRIDGE|" "$PROJECT_ROOT/.env"
else
echo "CCIPWETH10_BRIDGE_CHAIN138=$WETH10_BRIDGE" >> "$PROJECT_ROOT/.env"
fi
else
log_warn "⚠️ Deployment may have failed"
fi
log_success "✅ Chain-138 bridge deployment complete!"