Files
proxmox/scripts/archive/consolidated/verify/check-contract-bytecode.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

34 lines
942 B
Bash
Executable File

#!/usr/bin/env bash
# Check contract bytecode on-chain
# Usage: ./check-contract-bytecode.sh [address]
set -euo pipefail
RPC_URL="${RPC_URL:-https://rpc-core.d-bis.org}"
ADDRESS="${1:-}"
if [ -z "$ADDRESS" ]; then
echo "Usage: $0 <contract-address>"
echo ""
echo "Example: $0 0x3304b747e565a97ec8ac220b0b6a1f6ffdb837e6"
exit 1
fi
echo "Checking contract bytecode for: $ADDRESS"
echo "RPC: $RPC_URL"
echo ""
BYTECODE=$(cast code "$ADDRESS" --rpc-url "$RPC_URL" 2>/dev/null || echo "")
if [ -z "$BYTECODE" ] || [ "$BYTECODE" = "0x" ]; then
echo "❌ Contract has no bytecode (not deployed or empty)"
exit 1
else
BYTECODE_LENGTH=$((${#BYTECODE} - 2)) # Subtract "0x" prefix
echo "✅ Contract has bytecode"
echo " Length: $BYTECODE_LENGTH characters ($((BYTECODE_LENGTH / 2)) bytes)"
echo " First 100 chars: ${BYTECODE:0:100}..."
echo ""
echo "✅ Contract is deployed and has code"
fi