Files
proxmox/scripts/test-contract-functions.sh
defiQUG cb47cce074 Complete markdown files cleanup and organization
- Organized 252 files across project
- Root directory: 187 → 2 files (98.9% reduction)
- Moved configuration guides to docs/04-configuration/
- Moved troubleshooting guides to docs/09-troubleshooting/
- Moved quick start guides to docs/01-getting-started/
- Moved reports to reports/ directory
- Archived temporary files
- Generated comprehensive reports and documentation
- Created maintenance scripts and guides

All files organized according to established standards.
2026-01-06 01:46:25 -08:00

63 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Test contract functions comprehensively
# Usage: ./test-contract-functions.sh
RPC_URL="${RPC_URL:-http://192.168.11.250:8545}"
echo "========================================="
echo "Contract Function Testing"
echo "RPC: $RPC_URL"
echo "========================================="
echo ""
# Test Oracle Proxy
echo "1. Testing Oracle Proxy (0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6)..."
ORACLE_RESULT=$(cast call "0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6" \
"latestRoundData()(uint80,int256,uint256,uint256,uint80)" \
--rpc-url "$RPC_URL" 2>&1)
if echo "$ORACLE_RESULT" | grep -qE "^[0-9]+ [0-9-]+ [0-9]+ [0-9]+ [0-9]+$"; then
echo " ✅ latestRoundData() - Functional"
echo " Result: $ORACLE_RESULT"
else
echo " ⚠️ latestRoundData() - May need initialization"
fi
# Test CCIP Router - check if it's a contract
echo ""
echo "2. Testing CCIP Router (0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e)..."
CCIP_BYTECODE=$(cast code "0x8078A09637e47Fa5Ed34F626046Ea2094a5CDE5e" --rpc-url "$RPC_URL" 2>/dev/null)
if [ -n "$CCIP_BYTECODE" ] && [ "$CCIP_BYTECODE" != "0x" ]; then
echo " ✅ Contract has bytecode"
echo " 📦 Bytecode size: ~$(( $(echo -n "$CCIP_BYTECODE" | wc -c) / 2 )) bytes"
else
echo " ❌ No bytecode found"
fi
# Test all contracts bytecode
echo ""
echo "3. Testing all contracts for bytecode..."
declare -A CONTRACTS=(
["Oracle Aggregator"]="0x99b3511a2d315a497c8112c1fdd8d508d4b1e506"
["CCIP Sender"]="0x105F8A15b819948a89153505762444Ee9f324684"
["CCIPWETH9Bridge"]="0x89dd12025bfCD38A168455A44B400e913ED33BE2"
["CCIPWETH10Bridge"]="0xe0E93247376aa097dB308B92e6Ba36bA015535D0"
["Price Feed Keeper"]="0xD3AD6831aacB5386B8A25BB8D8176a6C8a026f04"
)
FUNCTIONAL=0
for name in "${!CONTRACTS[@]}"; do
addr="${CONTRACTS[$name]}"
BYTECODE=$(cast code "$addr" --rpc-url "$RPC_URL" 2>/dev/null)
if [ -n "$BYTECODE" ] && [ "$BYTECODE" != "0x" ]; then
echo "$name - Has bytecode"
FUNCTIONAL=$((FUNCTIONAL + 1))
else
echo "$name - No bytecode"
fi
done
echo ""
echo "========================================="
echo "Summary: $FUNCTIONAL/5 additional contracts functional"
echo "========================================="