Skip to main content

Try it Live

Run ABI examples in the interactive playground

Overview

Abi.encode encodes function calldata (selector + parameters) using a full ABI. It looks up the function by name, then encodes the arguments according to the function inputs.

Quick Start

Parameters Only

If you need only the parameters (no selector), use Abi.encodeParameters:

Overloads and Ambiguity

Abi.encode matches by function name. If your ABI contains overloads, select the exact function item:

Error Handling

See Also