# `EEVM.Interpreter.MachineState.Frame`
[🔗](https://github.com/mw2000/eevm/blob/v0.1.0/lib/eevm/interpreter/machine_state/frame.ex#L1)

Per-call execution frame.

A frame is everything that gets a fresh value when a CALL/CREATE-like
opcode spawns a child, and that gets restored when the child halts:

- `pc`, `stack`, `memory`, `gas`, `refund` — execution registers
- `code` — the currently-executing bytecode
- `program` — `code` decoded for the interpreter
  (`EEVM.Interpreter.InstructionTable.decode/3`), or `t:undecoded/0` while
  the frame runs `code` undecoded; `nil` until the frame starts
- `return_data` — buffer holding the most recent child frame's output
- `contract` — the per-call message context (`msg.sender`, `msg.value`,
  `address`, `calldata`, `balances`)
- `depth` — the EVM call depth (max 1024)
- `is_static` — STATICCALL flag; state-mutating opcodes revert under it

The active frame lives at `MachineState.frame`. CALL and CREATE run a
child frame in a nested `EEVM.Interpreter.run_loop/1` and copy its result
back into the parent frame.

# `t`

```elixir
@type t() :: %EEVM.Interpreter.MachineState.Frame{
  code: binary(),
  contract: EEVM.Context.Contract.t(),
  depth: non_neg_integer(),
  gas: non_neg_integer(),
  is_static: boolean(),
  memory: EEVM.Interpreter.Memory.t(),
  pc: non_neg_integer(),
  program: EEVM.Interpreter.InstructionTable.program() | undecoded() | nil,
  refund: integer(),
  return_data: binary(),
  stack: EEVM.Interpreter.Stack.t()
}
```

# `undecoded`

```elixir
@type undecoded() :: {:undecoded, decode_at :: integer(), jumpdests :: binary() | nil}
```

A frame running its code undecoded (#210): the gas left at which its next
jump decodes the code, and the code's JUMPDEST map
(`EEVM.Interpreter.InstructionTable.jumpdests/1`) once it has jumped.

---

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