Skip to content

@abi.encodeCall

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

On-chain (@abi.encodeCall!): The signature must be a constant; live arguments must be elementary static types, each contributing its 32-byte word (at most 4 per call).

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 signature is a constant, so the selector seeds the first constant run and each argument appends its 32-byte head word — one concat for the whole calldata value. Live arguments must be elementary static types, at most 4 per call; all-constant calls fold at composition.

This is not the ::! chain operator wearing a new name: ::! PERFORMS a constructed read, while this face produces the calldata as a bytes VALUE — for comparing against stored payloads (a timelock's queued call, a multisig's proposed transaction) rather than executing anything.

  • @abi.decodeCall — the inverse: decode calldata into [contract sig [args]]
  • send — send pre-encoded calldata
  • exec — call by signature (auto-encodes)
  • @hash — compute a function selector