Deploy.contractCallByContractHash constructor
Deploy.contractCallByContractHash(])
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.
contractHash
is 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.contractCallByContractHash(HashKey contractHash, 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 = StoredContractByHashDeployItem(contractHash.key, contractEntryPoint, args);
header.bodyHash = Cep57Checksum.encode(bodyHash);
hash = Cep57Checksum.encode(headerHash);
}