---
eip: 7997
label: EIP-7997
title: Deterministic Factory Contract
status: Last Call
type: Standards Track
category: Core
created: 2025-08-03
requires: 1014
official: https://eips.ethereum.org/EIPS/eip-7997
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7997.md
canonical: https://eips.huatuo.xyz/eip-7997/
lang: en
tldr: Makes the widely used keyless CREATE2 factory at 0x4e59b448...4956C a formal requirement on EVM chains, so contracts and smart accounts can be deployed at the same address on every chain.
tags: [create2, factory, deterministic-deployment, multichain, core]
---

# EIP-7997: Deterministic Factory Contract

> A minimal `CREATE2` factory shared by EVM chains.

**TL;DR:** Makes the widely used keyless CREATE2 factory at 0x4e59b448...4956C a formal requirement on EVM chains, so contracts and smart accounts can be deployed at the same address on every chain.

## What problem does it solve?

Developers want a contract (and users want their smart account) to live at the **same address on every chain**. `CREATE2` ([EIP-1014](/eip-1014/)) makes addresses deterministic, but the result depends on the deployer's address, so you first need a factory that already sits at the same address everywhere.

The usual trick is a keyless "Nick's method" transaction that anyone can replay on a new chain. It has a fixed gas price and gas limit, so it fails on chains whose gas rules differ, and the spec notes this has started to affect Ethereum's own devnets as the gas schedule changes. Without a guaranteed factory, smart accounts end up at different addresses on different chains, which confuses users and has caused loss of funds.

## How it works

- `FACTORY_ADDRESS = 0x4e59b44847b379578588920cA78FbF26c0B4956C`.
- A chain's state MUST contain this account with a nonzero nonce and the exact runtime bytecode given in the spec.
- A chain can satisfy this by deploying it with an ordinary transaction (such as the existing keyless one) where gas rules allow, or by including it in genesis with nonce `1`. Clients must not check for it at the fork boundary.

Factory behavior:

- Calldata = `salt (32 bytes) ++ initcode`. `msg.value` is forwarded to `CREATE2`.
- On success it returns the new address as **exactly 20 bytes**, not ABI-padded.
- On failure it reverts with empty data. Calldata shorter than 32 bytes should also revert.

The resulting address is the standard `CREATE2` formula with the factory as deployer:

```text
address = keccak256(0xff ++ FACTORY_ADDRESS ++ salt ++ keccak256(initcode))[12:]
```

## Sample code

Deploying through the factory and predicting the address (ethers v6):

```ts
import { Wallet, JsonRpcProvider, concat, zeroPadValue, getCreate2Address, keccak256 } from "ethers";

const FACTORY = "0x4e59b44847b379578588920cA78FbF26c0B4956C";
const wallet = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL));

const salt = zeroPadValue("0x01", 32);
const initcode = "0x..."; // your creation code + encoded constructor args

const predicted = getCreate2Address(FACTORY, salt, keccak256(initcode));
const tx = await wallet.sendTransaction({ to: FACTORY, data: concat([salt, initcode]) });
await tx.wait();
console.log("deployed at", predicted); // same on every chain with the factory
```

## Things to know

- Status: **Last Call**. The spec says Ethereum Mainnet and most chains already have the factory, so for them it is a no-op.
- The return value is 20 raw bytes; do not `abi.decode` it as an `address`.
- Revert reasons from your initcode are not propagated; use a trace to debug failed deployments.
- Deployments of contracts that read the environment (`ORIGIN`, `NUMBER`, …) can be front-run with attacker-chosen parameters. Use the factory only for fully deterministic initcode.
- An earlier attempt at a standard singleton factory was [ERC-2470](/eip-2470/) (Stagnant).


---

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