Solidity REPL
Encoding & crypto

Function selector

Calculate the first four bytes used to identify a function call.

Solidity 0.8.36REPL mode

Why use this example

Use this pattern when you need to check the exact bytes, selector, hash, or decoded values that Solidity will produce. The entry isolates function selector so its input, result, and state changes stay easy to compare.

Solidity to run

bytes4 selector = bytes4(keccak256("transfer(address,uint256)"))
selector
abi.encodeWithSelector(selector, address(0xBEEF), 10)

What to expect

The transfer(address,uint256) signature resolves to selector 0xa9059cbb and the complete encoded call is displayed.

Continue the investigation

Change a value, add another expression, or open Inspect after the run. Accepted entries remain available to the next entry, and the clean replay keeps the complete result reproducible.

Read about values and inspection Prototype Solidity behavior