Table of Contents

Class ContractAddress

Namespace
Concordium.Sdk.Types
Assembly
Concordium.Sdk.dll

Represents a contract address.

A contract is identified by its unique ContractAddress. A contract address consists of a contract index and a contact sub-index both represented as 64-bit unsigned integers.

public sealed record ContractAddress : IAddress, IEquatable<ContractAddress>
Inheritance
ContractAddress
Implements
Inherited Members

Constructors

ContractAddress(ulong, ulong)

Represents a contract address.

A contract is identified by its unique ContractAddress. A contract address consists of a contract index and a contact sub-index both represented as 64-bit unsigned integers.

public ContractAddress(ulong Index, ulong SubIndex)

Parameters

Index ulong

The index part of the address of a contract.

SubIndex ulong

The sub-index part of the address of a contract.

Fields

BytesLength

Byte size of ContractAddress.

public const uint BytesLength = 16

Field Value

uint

Properties

Index

The index part of the address of a contract.

public ulong Index { get; init; }

Property Value

ulong

SubIndex

The sub-index part of the address of a contract.

public ulong SubIndex { get; init; }

Property Value

ulong

Methods

From(ulong, ulong)

Creates an instance of contract address.

public static ContractAddress From(ulong index, ulong subIndex)

Parameters

index ulong

the index value.

subIndex ulong

the sub index value.

Returns

ContractAddress

ToBytes()

Serialize the ContractAddress in big-endian format.

public byte[] ToBytes()

Returns

byte[]

ToProto()

Converts the contract address to its corresponding protocol buffer message instance.

This can be used as the input for class methods of RawClient.

public ContractAddress ToProto()

Returns

ContractAddress

TryDeserial(ReadOnlySpan<byte>, out (ContractAddress? Address, string? Error))

Attempt to deserialize a contract address from a span of bytes.

public static bool TryDeserial(ReadOnlySpan<byte> bytes, out (ContractAddress? Address, string? Error) output)

Parameters

bytes ReadOnlySpan<byte>

The span of bytes.

output (ContractAddress Address, string Error)

Where to write the result of the operation.

Returns

bool