Definition

What is Function selector?

A function selector is the first four bytes of the keccak-256 hash of a function's signature, used at the start of calldata to tell the contract which function to run.

For example transfer(address,uint256) hashes to 0xa9059cbb. Explorers and debuggers decode selectors using the ABI.

Go deeper

Related terms

Definition by , founder of Monsmith.

See it in practice

Open Monsmith, paste a contract, and watch the audit and profiler explain it.

Open the studio