Read message input as bytes before interpreting an ABI.
LET’S PICTURE IT
An incoming envelope contains raw bytes; a schema explains which parts are fields.
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.
Load a word from input
CALLDATALOAD reads thirty-two bytes beginning at a supplied calldata offset. Bytes beyond the input are treated according to the opcode’s zero-padding behavior.
Do not skip framing automatically
At offset zero, ordinary function input begins with a four-byte selector. A raw word load does not automatically remove that selector or decode the first argument.
Copy into memory explicitly
CALLDATACOPY copies a selected input range into memory. The destination uses memory byte offsets and may cause memory expansion.
Validate higher-level lengths
Zero-padding at opcode level does not make truncated ABI input semantically valid. A safe ABI decoder still checks that required fields and tails exist.
Trace the idea
ordinary calldata:
bytes 0–3: selector
bytes 4–35: first static argument word
CALLDATALOAD(4) can read that word when the schema and length are valid.
Stack examples list the bottom first and the top last. These small traces omit gas and surrounding dispatch unless stated.
QUICK CHECK · NO PRESSURE
Does CALLDATALOAD automatically decode an ABI argument?
It reads raw bytes; decoding requires schema and framing.