- 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.
58 lines
2.2 KiB
Bash
Executable File
58 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Configure bridge destinations for cross-chain functionality
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/../lib/init.sh"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
|
|
|
|
log_info "=== Configuring Bridge Destinations ==="
|
|
|
|
# Load environment
|
|
if [ -f "$PROJECT_ROOT/.env" ]; then
|
|
source "$PROJECT_ROOT/.env"
|
|
fi
|
|
|
|
MAINNET_RPC="${ETHEREUM_MAINNET_RPC:-https://eth.llamarpc.com}"
|
|
CHAIN138_RPC="${RPC_URL:-https://rpc.d-bis.org}"
|
|
PRIVATE_KEY="${PRIVATE_KEY}"
|
|
if [[ ! "$PRIVATE_KEY" =~ ^0x ]]; then
|
|
PRIVATE_KEY="0x$PRIVATE_KEY"
|
|
fi
|
|
|
|
# Get deployed addresses
|
|
WETH9_BRIDGE_MAINNET=$(grep "CCIPWETH9_BRIDGE_MAINNET=" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
WETH10_BRIDGE_MAINNET=$(grep "CCIPWETH10_BRIDGE_MAINNET=" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
WETH9_BRIDGE_CHAIN138=$(grep "CCIPWETH9_BRIDGE_CHAIN138=" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
WETH10_BRIDGE_CHAIN138=$(grep "CCIPWETH10_BRIDGE_CHAIN138=" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
|
|
# Chain selectors
|
|
ETH_SELECTOR="${ETH_MAINNET_SELECTOR:-0x500147}" # Ethereum Mainnet
|
|
CHAIN138_SELECTOR="${CHAIN138_SELECTOR:-0x000000000000008a}" # Chain-138
|
|
|
|
echo "Configuration:"
|
|
echo " Ethereum Mainnet Selector: $ETH_SELECTOR"
|
|
echo " Chain-138 Selector: $CHAIN138_SELECTOR"
|
|
|
|
if [ -z "$WETH9_BRIDGE_MAINNET" ] || [ -z "$WETH9_BRIDGE_CHAIN138" ]; then
|
|
log_warn "⚠️ Bridge addresses not found in .env"
|
|
echo "Please ensure bridges are deployed on both chains"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Bridge Addresses:"
|
|
echo " WETH9 Mainnet: $WETH9_BRIDGE_MAINNET"
|
|
echo " WETH9 Chain-138: $WETH9_BRIDGE_CHAIN138"
|
|
echo " WETH10 Mainnet: $WETH10_BRIDGE_MAINNET"
|
|
echo " WETH10 Chain-138: $WETH10_BRIDGE_CHAIN138"
|
|
|
|
log_info "Note: Bridge destination configuration requires:"
|
|
echo " 1. Calling addDestination() on each bridge contract"
|
|
echo " 2. Setting the corresponding bridge address on the destination chain"
|
|
echo " 3. Enabling the destination"
|
|
echo "This can be done via:"
|
|
echo " • cast send (for Foundry)"
|
|
echo " • Hardhat scripts"
|
|
echo " • Direct contract interaction"
|
|
log_warn "⚠️ Manual configuration required"
|