In this track: Meet smart contracts
beginner · 3 MIN READ

What is a permission check?

A rule determines whether the current caller may perform an action.

LET’S PICTURE IT

A club can ask for proof of membership before admitting someone. Merely naming a door “members only” does not enforce that policy.

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.

State the allowed condition

A setting might be changeable only by an owner address or a configured role. The contract needs a code path that tests the relevant condition before allowing the sensitive effect.

The caller context matters

In a normal contract call, msg.sender identifies the immediate caller of that frame. Nested calls can make that caller another contract. A rule designed around the wrong identity can grant or deny access incorrectly.

Every sensitive path needs enforcement

Protecting one visible function is insufficient if another exposed path performs the same sensitive action without the check. Interfaces and comments help readers, but execution logic determines what is possible.

A failing check can revert

An unauthorized request may return custom error data or another revert form. The decoder can read supplied error bytes, but proving that access control is correct requires reviewing the complete implementation and state.

TURN UNDERSTANDING INTO PRACTICEOpen the Revert decoder →
QUICK CHECK · NO PRESSURE

Does naming a function adminUpdate restrict it to an administrator?

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.