# Contracts and ABI

Contracts and ABI functions with exact signatures, examples, and catalog metadata.

Canonical HTML: <https://determica.com/docs/category/contracts-and-abi>

Encode and decode ABI values, inspect contracts, and call contract functions.

- [abi_encode_packed](/docs/functions/abi_encode_packed.md) — Encodes scalar values with Solidity's packed ABI rules. The result has no selector, offsets, lengths, or 32-byte padding.
- [call_decode](/docs/functions/call_decode.md) — Decodes selector-free function return data into typed SQL columns defined by the function's ABI outputs.
- [decode_function_data](/docs/functions/decode_function_data.md) — Validates and decodes selector-prefixed function calldata into typed SQL columns defined by the function's ABI inputs.
- [encode_function_args](/docs/functions/encode_function_args.md) — Encodes function arguments with standard ABI encoding and omits the 4-byte function selector.
- [encode_function_data](/docs/functions/encode_function_data.md) — Encodes function arguments as contract calldata: the function's 4-byte selector followed by standard ABI argument bytes.
- [error_decode_json](/docs/functions/error_decode_json.md) — Returns a status-rich JSON description of EVM revert bytes; supply an ABI to decode matching custom errors.
- [error_selector](/docs/functions/error_selector.md) — Returns a custom error's 4-byte selector by hashing already-canonical signature text exactly; use it to identify revert payloads.
- [error_selector_json](/docs/functions/error_selector_json.md) — Returns the 4-byte selector for a custom error described by JSON ABI; use it to identify revert payloads.
- [event_decode](/docs/functions/event_decode.md) — Returns one EVM log as ABI-derived typed columns; use it when a constant event ABI can define the SQL schema at bind time.
- [event_decode_json](/docs/functions/event_decode_json.md) — Returns decoded EVM event arguments as compact JSON; use it for already-materialized topics and data when malformed input should produce NULL.
- [event_signature](/docs/functions/event_signature.md) — Returns EVM topic0 by hashing already-canonical event signature text exactly; use it to filter non-anonymous logs.
- [event_signature_json](/docs/functions/event_signature_json.md) — Returns EVM topic0 for an event described by JSON ABI; use it to filter or validate non-anonymous logs.
- [evm_abi_word](/docs/functions/evm_abi_word.md) — Encodes an ADDRESS, BYTES32, BOOLEAN, or integer as one 32-byte Solidity ABI word. ADDRESS and unsigned integer values are left-padded with zeros. Signed integers are sign-extended in two's-complement form; BOOLEAN uses 0 or 1. BYTES32 values are copied unchanged.
- [evm_decode_log_for](/docs/functions/evm_decode_log_for.md) — Returns a log diagnostic using the ABI registered locally for a chain, emitter, and block; use it when ABI selection depends on contract context.
- [evm_decode_revert_for](/docs/functions/evm_decode_revert_for.md) — Returns a revert diagnostic using the ABI registered locally for a chain, contract, and block; use it when ABI selection depends on contract context.
- [evm_register_contract_abi](/docs/functions/evm_register_contract_abi.md) — Stores contract ABI metadata in the current database for block-aware log and revert decoding.
- [function_selector](/docs/functions/function_selector.md) — Returns the 4-byte Keccak-256 selector for an already-canonical function signature. The input bytes are hashed exactly and are not normalized.
- [function_selector_json](/docs/functions/function_selector_json.md) — Builds the canonical signature for a JSON ABI function fragment and returns its 4-byte Keccak-256 selector.
- [log_decode_json](/docs/functions/log_decode_json.md) — Returns a status-rich JSON description of one EVM log; use it when unknown, ambiguous, and malformed logs must remain distinguishable.
- [parse_abi_event](/docs/functions/parse_abi_event.md) — Returns a JSON ABI event fragment parsed from Solidity event syntax; use it with log filters and decoders.
