← Protocols
ERC-2470 — Singleton Factory
Standard / EIP·EVM

ERC-2470 — Singleton Factory

01Description

Stagnant ERC defining a permissionless CREATE2 factory deployed via Nick's keyless method to the same address (`0xce0042B868300000d44A59004Da54A005ffdcf9f`) on every EVM chain. Lets any project deploy a deterministic singleton (e.g. ERC-1820 registry) at the same address across chains without trusting a deployer EOA.

02Best for
  • 01deploying cross-chain singletons at identical addresses
  • 02registries (ERC-1820, ERC-1967 beacons) that must exist at one address everywhere
  • 03trust-minimised deployment of infrastructure contracts
  • 04deterministic deployment in deployment scripts (Hardhat / Foundry)
  • 05AA bundlers / EntryPoint deployments on new chains
03Install
  • # Address: 0xce0042B868300000d44A59004Da54A005ffdcf9f (same on all chains)
  • # To bootstrap on a new chain, fund 0xBb6e024b9cFFACB947A71991E386681B1Cd1477D and broadcast the keyless tx
  • pnpm add @safe-global/safe-singleton-factory
05Prompt snippet
Use the ERC-2470 SingletonFactory at `0xce0042B868300000d44A59004Da54A005ffdcf9f` (identical on every EVM chain it has been bootstrapped on) to deploy contracts at deterministic addresses. The interface is a single function: `function deploy(bytes memory _initCode, bytes32 _salt) external returns (address payable createdContract)`. The address is `keccak256(0xff ++ factory ++ salt ++ keccak256(initCode))[12:]` per CREATE2 (EIP-1014). On chains where the factory is not yet deployed, bootstrap it by funding the deployer EOA `0xBb6e024b9cFFACB947A71991E386681B1Cd1477D` with ~0.0247 ETH-equivalent for gas and broadcasting the canonical signed tx from the EIP. For Safe-style ecosystem deploys prefer `safe-singleton-factory` (a wrapper with funded deployers on most chains). In Foundry use `vm.computeCreate2Address(salt, keccak256(bytecode), factory)` to predict addresses before deploying.
06Gotchas
  • Salt collisions: anyone can call `deploy(initCode, salt)` for any salt — pick salts that include a project-namespaced prefix (e.g. `keccak256('myproto.v1')`) and verify the deployed code hash matches what you expected before trusting the address.
  • Not every chain has the factory pre-deployed. On L2s and new chains you must bootstrap first — and bootstrapping requires the deployer EOA's gas balance and an unmodified legacy tx (chains enforcing strict EIP-155 chain-id signing will reject the keyless tx; use `safe-singleton-factory` instead which has per-chain funded deployers).
  • `initCode` must include constructor args, and the resulting address depends on the entire `initCode` hash — changing constructor args (or compiler version producing different bytecode) changes the address. Pin solc + optimizer settings in `foundry.toml` / `hardhat.config` if cross-chain identical addresses matter.
  • ERC-2470 is `Stagnant`; some teams prefer the Arachnid deterministic-deployment-proxy at `0x4e59b44847b379578588920cA78FbF26c0B4956C` or the Safe singleton factory. Pick one and document it — using two factories will produce different addresses for the same bytecode.
  • Deploying to a precomputed address can be front-run on public mempools: an attacker can deploy a malicious contract with the same `(salt, initCode)` ahead of you. Mitigate by using a private RPC / Flashbots, or by salting with a secret committed in advance.
07Alternatives