Skip to main content

Overview

PaymentIndexRecorderHook indexes payments by payer and receiver and stores the full PaymentInfo struct keyed by paymentInfoHash. Wire it into AUTHORIZE_POST_ACTION_HOOK on a HookCombinator (or directly when authorize is the only hook slot you use) so each new authorization registers itself for on-chain lookups.

When to use

  • You need on-chain payment lookups without a subgraph
  • Other contracts need to read the full PaymentInfo for a hash, or page through every payment by payer / receiver
  • You want a single chain-singleton index that aggregates across every operator routing through HookCombinator
Skip when: you’re using a subgraph for payment queries, since the subgraph can derive indexes from events without the on-chain gas cost.

State

Methods

amount, caller, and data are unused; they exist to satisfy IHook.run.

Querying

Gas

Cost: ~175k gas per authorization (payer index + receiver index + full PaymentInfo SSTORE).

Next Steps

HookCombinator

Combine with other hooks in a single slot.

Hooks Overview

Compare recording strategies.