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

Static context restrictions

Read-only execution rules extend across nested execution.

LET’S PICTURE IT

A no-edit inspection cannot bypass its restrictions by asking another desk to make the edit.

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.

Start with the runtime restriction

A frame entered through STATICCALL executes in static context. Certain effects, including storage writes and logs, are prohibited under that context.

Propagate through nested calls

Calling another address does not automatically remove the restriction. The nested execution must still respect the static rules inherited from its context.

Allow temporary computation

Static execution can use stack and memory to compute results. Read-only restrictions are not a ban on all temporary working-state changes.

Avoid a trust shortcut

A static call can fail, be expensive or return arbitrary bytes. Read-only execution is an effect restriction, not a security review or a truthful-data certificate.

Follow the execution

Static frame:
  stack and memory computation: allowed
  persistent storage write: prohibited
  LOG emission: prohibited
  misleading output: still possible

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

QUICK CHECK · NO PRESSURE

Can static execution use temporary memory?

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.