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

v0 state

Back to all declarations

realmPath

untyped string

realmPath is this realm's own path, the one its gnomod.toml module line declares. It is written out rather than read from the runtime, because every plain read this realm exports reports its CALLER and would build every link against the wrong realm.

Value

"gno.land/r/moul/x/social/crews/v0"

denom

untyped string

denom is the only coin a crew holds. ugnot and nothing else: a treasury that can hold several denominations needs a per-denomination share price, which is a different product.

Value

"ugnot"

IndexCrews

untyped bigint

IndexCrews is how many crews the index page lists.

Value

(20 <untyped> bigint)

crews

*v0.Crews

crews holds every crew, every proposal and the credit ledger. A redeploy wipes it, which is the trade gnomod.toml's private = true makes: see the comment there.

Open
OID
025928…11a9:4
crews details

Inspect pointer

Create

func(name string) int64

Create opens a crew and makes the caller its first member. Send ugnot with the call: the founder's shares are bought out of it at crew.InitialPricePerShare, and the whole amount, remainder included, becomes the treasury. Returns the new crew's id.

Open
OID
025928…11a9:13
Create details

Inspect func

Join

func(crewID int64) int64

Join mints the caller shares at what a share is worth right now and adds what they sent to the treasury. Returns the shares minted. The price is amount \* totalShares / treasury, rounded down, so somebody joining a crew that has tripled its money pays three times what the founders did. Send at least ValuePerShare ugnot, or there is no whole share to mint.

Open
OID
025928…11a9:15
Join details

Inspect func

Fund

func(crewID int64) int64

Fund adds what the caller sent to a crew's treasury and mints nothing, so every existing share is worth more afterwards. It is how revenue, a grant or a member topping the pot up arrives. Anyone may fund any crew, member or not: there is no way to refuse a transfer on this chain anyway, and pretending otherwise would only move the donation to a bank send the realm cannot account for.

Open
OID
025928…11a9:16
Fund details

Inspect func

Propose

func(crewID int64, text string) int64

Propose opens an advisory question on a crew. Any member may propose, and it stays open for crew.VoteBlocks blocks. Returns the proposal's id. A proposal EXECUTES NOTHING. Passing one records that the crew agreed by share weight, and moves no coins, changes no membership and binds no code. Executing a payout is the next step and it is not in v0.

Open
OID
025928…11a9:17
Propose details

Inspect func

Vote

func(proposalID int64, yes bool)

Vote records the caller's ballot, weighted by the shares they hold at this moment. One ballot per member, changeable while the proposal is open.

Open
OID
025928…11a9:18
Vote details

Inspect func

Close

func(proposalID int64) bool

Close records a proposal as passed or failed once its deadline has gone by, and returns which. Anyone may call it: closing is bookkeeping, not authority.

Open
OID
025928…11a9:19
Close details

Inspect func

Ragequit

func(crewID int64) int64

Ragequit burns every share the caller holds, credits them their pro-rata slice of the treasury and removes them from the crew. Returns the amount credited, which [Withdraw](#Withdraw) collects. Nobody has to agree. That is what makes a share mean something: the exit is priced by the same number that votes, and a member outvoted on everything can still leave with what they put in plus their part of what the crew built.

Open
OID
025928…11a9:20
Ragequit details

Inspect func

Withdraw

func() int64

Withdraw sends the caller everything they have been credited, and returns it. The credit is zeroed before the coins move, so a reentrant call finds nothing left to take. Nothing in this realm ever pushes value: one address that cannot be paid must not be able to wedge everybody else.

Open
OID
025928…11a9:21
Withdraw details

Inspect func

Get

func(crewID int64) (string, int64, int, int64, int64)

Get returns a crew's name, the height it was created at, how many members it has, its total shares and its treasury in ugnot. Flat values rather than the crew itself: handing out a pointer to live state is a mutation handle nothing checks, and a struct is not something a wallet can decode anyway.

Open
OID
025928…11a9:22
Get details

Inspect func

Count

func() int

Count is how many crews exist.

Open
OID
025928…11a9:23
Count details

Inspect func

SharesOf

func(crewID int64, who .uverse.address) int64

SharesOf is how many shares who holds in a crew.

Open
OID
025928…11a9:24
SharesOf details

Inspect func

MemberCount

func(crewID int64) int

MemberCount is how many people are in a crew.

Open
OID
025928…11a9:25
MemberCount details

Inspect func

Treasury

func(crewID int64) int64

Treasury is what a crew holds, in ugnot. The coins themselves sit at this realm's single address: see the package doc on custody.

Open
OID
025928…11a9:26
Treasury details

Inspect func

ValuePerShare

func(crewID int64) int64

ValuePerShare is what one of a crew's shares is worth in ugnot, rounded down.

Open
OID
025928…11a9:27
ValuePerShare details

Inspect func

ProposalOf

func(proposalID int64) (int64, .uverse.address, string, int64, bool, bool)
Open
OID
025928…11a9:28
ProposalOf details

Inspect func

Tally

func(proposalID int64) (int64, int64)

Tally is a proposal's share-weighted yes and no.

Open
OID
025928…11a9:29
Tally details

Inspect func

CreditOf

func(who .uverse.address) int64

CreditOf is what an address can withdraw right now, in ugnot.

Open
OID
025928…11a9:30
CreditOf details

Inspect func

TotalOwed

func() int64

TotalOwed is every outstanding credit, which is the part of this realm's balance that belongs to people who have already left.

Open
OID
025928…11a9:31
TotalOwed details

Inspect func

Render

func(path string) string

Render routes three views: the index, one crew, and one proposal.

Open
OID
025928…11a9:33
Render details

Inspect func

renderCrew

func(raw string) string
Open
OID
025928…11a9:36
renderCrew details

Inspect func

renderProposal

func(raw string) string
Open
OID
025928…11a9:37
renderProposal details

Inspect func

crewTable

func(items []v0.Listing) string

crewTable lists crews, newest first.

Open
OID
025928…11a9:38
crewTable details

Inspect func

proposalTable

func(ids []v0.ID) string

proposalTable lists a crew's proposals, newest first. The link title is the id and not the text, which is the opposite of crewTable and deliberate: a proposal's text is free prose and may contain a pipe, md.Link's escaper leaves pipes alone, and a pipe in a link title inside a table cell opens a column. So the chrome carries the link and the prose goes through ui.Cell, which is the escaper that knows it is in a table.

Open
OID
025928…11a9:39
proposalTable details

Inspect func

state

func(p *v0.Proposal, now int64) string

state is the one word a proposal is in at height now.

Open
OID
025928…11a9:40
state details

Inspect func

crewURL

func(id v0.ID) string

crewURL is the gnoweb path of one crew.

Open
OID
025928…11a9:41
crewURL details

Inspect func

proposalURL

func(id v0.ID) string

proposalURL is the gnoweb path of one proposal.

Open
OID
025928…11a9:42
proposalURL details

Inspect func

realmURL

func() string

realmURL is this realm's gnoweb path. The chain domain is the first element of a package path and a gnoweb path is the rest of it, so this is a prefix strip and not a hostname the realm has to know.

Open
OID
025928…11a9:43
realmURL details

Inspect func
realmPath : untyped string ="gno.land/r/moul/x/social/crews/v0"
denom : untyped string ="ugnot"
IndexCrews : untyped bigint =(20 <untyped> bigint)
crews : *v0.Crews Inspect
Create : func(name string) int64 Inspect
Join : func(crewID int64) int64 Inspect
Fund : func(crewID int64) int64 Inspect
Propose : func(crewID int64, text string) int64 Inspect
Vote : func(proposalID int64, yes bool) Inspect
Close : func(proposalID int64) bool Inspect
Ragequit : func(crewID int64) int64 Inspect
Withdraw : func() int64 Inspect
Get : func(crewID int64) (string, int64, int, int64, int64) Inspect
Count : func() int Inspect
SharesOf : func(crewID int64, who .uverse.address) int64 Inspect
MemberCount : func(crewID int64) int Inspect
Treasury : func(crewID int64) int64 Inspect
ValuePerShare : func(crewID int64) int64 Inspect
ProposalOf : func(proposalID int64) (int64, .uverse.address, string, int64, bool, bool) Inspect
Tally : func(proposalID int64) (int64, int64) Inspect
CreditOf : func(who .uverse.address) int64 Inspect
TotalOwed : func() int64 Inspect
caller : func() .uverse.address Inspect
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderCrew : func(raw string) string Inspect
renderProposal : func(raw string) string Inspect
crewTable : func(items []v0.Listing) string Inspect
proposalTable : func(ids []v0.ID) string Inspect
state : func(p *v0.Proposal, now int64) string Inspect
crewURL : func(id v0.ID) string Inspect
proposalURL : func(id v0.ID) string Inspect
realmURL : func() string Inspect