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

Who can call a smart contract?

Reachability and permission are different questions.

LET’S PICTURE IT

A public service desk can receive a request from anyone while its rules still decide which requests are accepted.

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.

An interface is not the only doorway

People can prepare contract calldata without using the project’s website. Other contracts can call exposed functions as part of execution. Hiding a button therefore does not enforce who can perform the underlying action.

Visibility controls one part of access

Solidity function visibility describes how a function can be called through the language and interface. Public or external visibility does not by itself mean every caller is authorized to make every state change.

Code checks the allowed caller

A function can verify an owner, role or other condition before proceeding. These checks must be part of the actual execution path. A comment saying “admins only” cannot enforce a permission.

Follow the immediate caller

Nested calls can make the current caller a contract rather than the original user. Different call mechanisms have their own context rules. Read permissions and call traces before assuming every msg.sender is a human wallet.

QUICK CHECK · NO PRESSURE

Can hiding an admin button secure an otherwise unrestricted public function?

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.