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
The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.
The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.Keccak-256 of the canonical signature supplies the first four bytes. The transfer selector is a9059cbb.An address is twenty bytes. Standard ABI encoding adds twelve zero bytes on the left to fill one thirty-two-byte word.The integer one hundred is hex 64, left-padded in word one. Selector plus two words produces sixty-eight bytes of standard calldata.
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.