Glossary
Function Selector
The first four bytes of an EVM transaction's calldata — the keccak-256 hash prefix that tells the contract which function to dispatch to.
When a contract receives a call, the EVM inspects the first four
bytes of calldata. Those bytes are the function selector:
bytes4(keccak256("transfer(address,uint256)")) for ERC-20
transfer, for example. The contract's dispatch table maps each
selector to the function body that handles it.
Selector collisions (two different signatures hashing to the same prefix) are vanishingly rare but possible — and have been exploited before to inject hidden behavior into proxy contracts. Block explorers maintain selector→signature lookups for decoding unknown calldata.