Try it Live
Run ABI examples in the interactive playground
Conceptual guide - For encoding rules, see ABI Encoding.
Overview
ABI items describe a contract interface as JSON objects. Voltaire treats them as typed plain objects and provides helpers to encode/decode data safely.Function
Functions define callable methods with inputs, outputs, and mutability.name- function nameinputs- parameter listoutputs- return liststateMutability-pure | view | nonpayable | payable
Event
Events define log structures. Indexed parameters become topics.anonymous- if true, no topic0 selector is emittedinputs[].indexed- marks a parameter as a topic
Error
Custom errors encode like functions and surface revert data.Constructor
Constructor items define deployment parameters. They have no selector.Fallback and Receive
Fallback and receive functions are special, selector-less entries.Parameters and Tuples
Parameters describe inputs and outputs. Usecomponents for tuples (structs).
type- canonical ABI type stringname- optional parameter namecomponents- tuple fieldsindexed- events onlyinternalType- optional Solidity internal type
Canonical Type Names
Selectors and signatures require canonical types:uint->uint256int->int256- Use
bytesNfor fixed-size bytes - Use
tuplefor structs, pluscomponents
Type Inference
Useas const to enable strict inference for inputs and outputs.
Working With Items
Use helper functions to access and validate items:Overloads and Ambiguity
getFunction and Abi.encode match by name. If your ABI has overloads, select the exact item by signature:

