Transaction.callContract constructor

Transaction.callContract({
  1. required DeployedContract contract,
  2. required ContractFunction function,
  3. required List parameters,
  4. EthereumAddress? from,
  5. int? maxGas,
  6. EtherAmount? gasPrice,
  7. EtherAmount? value,
  8. int? nonce,
  9. EtherAmount? maxFeePerGas,
  10. EtherAmount? maxPriorityFeePerGas,
})

Constructs a transaction that can be used to call a contract function.

Implementation

Transaction.callContract({
  required DeployedContract contract,
  required ContractFunction function,
  required List<dynamic> parameters,
  this.from,
  this.maxGas,
  this.gasPrice,
  this.value,
  this.nonce,
  this.maxFeePerGas,
  this.maxPriorityFeePerGas,
})  : to = contract.address,
      data = function.encodeCall(parameters);