# `DoubleDown.Contract.Dispatch.Keys`
[🔗](https://github.com/mccraigmccraig/double_down/blob/main/lib/double_down/contract/dispatch/keys.ex#L1)

Centralised NimbleOwnership key helpers for DoubleDown dispatch.

All test-time state is stored in a single `NimbleOwnership` GenServer
keyed by atoms derived from the contract module. This module provides
the canonical key-generation functions so that `Dispatch`, `Double`,
and `Testing` all agree on the key scheme.

## Key scheme

| Key | Function | Purpose |
|-----|----------|---------|
| `ownership_server/0` | Server name | The `NimbleOwnership` GenServer registered name |
| contract module atom | (no function) | Handler meta + inline state for stateful handlers |
| `log_key/1` | Per-contract | Accumulated `{contract, op, args, result}` call log |
| `contracts_key/0` | Global | Set of contracts with active `Double` expects |

# `contracts_key`

```elixir
@spec contracts_key() :: atom()
```

NimbleOwnership key for the set of contracts with active `Double` expects/stubs.

# `log_key`

```elixir
@spec log_key(module()) :: atom()
```

NimbleOwnership key for a contract's dispatch call log.

# `ownership_server`

```elixir
@spec ownership_server() :: atom()
```

The registered name of the NimbleOwnership GenServer.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
