Deploy.contractCall constructor

Deploy.contractCall(
  1. String contractName,
  2. String contractEntryPoint,
  3. List<NamedArg> args,
  4. ClPublicKey caller,
  5. BigInt paymentAmount,
  6. String chainName, [
  7. int gasPrice = 1,
  8. Duration ttl = const Duration(minutes: 30),
])

Creates a Deploy object to call an entry point in a contract. The contract is referred by a named key in the caller's account. contractName is the named key in the caller account that contains a reference to the contract hash key. contractEntryPoint is the entry point of the contract to be called. args is the list of runtime arguments to be passed to the entry point. caller is the public key of the account that calls the contract. paymentAmount is the amount of CSPR (in motes) to pay for the call. chainName is the name of the network that will execute the call. gasPrice is the gas price. Default value is 1. ttl is the validity period of the Deploy since creation. Default value is 30 minutes.

Implementation

Deploy.contractCall(String contractName, String contractEntryPoint, List<NamedArg> args, ClPublicKey caller,
    BigInt paymentAmount, String chainName,
    [int gasPrice = 1, Duration ttl = const Duration(minutes: 30)]) {
  header = DeployHeader.withoutBodyHash(
    caller,
    DateTime.now(),
    ttl,
    gasPrice,
    [],
    chainName,
  );

  payment = ModuleBytesDeployItem.fromAmount(paymentAmount);
  session = StoredContractByNameDeployItem(contractName, contractEntryPoint, args);
  header.bodyHash = Cep57Checksum.encode(bodyHash);
  hash = Cep57Checksum.encode(headerHash);
}