getContractEncodedDataBytes method

Uint8List getContractEncodedDataBytes({
  1. required String contractAbi,
  2. required String functionName,
  3. required List args,
  4. BigInt? gasPrice,
  5. BigInt? gasLimit,
})

Implementation

Uint8List getContractEncodedDataBytes({
  required String contractAbi,
  required String functionName,
  required List<dynamic> args,
  BigInt? gasPrice,
  BigInt? gasLimit,
}) {
  var contractToInteract = DeployedContract(
      ContractAbi.fromJson(contractAbi, randomAddress),
      EthereumAddress.fromHex(randomAddress));
  var func = contractToInteract.function(functionName);
  var encodedData = func.encodeCall(args);
  return encodedData;
}