How Calldata Is Laid Out: Selector, Arguments, and Offsets
After the selector's four bytes, arguments follow in 32-byte words. Static values sit in place, dynamic values point onward with an offset measured without the selector.
Strip the labels off a raw transfer and you are left with a9059cbb plus two 32-byte words. Nothing in those bytes is named "recipient" or "amount". The ABI specification is the rule that sliced the arguments into words, and the types are what tell you which word is the address. The examples below were recomputed on 10 November 2026 with the same Keccak function that matches the specification's own examples.
How those four selector bytes are produced is covered in What the 4-byte selector means. From the fifth byte, you are reading arguments.
Static arguments sit in the word
address, uint256, and bool are static. The value is the word itself. An address is padded on the left with zeros to 32 bytes, a number is padded the same way, and true becomes 1. For transfer(address,uint256) to the example address 0x1111111111111111111111111111111111111111 with an amount of 1000, the calldata looks like this:
| Part | Hex |
|---|---|
Selector transfer(address,uint256) | a9059cbb |
| Address, left-padded | 0000000000000000000000001111111111111111111111111111111111111111 |
Amount 1000 (0x3e8) | 00000000000000000000000000000000000000000000000000000000000003e8 |
0x1111…1111 is a placeholder for reading, not a payment recommendation. The zeros in front of it are padding: 20 bytes of address, 12 bytes of zeros. The specification uses the same word encoding for return values and for non-indexed event data. Those omit the four selector bytes.
Dynamic arguments are a pointer
string, bytes, and arrays do not store their contents in the head. They store an offset, counted in bytes from the start of the arguments, so the four selector bytes are outside the count. Length comes next, then the contents, padded on the right with zeros until the word is full.
For setName(string) with the text Ada:
| Part | Meaning |
|---|---|
c47f0027 | Selector of setName(string) |
0x20 | Offset 32: the data starts after this single head word |
3 | Length in bytes |
416461 | UTF-8 of Ada, padded on the right to 32 bytes |
The selector, then one 32-byte word per line:
c47f0027
0000000000000000000000000000000000000000000000000000000000000020
0000000000000000000000000000000000000000000000000000000000000003
4164610000000000000000000000000000000000000000000000000000000000
Two dynamic arguments produce two offsets. The specification's layout of sam(bytes,bool,uint256[]) is the worked case: the boolean sits in the head, and the two dynamic values point to 0x60 and 0xa0. Start that count at the selector instead of at the arguments and you are four bytes out, so length and text are read from the wrong place.
Without types, a word is ambiguous
One 32-byte word can be a small number, an address, or an offset. In the setName row, 0x20 is the offset 32. The same integer would be a legal amount. The type string is what tells you to follow it.
The ABI Decoder reads the rest according to the ABI or signature you paste. If that field stays empty, it shows the selector and offers a match from its short local list. If the pasted ABI does not fit, it says so instead of falling back to the list. It does not fetch an ABI from the network, and it does not ask for a private key.
Contract creation is not a function call. In that transaction to is empty, and the data is the init code, not a selector plus arguments. The transactions documentation describes this. The Transaction Decoder shows that field; the nonce beside it is explained in What is a nonce?.
An exercise on the placeholder calldata
In the ABI Decoder, paste the signature transfer(address,uint256) and this calldata. It is the three transfer rows above, joined, with 0x only at the start:
0xa9059cbb000000000000000000000000111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000003e8
The address and the amount 1000 should become readable. Then change one digit in the amount and read the new value. Nothing is sent.
Sources:
Specification and recomputation
- Solidity: Contract ABI Specification (head and tail, offsets excluding the selector, the
samexample). Retrieved 10 November 2026. - Ethereum Foundation: Transactions (empty
tofor contract creation). Retrieved 10 November 2026. transferandsetNamebytes: recomputed with ethers (idandAbiCoder) on 10 November 2026. Checked against the specification selectors0xcdcd77c0and0xa5643bf2.
Continue reading