bytes4keccak256onERC721Receivedaddressaddressuint256bytes
Bytes4 keccak256, in the context of Ethereum, refers to the 4-byte function selector used to identify which contract function to execute. The selector is a value of type bytes4 derived from the first four bytes of the keccak-256 hash of the function signature. The function signature is the function name followed by a parenthesized, comma-separated list of parameter types, for example "transfer(address,uint256)".
In an Ethereum call, the calldata begins with this 4-byte selector, followed by encoded arguments. The selector
To compute a selector, one takes keccak256("functionSignature") and uses the first 4 bytes of the resulting 32-byte
Applications of the bytes4 selector include low-level calls, contract dispatch, and ABI-based function invocation. It is