Pure package detail
basedao
gno.land/p/samcrew/basedao
Indexed deployment identity with independently loaded latest RPC source. Functions and Render are realm-only RPC capabilities.
Indexed deployment
Identity
- Package path
- gno.land/p/samcrew/basedao
- Block
- 98962
- Deployed (UTC)
- Transaction
- vFRzo/FVwQsb8Cx+tKBmj8a88A034YhkhP+ftPai79c=
Latest RPC state
Source
package basedao
import (
"strconv"
"gno.land/p/moul/md"
"gno.land/p/moul/txlink"
"gno.land/p/nt/seqid/v0"
"gno.land/p/nt/ufmt/v0"
"gno.land/p/samcrew/daocond"
"gno.land/p/samcrew/daokit"
)
func (d *DAOPrivate) ProposalDetailPageView(idu uint64) string {
return d.ProposalDetailHeaderView() +
d.ProposalDetailView(idu)
}
func (d *DAOPrivate) ProposalDetailHeaderView() string {
pkgPath := d.Realm.PkgPath()
linkPath := getLinkPath(pkgPath)
name := d.GetProfileString(d.Realm.Address(), "DisplayName", "DAO")
s := ""
s += ufmt.Sprintf("# %s - Proposal Detail\n\n", name)
s += md.Link("> Go to Proposals", linkPath+":"+PROPOSALS_PATH) + "\n"
s += ufmt.Sprintf("\n--------------------------------\n")
return s
}
func (d *DAOPrivate) ProposalDetailView(idu uint64) string {
id := seqid.ID(idu)
proposal := d.Core.Proposals.GetProposal(uint64(id))
s := ""
s += ufmt.Sprintf("## Title - %s π\n\n", proposal.Title)
s += ufmt.Sprintf("## Description π\n\n%s\n\n", proposal.Description)
s += ufmt.Sprintf("## Resource - %s π¦\n\n", proposal.Action.Type())
resource := d.Core.Resources.Get(proposal.Action.Type())
s += ufmt.Sprintf(" - **Name:** %s\n", resource.DisplayName)
s += ufmt.Sprintf(" - **Description:** %s\n", resource.Description)
s += ufmt.Sprintf(" - **Condition:** %s\n\n", d.RenderWithRolesLinks(resource.Condition.Render()))
s += ("---\n\n")
s += proposal.Action.String() + "\n\n"
s += ("---\n\n")
status := proposal.DisplayStatus()
if status == daokit.ProposalStatusOpen {
s += ufmt.Sprintf("## Status - Open π‘\n\n")
s += md.Link("Approve this proposal π³οΈ", txlink.Call("Vote", "proposalID", strconv.FormatUint(idu, 10), "vote", string(daocond.VoteYes))) + "\n\n"
} else if status == daokit.ProposalStatusPassed {
s += ufmt.Sprintf("## Status - Passed π’\n\n")
s += md.Link("Execute this proposal π³οΈ", txlink.Call("Execute", "proposalID", strconv.FormatUint(idu, 10))) + "\n\n"
} else if status == daokit.ProposalStatusExecuted {
s += ufmt.Sprintf("## Status - Executed β
\n\n")
} else {
s += ufmt.Sprintf("## Status - Closed π΄\n\n")
}
signal := proposal.Condition.Signal(proposal.Ballot)
s += ufmt.Sprintf("%f", signal) + "\n"
s += ufmt.Sprintf("> proposed by %s π€\n\n", proposal.ProposerID)
s += ufmt.Sprintf("\n--------------------------------\n")
s += ufmt.Sprintf("## Votes π³οΈ\n\n%s\n\n", d.RenderWithRolesLinks(proposal.Condition.RenderWithVotes(proposal.Ballot)))
s += ufmt.Sprintf("\n--------------------------------\n")
return s
}
The verified vm/qfuncs operation accepts realm paths only.
Pure packages expose source files but do not have Realm Render.