CREATE2 Address Predictor

Calculate deterministic contract addresses using CREATE2 opcode before deployment

The address that will call CREATE2 to deploy the contract
Enter a number (e.g., 0, 1, 123) or full 32-byte hex value
Full contract creation bytecode (constructor code + runtime code)

1. What is CREATE2?

CREATE2 is an Ethereum opcode that allows you to deploy smart contracts to deterministic addresses. Unlike CREATE (which generates addresses based on sender and nonce), CREATE2 generates addresses based on the deployer address, a salt, and the contract bytecode. This enables you to know the contract address before deployment.

2. How does it work?

The CREATE2 address is calculated using the formula:

1address = keccak256(0xff ++ deployer ++ salt ++ keccak256(initCode))[12:]
  • 0xff - Constant prefix to distinguish from CREATE
  • deployer - Address of the factory contract deploying the new contract
  • salt - 32-byte value chosen by deployer for determinism
  • keccak256(initCode) - Hash of the contract creation bytecode

Use Cases

  • Counterfactual deployment - interact with contracts before they exist
  • Cross-chain same-address deployment for multi-chain protocols
  • Vanity addresses - create memorable contract addresses
  • State channels and payment channels that may never be deployed on-chain
  • Upgradeability patterns with deterministic proxy addresses

Vanity Mode

Vanity mode searches for salt values that produce contract addresses with your desired prefix. Note that longer prefixes require exponentially more computation time. For browser-based searching, prefixes of 3-4 characters are recommended.

3. Examples

Minimal Empty Contract

Deployer: 0x1F98431c8aD98523631AE4a59f267346ea31F984
Salt: 0
Init Code Hash: 0xe54142092c5e695c54fbd03feb5e115168fefc02ec03216244eec3498c0debfe
→ Calculates deterministic address for deployment

Using Full Bytecode

Provide full contract bytecode instead of hash:
Init Code: 0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea2646970667358221220...
Tool will automatically hash it to calculate address

Vanity Address Search

Use Vanity Mode to find a salt that generates address starting with desired prefix:
Prefix: "cafe" → Searches through salts to find 0xcafe...
Warning: Longer prefixes take exponentially longer to find

References