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:
95
scripts/deployment/verify-mainnet-contracts.sh
Executable file
95
scripts/deployment/verify-mainnet-contracts.sh
Executable file
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env bash
|
||||
# Verify Ethereum Mainnet contracts on Etherscan
|
||||
# This script checks verification status and provides verification commands
|
||||
|
||||
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 "=========================================="
|
||||
echo "Ethereum Mainnet Contract Verification"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
|
||||
# Mainnet contract addresses (from deployment logs)
|
||||
CCIPWETH9BRIDGE_MAINNET="0x3304b747E565a97ec8AC220b0B6A1f6ffDB837e6"
|
||||
CCIPWETH10BRIDGE_MAINNET="0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e"
|
||||
|
||||
# Check verification status
|
||||
check_verification() {
|
||||
local contract_name=$1
|
||||
local contract_address=$2
|
||||
|
||||
echo "Checking $contract_name ($contract_address)..."
|
||||
|
||||
if [ -z "${ETHERSCAN_API_KEY:-}" ]; then
|
||||
echo " ⚠️ ETHERSCAN_API_KEY not set - cannot check via API"
|
||||
echo " 📄 Check manually: https://etherscan.io/address/$contract_address#code"
|
||||
return
|
||||
fi
|
||||
|
||||
local response=$(curl -s "https://api.etherscan.io/api?module=contract&action=getsourcecode&address=$contract_address&apikey=$ETHERSCAN_API_KEY")
|
||||
local sourcecode=$(echo "$response" | jq -r '.result[0].SourceCode' 2>/dev/null || echo "")
|
||||
local contract_name_api=$(echo "$response" | jq -r '.result[0].ContractName' 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$sourcecode" ] && [ "$sourcecode" != "" ]; then
|
||||
echo " ✅ Contract is VERIFIED"
|
||||
if [ -n "$contract_name_api" ] && [ "$contract_name_api" != "" ]; then
|
||||
echo " Contract Name: $contract_name_api"
|
||||
fi
|
||||
echo " 📄 View: https://etherscan.io/address/$contract_address#code"
|
||||
else
|
||||
echo " ❌ Contract is NOT VERIFIED"
|
||||
echo " 📄 Verify at: https://etherscan.io/address/$contract_address#code"
|
||||
echo ""
|
||||
# Get contract name for verification
|
||||
local contract_file=""
|
||||
local contract_name_short=""
|
||||
if [[ "$contract_name" == *"9Bridge"* ]]; then
|
||||
contract_file="contracts/ccip/CCIPWETH9Bridge.sol:CCIPWETH9Bridge"
|
||||
contract_name_short="CCIPWETH9Bridge"
|
||||
elif [[ "$contract_name" == *"10Bridge"* ]]; then
|
||||
contract_file="contracts/ccip/CCIPWETH10Bridge.sol:CCIPWETH10Bridge"
|
||||
contract_name_short="CCIPWETH10Bridge"
|
||||
else
|
||||
contract_file="contracts/ccip/${contract_name}.sol:${contract_name}"
|
||||
contract_name_short="$contract_name"
|
||||
fi
|
||||
|
||||
echo " Verification Command (Foundry):"
|
||||
echo " forge verify-contract \\"
|
||||
echo " --chain-id 1 \\"
|
||||
echo " --num-of-optimizations 200 \\"
|
||||
echo " --watch \\"
|
||||
echo " $contract_address \\"
|
||||
echo " $contract_file \\"
|
||||
if [ -n "${ETHERSCAN_API_KEY:-}" ]; then
|
||||
echo " $ETHERSCAN_API_KEY"
|
||||
else
|
||||
echo " <ETHERSCAN_API_KEY>"
|
||||
fi
|
||||
echo ""
|
||||
echo " Or verify via Etherscan UI:"
|
||||
echo " https://etherscan.io/address/$contract_address#code"
|
||||
fi
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Check both contracts
|
||||
check_verification "CCIPWETH9Bridge" "$CCIPWETH9BRIDGE_MAINNET"
|
||||
check_verification "CCIPWETH10Bridge" "$CCIPWETH10BRIDGE_MAINNET"
|
||||
|
||||
echo "=========================================="
|
||||
echo "Verification Check Complete"
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
echo "📋 Quick Links:"
|
||||
echo " • CCIPWETH9Bridge: https://etherscan.io/address/$CCIPWETH9BRIDGE_MAINNET"
|
||||
echo " • CCIPWETH10Bridge: https://etherscan.io/address/$CCIPWETH10BRIDGE_MAINNET"
|
||||
echo " • Verify Contracts: https://etherscan.io/myverify_address"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user