BYTES4

4-byte fixed bytes value, typically a function selector, error selector, or prefix. VARCHAR casts parse 0x-prefixed hex exactly; use BYTES when variable-length calldata or return data is required.

Family
Fixed bytes
Physical
BLOB
Used by
8 functions
Examples
0 samples

Used by functions

Derived from generated function parameters and return types.

Accepted as input

  • hex

    Formats a BLOB-backed EVM byte value as uppercase hexadecimal text without a 0x prefix. hex and to_hex are compatibility aliases with identical behavior.

    scalar function Offline 1 overload
  • length

    Returns the number of bytes in a BLOB or BLOB-backed EVM value such as ADDRESS, BYTES32, UINT256, or INT256.

    scalar function Offline 1 overload
  • to_hex

    Formats a BLOB-backed EVM byte value as uppercase hexadecimal text without a 0x prefix. hex and to_hex are compatibility aliases with identical behavior.

    scalar function Offline 1 overload

Returned as output

  • decode_function_data

    Validates and decodes selector-prefixed function calldata into typed SQL columns defined by the function's ABI inputs.

    table function Offline 1 overload
  • error_selector

    Returns a custom error's 4-byte selector by hashing already-canonical signature text exactly; use it to identify revert payloads.

    scalar function Offline 1 overload
  • error_selector_json

    Returns the 4-byte selector for a custom error described by JSON ABI; use it to identify revert payloads.

    scalar function Offline 1 overload
  • function_selector

    Returns the 4-byte Keccak-256 selector for an already-canonical function signature. The input bytes are hashed exactly and are not normalized.

    scalar function Offline 1 overload
  • function_selector_json

    Builds the canonical signature for a JSON ABI function fragment and returns its 4-byte Keccak-256 selector.

    scalar function Offline 1 overload