Ethereum-Solidity Quiz Q31: What is the difference between CREATE and CREATE2 transaction types?
Source: Dev.to
CREATE (Regular Deployment)
// Address = keccak256(deployer, nonce)
new CreateContract(owner);
Example
- Deployer:
0x4f98e7507c578e2341B5b874E9a7C910aA8Db3e1 - Nonce:
234
Result: 0xa729B8363b472E8A3f20eF4E6210Cdd70C0cF5aB
Characteristics
- ✅ Simple, default behavior
- ❌ Address changes if the nonce changes
- ❌ Cannot predict the address before deployment
- ❌ Different address on each chain (different nonces)
Diagram
Deployer (0x4f98...) ──► Deploy Contract
│
│ address = hash(deployer, nonce)
│
▼
Ethereum: 0xAAA... (nonce = 100)
Base: 0xBBB... (nonce = 50) ◄── Different addresses!
Polygon: 0xCCC... (nonce = 75)
CREATE2
// Address = keccak256(0xff, factory, salt, initCodeHash)
// Used automatically by Foundry for libraries
Example
- Factory (Deterministic Deployer):
0x4f98e7507c578e2341B5b874E9a7C910aA8Db3e1 - Salt:
0x0000...0000 - InitCode: “
Result: 0xEdA41181EAB196E739140876C5fF35e2DFde188a
Characteristics
- ✅ Same address on all chains when the same salt and bytecode are used
- ✅ Predictable before deployment
- ✅ Ideal for libraries, factories, and cross‑chain deployments
- ❌ Slightly more complex than
CREATE - ❌ Requires a factory contract
Diagram
Deployer ──► Factory (0x4e59b448...) ──► Deploy Contract
│
│ address = hash(0xff, factory, salt, bytecodeHash)
│
▼
Ethereum: 0xEdA411...
Base: 0xEdA411... ◄── SAME address everywhere!
Polygon: 0xEdA411...