- 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.
87 lines
2.5 KiB
Bash
Executable File
87 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Verify all Mainnet deployments
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/../lib/init.sh"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
|
|
|
|
log_info "=== Verifying Mainnet Deployments ==="
|
|
|
|
# Load environment
|
|
if [ -f "$PROJECT_ROOT/.env" ]; then
|
|
source "$PROJECT_ROOT/.env"
|
|
fi
|
|
|
|
MAINNET_RPC="${ETHEREUM_MAINNET_RPC:-https://eth.llamarpc.com}"
|
|
|
|
# Function to verify contract
|
|
verify_contract() {
|
|
local address=$1
|
|
local name=$2
|
|
|
|
if [ -z "$address" ] || [ "$address" == "" ]; then
|
|
log_error "❌ $name: Not deployed (no address)"
|
|
return 1
|
|
fi
|
|
|
|
if [[ ! "$address" =~ ^0x[0-9a-fA-F]{40}$ ]]; then
|
|
log_error "❌ $name: Invalid address format: $address"
|
|
return 1
|
|
fi
|
|
|
|
# Check if contract has code
|
|
CODE=$(cast code "$address" --rpc-url "$MAINNET_RPC" 2>/dev/null || echo "")
|
|
if [ -z "$CODE" ] || [ "$CODE" == "0x" ]; then
|
|
log_error "❌ $name: No code at $address"
|
|
return 1
|
|
else
|
|
CODE_SIZE=$(echo -n "$CODE" | wc -c)
|
|
log_success "✅ $name: Deployed at $address (code size: $((CODE_SIZE/2)) bytes)"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
log_info "Checking deployed contracts..."
|
|
|
|
# Check for addresses in .env
|
|
CCIP_LOGGER_ADDRESS=$(grep "CCIP_LOGGER_ETH_ADDRESS" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
CCIPWETH9_ADDRESS=$(grep "CCIPWETH9_BRIDGE_MAINNET" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
CCIPWETH10_ADDRESS=$(grep "CCIPWETH10_BRIDGE_MAINNET" "$PROJECT_ROOT/.env" 2>/dev/null | cut -d'=' -f2 | tr -d ' "' || echo "")
|
|
|
|
VERIFIED=0
|
|
FAILED=0
|
|
|
|
if [ -n "$CCIP_LOGGER_ADDRESS" ]; then
|
|
verify_contract "$CCIP_LOGGER_ADDRESS" "CCIPLogger" && ((VERIFIED++)) || ((FAILED++))
|
|
else
|
|
log_warn "⚠️ CCIPLogger: Address not found in .env"
|
|
((FAILED++))
|
|
fi
|
|
|
|
if [ -n "$CCIPWETH9_ADDRESS" ]; then
|
|
verify_contract "$CCIPWETH9_ADDRESS" "CCIPWETH9Bridge" && ((VERIFIED++)) || ((FAILED++))
|
|
else
|
|
log_warn "⚠️ CCIPWETH9Bridge: Address not found in .env"
|
|
((FAILED++))
|
|
fi
|
|
|
|
if [ -n "$CCIPWETH10_ADDRESS" ]; then
|
|
verify_contract "$CCIPWETH10_ADDRESS" "CCIPWETH10Bridge" && ((VERIFIED++)) || ((FAILED++))
|
|
else
|
|
log_warn "⚠️ CCIPWETH10Bridge: Address not found in .env"
|
|
((FAILED++))
|
|
fi
|
|
|
|
log_info "=== Verification Summary ==="
|
|
echo " Verified: $VERIFIED"
|
|
echo " Failed/Missing: $FAILED"
|
|
|
|
if [ $FAILED -eq 0 ]; then
|
|
log_success "✅ All contracts verified!"
|
|
exit 0
|
|
else
|
|
log_error "❌ Some contracts not verified"
|
|
exit 1
|
|
fi
|