Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DistributedOrganization

class

Governable.DistributedOrganization

package

Governable

subpackage

Standard

since

v1.0.0

description

Generic class to describe Governable distributed organizations.

A distributed organization is represented by the following properties, which have to be agreed upon by operators during an initial launch agreement:

  • An agreement transaction: Consists of a multi-signature account which uses SecretLockTransaction and TransferTransaction to prove a DAO agreement of operators on-chain.

  • A target account: Consists of a public account that was agreed upon by operators to represent the distributed organization as an entity. This account will be converted to a multi-signature account where cosigners are the operators of the DAO.

  • A governance mosaic: Consists of a digital asset that is created only for the purposes of keeping track of operators' ability to help with decision making in a distributed organization. Governance mosaics are always non-transferrable. This implies that a transfer of authority is not possible and enforces an agreement to be persisted on-chain.

Hierarchy

  • DistributedOrganization

Implements

Index

Constructors

constructor

  • new DistributedOrganization(name: string, reader: ReaderImpl, signer: SignerImpl, bip39: MnemonicPassPhrase, password: string, agreementHash?: undefined | string): DistributedOrganization
  • Constructs a distributed organization instance around a name of \a name, a network reader \a reader and a signer implementation of \a signer. Also \a bip39 mnemonic pass phrases are used to derive deterministic child accounts, and \a password is used to encrypt the BIP39 mnemonic.

    Optionally, \a agreementHash can be passed to this method in order to indicate a previous DAO launch agreement that was commited to and confirmed on the network. If left empty, this instance will be forced to use contracts that are creating and commiting said agreement.

    Parameters

    • name: string

      The name of the distributed organization (e.g.: "SWAPS CLOUD").

    • reader: ReaderImpl

      The blockchain network reader configuration.

    • signer: SignerImpl

      The digital signature implementation ("key provider").

    • bip39: MnemonicPassPhrase

      The mnemonic pass phrase ("24-words"). Caution here.

    • password: string

      The password with which to protect the BIP39 seed.

    • Optional agreementHash: undefined | string

    Returns DistributedOrganization

Properties

agreement

agreement: AggregateTransaction | undefined
description

The transaction representing a committed DAO agreement that has been confirmed on the network.

If left empty, distributed organizations only allow to execute the contract CreateAgreement. This is to force a mandatory agreement of operators about target account and governance asset identifier.

Protected Optional agreementHash

agreementHash: undefined | string
readonly
access

protected

description

The agreement transaction hash. This optional argument is used to read information about an agreed upon DAO agreement that has taken place before. If left empty, this instance will be forced to use contracts that create and commit said agreement.

Protected bip39

bip39: MnemonicPassPhrase

The mnemonic pass phrase ("24-words"). Caution here.

metadata

metadata: OrganizationMetadata | undefined
description

Metadata about the distributed organization.

Information that is saved in a metadata bucket include: name of the DAO, website and contact links, optionally a logo for the DAO and other custom metadata fields.

mosaicInfo

mosaicInfo: MosaicInfo | undefined
description

Mosaic information for the network-wide created organization governance assets.

This mosaic must be non-transferrable such that updates to the governance structure of the DAO are only possible with the agreement of operators.

name

name: string

The name of the distributed organization (e.g.: "SWAPS CLOUD").

operators

operators: Address[] = []
description

List of operators of a distributed organization.

These addresses can be any address on the source network. As an operator of a DAO, these address will be attributed assets that are used in governance duties in a DAO.

Protected password

password: string

The password with which to protect the BIP39 seed.

reader

reader: ReaderImpl

The blockchain network reader configuration.

Protected signer

signer: SignerImpl

The digital signature implementation ("key provider").

source

source: AssetSource
description

The source blockchain network of assets used by a distributed organization. This instance usually will hold either of a generation hash, a genesis block hash or a forked block hash.

target

target: PublicAccount
description

The deterministic public account which owns a governable organization. This account is used to issue the organization governance mosaic.

This account must be converted to multi-signature during the CreateDAO contract execution.

Accessors

identifier

  • Getter for the deterministic asset identifier related to the organization's governance mosaic that was created on the network. At any time, there is always one identifier per distributed organization. Other identifiers may have existed in the past, as such only the last commited to DAO launch agreement should be taken into account.

    access

    public

    Returns AssetIdentifier

Methods

canExecute

  • Verifies the autorization for \a actor to execute a contract \a contract given a \a governAssetId organization governance asset identifier.

    access

    public

    Parameters

    • actor: PublicAccount

      The actor is whom executes the contract.

    • governAssetId: AssetIdentifier

      The governance asset identifier.

    • contract: string

      The digital contract name.

    • argv: ContractOption[]

      The contract options (arguments).

    Returns AllowanceResult

    Returns whether an actor is authorized to execute said contract.

execute

  • Executes \a contract given \a governAssetId organization governance asset identifier, \a actor public account and \a argv contract execution options and \a parameters for network broadcasting.

    access

    public

    Parameters

    • actor: PublicAccount

      The actor is whom executes the command.

    • governAssetId: AssetIdentifier

      The organization's governance asset identifier.

    • contract: string

      The digital contract name. (e.g. "CreateVote").

    • parameters: TransactionParameters

      The transaction parameters (network specific).

    • argv: ContractOption[]

      The contract execution options (arguments).

    Returns Promise<TransactionURI<Transaction>>

    A digital contract that must be signed by the actor and possibly by the target account.

executeOffline

  • Executes \a contract given \a governAssetId organization governance asset identifier, \a actor public account and \a argv contract execution options and \a parameters for network broadcasting.

    This method does not call the synchronize() method.

    access

    public

    Parameters

    • actor: PublicAccount

      The actor is whom executes the command.

    • governAssetId: AssetIdentifier

      The organization's governance asset identifier.

    • contract: string

      The digital contract name. (e.g. "CreateVote").

    • parameters: TransactionParameters

      The transaction parameters (network specific).

    • argv: ContractOption[]

      The contract execution options (arguments).

    Returns TransactionURI<Transaction>

    A digital contract that must be signed by the actor and possibly by the target account.

Protected getContext

  • Returns an execution context around an \a actor, \a argv contract options and \a parameters transaction parameters.

    access

    protected

    Parameters

    • actor: PublicAccount

      The actor in said execution context.

    • parameters: TransactionParameters

      The transaction parameters.

    • Optional argv: ContractOption[]

      The execution options.

    Returns Context

    The pre-configured execution context.

Protected getContract

  • Returns an executable instance for \a contract given \a context and \a governAssetId.

    see

    {Governable.DigitalContracts}

    access

    protected

    throws

    {FailureInvalidContract} On invalid digital contract name.

    Parameters

    • governAssetId: AssetIdentifier

      The governance asset identifier.

    • command: string

      The digital contract name (e.g. "CreateVote").

    • context: Context

      The contract execution context (arguments).

    Returns Contract

    The contract instance pre-configured with the execution context.

synchronize

  • synchronize(): Promise<boolean>
  • Synchronize the contract execution with the network. This method shall be used to fetch data required for / before the execution of a digital contract.

    async
    override

    {Organization.synchronize()}

    access

    public

    throws

    {FailureInvalidAgreement} On invalid DAO launch agreement (@see CommitAgreement).

    Returns Promise<boolean>

Generated using TypeDoc