Structure
Fields
selector - 4-byte function identifier- First 4 bytes of keccak256 hash of function signature
- Required for all function calls
- Immutable once created
- Human-readable like
"transfer(address,uint256)" - Useful for debugging and logging
- Not required for execution (EVM only uses selector)
- Array of structured ABI values
- Preserves type information
- Enables type-safe parameter access
Decoding CallData
- With ABI
- Without ABI
Encoding to CallData
- TypeScript
- Zig
Working with Parameters
Type-Safe Access
Dynamic Parameters
Selector Operations
Matching Selectors
Computing Selectors
Memory Management (Zig)
In Zig,CallDataDecoded owns allocated memory:
Signature Resolution
Known Signatures
4byte.directory API
See Also
- Fundamentals - How calldata works
- Encoding - ABI encoding details
- Abi - ABI encoding and decoding
- Usage Patterns - Common patterns

