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:
80
scripts/genesis/add-predeployed-weth-mainnet.sh
Executable file
80
scripts/genesis/add-predeployed-weth-mainnet.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Script to add predeployed WETH9 and WETH10 to genesis.json using Mainnet bytecode
|
||||
# This ensures they exist at their canonical Mainnet addresses
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
GENESIS_FILE="$PROJECT_ROOT/config/genesis.json"
|
||||
GENESIS_BACKUP="$GENESIS_FILE.backup.$(date +%Y%m%d_%H%M%S)"
|
||||
|
||||
|
||||
# Canonical Mainnet addresses
|
||||
WETH9_ADDRESS="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
||||
WETH10_ADDRESS="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
||||
|
||||
log_success "Adding predeployed WETH9 and WETH10 to genesis.json"
|
||||
|
||||
# Backup genesis file
|
||||
if [ -f "$GENESIS_FILE" ]; then
|
||||
cp "$GENESIS_FILE" "$GENESIS_BACKUP"
|
||||
log_warn "Backed up genesis.json to: $GENESIS_BACKUP"
|
||||
fi
|
||||
|
||||
# Fetch bytecode from Mainnet if cast is available
|
||||
if command -v cast &> /dev/null; then
|
||||
log_warn "Fetching bytecode from Ethereum Mainnet..."
|
||||
|
||||
WETH9_BYTECODE=$(cast code "$WETH9_ADDRESS" --rpc-url https://eth.llamarpc.com 2>/dev/null || echo "")
|
||||
if [ -z "$WETH9_BYTECODE" ] || [ "$WETH9_BYTECODE" == "0x" ]; then
|
||||
log_warn "Trying alternative RPC..."
|
||||
WETH9_BYTECODE=$(cast code "$WETH9_ADDRESS" --rpc-url https://rpc.ankr.com/eth 2>/dev/null || echo "")
|
||||
fi
|
||||
|
||||
WETH10_BYTECODE=$(cast code "$WETH10_ADDRESS" --rpc-url https://eth.llamarpc.com 2>/dev/null || echo "")
|
||||
if [ -z "$WETH10_BYTECODE" ] || [ "$WETH10_BYTECODE" == "0x" ]; then
|
||||
log_warn "Trying alternative RPC..."
|
||||
WETH10_BYTECODE=$(cast code "$WETH10_ADDRESS" --rpc-url https://rpc.ankr.com/eth 2>/dev/null || echo "")
|
||||
fi
|
||||
else
|
||||
log_error "Error: cast not found. Please install Foundry (forge install)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$WETH9_BYTECODE" ] || [ "$WETH9_BYTECODE" == "0x" ]; then
|
||||
log_error "Error: Could not fetch WETH9 bytecode from Mainnet"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$WETH10_BYTECODE" ] || [ "$WETH10_BYTECODE" == "0x" ]; then
|
||||
log_error "Error: Could not fetch WETH10 bytecode from Mainnet"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_success "Fetched bytecode:"
|
||||
echo " WETH9: $(echo $WETH9_BYTECODE | wc -c) characters"
|
||||
echo " WETH10: $(echo $WETH10_BYTECODE | wc -c) characters"
|
||||
|
||||
# Use jq to add contracts to alloc
|
||||
log_warn "Updating genesis.json..."
|
||||
jq --arg addr "$WETH9_ADDRESS" \
|
||||
--arg code "$WETH9_BYTECODE" \
|
||||
--arg addr10 "$WETH10_ADDRESS" \
|
||||
--arg code10 "$WETH10_BYTECODE" \
|
||||
'.alloc[$addr] = {
|
||||
"code": $code,
|
||||
"balance": "0x0"
|
||||
} | .alloc[$addr10] = {
|
||||
"code": $code10,
|
||||
"balance": "0x0"
|
||||
}' "$GENESIS_FILE" > "$GENESIS_FILE.tmp" && mv "$GENESIS_FILE.tmp" "$GENESIS_FILE"
|
||||
|
||||
log_success "Successfully added predeployed contracts to genesis.json"
|
||||
echo "Predeployed contracts:"
|
||||
echo " WETH9: $WETH9_ADDRESS"
|
||||
echo " WETH10: $WETH10_ADDRESS"
|
||||
log_warn "Note: These contracts will exist at their canonical Mainnet addresses"
|
||||
log_warn " when the chain starts. No deployment needed!"
|
||||
79
scripts/genesis/add-predeployed-weth.sh
Executable file
79
scripts/genesis/add-predeployed-weth.sh
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Script to add predeployed WETH9 and WETH10 to genesis.json
|
||||
# This ensures they exist at their canonical Mainnet addresses
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
GENESIS_FILE="$PROJECT_ROOT/config/genesis.json"
|
||||
GENESIS_BACKUP="$GENESIS_FILE.backup.$(date +%Y%m%d_%H%M%S)"
|
||||
|
||||
|
||||
# Canonical Mainnet addresses
|
||||
WETH9_ADDRESS="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
||||
WETH10_ADDRESS="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
||||
|
||||
log_success "Adding predeployed WETH9 and WETH10 to genesis.json"
|
||||
|
||||
# Backup genesis file
|
||||
if [ -f "$GENESIS_FILE" ]; then
|
||||
cp "$GENESIS_FILE" "$GENESIS_BACKUP"
|
||||
log_warn "Backed up genesis.json to: $GENESIS_BACKUP"
|
||||
fi
|
||||
|
||||
# Check if contracts are compiled
|
||||
if [ ! -f "$PROJECT_ROOT/out/tokens/WETH.sol/WETH.json" ]; then
|
||||
log_warn "WETH9 not compiled. Compiling..."
|
||||
cd "$PROJECT_ROOT"
|
||||
forge build --contracts contracts/tokens/WETH.sol 2>&1 | grep -E "(Compiling|Error)" || true
|
||||
fi
|
||||
|
||||
if [ ! -f "$PROJECT_ROOT/out/tokens/WETH10.sol/WETH10.json" ]; then
|
||||
log_warn "WETH10 not compiled. Compiling..."
|
||||
cd "$PROJECT_ROOT"
|
||||
forge build --contracts contracts/tokens/WETH10.sol 2>&1 | grep -E "(Compiling|Error)" || true
|
||||
fi
|
||||
|
||||
# Extract bytecode
|
||||
WETH9_BYTECODE=$(jq -r '.bytecode.object' "$PROJECT_ROOT/out/tokens/WETH.sol/WETH.json" 2>/dev/null || echo "")
|
||||
WETH10_BYTECODE=$(jq -r '.bytecode.object' "$PROJECT_ROOT/out/tokens/WETH10.sol/WETH10.json" 2>/dev/null || echo "")
|
||||
|
||||
if [ -z "$WETH9_BYTECODE" ] || [ "$WETH9_BYTECODE" == "null" ] || [ "$WETH9_BYTECODE" == "" ]; then
|
||||
log_error "Error: Could not extract WETH9 bytecode"
|
||||
echo "Please ensure contracts are compiled: forge build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$WETH10_BYTECODE" ] || [ "$WETH10_BYTECODE" == "null" ] || [ "$WETH10_BYTECODE" == "" ]; then
|
||||
log_error "Error: Could not extract WETH10 bytecode"
|
||||
echo "Please ensure contracts are compiled: forge build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_success "Extracted bytecode:"
|
||||
echo " WETH9: $(echo $WETH9_BYTECODE | wc -c) characters"
|
||||
echo " WETH10: $(echo $WETH10_BYTECODE | wc -c) characters"
|
||||
|
||||
# Use jq to add contracts to alloc
|
||||
log_warn "Updating genesis.json..."
|
||||
jq --arg addr "$WETH9_ADDRESS" \
|
||||
--arg code "$WETH9_BYTECODE" \
|
||||
--arg addr10 "$WETH10_ADDRESS" \
|
||||
--arg code10 "$WETH10_BYTECODE" \
|
||||
'.alloc[$addr] = {
|
||||
"code": $code,
|
||||
"balance": "0x0"
|
||||
} | .alloc[$addr10] = {
|
||||
"code": $code10,
|
||||
"balance": "0x0"
|
||||
}' "$GENESIS_FILE" > "$GENESIS_FILE.tmp" && mv "$GENESIS_FILE.tmp" "$GENESIS_FILE"
|
||||
|
||||
log_success "Successfully added predeployed contracts to genesis.json"
|
||||
echo "Predeployed contracts:"
|
||||
echo " WETH9: $WETH9_ADDRESS"
|
||||
echo " WETH10: $WETH10_ADDRESS"
|
||||
log_warn "Note: These contracts will exist at their canonical Mainnet addresses"
|
||||
log_warn " when the chain starts. No deployment needed!"
|
||||
39
scripts/genesis/add-weth-to-genesis.sh
Executable file
39
scripts/genesis/add-weth-to-genesis.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
# Add WETH9 and WETH10 to genesis.json via alloc
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# Color codes
|
||||
|
||||
echo "=== Adding WETH9 and WETH10 to Genesis ==="
|
||||
|
||||
GENESIS_FILE="config/genesis.json"
|
||||
|
||||
if [ ! -f "$GENESIS_FILE" ]; then
|
||||
log_error "❌ Genesis file not found: $GENESIS_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# WETH9 and WETH10 addresses
|
||||
WETH9_ADDR="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
||||
WETH10_ADDR="0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9f"
|
||||
|
||||
# Check if already present
|
||||
if grep -q "$WETH9_ADDR" "$GENESIS_FILE" 2>/dev/null; then
|
||||
log_success "✅ WETH9 already in genesis"
|
||||
else
|
||||
log_warn "⚠️ WETH9 not in genesis - needs to be added"
|
||||
echo " Use: scripts/genesis/add-predeployed-weth-mainnet.sh"
|
||||
fi
|
||||
|
||||
if grep -q "$WETH10_ADDR" "$GENESIS_FILE" 2>/dev/null; then
|
||||
log_success "✅ WETH10 already in genesis"
|
||||
else
|
||||
log_warn "⚠️ WETH10 not in genesis - needs to be added"
|
||||
echo " Use: scripts/genesis/add-predeployed-weth-mainnet.sh"
|
||||
fi
|
||||
|
||||
echo "Note: WETH contracts should be predeployed via alloc in genesis.json"
|
||||
echo " This ensures they exist at canonical addresses from block 0"
|
||||
Reference in New Issue
Block a user