---
eip: 7698
label: EIP-7698
title: EOF - Creation transaction
status: Stagnant
type: Standards Track
category: Core
created: 2024-04-24
requires: 3540
official: https://eips.ethereum.org/EIPS/eip-7698
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7698.md
canonical: https://eips.huatuo.xyz/eip-7698/
lang: en
tldr: Lets an ordinary contract-creation transaction deploy an EOF contract by sending an EOF initcontainer followed by constructor arguments, giving EOF its first way onto the chain.
tags: [evm, eof, deployment, core]
---

# EIP-7698: EOF - Creation transaction

> Deploy EOF contracts using creation transactions

**TL;DR:** Lets an ordinary contract-creation transaction deploy an EOF contract by sending an EOF initcontainer followed by constructor arguments, giving EOF its first way onto the chain.

## What problem does it solve?

The EVM Object Format (EOF, [EIP-3540](/eip-3540/) and the [EIP-7692](/eip-7692/) bundle) is a new, validated container format for contract code. Inside EOF, contracts create others with `EOFCREATE`, and legacy `CREATE`/`CREATE2` are not allowed to deploy EOF code. That leaves a bootstrap problem: how does the first EOF contract get deployed?

EIP-7698 answers it with the simplest option: a normal creation transaction (empty `to`) can carry EOF code. Because constructor arguments are still just appended to the code, existing deployment tools work unchanged.

## How it works

If a creation transaction's `data` starts with the EOF magic `0xEF00`:

1. The usual intrinsic-gas rules and initcode limits for creation transactions ([EIP-3860](/eip-3860/)) apply to the whole `data`.
2. The client parses the EOF header and adds up the section sizes to find where the **initcontainer** ends. Everything after it is **calldata** for the constructor.
3. The initcontainer and all nested subcontainers are validated. The initcontainer's declared data size must match the actual data, and it must not use `RETURN` or `STOP`.
4. If parsing or validation fails, the transaction is valid but fails: only the intrinsic cost is charged.
5. Otherwise the initcode runs. The new address is computed from the sender's address and nonce, as for a legacy creation transaction.
6. Success means the initcode ends with `RETURNCODE`, which picks a subcontainer to deploy and appends some memory ("aux data") to its data section. The result must fit the 24,576-byte code size limit, and 200 gas per deployed byte is charged.

The [EIP-3541](/eip-3541/) ban on deploying code starting with `0xEF` does not apply here, since this is valid EOF. All other rules (access lists, nonce bumping, value transfer, address collisions) follow legacy creation.

## Sample code

Shape of the transaction `data` (pseudocode):

```python
# data = initcontainer || constructor_args
data = eof_initcontainer + abi_encode(constructor_args)

assert data[:2] == b"\xef\x00"          # EOF_MAGIC triggers the new path
header = parse_eof_header(data)
init_len = header.header_size + sum(header.section_sizes)
initcontainer, calldata = data[:init_len], data[init_len:]

validate_recursively(initcontainer)     # failure => tx fails, intrinsic gas only
```

Deploying from ethers v6 looks exactly like a legacy deployment:

```ts
const tx = await wallet.sendTransaction({ data: eofInitcontainer + encodedArgs.slice(2) });
const receipt = await tx.wait();
console.log(receipt!.contractAddress);
```

## Things to know

- Status: **Stagnant**. It belongs to the EOF effort, which has not shipped on Ethereum mainnet.
- An earlier design deployed a "creator contract" via an irregular state change plus a new `InitcodeTransaction` (`TXCREATE`); it was dropped to reduce scope. See [EIP-7620](/eip-7620/) for `EOFCREATE`/`RETURNCODE`.
- Constructor arguments are read with `CALLDATA*`, not appended to the data section, so compilers generate the same initcode whether it runs from a transaction or from `EOFCREATE`.
- Legacy deployments are unaffected: any old creation transaction starting with `0xEF` already failed.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7698
