dao
*impl.GovDAOdao is the actual govDAO implementation, having all the needed business logic
- OID
- 01c9af…30af:64
dao details
allowedDAOs
[]stringallowedDAOs contains realms that can be used to update the actual govDAO implementation, and validate Proposals. This is like that to be able to rollback using a previous govDAO implementation in case the latest implementation has a breaking bug. After a test period, a proposal can be executed to remove all previous govDAOs implementations and leave the last one.
- OID
- 05205d…f007:35
allowedDAOs details
proposals
*dao.Proposalsproposals contains all the proposals in history.
- OID
- 05205d…f007:6
proposals details
Render
func(p string) stringRender calls directly to Render's DAO implementation. This allows to have this realm as the main entry point for everything.
- OID
- 05205d…f007:10
Render details
MustCreateProposal
func(r dao.ProposalRequest) dao.ProposalIDMustCreateProposal is an utility method that does the same as CreateProposal, but instead of erroing if something happens, it panics.
- OID
- 05205d…f007:12
MustCreateProposal details
ExecuteProposal
func(pid dao.ProposalID) boolExecuteProposal 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.
- OID
- 05205d…f007:13
ExecuteProposal details
ExecuteOrRejectProposal
func(pid dao.ProposalID) boolExecuteOrRejectProposal 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.
- OID
- 05205d…f007:14
ExecuteOrRejectProposal details
CreateProposal
func(r dao.ProposalRequest) (dao.ProposalID, .uverse.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.
- OID
- 05205d…f007:15
CreateProposal details
MustVoteOnProposal
func(r dao.VoteRequest)- OID
- 05205d…f007:16
MustVoteOnProposal details
VoteOnProposal
func(r dao.VoteRequest) .uverse.errorVoteOnProposal 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.
- OID
- 05205d…f007:17
VoteOnProposal details
MustVoteOnProposalSimple
func(pid int64, option string)MustVoteOnProposalSimple is like MustVoteOnProposal but intended to be used through gnokey with basic types.
- OID
- 05205d…f007:18
MustVoteOnProposalSimple details
MustGetProposal
func(pid dao.ProposalID) *dao.Proposal- OID
- 05205d…f007:19
MustGetProposal details
GetProposal
func(pid dao.ProposalID) (*dao.Proposal, .uverse.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.
- OID
- 05205d…f007:20
GetProposal details
UpdateImpl
func(r dao.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!
- OID
- 05205d…f007:21
UpdateImpl details
AllowedDAOs
func() []string- OID
- 05205d…f007:22
AllowedDAOs details
InAllowedDAOs
func(pkg string) bool- OID
- 05205d…f007:23
InAllowedDAOs details
executeProposal
func(pid dao.ProposalID, execErrorRejects bool) bool- OID
- 05205d…f007:24
executeProposal details
ProposalID
typeValue
dao.ProposalID
VoteOption
typeVoteOption is the limited voting option for a DAO proposal New govDAOs can create their own VoteOptions if needed in the future.
Value
dao.VoteOption
AbstainVote
dao.VoteOption// Side is not chosen
Value
<gnolang.StringValue>
YesVote
dao.VoteOption// Proposal should be accepted
Value
<gnolang.StringValue>
NoVote
dao.VoteOption// Proposal should be rejected
Value
<gnolang.StringValue>
VoteRequest
typeValue
dao.VoteRequest
NewVoteRequest
func(option dao.VoteOption, proposalID dao.ProposalID) dao.VoteRequest- OID
- 05205d…f007:25
NewVoteRequest details
NewVoteRequestWithMetadata
func(option dao.VoteOption, proposalID dao.ProposalID, metadata interface{...}) dao.VoteRequest- OID
- 05205d…f007:27
NewVoteRequestWithMetadata details
NewProposalRequest
func(title string, description string, executor dao.Executor) dao.ProposalRequest- OID
- 05205d…f007:28
NewProposalRequest details
NewProposalRequestWithFilter
func(title string, description string, executor dao.Executor, filter dao.Filter) dao.ProposalRequest- OID
- 05205d…f007:29
NewProposalRequestWithFilter details
Filter
typeValue
dao.Filter
ProposalRequest
typeValue
dao.ProposalRequest
Proposal
typeValue
dao.Proposal
Proposals
typeValue
dao.Proposals
NewProposals
func() *dao.Proposals- OID
- 05205d…f007:30
NewProposals details
Executor
typeValue
dao.Executor
NewSimpleExecutor
func(int, rlm .uverse.realm, callback func(...), description string) *dao.SimpleExecutorNewSimpleExecutor 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.
- OID
- 05205d…f007:31
NewSimpleExecutor details
SimpleExecutor
typeSimpleExecutor implements the Executor interface using a callback function and a description string.
Value
dao.SimpleExecutor
NewSafeExecutor
func(e dao.Executor) *dao.SafeExecutor- OID
- 05205d…f007:32
NewSafeExecutor details
SafeExecutor
typeSafeExecutor wraps an Executor to only allow its execution by allowed govDAOs.
Value
dao.SafeExecutor
DAO
typeDAO is the govDAO implementation interface. All mutating/auth-gated methods take rlm as their realm-typed parameter in the second position (the \`\_ int, rlm realm\` non-crossing form): callers thread the proxy's cur as data without forcing a realm transition, so the impl's existing unsafe.CurrentRealm()-based auth gates (isValidCall, memberstore.Get) continue to see the proxy realm. Render stays unchanged.
Value
dao.DAO
UpdateRequest
typeValue
dao.UpdateRequest
NewUpdateRequest
func(d dao.DAO, allowedDAOs []string) dao.UpdateRequestNewUpdateRequest 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.
- OID
- 05205d…f007:33