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
Amount
CcdAmountDeposit this amount of CCD.
ModuleRef
ModuleReferenceThe smart contract module reference.
ContractName
ContractNameThe init name of the smart contract.
Parameter
ParameterThe 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
sender
AccountAddressAddress of the sender of the transaction.
sequenceNumber
AccountSequenceNumberAccount sequence number to use for the transaction.
expiry
ExpiryExpiration time of the transaction.
energy
EnergyAmountThe 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
bytes
ReadOnlySpan<byte>The serialized InitContract payload.
output
(InitContract InitContract, string Error)Where to write the result of the operation.