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

Governable.Executable

package

Governable

subpackage

Contracts

since

v1.0.0

description

Abstract class that describes a digital contract. This is the base layer for defining an executable digital contract available to a DAO as defined in this package.

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[] = []
access

public

description

The list of required arguments to execute a digital contract related to a DAO.

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
  • This method MUST return a unique digital contract descriptor which includes:

    • the open standard descriptor (e.g.: "Governable") ;
    • the open standard revision (e.g.: 1) ;
    • the kebab-case command name (e.g.: "create-dao") ;
    • and the governance asset identifier.

    Items are joined with the : operator and attached to a so-called execution proof transaction.

    abstract
    access

    public

    Returns string

name

  • get name(): string

specification

  • get specification(): Taxonomy

Protected transactions

  • get transactions(): Transaction[]
  • This method MUST return a list of unsigned transactions. Transactions returned here will then be wrapped inside a transaction URI in the execute() method.

    see

    {execute()}

    abstract
    access

    public

    Returns Transaction[]

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

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. By default, this method returns true only if the actor is the target public account.

    This method asserts the presence of mandatory arguments.

    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