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

Apply

func Apply(cur realm, key, url, description string)

Apply lists an entry under key, in exchange for exactly 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 and 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.

Params

Warning

This transaction link is requesting 1000000ugnot from your balance. For your safety, you must manually confirm the addition of coins to the transaction.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/moul/x/social/curated/v0" -func "Apply" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/moul/x/social/curated/v0" -func "Apply" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx