#!/usr/bin/env bash # ============================================================================= # verify-everything.sh — reproduce every live BlazePhoenix claim in ~60s. # # Do not trust the site; run this. Needs: curl, jq. Optional: foundry's # `cast` — when present, on-chain reads are ALSO reproduced directly against # a public RPC, bypassing blazephoenix.xyz entirely. # # curl -sO https://blazephoenix.xyz/repro/verify-everything.sh && bash verify-everything.sh # ============================================================================= set -u BASE="${BLAZEPHOENIX_ORIGIN:-https://blazephoenix.xyz}" RPC="${BASE_RPC:-https://mainnet.base.org}" pass=0; fail=0 ok() { echo " ✓ $1"; pass=$((pass+1)); } bad() { echo " ✗ $1"; fail=$((fail+1)); } command -v curl >/dev/null || { echo "curl required"; exit 1; } command -v jq >/dev/null || { echo "jq required"; exit 1; } echo "— Live-verifiable facts (re-executed on-chain via $BASE/api/verify) —" ids=$(curl -sf "$BASE/api/verify" | jq -r '.verifiable[].id') for id in $ids; do r=$(curl -sf "$BASE/api/verify?fact=$id") if [ "$(echo "$r" | jq -r '.ok')" = "true" ]; then ok "$id → $(echo "$r" | jq -r '.verified.decoded // .verified.raw' | cut -c1-48) @ block $(echo "$r" | jq -r '.verified.block')" else bad "$id ($(echo "$r" | jq -r '.code // "unknown"')) — retry: it may be a transient RPC miss" fi done echo "— Solvency (the invariant, not a dashboard) —" b=$(curl -sf "$BASE/api/badge" | jq -r '.message') case "$b" in *true*) ok "badge: $b";; *) bad "badge: $b";; esac if command -v cast >/dev/null; then s=$(cast call 0x3f60C7aa0c36a78D200405feBE143d2Cf3fA0c77 "isSolvent()(bool)" --rpc-url "$RPC" 2>/dev/null) [ "$s" = "true" ] && ok "cast isSolvent() = true (independent of the site)" || bad "cast isSolvent() = $s" else echo " · install foundry (cast) to reproduce isSolvent() without trusting this site" fi echo "— A real quote, computed on-chain —" q=$(curl -sf "$BASE/api/quote?chain=base&in=ETH&out=USDC&amountIn=100000000000000000") if [ "$(echo "$q" | jq -r '.ok')" = "true" ]; then ok "0.1 ETH → $(echo "$q" | jq -r '.amountOut') USDC base-units · verdict $(echo "$q" | jq -r '.checks.verdict') · floor enforced on-chain" else bad "quote failed: $(echo "$q" | jq -r '.error // "unknown"')" fi echo "— Authorship priority (Bitcoin-anchored) —" n=$(curl -sf "$BASE/provenance/provenance.json" | jq -r '.proofs | length') [ "${n:-0}" -gt 0 ] && ok "$n OpenTimestamps proofs published — verify any with: ots verify " || bad "no provenance proofs found" echo "" echo "passed $pass · failed $fail — every claim above has a reproduction path;" echo "the full proof-carrying list is at $BASE/facts.json" [ "$fail" -eq 0 ]