encodeFunctionCall static method
- String methodName,
- EthereumAddress contractAddress,
- ContractAbi abi,
- 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);
}