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. Render builds its links from it rather than from unsafe.CurrentRealm(), which in a plain read reports the CALLER.

Value

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

Denom

untyped string

Value

"ugnot"

Deposit

int64

Value

1000000

ChallengeBlocks

int64

Value

1000

list

*v0.Registry

list is every entry and the credit ledger behind them. A redeploy would wipe it while leaving the coins at the address, which is what the note in gnomod.toml is about.

Open
OID
094fa8…3c9c:4
list details

Inspect pointer

Apply

func(key string, url string, description string)

Apply lists an entry under key, in exchange for exactly [Deposit](#Deposit) ugnot. The entry is on the list the moment this returns: there is no application period in v0, and the check on a bad entry is that anybody can challenge it. The deposit comes back through [Unlist](#Unlist) and [Withdraw](#Withdraw) if nobody ever does. key is a slug: lowercase ASCII letters, digits, '-', '\_' and '.', starting alphanumeric. A key whose entry was removed is free to apply for again.

Open
OID
094fa8…3c9c:8
Apply details

Inspect func

Challenge

func(key string)

Challenge objects to an entry, in exchange for a bond equal to that entry's own deposit, and opens a vote that closes [ChallengeBlocks](#ChallengeBlocks) blocks later. An owner cannot challenge their own entry: it would cost them nothing and would make the entry immune to a real challenge for the whole window.

Open
OID
094fa8…3c9c:10
Challenge details

Inspect func

Vote

func(key string, keep bool)

Vote takes a side on an open challenge: keep the entry, or remove it. One address, one vote, unweighted, and it cannot be changed. An address is free, so this is cheap to manufacture; see the package doc.

Open
OID
094fa8…3c9c:11
Vote details

Inspect func

Resolve

func(key string)

Resolve closes a challenge whose window has passed. Anyone may call it, so neither party can stall the other by sitting still. A majority of keep votes keeps the entry and credits its owner the bond. Otherwise the entry is removed and the challenger is credited the bond plus the deposit. A tie, including nobody voting at all, keeps the entry: the incumbent is the one already at risk, so a challenge that convinced nobody loses, which is what makes being wrong cost something.

Open
OID
094fa8…3c9c:12
Resolve details

Inspect func

Unlist

func(key string)

Unlist takes the caller's own entry off the list and credits them the deposit back, which [Withdraw](#Withdraw) then pays out. It is refused while a challenge is open: an owner who could walk away mid-challenge would be risking nothing, which is the one thing the deposit exists to prevent.

Open
OID
094fa8…3c9c:13
Unlist details

Inspect func

Withdraw

func() int64

Withdraw pays the caller everything credited to them and returns it. This is the only way coins leave the realm. The credit is zeroed before the transfer, so a reentrant call finds nothing left to take.

Open
OID
094fa8…3c9c:14
Withdraw details

Inspect func

Get

func(key string) (url string, description string, owner .uverse.address, deposit int64, at int64, state string)
Open
OID
094fa8…3c9c:15
Get details

Inspect func

Count

func() int

Count is how many entries are on the list right now. A challenged entry counts: a challenge is an objection, not a verdict.

Open
OID
094fa8…3c9c:16
Count details

Inspect func

Listed

func() []string

Listed is every key on the list, oldest first.

Open
OID
094fa8…3c9c:17
Listed details

Inspect func

IsListed

func(key string) bool

IsListed reports whether key is on the list right now.

Open
OID
094fa8…3c9c:18
IsListed details

Inspect func

ChallengeOf

func(key string) (challenger .uverse.address, bond int64, deadline int64, keep int64, remove int64, open bool)
Open
OID
094fa8…3c9c:19
ChallengeOf details

Inspect func

CreditOf

func(who .uverse.address) int64

CreditOf is what who can collect with [Withdraw](#Withdraw) right now.

Open
OID
094fa8…3c9c:20
CreditOf details

Inspect func

Render

func(path string) string

Render routes two views: the list itself, and one entry. A key never contains a slash, so "entry/\<key>" is a prefix strip rather than a path element that would have to be rejoined.

Open
OID
094fa8…3c9c:22
Render details

Inspect func

renderEntry

func(key string) string
Open
OID
094fa8…3c9c:25
renderEntry details

Inspect func

listing

func(entries []*v0.Entry) string

listing renders the entries as the list itself: the key links to its page, the description links to the thing it describes.

Open
OID
094fa8…3c9c:26
listing details

Inspect func

challengeTable

func(entries []*v0.Entry) string

challengeTable renders the open challenge against each of entries. An entry with none is skipped rather than shown blank.

Open
OID
094fa8…3c9c:27
challengeTable details

Inspect func

entryURL

func(key string) string

entryURL is the gnoweb path of one entry's page. 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 to hardcode.

Open
OID
094fa8…3c9c:28
entryURL details

Inspect func

applyURL

func() string

applyURL is the Apply form with the deposit already attached, so a reader never has to work out what -send should say.

Open
OID
094fa8…3c9c:29
applyURL details

Inspect func

challengeURL

func(key string, bond int64) string

challengeURL is the same for Challenge, carrying that entry's own bond.

Open
OID
094fa8…3c9c:30
challengeURL details

Inspect func
realmPath : untyped string ="gno.land/r/moul/x/social/curated/v0"
Denom : untyped string ="ugnot"
Deposit : int64 =1000000
ChallengeBlocks : int64 =1000
list : *v0.Registry Inspect
Apply : func(key string, url string, description string) Inspect
Challenge : func(key string) Inspect
Vote : func(key string, keep bool) Inspect
Resolve : func(key string) Inspect
Unlist : func(key string) Inspect
Withdraw : func() int64 Inspect
Get : func(key string) (url string, description string, owner .uverse.address, deposit int64, at int64, state string) Inspect
Count : func() int Inspect
Listed : func() []string Inspect
IsListed : func(key string) bool Inspect
ChallengeOf : func(key string) (challenger .uverse.address, bond int64, deadline int64, keep int64, remove int64, open bool) Inspect
CreditOf : func(who .uverse.address) int64 Inspect
caller : func() .uverse.address Inspect
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderEntry : func(key string) string Inspect
listing : func(entries []*v0.Entry) string Inspect
challengeTable : func(entries []*v0.Entry) string Inspect
entryURL : func(key string) string Inspect
applyURL : func() string Inspect
challengeURL : func(key string, bond int64) string Inspect
send : func(amount int64) string Inspect