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

The outcome of a transaction that passed validation, returned by
`EEVM.transact/4`. A transaction that fails validation returns
`{:error, reason}` instead, and the database is unchanged.

| Field | Description |
|-------|-------------|
| `status` | `:success`, `:revert`, or `{:halt, reason}` (see `t:EEVM.CallResult.status/0`) |
| `gas_used` | Gas the sender pays for, after the refund |
| `gas_refunded` | Gas left unused by execution |
| `sender` | The recovered sender address |
| `contract_address` | The deployed contract's address, for a successful creation |
| `return_data` | The top-level RETURN data, or the REVERT data when `status` is `:revert` (see `EEVM.revert_reason/1`); empty after a halt |
| `logs` | Logs emitted, in order; empty unless `status` is `:success` |
| `receipt` | The `EEVM.Block.Receipt`, with `cumulative_gas_used` equal to `gas_used` |
| `db` | The `EEVM.Database` after the transaction, fees and refunds included; committed when the backend implements `c:EEVM.Database.commit/2` |
| `changes` | The `EEVM.StateChanges` the transaction wrote |
| `trace` | The `EEVM.Tracer` when run with `tracer:`, else `nil` |

`post_state_db` and `logs_bloom` are deprecated copies of `db` and
`receipt.logs_bloom`, kept for one minor version.

# `log_entry`

```elixir
@type log_entry() :: EEVM.Block.Bloom.log_entry()
```

# `status`

```elixir
@type status() :: EEVM.CallResult.status()
```

# `t`

```elixir
@type t() :: %EEVM.TransactionResult{
  changes: EEVM.StateChanges.t() | nil,
  contract_address: non_neg_integer() | nil,
  db: EEVM.Database.t(),
  gas_refunded: non_neg_integer(),
  gas_used: non_neg_integer(),
  logs: [log_entry()],
  logs_bloom: EEVM.Block.Bloom.t(),
  post_state_db: EEVM.Database.t(),
  receipt: EEVM.Block.Receipt.t(),
  return_data: binary(),
  sender: non_neg_integer(),
  status: status(),
  trace: EEVM.Tracer.t() | nil
}
```

---

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