Options
All
  • Public
  • Public/Protected
  • All
Menu
class

Governable.CreateDAO

package

Governable

subpackage

Contracts

since

v1.0.0

description

Class that describes a contract for creating a distributed organization with operators. A key ceremony MUST have taken place before and also MUST be accessible through the network to read information about the agreed target public key.

summary

This digital contract accepts the following arguments:

Argument Description Example
operators Organization operator public accounts [new PublicAccount(...)]
metadata Metadata associated to mosaic {'code': '87', ...}

The execution of this contract results in the creation of the following list of transactions with their respective signer and a description:

Sequence Type Signer Description
01 MultisigAccountModificationTransaction Target Account + Operators Converts the target account in a multi-signature account where cosignatories are the operator accounts.
02 MosaicDefinitionTransaction Target Account Creates the governance mosaic. governance mosaics are distributed only to operators. There is one governance mosaic per each distributed organization. Governance mosaics have a mutable supply and are non-transferable.
03 MosaicSupplyChangeTransaction Target Account Creates the initial supply of governance assets. The amount issued is equal to the number of operators.
04 AccountMosaicRestrictionTransaction Target Account Restricts the target account such that it can only hold the concerned mosaics (i.e.: the governance mosaic and the network fee mosaic). :warning: This transaction protects the target account from SPAM transactions/mosaics.
05 MosaicGlobalRestrictionTransaction Target Account Restricts the target account such that it can only hold the concerned mosaics (i.e.: the governance mosaic and the network fee mosaic). :warning: This transaction protects the target account from SPAM transactions/mosaics.
06 MosaicAddressRestrictionTransaction Target Account Assigns the restriction value 1 ("Target") to the target account address.
07 MosaicMetadataTransaction Target Account Assigns the Org_Id metadata value to the governance mosaic.
08 AccountMetadataTransaction Target Account Assigns the Org_Id metadata value to the target account.
09 AccountMetadataTransaction Target Account Assigns the Name metadata value to the target account.
10 AccountMetadataTransaction Target Account Assigns the Code metadata value to the target account.
11 AccountMetadataTransaction Target Account Assigns the Website metadata value to the target account.
12 AccountMetadataTransaction Target Account Assigns the Contact metadata value to the target account.
13 AccountMetadataTransaction Target Account Assigns the Description metadata value to the target account.
14 AccountMetadataTransaction Target Account Assigns the Image metadata value to the target account.
15..n MosaicAddressRestrictionTransaction Target Account Assigns the restriction value 2 ("Operator") to the operator accounts. This transaction will be repeated per each operator.
16..n TransferTransaction Target Account Transfers the initially created supply of governance assets to the operator accounts. This transaction will be repeated per each operator.
n+1 TransferTransaction Target Account Adds an execution proof message sent to the target account.

Hierarchy

Implements

Index

Constructors

constructor

Properties

agreement

agreement: AggregateTransaction | undefined
access

public

description

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

arguments

arguments: string[] = ['target','operators','metadata', // @see {MetadataBucket}]
access

public

description

The list of required arguments to execute this digital contract.

context

context: Context

The execution context.

Protected identifier

identifier: AssetIdentifier

The organization governance asset identifier.

metadata

metadata: MetadataBucket | undefined
access

public

description

Metadata about the distributed organization.

mosaicInfo

mosaicInfo: MosaicInfo | undefined
access

public

description

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

operators

operators: Address[] = []
access

public

description

List of operators of a distributed organization.

target

target: PublicAccount
access

public

description

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

Accessors

descriptor

  • get descriptor(): string

name

  • get name(): string

specification

  • get specification(): Taxonomy

Protected transactions

  • get transactions(): Transaction[]
  • This method returns a list of unsigned transactions in a sequencial order of execution. The resulting transaction array is later wrapped inside a digital contract that is executed atomically such that either all transactions do succeed or all transactions are cancelled.

    see

    {execute()}

    access

    public

    Returns Transaction[]

    Given the execution of a contract, returns a list of unsigned transactions.

Methods

Protected assertExecutionAllowance

  • assertExecutionAllowance(actor: PublicAccount, argv: ContractOption[] | undefined): boolean

Protected assertHasMandatoryArguments

  • assertHasMandatoryArguments(argv: ContractOption[] | undefined, fields: string[]): boolean

canExecute

  • Verifies allowance of \a actor to execute a contract with arguments \a argv. This method asserts the presence of mandatory arguments.

    Additionally, this method asserts that the argument used for the target contract option refers to the correctly derived target account of a distributed organization.

    access

    public

    throws

    {FailureMissingArgument} On missing mandatory argument(s).

    Parameters

    • actor: PublicAccount

      The actor is whom executes the contract.

    • Optional argv: ContractOption[]

      The contract options (arguments).

    Returns AllowanceResult

    Returns whether an actor is authorized to execute this contract.

execute

  • execute(actor: PublicAccount, argv?: ContractOption[]): TransactionURI<Transaction>
  • Executes a digital contract with \a actor given \a argv contract options.

    access

    public

    throws

    {FailureMissingArgument} On missing mandatory argument(s).

    throws

    {FailureOperationForbidden} On denial of authorization.

    Parameters

    • actor: PublicAccount

      The actor is whom executes the contract.

    • Optional argv: ContractOption[]

      The contract options (arguments).

    Returns TransactionURI<Transaction>

    Returns one transaction URI with all transactions.

Protected prepare

  • prepare(): AggregateTransaction | Transaction

Generated using TypeDoc