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.
This commit is contained in:
119
scripts/testing/test-contracts-mainnet.sh
Executable file
119
scripts/testing/test-contracts-mainnet.sh
Executable file
@@ -0,0 +1,119 @@
|
||||
#!/bin/bash
|
||||
# Test script for MainnetTether and TransactionMirror contracts
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../" && pwd)"
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
# Source environment variables
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
else
|
||||
echo "❌ Error: .env file not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Contract addresses
|
||||
MAINNET_TETHER="${MAINNET_TETHER_ADDRESS:-0x15DF1D5BFDD8Aa4b380445D4e3E9B38d34283619}"
|
||||
TRANSACTION_MIRROR="${TRANSACTION_MIRROR_ADDRESS:-0x4CF42c4F1dBa748601b8938be3E7ABD732E87cE9}"
|
||||
DEPLOYER="0x4A666F96fC8764181194447A7dFdb7d471b301C8"
|
||||
|
||||
echo "=== Testing Deployed Contracts ==="
|
||||
echo ""
|
||||
echo "MainnetTether: $MAINNET_TETHER"
|
||||
echo "TransactionMirror: $TRANSACTION_MIRROR"
|
||||
echo "Deployer: $DEPLOYER"
|
||||
echo ""
|
||||
|
||||
# Test MainnetTether
|
||||
echo "=== Testing MainnetTether ==="
|
||||
echo ""
|
||||
|
||||
echo "1. Checking admin..."
|
||||
TETHER_ADMIN=$(cast call $MAINNET_TETHER "admin()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
echo " Admin: $TETHER_ADMIN"
|
||||
if [ "$(echo $TETHER_ADMIN | tr '[:upper:]' '[:lower:]')" = "$(echo $DEPLOYER | tr '[:upper:]' '[:lower:]')" ]; then
|
||||
echo " ✅ Admin matches deployer"
|
||||
else
|
||||
echo " ⚠️ Admin does not match deployer"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "2. Checking paused status..."
|
||||
PAUSED=$(cast call $MAINNET_TETHER "paused()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
if [ "$PAUSED" = "0x0000000000000000000000000000000000000000000000000000000000000000" ]; then
|
||||
echo " ✅ Contract is not paused"
|
||||
else
|
||||
echo " ⚠️ Contract is paused"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "3. Checking CHAIN_138 constant..."
|
||||
CHAIN_138=$(cast call $MAINNET_TETHER "CHAIN_138()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
echo " CHAIN_138: $CHAIN_138"
|
||||
|
||||
echo ""
|
||||
echo "4. Testing isAnchored (block 0)..."
|
||||
IS_ANCHORED=$(cast call $MAINNET_TETHER "isAnchored(uint256)" 0 --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
if [ "$IS_ANCHORED" = "0x0000000000000000000000000000000000000000000000000000000000000000" ]; then
|
||||
echo " ✅ Block 0 is not anchored (expected)"
|
||||
else
|
||||
echo " ⚠️ Block 0 is anchored"
|
||||
fi
|
||||
|
||||
# Test TransactionMirror
|
||||
echo ""
|
||||
echo "=== Testing TransactionMirror ==="
|
||||
echo ""
|
||||
|
||||
echo "1. Checking admin..."
|
||||
MIRROR_ADMIN=$(cast call $TRANSACTION_MIRROR "admin()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
echo " Admin: $MIRROR_ADMIN"
|
||||
if [ "$(echo $MIRROR_ADMIN | tr '[:upper:]' '[:lower:]')" = "$(echo $DEPLOYER | tr '[:upper:]' '[:lower:]')" ]; then
|
||||
echo " ✅ Admin matches deployer"
|
||||
else
|
||||
echo " ⚠️ Admin does not match deployer"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "2. Checking paused status..."
|
||||
PAUSED=$(cast call $TRANSACTION_MIRROR "paused()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
if [ "$PAUSED" = "0x0000000000000000000000000000000000000000000000000000000000000000" ]; then
|
||||
echo " ✅ Contract is not paused"
|
||||
else
|
||||
echo " ⚠️ Contract is paused"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "3. Checking CHAIN_138 constant..."
|
||||
CHAIN_138=$(cast call $TRANSACTION_MIRROR "CHAIN_138()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
echo " CHAIN_138: $CHAIN_138"
|
||||
|
||||
echo ""
|
||||
echo "4. Checking MAX_BATCH_SIZE..."
|
||||
MAX_BATCH=$(cast call $TRANSACTION_MIRROR "MAX_BATCH_SIZE()" --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
echo " MAX_BATCH_SIZE: $(cast --to-dec $MAX_BATCH 2>/dev/null || echo $MAX_BATCH)"
|
||||
|
||||
echo ""
|
||||
echo "5. Testing isMirrored (zero hash)..."
|
||||
ZERO_HASH="0x0000000000000000000000000000000000000000000000000000000000000000"
|
||||
IS_MIRRORED=$(cast call $TRANSACTION_MIRROR "isMirrored(bytes32)" $ZERO_HASH --rpc-url "$ETHEREUM_MAINNET_RPC" 2>/dev/null)
|
||||
if [ "$IS_MIRRORED" = "0x0000000000000000000000000000000000000000000000000000000000000000" ]; then
|
||||
echo " ✅ Zero hash is not mirrored (expected)"
|
||||
else
|
||||
echo " ⚠️ Zero hash is mirrored"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Test Summary ==="
|
||||
echo "✅ All basic contract tests completed"
|
||||
echo ""
|
||||
echo "Next Steps:"
|
||||
echo " 1. Test pause/unpause functionality (requires admin)"
|
||||
echo " 2. Test state proof anchoring (requires Chain-138 data)"
|
||||
echo " 3. Test transaction mirroring (requires Chain-138 transactions)"
|
||||
echo " 4. Monitor contract events on Etherscan"
|
||||
|
||||
85
scripts/testing/test-contracts.sh
Executable file
85
scripts/testing/test-contracts.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env bash
|
||||
# Test deployed contracts on all chains
|
||||
# This script performs basic tests on deployed contracts
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
source .env 2>/dev/null || true
|
||||
|
||||
echo "=== Testing Deployed Contracts ==="
|
||||
echo ""
|
||||
|
||||
# Test function
|
||||
test_chain() {
|
||||
local chain_name=$1
|
||||
local rpc_url=$2
|
||||
local weth9=$3
|
||||
local weth10=$4
|
||||
local bridge9=$5
|
||||
local bridge10=$6
|
||||
|
||||
echo "Testing ${chain_name}..."
|
||||
echo " RPC: ${rpc_url}"
|
||||
echo " WETH9: ${weth9}"
|
||||
echo " WETH10: ${weth10}"
|
||||
echo " Bridge9: ${bridge9}"
|
||||
echo " Bridge10: ${bridge10}"
|
||||
|
||||
# Check if contracts exist
|
||||
if cast code "$weth9" --rpc-url "$rpc_url" > /dev/null 2>&1; then
|
||||
echo " ✓ WETH9 contract exists"
|
||||
else
|
||||
echo " ✗ WETH9 contract not found"
|
||||
fi
|
||||
|
||||
if cast code "$weth10" --rpc-url "$rpc_url" > /dev/null 2>&1; then
|
||||
echo " ✓ WETH10 contract exists"
|
||||
else
|
||||
echo " ✗ WETH10 contract not found"
|
||||
fi
|
||||
|
||||
if cast code "$bridge9" --rpc-url "$rpc_url" > /dev/null 2>&1; then
|
||||
echo " ✓ CCIPWETH9Bridge contract exists"
|
||||
else
|
||||
echo " ✗ CCIPWETH9Bridge contract not found"
|
||||
fi
|
||||
|
||||
if cast code "$bridge10" --rpc-url "$rpc_url" > /dev/null 2>&1; then
|
||||
echo " ✓ CCIPWETH10Bridge contract exists"
|
||||
else
|
||||
echo " ✗ CCIPWETH10Bridge contract not found"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Test all deployed chains
|
||||
if [ -n "${WETH9_BSC:-}" ] && [ -n "${BSC_RPC_URL:-}" ]; then
|
||||
test_chain "BSC" "$BSC_RPC_URL" "$WETH9_BSC" "$WETH10_BSC" "$CCIPWETH9BRIDGE_BSC" "$CCIPWETH10BRIDGE_BSC"
|
||||
fi
|
||||
|
||||
if [ -n "${WETH9_POLYGON:-}" ] && [ -n "${POLYGON_RPC_URL:-}" ]; then
|
||||
test_chain "Polygon" "$POLYGON_RPC_URL" "$WETH9_POLYGON" "$WETH10_POLYGON" "$CCIPWETH9BRIDGE_POLYGON" "$CCIPWETH10BRIDGE_POLYGON"
|
||||
fi
|
||||
|
||||
if [ -n "${WETH9_AVALANCHE:-}" ] && [ -n "${AVALANCHE_RPC_URL:-}" ]; then
|
||||
test_chain "Avalanche" "$AVALANCHE_RPC_URL" "$WETH9_AVALANCHE" "$WETH10_AVALANCHE" "$CCIPWETH9BRIDGE_AVALANCHE" "$CCIPWETH10BRIDGE_AVALANCHE"
|
||||
fi
|
||||
|
||||
if [ -n "${WETH9_BASE:-}" ] && [ -n "${BASE_RPC_URL:-}" ]; then
|
||||
test_chain "Base" "$BASE_RPC_URL" "$WETH9_BASE" "$WETH10_BASE" "$CCIPWETH9BRIDGE_BASE" "$CCIPWETH10BRIDGE_BASE"
|
||||
fi
|
||||
|
||||
if [ -n "${WETH9_ARBITRUM:-}" ] && [ -n "${ARBITRUM_RPC_URL:-}" ]; then
|
||||
test_chain "Arbitrum" "$ARBITRUM_RPC_URL" "$WETH9_ARBITRUM" "$WETH10_ARBITRUM" "$CCIPWETH9BRIDGE_ARBITRUM" "$CCIPWETH10BRIDGE_ARBITRUM"
|
||||
fi
|
||||
|
||||
if [ -n "${WETH9_OPTIMISM:-}" ] && [ -n "${OPTIMISM_RPC_URL:-}" ]; then
|
||||
test_chain "Optimism" "$OPTIMISM_RPC_URL" "$WETH9_OPTIMISM" "$WETH10_OPTIMISM" "$CCIPWETH9BRIDGE_OPTIMISM" "$CCIPWETH10BRIDGE_OPTIMISM"
|
||||
fi
|
||||
|
||||
echo "=== Testing Complete ==="
|
||||
Reference in New Issue
Block a user