CREATE2

Storage & deploys

contract address calculator

Predict a contract address before deploying: CREATE from the deployer and nonce, or CREATE2 from the deployer (factory), salt and init code or its hash.

runs in your browser
try
create2 address
0x902994FADF3f27C9302909aC717506E6d5403093
salt (bytes32)
0x0000000000000000000000000000000000000000000000000000000000000000
init code hash
0x7e6b09da979f7ccca08dec3a7fca30d1da2b7b911cee751d9b7ce6876bb0e88f

init code = creation bytecode + abi-encoded constructor args. in foundry: abi.encodePacked(type(C).creationCode, abi.encode(args))

good to know

what is create2?

address = last 20 bytes of keccak256(0xff ++ deployer ++ salt ++ keccak256(initcode)). no nonce, so the address is known up front and is the same on every chain with the same factory and bytecode.

my predicted address is wrong

the init code must include the constructor arguments, abi-encoded and appended. different compiler settings or metadata also change the bytecode, and with it the address.