Class InitContract
- Namespace
- Concordium.Sdk.Transactions
- Assembly
- Concordium.Sdk.dll
Represents an "init_contract" transaction.
Used for initializing deployed smart contracts.
public sealed record InitContract : AccountTransactionPayload, IEquatable<AccountTransactionPayload>, IEquatable<InitContract>
- Inheritance
-
InitContract
- Implements
- Inherited Members
Constructors
InitContract(CcdAmount, ModuleReference, ContractName, Parameter)
Represents an "init_contract" transaction.
Used for initializing deployed smart contracts.
public InitContract(CcdAmount Amount, ModuleReference ModuleRef, ContractName ContractName, Parameter Parameter)
Parameters
AmountCcdAmountDeposit this amount of CCD.
ModuleRefModuleReferenceThe smart contract module reference.
ContractNameContractNameThe init name of the smart contract.
ParameterParameterThe parameters for the smart contract.
Properties
Amount
Deposit this amount of CCD.
public CcdAmount Amount { get; init; }
Property Value
ContractName
The init name of the smart contract.
public ContractName ContractName { get; init; }
Property Value
ModuleRef
The smart contract module reference.
public ModuleReference ModuleRef { get; init; }
Property Value
Parameter
The parameters for the smart contract.
public Parameter Parameter { get; init; }
Property Value
Methods
Prepare(AccountAddress, AccountSequenceNumber, Expiry, EnergyAmount)
Prepares the account transaction payload for signing.
public PreparedAccountTransaction Prepare(AccountAddress sender, AccountSequenceNumber sequenceNumber, Expiry expiry, EnergyAmount energy)
Parameters
senderAccountAddressAddress of the sender of the transaction.
sequenceNumberAccountSequenceNumberAccount sequence number to use for the transaction.
expiryExpiryExpiration time of the transaction.
energyEnergyAmountThe amount of energy that can be used for contract execution. The base energy amount for transaction verification will be added to this cost.
Returns
ToBytes()
Copies the "init_contract" transaction in the binary format expected by the node to a byte array.
public override byte[] ToBytes()
Returns
- byte[]
TryDeserial(ReadOnlySpan<byte>, out (InitContract? InitContract, string? Error))
Deserialize a "InitContract" payload from a serialized byte array.
public static bool TryDeserial(ReadOnlySpan<byte> bytes, out (InitContract? InitContract, string? Error) output)
Parameters
bytesReadOnlySpan<byte>The serialized InitContract payload.
output(InitContract InitContract, string Error)Where to write the result of the operation.