# Payment Registry

The Payment Registry accepts fulfillments from Market Makers (MMs), transfers funds to users on the destination chain, and records immutable fulfillment data used later for HDP verification.

## Storage

* `mapping(bytes32 => bytes32) fulfillments`: maps a fulfillment order hash to the MM’s source address (stored as `bytes32`). A non-zero value indicates the order has been fulfilled and by whom.

## HDP Integration

* The `fulfillments` mapping is the on-chain ground truth that orders were paid on the destination chain.
* HDP reads the EVM storage slot for each order’s fulfillment hash to verify non-zero presence and who fulfilled it.
* The mapping slot index is fixed by the contract’s storage layout and is used by the HDP module to derive the storage key for proofs.

## Controls and Safety

* `Pausable` admin switch and `onlyOwner` pause/unpause.
* `ReentrancyGuard` on fulfillment entrypoint.
* Uses `SafeERC20` for token transfers.
* `fulfillments[orderHash] == 0` check prevents double-fulfillment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.most.wtf/developers/developer/payment-registry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
