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

Init code versus runtime code

Deployment instructions and installed instructions have different jobs.

LET’S PICTURE IT

A shop’s setup checklist differs from its daily operating manual.

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.

Run setup once

Init code executes during creation and can establish initial state. It can include constructor logic and access to encoded constructor arguments.

Return the installed program

The bytes returned by successful init execution become the runtime code used for later ordinary calls. The init code itself is not necessarily retained as runtime.

Do not decode creation as a normal call

Constructor arguments do not begin behind an ordinary function selector. Recovering them requires the correct creation-code boundary and constructor schema.

Compare the correct artifact

Source verification, address prediction and runtime inspection use related but different byte artifacts. Label which artifact is being hashed or compared at every step.

Follow the execution

Creation input = init program + constructor arguments
Init execution → returned runtime
Later call → runtime executes

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

QUICK CHECK · NO PRESSURE

What bytes become ordinary deployed code after successful creation?

Your progress stays in this browser.
Keep exploring the original referenceethereum.org ↗

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