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
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.
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.