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
This example begins with count zero and a request to call increment(). No real contract is deployed.
This example begins with count zero and a request to call increment(). No real contract is deployed.Execution follows the code’s input and permission rules. A website button is not the access-control mechanism.The function reads zero, calculates zero plus one, and writes one to persistent storage.The accepted state contains count one. Later reads can inspect it. Events are emitted only if the code implements them.
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.