dao package

Functions

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

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "ExecuteProposal"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

InAllowedDAOs

func InAllowedDAOs(pkg string) bool

Param

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "InAllowedDAOs"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

MustVoteOnProposal

func MustVoteOnProposal(cur realm, r VoteRequest)

Param

Command

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

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "MustVoteOnProposalSimple"  -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

Render

func Render(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

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

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

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "VoteOnProposal"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

GetProposal

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

GetProposal gets created proposal by its ID

Param

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "GetProposal"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

MustGetProposal

func MustGetProposal(cur realm, pid ProposalID) *Proposal

Param

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "MustGetProposal"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

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

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

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "MustCreateProposal"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

NewProposalRequest

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

Params

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "NewProposalRequest"  -args "" -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

NewProposalRequestWithFilter

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

Params

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "NewProposalRequestWithFilter"  -args "" -args "" -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

NewProposals

func NewProposals() *Proposals

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "NewProposals"  -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

NewSafeExecutor

func NewSafeExecutor(e Executor) *SafeExecutor

Param

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "NewSafeExecutor"  -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx

NewSimpleExecutor

func NewSimpleExecutor(callback func() error, description string) *SimpleExecutor

Params

Command

gnokey query -remote "https://rpc.test6.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/gov/dao" -func "NewSimpleExecutor"  -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "test6" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.test6.testnets.gno.land" call.tx