Deploy.versionedContractCallByContractHash constructor

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

Creates a Deploy object to call an entry point in a versioned contract. The contract is referred by the contract package hash key. contractHash is the contract package hash key. version is the version of the contract to be called. 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.versionedContractCallByContractHash(HashKey contractHash, int? version, 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 = StoredVersionedContractByHashDeployItem(contractHash.key, version, contractEntryPoint, args);
  header.bodyHash = Cep57Checksum.encode(bodyHash);
  hash = Cep57Checksum.encode(headerHash);
}