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.

v1 state

Back to all declarations

keyFee

untyped string

The house fee, expressed the same way the pricing rules are so there is one convention on this project and not two: "1000000" a flat amount in ugnot — 1 GNOT "%3" three percent of the sale "%2.5" two and a half percent; one decimal place is honoured Stored in the vault as a global so it can be changed without redeploying anything, read fresh on every sale so a change takes effect immediately rather than at the next deploy.

Value

"marketfee"

defaultFee

untyped string

// 1 GNOT

Value

"1000000"

maxFeeBps

int64

// 50%

Value

5000

bpsDenom

int64

The house fee, expressed the same way the pricing rules are so there is one convention on this project and not two: "1000000" a flat amount in ugnot — 1 GNOT "%3" three percent of the sale "%2.5" two and a half percent; one decimal place is honoured Stored in the vault as a global so it can be changed without redeploying anything, read fresh on every sale so a change takes effect immediately rather than at the next deploy.

Value

10000

SetFee

func(spec string)

SetFee changes it. Admin only, and validated here rather than trusted, because a malformed spec would otherwise be read on every sale and silently resolve to zero. SetFee CANNOT WORK FROM HERE, and saying so is the fix. nsdata.SetGlobalRecord opens with assertIsTrustedLogic, and this realm is deliberately outside the trusted set — types.gno says so in capitals, and the deploy panel actively revokes anything but nslogic. So every call here passed its own admin check and its own validation and then panicked inside the vault, for everybody, including the correct admin. A dead control that reads as live is worse than no control: it fails at signing time, during the incident that prompted reaching for it. Granting nsmarket vault trust to fix this would surrender the property the whole realm is built around. So the setter moved to nslogic, which already has the grant, and runs the same parseFee validation there.

Open
OID
0f2ccf…6764:5
SetFee details

Inspect func

parseFee

func(spec string) (int64, int64, string)

parseFee returns (flat ugnot, basis points, error). Exactly one of the first two is non-zero.

Open
OID
0f2ccf…6764:6
parseFee details

Inspect func

FeeFor

func(price int64) (fee int64, toSeller int64)

FeeFor is what the house takes on a sale at this price, and what the seller is left with. Exported so the listing screen can show both before anybody signs — a fee somebody discovers afterwards is a fee they were not told about.

Open
OID
0f2ccf…6764:7
FeeFor details

Inspect func

List

func(tid string, price int64)

List puts a name up for sale at a price in ugnot. It does NOT take the name. The seller keeps it, keeps using it, and keeps the right to change their mind — revoking the approval stops the listing from completing without needing this realm's cooperation. (It does not DELETE the listing: this realm is not told. Unlist, or anyone's Prune, clears it. See staleReason.) The approval is required BEFORE listing rather than checked only at sale time, so a listing that could never complete cannot exist. A buyer finding out at the checkout that the seller never approved anything is the worst moment to find out.

Open
OID
0f2ccf…6764:9
List details

Inspect func

Unlist

func(tid string)

Unlist withdraws a listing. The seller, or the admin for a name that should not be on sale at all — the same manual lever the takedown process already relies on elsewhere.

Open
OID
0f2ccf…6764:11
Unlist details

Inspect func

Prune

func(tid string)

Prune clears a listing that can no longer complete. Anyone may call it. WHY ANYONE. A listing goes stale without this realm hearing about it: the name is transferred elsewhere, lapses, is frozen, or the seller revokes the approval. Buy refuses such a listing — but a refusal is a panic, and a panic reverts everything, including any attempt to delete the listing on the way out. Found on Pearl, 2026-09-10: three refused buys, three listings still stored, each message saying "the listing is gone". A stale listing is not harmless while it sits there. Revoking the approval is how a seller would naturally "cancel"; if that seller later grants the marketplace an operator approval to list something else, the old listing completes again, at the old price. Clearing it is the fix, and nobody should have to wait for the seller to think of it. The caller gains nothing but the storage deposit the listing held, which the chain refunds to whoever frees storage. That is the right incentive: the only thing Prune can do is remove a listing that is already dead — staleReason must name a reason, or it refuses.

Open
OID
0f2ccf…6764:12
Prune details

Inspect func

Buy

func(tid string)

Buy completes a sale in the buyer's own transaction. Order matters here. Everything that can refuse the sale is checked before a single coin moves, and the name moves before the money does, so there is no arrangement of failures that leaves the seller paid and the buyer empty-handed. A panic anywhere reverts all of it.

Open
OID
0f2ccf…6764:13
Buy details

Inspect func

staleReason

func(self .uverse.address, tid string, l *v1.Listing) string

staleReason says why a listing can no longer complete, or "" when it can. ONE ANSWER FOR THREE CALLERS. Buy refuses on it, Prune clears on it, and the reads report live=false on it. They used to be three separate lists of checks, and the reads' list had no approval check: a listing whose seller had revoked permission showed as live, with an enabled Buy button, and failed at the checkout. Each of these is a real thing that happens, not a defensive flourish: - changed hands: the seller transferred the name elsewhere - lapsed and re-registered: owner and validity match again, but it is not the asset the listing was written against (Listing.registered) - sold and bought back: same owner, same registration, but a different ownership epoch — an operator grant survives transfers (Listing.epoch) - withdrawn permission: the seller revoked the approval

Open
OID
0f2ccf…6764:15
staleReason details

Inspect func

approvedTo

func(self .uverse.address, seller .uverse.address, tid string) bool

Whether this realm may move that token on the seller's behalf. Either form of GRC-721 permission counts: approved for the one token, or an operator for everything the seller holds. \`self\` is threaded in from the caller rather than looked up, because a realm can only learn its own address from its own \`cur\`.

Open
OID
0f2ccf…6764:16
approvedTo details

Inspect func

splitTokenID

func(tid string) (label string, domainLabel string)
Open
OID
0f2ccf…6764:17
splitTokenID details

Inspect func

assertNoSend

func()

This realm takes no payment on anything except Buy.

Open
OID
0f2ccf…6764:18
assertNoSend details

Inspect func

row

func(tid string, l *v1.Listing) string
Open
OID
0f2ccf…6764:19
row details

Inspect func

GetListing

func(tid string) string

GetListing returns one row, or "" when nothing is listed.

Open
OID
0f2ccf…6764:21
GetListing details

Inspect func

ListForSale

func(after string, limit int) (rows string, next string)

ListForSale pages through everything on offer, cheapest first within a page. \`after\` is the last token id of the previous page.

Open
OID
0f2ccf…6764:22
ListForSale details

Inspect func

ListingsBy

func(seller .uverse.address) string

ListingsBy is everything one wallet has up for sale. Walks the whole tree because listings are keyed by token id, not by seller: a second index would be a second thing to keep correct and a second thing the seller pays storage for, to save a walk over a list that is small by construction.

Open
OID
0f2ccf…6764:23
ListingsBy details

Inspect func

Quote

func(tid string) (price int64, fee int64, toSeller int64)

Quote is what a buyer pays and what the seller receives, before anybody signs anything. The fee is read live, so this is the same arithmetic Buy will do rather than a copy of it that can drift.

Open
OID
0f2ccf…6764:26
Quote details

Inspect func

Version

func() string

Version lets the site tell which shape it is talking to without guessing from a function signature.

Open
OID
0f2ccf…6764:27
Version details

Inspect func

Listing

type

A listing. Kept small on purpose: the seller pays to store it, and everything derivable is derived rather than copied. The seller's address is here because the name can change hands outside this realm and a stale seller must be caught, not trusted.

Value

v1.Listing

sold

int64

// completed sales, for the honest version of a stat

Value

1

marketAddr

.uverse.address

Value

<gnolang.StringValue>

maxPage

untyped bigint

Value

(200 <untyped> bigint)

minPrice

int64

// zero would be a giveaway, not a sale

Value

1

maxPrice

int64

// guards the fee arithmetic from overflow

Value

4503599627370496

ugnot

untyped string

Value

"ugnot"
keyFee : untyped string ="marketfee"
defaultFee : untyped string ="1000000"
maxFeeBps : int64 =5000
bpsDenom : int64 =10000
FeeSpec : func() string Inspect
SetFee : func(spec string) Inspect
parseFee : func(spec string) (int64, int64, string) Inspect
FeeFor : func(price int64) (fee int64, toSeller int64) Inspect
assertIsAdmin : func() Inspect
List : func(tid string, price int64) Inspect
Unlist : func(tid string) Inspect
Prune : func(tid string) Inspect
Buy : func(tid string) Inspect
get : func(tid string) *v1.Listing Inspect
staleReason : func(self .uverse.address, tid string, l *v1.Listing) string Inspect
approvedTo : func(self .uverse.address, seller .uverse.address, tid string) bool Inspect
splitTokenID : func(tid string) (label string, domainLabel string) Inspect
assertNoSend : func() Inspect
row : func(tid string, l *v1.Listing) string Inspect
GetListing : func(tid string) string Inspect
ListForSale : func(after string, limit int) (rows string, next string) Inspect
ListingsBy : func(seller .uverse.address) string Inspect
CountListed : func() int64 Inspect
CountSold : func() int64 Inspect
Quote : func(tid string) (price int64, fee int64, toSeller int64) Inspect
Version : func() string Inspect
Listing : type =v1.Listing
listings : v0.Tree Inspect
sold : int64 =1
marketAddr : .uverse.address =<gnolang.StringValue>
maxPage : untyped bigint =(200 <untyped> bigint)
minPrice : int64 =1
maxPrice : int64 =4503599627370496
ugnot : untyped string ="ugnot"