Skip to content
ihategas.xyz

Function Selector

Reads public data

Look up or generate 4-byte function and event selectors.

transfer(address,uint256) — or paste 0xa9059cbb
Function selectorfirst 4 bytes — calldata
0xa9059cbb
Event topicfull 32 bytes — log topic0
0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b

Similar known signatures

  • 0xa9059cbbtransfer(address,uint256)

About function selector

A function selector is the first four bytes of a call's calldata: keccak256 of the signature, truncated. Events use the full thirty-two byte hash as topic0 instead. The mapping only runs one way — computing a selector from a signature is arithmetic, and going back is a dictionary lookup, because four bytes cannot uniquely identify anything. That is not a footnote: a name can be chosen so that it collides with a familiar one, and calldata carrying such a selector is indistinguishable from the real thing until you have the contract's own ABI. So every candidate is listed rather than one being picked, with the ones crafted to collide marked as such. A few hundred common signatures are matched offline; anything else is looked up in Openchain's public database, which receives the four bytes and nothing else.

More developer tools