Table of Contents

Class ContractName

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

The init name of a smart contract function. Expected format: "init_<contract_name>". It must only consist of at most 100 ASCII alphanumeric or punctuation characters, must not contain a '.' and must start with 'init_'.

public sealed record ContractName : IEquatable<ContractName>
Inheritance
ContractName
Implements
Inherited Members

Properties

Name

A contract name with format: "init_<contract_name>".

public string Name { get; init; }

Property Value

string

Methods

Equals(ContractName?)

Check for equality.

public bool Equals(ContractName? other)

Parameters

other ContractName

Returns

bool

GetContractName()

Get the contract name part of Name.

public ContractIdentifier GetContractName()

Returns

ContractIdentifier

Contract identification name

GetHashCode()

Gets hash code.

public override int GetHashCode()

Returns

int

ToBytes()

Copies the init name to a byte array which has the length preprended.

public byte[] ToBytes()

Returns

byte[]

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

Deserialize an init name from a serialized byte array.

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

Parameters

bytes ReadOnlySpan<byte>

The serialized init name.

output (ContractName ContractName, string Error)

Where to write the result of the operation.

Returns

bool

TryParse(string, out (ContractName? ContractName, ValidationError? Error))

Try parse input name against expected format.

public static bool TryParse(string name, out (ContractName? ContractName, ContractName.ValidationError? Error) output)

Parameters

name string

Input init name.

output (ContractName ContractName, ContractName.ValidationError? Error)

If parsing succeeded then ContractName will be not null. If parsing failed Error will be not null with first error seen.

Returns

bool

True if name satisfied expected format.