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

Understand transfer and transferFrom

Moving your own tokens and spending with permission use different interfaces.

LET’S PICTURE IT

Handing someone your own ticket differs from collecting tickets on someone else’s behalf under an allowance.

SEE IT FOR YOURSELF
Build a transfer call from typed fieldsStep 1 / 4
Build a transfer call from typed fieldstransfer(address,uint256)Recipient: 0x0000…0001Raw amount: 100Diagram labels abbreviate addresses; the lab shows full bytes4-byte selectora9059cbbEach box is one byte; this prefix is not a 32-byte wordWord 0 · recipient address12 zero bytes20 address bytes000…0001Left padding preserves the lower-order address valueSelector4 bytesa9059cbbAddress32 bytesword 0Amount32 bytesword 1 → 0x644 + 32 + 32 = 68 bytesThe integer does not contain token decimals or market price

The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Transfer selects a recipient

A standard transfer call takes a destination and a raw amount. The implementation updates balances according to its rules. The caller’s identity and the transaction context still matter.

TransferFrom names a source too

transferFrom includes a source, destination and amount. It supports authorized movement on behalf of another account. Allowance is a common authorization mechanism, while actual implementation behavior needs inspection.

Check success as well as shape

ERC-20 callers must handle the interface’s success result and failures appropriately. A familiar function name does not prove that every nonstandard token behaves identically.

Trace the address roles

Compare source, caller, spender and final recipient rather than labeling every address as the sender. The calldata lab teaches how typed arguments identify those roles without executing a transfer.

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

Which standard function includes an explicit source-account argument?

Your progress stays in this browser.
Keep exploring the original referenceEthereum Improvement Proposals ↗

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