Skip to main content
Selector (SelectorType) is a branded 4-byte Uint8Array (length === 4) representing the first 4 bytes of keccak256(canonicalSignature) used to dispatch EVM contract calls and identify custom revert errors.

Quick Start

Import Selector from @tevm/voltaire.

Layout & Constant

API Reference

Edge Cases

  • fromSignature hashes the string verbatim: use canonical Solidity types without spaces or names (uint256, not uint; transfer(address,uint256), not transfer(address to, uint256 amount)).
  • from and fromHex throw InvalidLengthError when byte length is not 4.
  • ABI — Full calldata encoding, decoding, and hasSelectorCollisions
  • ABI Fundamentals — Canonical signature rules
  • Bytes — General fixed-width byte types (Bytes4)