# `EEVM.HardforkConfig`
[🔗](https://github.com/mw2000/eevm/blob/main/lib/eevm/hardfork_config.ex#L1)

Hardfork configuration controlling which EIP rules are active during execution.

The `spec_id` atom identifies the target hardfork, and `enabled?/2` answers
whether a given EIP is active under that spec.

Hardfork timeline (oldest → newest):

| Hardfork         | Notable EIPs |
|------------------|--------------|
| `:frontier`      | baseline     |
| `:homestead`     | —            |
| `:tangerine_whistle` | EIP-150 gas repricing |
| `:spurious_dragon` | EIP-155, EIP-161, EIP-170 (code size limit) |
| `:byzantium`     | REVERT, RETURNDATASIZE, RETURNDATACOPY, STATICCALL |
| `:constantinople` | CREATE2, SHL/SHR/SAR, EXTCODEHASH |
| `:istanbul`      | EIP-1344 (CHAINID), EIP-1884 (SELFBALANCE), EIP-2200 (SSTORE) |
| `:berlin`        | EIP-2929 (cold/warm access), EIP-2930 (access lists) |
| `:london`        | EIP-1559 (basefee), EIP-3529 (refund cap), EIP-3541 (0xEF rejection) |
| `:paris`         | The Merge (PREVRANDAO replaces DIFFICULTY) |
| `:shanghai`      | EIP-3651 (COINBASE pre-warm), EIP-3855 (PUSH0), EIP-3860 (initcode limit) |
| `:cancun`        | EIP-1153 (TLOAD/TSTORE), EIP-4844 (blobs), EIP-5656 (MCOPY), EIP-6780 (SELFDESTRUCT) |
 | `:prague`        | EIP-2537 (BLS12-381 precompiles), EIP-7623 (calldata floor), EIP-7702 (set-code) |
| `:osaka`         | EIP-7825 (tx gas limit cap), EIP-7918 (blob base fee floor), EIP-7934 (block RLP size limit), EIP-7939 (CLZ) |
|                  | EIP-7883 (ModExp repricing), EIP-7951 (P256VERIFY precompile) |

# `spec_id`

```elixir
@type spec_id() ::
  :frontier
  | :homestead
  | :tangerine_whistle
  | :spurious_dragon
  | :byzantium
  | :constantinople
  | :istanbul
  | :berlin
  | :london
  | :paris
  | :shanghai
  | :cancun
  | :prague
  | :osaka
```

# `t`

```elixir
@type t() :: %EEVM.HardforkConfig{spec_id: spec_id()}
```

# `all_spec_ids`

```elixir
@spec all_spec_ids() :: [spec_id()]
```

Returns a list of all known spec IDs in chronological order.

# `default`

```elixir
@spec default() :: t()
```

Returns the default hardfork config — Cancun, the most-tested hardfork.

Callers that don't specify a hardfork explicitly get Cancun semantics,
preserving backwards compatibility with all existing tests.

# `enabled?`

```elixir
@spec enabled?(t(), atom()) :: boolean()
```

Returns `true` if the given EIP feature flag is active in this hardfork config.

## Examples

    iex> config = EEVM.HardforkConfig.new(:cancun)
    iex> EEVM.HardforkConfig.enabled?(config, :eip_6780)
    true

    iex> config = EEVM.HardforkConfig.new(:london)
    iex> EEVM.HardforkConfig.enabled?(config, :eip_6780)
    false

    iex> config = EEVM.HardforkConfig.new(:berlin)
    iex> EEVM.HardforkConfig.enabled?(config, :eip_2929)
    true

# `new`

```elixir
@spec new(spec_id()) :: t()
```

Creates a new hardfork config for the given `spec_id`.

## Example

    iex> EEVM.HardforkConfig.new(:cancun)
    %EEVM.HardforkConfig{spec_id: :cancun}

---

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