In this track: ABI encoding foundations
advanced · 4 MIN READ

Static ABI decoding challenge set

Use the schema, padding and complete static width together.

LET’S PICTURE IT

Several fixed-width fields become readable once you know which ruler belongs to each one.

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.

Challenge one: a small number

A uint256 word ending in 2a is decimal 42 when all preceding bytes are zero. The encoding is left-padded and occupies a complete word.

Challenge two: a fixed byte label

bytes4 0x12345678 starts its word with those bytes and has trailing zeros. Reading it as a right-aligned integer would assign a different meaning.

Challenge three: a fixed array

uint256[2] containing 1 and 2 has two words and no dynamic length prefix. Its count is part of the schema.

Challenge four: the missing selector

A pair of ordinary return values begins with the first output word. Do not remove four bytes by habit. Identify whether you have calldata, return data, event data or error data first.

Follow the bytes

types: uint256[2]
values: [["1","2"]]
no function selector prefix

word 0 · argument offset 0 bytes
0x0000000000000000000000000000000000000000000000000000000000000001

word 1 · argument offset 32 bytes
0x0000000000000000000000000000000000000000000000000000000000000002

Use the trace to check the static array’s complete width.

TURN UNDERSTANDING INTO PRACTICEOpen the Calldata decoder →
QUICK CHECK · NO PRESSURE

How many data words encode uint256[2] with values 1 and 2?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

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