In this track: Execution traces and low-level calls
advanced · 4 MIN READ

Deterministic creation with CREATE2

Creator, salt and init-code hash determine a candidate address.

LET’S PICTURE IT

A numbered reservation depends on the office, chosen label and exact application package.

SEE IT FOR YOURSELF
A valid counter call, step by stepStep 1 / 4
A valid counter call, step by stepFunction requestincrement()No argumentsBefore executionstored count0A local teaching example with a defined starting stateIncoming callCheck function dispatchCheck coded conditionsRules passConditions passContinue executionA failed check can revert insteadCalculation0 + 1Result: 1Storage writecount = 1Persists if call succeedsCalculating a local value and storing it are separate stepsPersistent statecount1Later readGetter reports 1No new incrementState, logs and browser display have different roles

This example begins with count zero and a request to call increment(). No real contract is deployed.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Identify all inputs

CREATE2 address derivation uses the deploying address, a thirty-two-byte salt and the hash of the init code, with the specified prefix and truncation.

Hash the correct code

The formula uses init code, not merely the final runtime bytecode. Constructor arguments included in the creation input can therefore affect the derived address.

Separate prediction from permission

An address calculation does not authorize a deployment or establish that it will succeed. Existing account conditions, execution failures and other creation rules still matter.

Verify initialization and state

Deterministic location is not a guarantee of intended ownership or safe behavior. Review the actual creation input, initialization path and resulting code.

Follow the execution

candidate = last20bytes(keccak256(
  0xff || creator20 || salt32 || keccak256(init_code)
))

A local conceptual trace with explicit assumptions; this is not a trace of a live transaction.

QUICK CHECK · NO PRESSURE

Which code hash enters CREATE2 address derivation?

Your progress stays in this browser.
Keep exploring the original referenceEthereum Improvement Proposals ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.