Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

commondao/v0 package

Overview

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

Package commondao provides a reference realm implementation of the gno.land/p/nt/commondao/v0 package for managing Decentralized Autonomous Organizations per the Common DAO Spec: DAO and sub-DAO trees with councils and charters, a governable registry of proposal kinds (ten defaults plus an opt-in arbitrary-execution kind), per-DAO treasuries on derived sub-identity addresses with ancestor clawback/freeze powers, and bylaws documents amended by verifiable diff patches. See README.md and the ADRs under gno.land/adr/ for the design record.

Function

CreateExecutionProposal

func CreateExecutionProposal(cur realm, daoID uint64, title, body string, fn commondao.ExecFunc) uint64

CreateExecutionProposal creates a proposal that runs an arbitrary ExecFunc as the DAO's own sub on approval, through the realm's execution kind.

The execution kind is opt-in: it is not seeded on new DAOs and must be registered first through a supermajority CreateRegisterKindProposal.

Freeze policy: an execution proposal moves value under the DAO's own authority, so it is subject to the treasury freeze exactly like a spend. This wrapper fails fast when the treasury is already frozen, and the definition re-checks at Execute (so a freeze landing after the proposal passed fails it cleanly, StatusFailed, no funds leaving). An ancestor's clawback/dissolution is a separate power and is not blocked by freeze.

Sharp edges (known limitations):

  • The fn closure cannot be encoded in a CLI transaction, so this wrapper is reachable only from a PERSISTENT realm that imports this one and is a council member of the DAO (a realm-in-council). The closure must be authored in that realm so it survives Propose→Execute; a `maketx run` script's closure does not persist and cannot execute later.
  • A closure that panics or runs out of gas aborts the whole Execute tx, so the proposal is stuck Active (every retry re-aborts) and can never finalize. The only recovery is dissolving the DAO (Dissolve dismisses in-flight proposals). Author closures that return an error instead of panicking so a bad execution fails cleanly (StatusFailed) and releases.

Parameters: - daoID: ID of the DAO (required) - title: proposal title (raw text, escaped when rendered) - body: proposal body (raw text, escaped when rendered) - fn: the closure executed on approval (required, non-nil)

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nt/commondao/v0" -func "CreateExecutionProposal" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "dev" -remote "https://api.gno.berty.io:443" ADDRESSgnokey query -remote "https://api.gno.berty.io:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nt/commondao/v0" -func "CreateExecutionProposal" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "dev" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://api.gno.berty.io:443" call.tx