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

Canonical function signatures

Normalize the name and parameter types before hashing a selector.

LET’S PICTURE IT

A filing system needs one agreed spelling of an action name before deriving its identifier.

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.

Use canonical types

A standard signature combines the function name and parenthesized canonical input types. uint becomes uint256; address payable uses address for this ABI purpose. Parameter names and data-location words are omitted.

Exclude return values

Outputs and mutability are not part of the function selector signature. Two declarations cannot obtain distinct ordinary overload selectors merely by changing a return type.

Remove formatting noise

The canonical signature uses comma-separated types without spaces. Hashing a source declaration with names or whitespace can produce a different fingerprint from the intended signature.

Keep exceptions in context

The ordinary external contract ABI has specific rules; library interfaces and compiler internals can have additional details. Start with a standard external function before generalizing.

Follow the bytes

function send(address to, uint256 amount)
arguments: ["0x0000000000000000000000000000000000000001","7"]

selector: 0xd0679d34
arguments begin at calldata byte 4

word 0 · argument offset 0 bytes
0x0000000000000000000000000000000000000000000000000000000000000001

word 1 · argument offset 32 bytes
0x0000000000000000000000000000000000000000000000000000000000000007

Only send(address,uint256) supplies the standard selector input.

TURN UNDERSTANDING INTO PRACTICEOpen the ABI encoder →
QUICK CHECK · NO PRESSURE

What is the canonical signature for send(address to, uint amount)?

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.