In this track: Smart contract security foundations
advanced · 4 MIN READ

Security review practice set

Review authority, invariants and progress under hostile conditions.

LET’S PICTURE IT

A good inspection tests how a system fails as well as how it works on a quiet day.

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 protected properties

Write what must remain true: who controls upgrades, how credits are conserved and which users must remain able to exit. These properties guide the review.

Map trust boundaries

List external calls, callback paths, signed requests, oracle inputs and privileged roles. For each, state what is assumed and what is checked.

Construct counterexamples locally

Try unauthorized callers, stale prices, repeated claims, failing recipients and extreme values. A failing property is more informative than a long list of happy-path calls.

Record limits and unresolved risks

Passing tests and a careful review add evidence, but do not prove universal safety. Keep the assumptions, exact build context and unsupported behaviors visible.

Reason about the scenario

Property → relevant code paths → hostile scenario
→ observed outcome → fix or documented assumption
→ regression check

Pseudocode or a simplified scenario for local reasoning. This is not a production contract or a completed security review.

QUICK CHECK · NO PRESSURE

What is a useful starting point for a review?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

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