Overview
PaymentIndexRecorder records a sequential index for each payment action, enabling multiple refund requests per payment. Each timerecord() is called, the index increments by 1.
When to Use
- You need on-chain payment lookups without a subgraph
- You need to support multiple refund requests per payment (each keyed by nonce)
- Other contracts need to read the payment index on-chain
State
Methods
Integration with RefundRequest
Thenonce parameter in RefundRequest.requestRefund() corresponds to the payment index. This allows one refund request per charge/action:
Gas
Cost: ~20k gas perrecord() call (one SSTORE for the counter increment).
