Ethereum icon

Ethereum

Interact with Ethereum blockchain

Utils → Encode Function Data

AI-generated

Summary

Encode a contract function call into ABI-encoded data

Inputs

  • abi (required) — Contract ABI JSON array
  • functionName (required) — Name of the function to encode
  • args — Array of arguments to pass to the function

Output shape

hex-encoded function call data string

Returns an empty string on validation errors

Examples

Example 1: Encode ERC20 transfer

ABI supplied, functionName='transfer', args=['0xRecipient','100']

Links

Discussion