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:
64
scripts/deployment/verify-contract-etherscan.sh
Executable file
64
scripts/deployment/verify-contract-etherscan.sh
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Verify deployed contracts on Etherscan using ETHERSCAN_API_KEY
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
|
||||
|
||||
# Load environment variables
|
||||
if [ -f "$PROJECT_ROOT/.env" ]; then
|
||||
source "$PROJECT_ROOT/.env"
|
||||
else
|
||||
log_error "Error: .env file not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_info "=== Etherscan Contract Verification ==="
|
||||
|
||||
if [ -z "$ETHERSCAN_API_KEY" ]; then
|
||||
log_error "Error: ETHERSCAN_API_KEY not set in .env"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Function to verify contract
|
||||
verify_contract() {
|
||||
local contract_address=$1
|
||||
local contract_name=$2
|
||||
local source_code=$3
|
||||
|
||||
log_warn "Verifying $contract_name at $contract_address..."
|
||||
|
||||
# Etherscan verification API
|
||||
local response=$(curl -s -X POST "https://api.etherscan.io/api" \
|
||||
-d "apikey=$ETHERSCAN_API_KEY" \
|
||||
-d "module=contract" \
|
||||
-d "action=verifysourcecode" \
|
||||
-d "address=$contract_address" \
|
||||
-d "sourceCode=$source_code" \
|
||||
-d "codeformat=solidity-single-file" 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$response" ]; then
|
||||
local status=$(echo "$response" | jq -r '.status' 2>/dev/null || echo "")
|
||||
if [ "$status" == "1" ]; then
|
||||
log_success "✅ Verification submitted"
|
||||
return 0
|
||||
else
|
||||
local message=$(echo "$response" | jq -r '.message' 2>/dev/null || echo "")
|
||||
log_warn "⚠️ $message"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
log_error "❌ Verification failed"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "This script helps verify contracts on Etherscan."
|
||||
echo "For full verification, use Foundry's verify command:"
|
||||
echo " forge verify-contract <address> <contract> --chain-id 1 --etherscan-api-key \$ETHERSCAN_API_KEY"
|
||||
echo "Example:"
|
||||
echo " forge verify-contract \$CCIP_WETH9_BRIDGE CCIPWETH9Bridge --chain-id 1 --etherscan-api-key \$ETHERSCAN_API_KEY"
|
||||
Reference in New Issue
Block a user