contract address calculator

predict deploy addresses from deployer + nonce, or salt + initcode.

factory / deployerdefault: the deterministic deployment proxy foundry uses
try
salta number or bytes32
init code
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))

about this tool

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.

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.