# `EEVM.CallResult`
[🔗](https://github.com/mw2000/eevm/blob/v0.1.0/lib/eevm/call_result.ex#L1)

The outcome of a message call: `EEVM.run/2`, `EEVM.call/4`, or
`EEVM.create/3`.

| Field | Description |
|-------|-------------|
| `status` | `:success`, `:revert`, or `{:halt, reason}` (see `t:status/0`) |
| `return_data` | Bytes from RETURN or REVERT (see `EEVM.revert_reason/1`); empty after a halt |
| `gas_used` | Gas the code consumed, after the refund. A message call has no transaction, so unlike `EEVM.TransactionResult.gas_used` this excludes the intrinsic gas (21,000 plus calldata) |
| `gas_left` | Gas remaining from the `:gas` limit |
| `logs` | Logs emitted, in order; empty unless `status` is `:success` |
| `db` | The `EEVM.Database` after the call, writes still in its overlay; unchanged unless `status` is `:success` |
| `changes` | `db`'s pending writes as an `EEVM.StateChanges`; message calls never commit them |
| `contract_address` | The new contract's address after a successful `EEVM.create/3`, else `nil` |
| `trace` | The `EEVM.Tracer` when run with `tracer:`, else `nil` |
| `stack` | The final stack, top first, when run with `debug: true`, else `nil` |

# `status`

```elixir
@type status() :: :success | :revert | {:halt, EEVM.Error.halt_reason()}
```

How execution ended: `:success` after STOP or RETURN, `:revert` after
REVERT, or `{:halt, reason}` after an exceptional halt, which consumes all
gas. `reason` is an `t:EEVM.Error.halt_reason/0`, such as `:out_of_gas` or
`:invalid_opcode`.

# `t`

```elixir
@type t() :: %EEVM.CallResult{
  changes: EEVM.StateChanges.t(),
  contract_address: non_neg_integer() | nil,
  db: EEVM.Database.t(),
  gas_left: non_neg_integer(),
  gas_used: non_neg_integer(),
  logs: [EEVM.Block.Bloom.log_entry()],
  return_data: binary(),
  stack: [non_neg_integer()] | nil,
  status: status(),
  trace: EEVM.Tracer.t() | nil
}
```

---

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