# `Cartouche.Receipt.Log`
[🔗](https://github.com/zenhive/cartouche/blob/main/lib/cartouche/receipt.ex#L13)

An event log entry emitted during the transaction referenced by a
`Cartouche.Receipt` — address, data, indexed topics, and the block/tx
position needed to locate the log on chain.

# `t`

```elixir
@type t() :: %Cartouche.Receipt.Log{
  address: &lt;&lt;_::160&gt;&gt;,
  block_hash: &lt;&lt;_::256&gt;&gt;,
  block_number: integer(),
  data: binary(),
  log_index: integer(),
  topics: [&lt;&lt;_::256&gt;&gt;],
  transaction_hash: &lt;&lt;_::256&gt;&gt;,
  transaction_index: integer()
}
```

# `deserialize`

```elixir
@spec deserialize(map()) :: t() | no_return()
```

Deserializes a transaction receipt as serialized by an Ethereum JSON-RPC response.

See also https://ethereum.org/en/developers/docs/apis/json-rpc#eth_gettransactionreceipt

## Examples

    iex> use Cartouche.Hex
    iex> %{
    ...>   "logIndex" => "0x1",
    ...>   "blockNumber" => "0x1b4",
    ...>   "blockHash" => "0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3",
    ...>   "transactionHash" =>  "0xaadf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
    ...>   "transactionIndex" => "0x0",
    ...>   "address" => "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
    ...>   "data" => "0x0000000000000000000000000000000000000000000000000000000000000000",
    ...>   "topics" => [
    ...>     "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
    ...>   ]
    ...> }
    ...> |> Cartouche.Receipt.Log.deserialize()
    %Cartouche.Receipt.Log{
      log_index: 1,
      block_number: 0x01b4,
      block_hash: ~h[0xa957d47df264a31badc3ae823e10ac1d444b098d9b73d204c40426e57f47e8c3],
      transaction_hash: ~h[0xaadf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf],
      transaction_index: 0,
      address: ~h[0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d],
      data: ~h[0x0000000000000000000000000000000000000000000000000000000000000000],
      topics: [
        ~h[0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5]
      ]
    }

---

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