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

Governable.CreateAgreement

package

Governable

subpackage

Contracts

since

v1.0.0

description

Class that describes a contract for starting a DAO launch agreement with associates (other operators), and thereby initiating the process of creation of a distributed organization. Note that the first listed operator account will fund the account used for the agreement with 1 symbol.xym. This amount is sent to the target account when the agreement has been commited and confirmed by the network.

summary

This digital contract accepts the following arguments:

Argument Description Example
password A password to protect a mnemonic pass phrase '...'
mnemonic BIP39 mnemonic pass phrase to derive child accounts. new MnemonicPassPhrase(...)
agreementPath BIP44 derivation path to derive agreement account. '...'
operators Operators public accounts [new PublicAccount(...)]

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 Agreement Account + Operators Converts the agreement account in a multi-signature account where cosignatories are the operator accounts.
02 SecretLockTransaction Operator Account The secret used is the resulting governance asset identifier. If unlocked, sends an initial amount of symbol.xym to the target account. If not unlocked, expecting new agreement, with different secret.
03 TransferTransaction Agreement Account Sends information containing the target account public key that must be agreed upon in a subsequent CommitAgreement contract execution.
04 TransferTransaction Agreement Account Adds an execution proof message sent to the agreement 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[] = ['password','mnemonic','operators','agreementPath',]
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 checks that there is no other launch agreement that was commited to and confirmed on the network.

    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