encodeFunctionCall static method

Uint8List encodeFunctionCall(
  1. String methodName,
  2. EthereumAddress contractAddress,
  3. ContractAbi abi,
  4. List params
)

Encodes the calldata for a function call.

  • methodName: The name of the method in the contract.
  • contractAddress: The address of the contract.
  • abi: The ABI of the contract.
  • params: The parameters for the method.

Returns a Uint8List representing the calldata.

Implementation

static Uint8List encodeFunctionCall(String methodName,
    EthereumAddress contractAddress, ContractAbi abi, List<dynamic> params) {
  final func = getContractFunction(methodName, contractAddress, abi);
  return func.encodeCall(params);
}