Skip to main content

@midnight/ledger v3.0.2Readme | API


@midnight/ledger v3.0.2 / ContractMaintenanceAuthority

Class: ContractMaintenanceAuthority

A committee permitted to make changes to this contract. If a threshold of the public keys in this committee sign off, they can change the rules of this contract, or recompile it for a new version.

If the threshold is greater than the number of committee members, it is impossible for them to sign anything.

Constructors

new ContractMaintenanceAuthority(committee, threshold, counter)

new ContractMaintenanceAuthority(
committee,
threshold,
counter?): ContractMaintenanceAuthority

Constructs a new authority from its components

Parameters

committee: string[]

threshold: number

counter?: bigint

Returns

ContractMaintenanceAuthority

Properties

committee

readonly committee: string[];

The committee public keys


counter

readonly counter: bigint;

The replay protection counter


threshold

readonly threshold: number;

How many keys must sign rule changes

Methods

serialize()

serialize(networkid): Uint8Array

Parameters

networkid: NetworkId

Returns

Uint8Array


toString()

toString(compact?): string

Parameters

compact?: boolean

Returns

string


deserialize()

static deserialize(raw, networkid): ContractState

Parameters

raw: Uint8Array

networkid: NetworkId

Returns

ContractState