Table of Contents

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 CcdAmount

Deposit this amount of CCD.

ModuleRef ModuleReference

The smart contract module reference.

ContractName ContractName

The init name of the smart contract.

Parameter Parameter

The parameters for the smart contract.

Properties

Amount

Deposit this amount of CCD.

public CcdAmount Amount { get; init; }

Property Value

CcdAmount

ContractName

The init name of the smart contract.

public ContractName ContractName { get; init; }

Property Value

ContractName

ModuleRef

The smart contract module reference.

public ModuleReference ModuleRef { get; init; }

Property Value

ModuleReference

Parameter

The parameters for the smart contract.

public Parameter Parameter { get; init; }

Property Value

Parameter

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 AccountAddress

Address of the sender of the transaction.

sequenceNumber AccountSequenceNumber

Account sequence number to use for the transaction.

expiry Expiry

Expiration time of the transaction.

energy EnergyAmount

The amount of energy that can be used for contract execution. The base energy amount for transaction verification will be added to this cost.

Returns

PreparedAccountTransaction

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.

Returns

bool