Web3 Dictionary Logo
Web3 Dictionary
Contribute

Categories

AllBlockchainDappsDAOsDeFiNFTsRegulationSecuritySmart ContractsTokenomicsWalletsWeb3 GamingOthers
  1. Web3 Dictionary
  2. Smart Contracts
  3. Function Selector
Smart Contracts

Function Selector

A 4-byte identifier that specifies which function in a smart contract to call.

Last Updated

2026-03-19

Related Concepts

Smart ContractApplication Binary InterfaceSolidityContract Call
Web3-Explorer Logo

Scale Blockchain Infra

AD

Smart contracts, protocol integrations, and scalable architecture for high-performance Web3 products.

See Blockchain Services

What is Function Selector?

A function selector is the first four bytes of a transaction's "call data" that tells the Ethereum Virtual Machine (EVM) which specific function within a smart contract to execute. It acts as a unique ID for every function in a contract.

How does Function Selector work?

  1. A function is defined by its "signature" (e.g., transfer(address,uint256) ).
  2. The EVM takes the Keccak-256 hash of this signature.
  3. The first 4 bytes of this hash become the "selector."
  4. When you call a contract, your wallet automatically prepends this selector to your transaction data.
  5. The EVM reads these 4 bytes and "routes" the transaction to the matching code inside the contract.

Why does Function Selector matter?

Function selectors are the core of how different smart contracts and off-chain tools interact. They enable the "Application Binary Interface" (ABI) to work, allowing a wallet to talk to any contract as long as it knows the function names and types.

Key features of Function Selector

  • Exactly 4 bytes long (8 hexadecimal characters)
  • Derived from the function's name and parameter types
  • First part of any "contract call" transaction data
  • Enables function "routing" within the EVM
  • Allows for "function overloading" (same name, different types)

Examples of Function Selector

The selector for the standard ERC-20 transfer(address,uint256) function is always 0xa9059cbb. Every time you send a token, your transaction starts with these 8 characters so the token contract knows you are trying to move funds.

External References

  • Solidity Docs: Function Selectors
  • RareSkills: Solidity Function Selector