Search Apps Documentation Source Content File Folder Download Copy Actions Download

dao package

Functions

AllowedDAOs

func AllowedDAOs() []string

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.AllowedDAOs()"

Result

ExecuteOrRejectProposal

func ExecuteOrRejectProposal(cur realm, pid ProposalID) bool

ExecuteOrRejectProposal executes the proposal with the provided ProposalID or rejects it when there is an execution error. If the proposal was denied, it will return false. If the proposal is correctly executed, it will return true, unless execution fails with an error, in which case proposal is rejected with the error as the reason. This function allows to finish proposals by rejecting them when there is a state change or an error in the proposal parameters that makes execution fail, potentially leaving the proposal active forever because it can't be successfully executed.

Param

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/gov/dao" -func "ExecuteOrRejectProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "ExecuteOrRejectProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

ExecuteProposal

func ExecuteProposal(cur realm, pid ProposalID) bool

ExecuteProposal will try to execute the proposal with the provided ProposalID. If the proposal was denied, it will return false. If the proposal is correctly executed, it will return true. If something happens this function will panic.

Param

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/gov/dao" -func "ExecuteProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "ExecuteProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

InAllowedDAOs

func InAllowedDAOs(pkg string) bool

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.InAllowedDAOs()"

Result

MustVoteOnProposal

func MustVoteOnProposal(cur realm, r VoteRequest)

Param

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/gov/dao" -func "MustVoteOnProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "MustVoteOnProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

MustVoteOnProposalSimple

func MustVoteOnProposalSimple(cur realm, pid int64, option string)

MustVoteOnProposalSimple is like MustVoteOnProposal but intended to be used through gnokey with basic types.

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/gov/dao" -func "MustVoteOnProposalSimple" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "MustVoteOnProposalSimple" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

Render

func Render(cur realm, p string) string

Render calls directly to Render's DAO implementation. This allows to have this realm as the main entry point for everything.

Param

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/gov/dao" -func "Render" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "Render" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

UpdateImpl

func UpdateImpl(cur realm, r UpdateRequest)

UpdateImpl is a method intended to be used on a proposal. This method will update the current govDAO implementation to a new one. AllowedDAOs are a list of realms that can call this method, in case the new DAO implementation had a breaking bug. Any value set as nil will be ignored. If AllowedDAOs field is not set correctly, the actual DAO implementation wont be able to execute new Proposals!

Param

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/gov/dao" -func "UpdateImpl" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "UpdateImpl" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

VoteOnProposal

func VoteOnProposal(cur realm, r VoteRequest) error

VoteOnProposal sends a vote to the actual govDAO implementation. If the voter cannot vote the specified proposal, this method will return an error with the explanation of why.

Param

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/gov/dao" -func "VoteOnProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "VoteOnProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

GetProposal

func GetProposal(pid ProposalID) (*Proposal, error)

GetProposal gets created proposal by its ID. Non-crossing pure read: looks up the proposal in this realm's package var. Callable directly from any realm without cross-call syntax.

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.GetProposal()"

Result

MustGetProposal

func MustGetProposal(pid ProposalID) *Proposal

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.MustGetProposal()"

Result

CreateProposal

func CreateProposal(cur realm, r ProposalRequest) (ProposalID, error)

CreateProposal will try to create a new proposal, that will be validated by the actual govDAO implementation. If the proposal cannot be created, an error will be returned.

Param

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/gov/dao" -func "CreateProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "CreateProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

MustCreateProposal

func MustCreateProposal(cur realm, r ProposalRequest) ProposalID

MustCreateProposal is an utility method that does the same as CreateProposal, but instead of erroing if something happens, it panics.

Param

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/gov/dao" -func "MustCreateProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "test-13" -remote "https://rpc.test13.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.test13.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "MustCreateProposal" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test-13" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test13.testnets.gno.land" call.tx
  

NewProposalRequest

func NewProposalRequest(title string, description string, executor Executor) ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewProposalRequest(,,)"

Result

NewProposalRequestWithFilter

func NewProposalRequestWithFilter(title string, description string, executor Executor, filter Filter) ProposalRequest

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewProposalRequestWithFilter(,,,)"

Result

NewProposals

func NewProposals() *Proposals

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewProposals()"

Result

NewSafeExecutor

func NewSafeExecutor(e Executor) *SafeExecutor

Param

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewSafeExecutor()"

Result

NewSimpleExecutor

func NewSimpleExecutor(_ int, rlm realm, callback func(realm) error, description string) *SimpleExecutor

NewSimpleExecutor constructs an Executor whose creationRealm is captured from rlm.PkgPath() at construction time. The IsCurrent() check rejects stale or stashed realm values so the captured value is the authentic caller realm. creationRealm is display-only (rendered as "Executor created in: ..." in proposal listings) — no auth gate downstream.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewSimpleExecutor(,,,)"

Result

NewUpdateRequest

func NewUpdateRequest(d DAO, allowedDAOs []string) UpdateRequest

NewUpdateRequest copies allowedDAOs into a fresh slice owned by /r/gov/dao. Under the storage=authority model, if we stored the caller-passed slice directly, the base ArrayValue would retain PkgID = caller_realm: storage rent would attribute to caller, and /r/gov/dao could not mutate (e.g. append to) its own copy without a DidUpdate panic. The internal copy ensures the UpdateRequest and its AllowedDAOs both live entirely in /r/gov/dao's authority.

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewUpdateRequest(,)"

Result

NewVoteRequest

func NewVoteRequest(option VoteOption, proposalID ProposalID) VoteRequest

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewVoteRequest(,)"

Result

NewVoteRequestWithMetadata

func NewVoteRequestWithMetadata(option VoteOption, proposalID ProposalID, metadata interface{}) VoteRequest

Params

Command

gnokey query vm/qeval -remote "https://rpc.test13.testnets.gno.land" -data "gno.land/r/gov/dao.NewVoteRequestWithMetadata(,,)"

Result