Skip to content

@abi.encodeCall

ABI-encode a function call from its signature and arguments.

On-chain (@abi.encodeCall!): The signature must be constant; live arguments may include arrays and tuples.

Returns: bytes

@abi.encodeCall(signature ...params)
NameTypeDescription
signaturewrite-abiFunction signature (e.g. transfer(address,uint256))
[...params]anyArguments to encode
# Encode a transfer call
set $data @abi.encodeCall("transfer(address,uint256)" 0x44fA8E6f47987339850636F88629646662444217 100e18)

The function signature stays constant. Live values, including arrays and tuples, are canonically ABI-encoded before the function selector is prepended. Integer ABI arguments require exact integral values in the destination type's range.