Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

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/nym-moultest123/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)

IndexProposals

untyped bigint

IndexProposals is how many of a crew's proposals its page lists. Finding 325-cost-at-caps-1: the page rendered every proposal a crew had ever had. Proposing is open to every member and nothing deletes one, so the cost every reader pays grew without a bound anybody controls.

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
0c83e3…f7a2: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
0c83e3…f7a2: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 the crew page's join price, treasury / totalShares rounded up, or there is no whole share to mint.

Open
OID
0c83e3…f7a2:15
Join details

Inspect func

joinPrice

func(c *v0.Crew) int64

joinPrice is the least a joiner can send and still be minted a share: the floor Join's envelope guard enforces, and the price a crew page quotes. The engine mints amount \* totalShares / treasury, rounded down, so one whole share needs treasury / totalShares rounded UP. crew.Crew.PricePerShare rounds down, which is one ugnot short whenever the treasury is not an exact multiple of the share count, the ordinary state after any Fund: a joiner paying the quoted price passed the guard and then reverted on "buys no whole share". That method lives in a published package and cannot change in place, so the rule is here, next to the only guard that uses it. A crew nobody holds a share in is back at the opening price, the same branch Join takes.

Open
OID
0c83e3…f7a2:16
joinPrice 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
0c83e3…f7a2:17
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
0c83e3…f7a2:18
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
0c83e3…f7a2:19
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
0c83e3…f7a2:20
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
0c83e3…f7a2:21
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
0c83e3…f7a2:22
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
0c83e3…f7a2:23
Get details

Inspect func

Count

func() int

Count is how many crews exist.

Open
OID
0c83e3…f7a2:24
Count details

Inspect func

SharesOf

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

SharesOf is how many shares who holds in a crew.

Open
OID
0c83e3…f7a2:25
SharesOf details

Inspect func

MemberCount

func(crewID int64) int

MemberCount is how many people are in a crew.

Open
OID
0c83e3…f7a2:26
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
0c83e3…f7a2:27
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
0c83e3…f7a2:28
ValuePerShare details

Inspect func

ProposalOf

func(proposalID int64) (int64, .uverse.address, string, int64, bool, bool)
Open
OID
0c83e3…f7a2:29
ProposalOf details

Inspect func

Tally

func(proposalID int64) (int64, int64)

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

Open
OID
0c83e3…f7a2:30
Tally details

Inspect func

CreditOf

func(who .uverse.address) int64

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

Open
OID
0c83e3…f7a2:31
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
0c83e3…f7a2:32
TotalOwed details

Inspect func

Render

func(path string) string

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

Open
OID
0c83e3…f7a2:34
Render details

Inspect func

renderCrew

func(raw string) string
Open
OID
0c83e3…f7a2:37
renderCrew details

Inspect func

renderProposal

func(raw string) string
Open
OID
0c83e3…f7a2:38
renderProposal details

Inspect func

crewTable

func(items []v0.Listing) string

crewTable lists crews, newest first.

Open
OID
0c83e3…f7a2:39
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
0c83e3…f7a2:40
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
0c83e3…f7a2:41
state details

Inspect func

crewURL

func(id v0.ID) string

crewURL is the gnoweb path of one crew.

Open
OID
0c83e3…f7a2:42
crewURL details

Inspect func

proposalURL

func(id v0.ID) string

proposalURL is the gnoweb path of one proposal.

Open
OID
0c83e3…f7a2:43
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
0c83e3…f7a2:44
realmURL details

Inspect func
realmPath : untyped string ="gno.land/r/nym-moultest123/x/social/crews/v0"
denom : untyped string ="ugnot"
IndexCrews : untyped bigint =(20 <untyped> bigint)
IndexProposals : untyped bigint =(20 <untyped> bigint)
crews : *v0.Crews Inspect
Create : func(name string) int64 Inspect
Join : func(crewID int64) int64 Inspect
joinPrice : func(c *v0.Crew) 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