# `EEVM.Precompiles.Identity`
[🔗](https://github.com/mw2000/eevm/blob/v0.1.0/lib/eevm/precompiles/identity.ex#L1)

Identity precompile — address `0x04`. Returns its input bytes unchanged.

### Gas schedule (Yellow Paper §E.2)

| Component | Cost |
|-----------|------|
| Base      | 15   |
| Per word  | 3 (one word = 32 bytes, rounded up) |

An empty input costs the 15-gas base with no word component.

# `execute`

```elixir
@spec execute(binary(), non_neg_integer()) ::
  {:ok, binary(), non_neg_integer()} | {:error, :out_of_gas}
```

Executes the identity precompile.

Returns the input bytes unchanged after verifying that the caller supplied
enough gas. Word count is `ceil(byte_size(input) / 32)`.

## Examples

    iex> EEVM.Precompiles.Identity.execute(<<>>, 1_000)
    {:ok, <<>>, 15}

    iex> EEVM.Precompiles.Identity.execute(<<"hello">>, 1_000)
    {:ok, <<"hello">>, 18}

    iex> EEVM.Precompiles.Identity.execute(<<1::256>>, 5)
    {:error, :out_of_gas}

---

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