ERC-7955 Permissionless CREATE2 factory
Draft · Other · created 2025-05-15
This standard defines a procedure that uses EIP-7702 delegation transactions to let anyone deploy a CREATE2 factory contract at the same address on every EVM chain, without a secret key or a preinstall.
Why it is needed
There have long been attempts to have a CREATE2 factory contract with the same address and code across multiple chains, but all three existing approaches had limitations. Nick's method relies on the fact that no one holds the signer's private key, but it cannot be used on chains that enforce EIP-155 replay protection, and because the gas values are fixed at signing time, a change in gas parameters renders the deployment transaction itself invalid. Signing with a secret private key kept in secure storage avoids the gas issue, but it is a permissioned structure in which whoever holds the key decides which chains to deploy to, and if the key is leaked or lost, deployment to new chains is no longer possible. Preinstalling the factory directly on a chain is likewise not standardized, and since each chain can choose whether to include it, it cannot be relied upon. A fourth method was therefore needed, one that guarantees the same outcome for anyone, on any chain, without permission.
What to implement
function deploy() external {: Check whether the CREATE2 factory is already deployed and whether the deployer account is correctly delegated to this bootstrap contract, then call the deployer's bootstrap() function.function bootstrap() external {: In the deployer account's context, actually deploy the CREATE2 factory contract using CREATE2_FACTORY_INIT_CODE and CREATE2_FACTORY_SALT, and verify that the deployed address matches the expected CREATE2_FACTORY_ADDRESS.fallback() external {: Minimal-version bootstrap code that attempts to deploy the factory contract directly via CREATE2 without any pre-validation.
In depth
The bootstrap problem and the limitations of existing methods
The original explains the problem of placing a CREATE2 factory with the same address and same code on multiple chains using three existing approaches. Nick's method creates arbitrary signatures for transactions without EIP-155 replay protection, letting an account with no private key deploy the factory, but it cannot be used on EIP-155-only chains, and because the gas value is fixed in the signature, it can no longer deploy once the gas environment changes. The secret private key approach (Safe Singleton Factory, CreateX, etc.) allows signing with an appropriate gas value on demand, but it is a permissioned structure where whoever holds the key decides whether and on which chain to deploy, and trust breaks down if the key leaks or is lost. The pre-install approach (OP Stack, ZKsync, etc.) has the chain itself embed the factory in advance, but it is not standardized, chains can freely choose whether to include it, and RIP-7740, which tried to standardize this, also did not succeed.
EIP-7702 type 0x4 transaction mechanism
This standard consists of three components: the Deployer, the bootstrap contract, and the bootstrapping code. The deployment procedure consists of three steps: first deploy the bootstrap contract to the chain, then sign an EIP-7702 delegation (authorization) to this bootstrap contract using DEPLOYER_PRIVATE_KEY, and finally execute an EIP-7702 type 0x4 transaction containing that delegation to call DEPLOYER_ADDRESS, causing the bootstrap code to create a CREATE2 factory using CREATE2_FACTORY_INIT_CODE and CREATE2_FACTORY_SALT. Once the bootstrap code executes without reverting, the factory is deployed at CREATE2_FACTORY_ADDRESS with the code CREATE2_FACTORY_RUNTIME_CODE.
Fixed parameters and derived addresses
DEPLOYER_PRIVATE_KEY is the private key derived from the mnemonic "make code code code code code code code code code code coconut" at derivation path m/44'/60'/0'/0/0, from which DEPLOYER_ADDRESS is determined. CREATE2_FACTORY_INIT_CODE and CREATE2_FACTORY_SALT are fixed values, and CREATE2_FACTORY_SALT was chosen as the first value found by sequential search starting from 0 such that the ERC-55 checksummed address begins with the case-sensitive prefix "0xC0DE...". This approach lets anyone verify that the authors could not have pre-found and exploited a hash collision for a specific address. As a result, CREATE2_FACTORY_ADDRESS and CREATE2_FACTORY_CODE_HASH are also both deterministically fixed.
Behavior of the CREATE2 factory bytecode
The factory takes a 32-byte salt followed by init_code as call data and executes CREATE2 with that salt and init_code. The resulting contract address is returned padded to 32 bytes, matching the 32-byte word convention used by precompiles such as ecrecover, unlike some existing implementations that return the raw 20 bytes. If init_code execution fails, the revert data is passed through to the caller unchanged. Both the initialization code and the runtime code use RETURNDATASIZE instead of the dedicated PUSH0 opcode to push zero onto the stack, for compatibility with chains that support EIP-7702 but not EIP-3855 (PUSH0).
Front-running risk and mitigation
Because DEPLOYER_PRIVATE_KEY is public, anyone can sign an arbitrary delegation or transaction to front-run a legitimate CREATE2 factory deployment. Doing so increments the nonce of DEPLOYER_ADDRESS, which can invalidate the EIP-7702 delegation of the legitimate deployment transaction and cause it to fail. However, this only costs the attacker gas and delays the deployment, it does not permanently block future deployment. A sustained attack can be avoided by using a private transaction queue or working directly with a block builder to evade front-running.
Compatibility differences from existing factories
This proposal differs from some existing CREATE2 factory implementations in that it returns the return value padded to 32 bytes and passes through the revert data unchanged when init_code execution fails, whereas some existing implementations return the raw 20 bytes or revert with empty data on failure. It also only works on chains where EIP-7702 is active, and the tooling ecosystem must additionally adopt the new factory address.
Future network upgrade risk and proposal status
If a new opcode or transaction type that permanently fixes account code is introduced in the future, anyone holding the public DEPLOYER_PRIVATE_KEY could, accidentally or maliciously, permanently fix the code of DEPLOYER_ADDRESS to something other than the bootstrap code, permanently blocking future factory deployment. However, once deployment has already occurred on Ethereum mainnet, that key no longer has value, and a method is also proposed to guarantee the code at that address via an RIP. This proposal is currently in Draft status, has not yet been finalized, and its details may change or be discontinued.
Things to watch out for
- Deployment delay from front-running: Anyone can use the public deployer private key to front-run the delegation and cause the legitimate deployment transaction to fail, but this costs the attacker gas and does not permanently block deployment.
- Avoidance measures against sustained attacks: If front-running attacks persist, a private transaction queue can be used, or the deployer can work directly with a block builder to prevent the bootstrap transaction from being front-run.
- Risk if a feature to permanently fix account code appears: If a new opcode or transaction type that permanently sets account code is introduced, the public private key could be used to permanently change the deployer account's code to something other than the bootstrap code, blocking future deployment.