In this track: Tokens and digital ownership
intermediate · 6 MIN READ

Tokens, NFTs and allowances

Contracts keep ownership records; standards make them easier to use.

LET’S PICTURE IT

A ticket office has a register of owners. A token contract is a programmable register with agreed ways to read and update it.

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.

ETH and tokens differ

ETH is the network’s native asset. An ERC-20 contract usually records interchangeable token balances. An ERC-721 contract tracks individually identified items, commonly called NFTs. Owning a token does not automatically give legal rights to an image, a company or a real object.

Why standards help

An ERC-20 interface includes functions such as balanceOf, transfer and approve. Wallets can recognize these common shapes. The ABI describes how to encode them. A familiar interface still does not prove that an implementation behaves honestly.

Raw numbers need context

transfer(address,uint256) takes a recipient and an integer in the token’s smallest units. A raw amount of 1000000 means one token if it uses six decimals, but 0.000000000001 tokens if it uses eighteen. Calldata alone does not include that display convention.

Allowances grant power

approve sets a spender’s allowance; transferFrom lets that spender move tokens under the contract’s rules. Inspect the spender and amount carefully. In the ABI lab, switch between transfer and approve to see how a similar pair of inputs can represent different permissions.

TURN UNDERSTANDING INTO PRACTICEOpen the ABI encoder →
QUICK CHECK · NO PRESSURE

Does the integer in ERC-20 transfer always mean Wei?

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.