Files
proxmox/scripts/archive/test/test-oracle-contract.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

50 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Test Oracle contract functionality
# Usage: ./test-oracle-contract.sh
RPC_URL="${RPC_URL:-http://${RPC_ALLTRA_1:-192.168.11.250}:8545}"
ORACLE_PROXY="0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6"
echo "Testing Oracle Proxy Contract"
echo "Address: $ORACLE_PROXY"
echo "RPC: $RPC_URL"
echo ""
echo "1. Checking contract bytecode..."
BYTECODE=$(cast code "$ORACLE_PROXY" --rpc-url "$RPC_URL" 2>/dev/null || echo "")
if [ -z "$BYTECODE" ] || [ "$BYTECODE" = "0x" ]; then
echo "❌ Contract has no bytecode"
exit 1
else
echo "✅ Contract has bytecode"
fi
echo ""
echo "2. Testing latestRoundData() function..."
RESULT=$(cast call "$ORACLE_PROXY" \
"latestRoundData()(uint80,int256,uint256,uint256,uint80)" \
--rpc-url "$RPC_URL" 2>/dev/null || echo "ERROR")
if [ "$RESULT" != "ERROR" ] && [ -n "$RESULT" ]; then
echo "✅ Function call successful"
echo " Result: $RESULT"
else
echo "⚠️ Function call failed or returned error"
fi
echo ""
echo "3. Checking recent events..."
BLOCK=$(cast block-number --rpc-url "$RPC_URL" 2>/dev/null || echo "0")
echo "Current block: $BLOCK"
echo ""
echo "Test complete"