encode_function_call

Documentation for eth_defi.abi.encode_function_call function.

encode_function_call(func, args=None)

Encode function selector + its arguments as data payload.

Uses web3.Contract.functions prepared function as the ABI source.

See also encode_function_args().

Example:

Parameters
  • func (web3.contract.contract.ContractFunction) – Function which arguments we are going to encode.

  • args (Optional[Sequence]) –

    Argument values to be encoded.

    If not given, take bound args from the function.

Returns

Solidity’s function selector + argument payload.

Return type

hexbytes.main.HexBytes