# `EEVM.Interpreter.MachineState.Substate`
[🔗](https://github.com/mw2000/eevm/blob/main/lib/eevm/interpreter/machine_state/substate.ex#L1)

Transaction-scoped accumulators that survive nested call frames.

### Fields

- `touched_addresses` — EIP-161 cleanup set; empty accounts touched during
  the transaction are deleted on commit.
- `accessed_addresses` / `accessed_storage_keys` — EIP-2929 access lists
  powering cold/warm gas pricing.
- `created_addresses` — EIP-6780 set of contracts created in this tx;
  only these can be fully deleted by `SELFDESTRUCT` post-Cancun. An
  address joins the set before its initcode runs, so a `SELFDESTRUCT`
  during init deletes it, and leaves the set if that creation fails.
- `original_storage` — per-tx snapshot of the first-observed value of
  each storage slot, keyed by `{address, key}`, used by EIP-2200 `SSTORE`
  accounting.
- `transient_storage` — EIP-1153 per-tx store keyed by `{address, slot}`,
  passed into every child frame and cleared at tx end.
- `logs` — emitted log entries, parent-then-child on success.

All seven fields revert together when a child frame fails (see
`EEVM.Interpreter.Journal`). Stack, memory, pc, and gas are *not*
substate — they belong to the per-frame execution context.

# `log_entry`

```elixir
@type log_entry() :: %{
  address: non_neg_integer(),
  data: binary(),
  topics: [non_neg_integer()]
}
```

# `t`

```elixir
@type t() :: %EEVM.Interpreter.MachineState.Substate{
  accessed_addresses: MapSet.t(non_neg_integer()),
  accessed_storage_keys: MapSet.t({non_neg_integer(), non_neg_integer()}),
  created_addresses: MapSet.t(non_neg_integer()),
  logs: [log_entry()],
  original_storage: %{
    required({non_neg_integer(), non_neg_integer()}) =&gt; non_neg_integer()
  },
  touched_addresses: MapSet.t(non_neg_integer()),
  transient_storage: %{
    required({non_neg_integer(), non_neg_integer()}) =&gt; non_neg_integer()
  }
}
```

# `new`

```elixir
@spec new(keyword()) :: t()
```

Builds a substate, taking each field from the option of the same name and
defaulting to an empty set, map, or list.

---

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