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

curated/v0 package

Overview

Package curated is a list anyone can get onto by locking a deposit, and anyone can try to get somebody else off by matching that deposit with a bond. The loser of the challenge pays the winner.

It is the registry member of a family of small social apps: a list is the thing every other one of them eventually needs, and a list is only worth reading if being on it cost something.

Example
1Apply(key, url, description)  -send 1000000ugnot   list it, immediately
2Challenge(key)                -send <the deposit>  object to it
3Vote(key, keep)                                    while the window is open
4Resolve(key)                                       anyone, after it closes
5Unlist(key)                                        the owner, if unchallenged
6Withdraw()                                         collect what you won

Money in, money out

Coins arrive in the envelope of a call and sit at this realm's address. They never leave by being pushed: a payout is a credit in a ledger and the payee calls Withdraw for their own. A realm that looped over winners and sent to each one would fail entirely when one of them could not be paid, and would hand a griefer a cheap denial of service for the price of one entry.

Every ugnot here is therefore either backing a live entry or an open challenge, or already assigned to somebody. The realm's own tests assert exactly that against the chain balance.

Voting is sybil-prone, and the bonds are GNOT

Vote is one address, one vote, unweighted, and an address is free. Read a resolution as "nobody with a stake objected enough", never as a verdict. Gating a vote on something harder to manufacture is a different problem with its own realm behind it, r/moul/x/social/vouch, a sibling in this family.

Bonds are GNOT and not a token of this list's own: see the README on why that is the only answer available at v0 and what would change it.

What v0 does not do, in the order it should be fixed

  1. Voters are paid nothing. Voting costs gas and returns nothing, so the only two addresses with a reason to vote are the ones with money on the outcome. A share of the loser's stake for the winning side is the standard answer and the first thing to add.
  2. There is no application period: Apply lists immediately.
  3. A challenge cannot be withdrawn and a vote cannot be changed.

Function

CreditOf

func CreditOf(who address) int64

CreditOf is what who can collect with Withdraw right now.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/moul/x/social/curated/v0.CreditOf()"

Result