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

ABI return values without selectors

Ordinary result data begins with the output tuple encoding.

LET’S PICTURE IT

A response form does not need to repeat the short action label that already selected the request.

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.

Know the output schema

A function returning uint256 provides a standard encoded output word. Return data is decoded using known outputs, not by guessing a function name from the first four bytes.

Do not strip a nonexistent selector

Removing four bytes from a normal return value shifts its alignment and loses data. Function calldata, ordinary results, events and errors use related encoding rules with different framing.

Dynamic outputs still use offsets

A string return is an output tuple with dynamic head and tail behavior. The absence of a selector does not eliminate dynamic layout.

Keep call outcome separate

A failed low-level call can return revert bytes rather than successful output data. Check the call’s success context before choosing which schema to decode.

Follow the bytes

types: uint256
values: ["42"]
no function selector prefix

word 0 · argument offset 0 bytes
0x000000000000000000000000000000000000000000000000000000000000002a

This entire word is result data.

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

Should you always remove four bytes before decoding a uint256 return value?

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.