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

gnofly state

Back to all declarations

collectionName

untyped string

Value

"gnofly planes"

collectionSymbol

untyped string

Value

"PLANE"

collectionCover

untyped string

Value

"https://gnofly.xyz/nft/collections/planes/777.png"

collectionSupply

untyped bigint

Value

(777 <untyped> bigint)

collectionMintPrice

int64

Value

77000000

registered

bool

registered is set once Init has registered this realm on Bazaar's factory: only then does it report its minted count there.

Value

true

Init

func()

Init registers this realm on Bazaar's factory. The factory requires the slug "gnofly" reserved first, with Reserve, by the wallet calling Init; it must be an admin of the game realm here too: the gnofly wallet. Once only.

Open
OID
01b76d…8286:4
Init details

Inspect func

noteMinted

func(int, rlm .uverse.realm)

noteMinted reports the planes minted so far to Bazaar's factory, which shows the count. Nothing before Init: the factory does not know this realm.

Open
OID
01b76d…8286:6
noteMinted details

Inspect func

bazaarFee

func(price int64, seller .uverse.address, buyer .uverse.address) (genesis int64, protocol int64)

bazaarFee is what Bazaar takes on a sale at price between seller and buyer: its ProtocolBps less the better holder discount of the two, never below zero. Of it, GenesisShareBps goes to its genesis sink, the rest to its protocol sink. All read from the factory now: its admin sets them.

Open
OID
01b76d…8286:7
bazaarFee details

Inspect func

Registered

func() bool

Registered reports whether Init has registered this realm on Bazaar.

Open
OID
01b76d…8286:8
Registered details

Inspect func

itoa64

func(n int64) string

itoa64 is strconv.FormatInt in base 10.

Open
OID
01b76d…8286:9
itoa64 details

Inspect func

errSpoofedRealm

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: spoofed realm"

errNotAdmin

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: caller is not an admin"

errNotUserCall

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: call it directly from a wallet (maketx call or Adena)"

errUnknownPlane

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: no such plane"

errNotOwner

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: caller does not own this plane"

errNotSeller

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: caller is not the seller of this plane"

errListed

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: this plane is listed"

errNotListed

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: this plane is not listed"

errOwnListing

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: a seller cannot buy their own listing"

errPaused

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: new listings are paused"

errBadPrice

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: price must be between 1000000 and 1000000000000 ugnot"

errNotApproved

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: approve the market on the planes realm first (Approve or SetApprovalForAll)"

errBadRecipient

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: invalid recipient address"

errNotStray

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: this plane is not held by the market outside a listing"

errRegistered

untyped string

The refusals of this realm, as strings: a string constant costs its length in storage where an errors.New value costs about a kilobyte (see the planes realm's errors.gno). A panic with a string aborts the call with it.

Value

"gnofly market: already registered on Bazaar"

payDenom

untyped string

Value

"ugnot"

minPrice

int64

Value

1000000

maxPrice

int64

Value

1000000000000

supply

untyped bigint

// plane ids run from 1 to 777

Value

(777 <untyped> bigint)

listing

type

listing is one plane for sale. The plane itself is held by this realm (escrow) until it is bought or the listing is cancelled.

Value

gnofly.listing

paused

bool

Value

false

self

.uverse.address

Value

<gnolang.StringValue>

List

func(id int, priceUgnot int64)

List puts plane id up for sale at priceUgnot. The caller must own it and have approved this realm on the planes realm (Approve for this plane, or SetApprovalForAll): the plane moves here, in escrow, until it is bought or the listing is cancelled.

Open
OID
01b76d…8286:16
List details

Inspect func

UpdatePrice

func(id int, priceUgnot int64)

UpdatePrice changes the price of a plane the caller listed.

Open
OID
01b76d…8286:17
UpdatePrice details

Inspect func

Cancel

func(id int)

Cancel takes a listing down and gives the plane back to its seller. It works while the market is paused.

Open
OID
01b76d…8286:18
Cancel details

Inspect func

Buy

func(id int)

Buy buys a listed plane: send exactly its price in ugnot. Out of the price: Bazaar's fee (bazaarFee, to its sinks), the planes realm's royalty (RoyaltyInfo: 5% to the gnofly treasury), and the rest to the seller; the plane goes to the buyer. It works while the market is paused.

Open
OID
01b76d…8286:19
Buy details

Inspect func

Transfer

func(to .uverse.address, id int)

Transfer gives a plane the caller owns, not listed, to another address, through this realm: the call Bazaar's site makes. It needs the same approval as List. A plane can always be moved on the planes realm itself.

Open
OID
01b76d…8286:20
Transfer details

Inspect func

SetPaused

func(p bool)

SetPaused stops (or resumes) new listings and price changes. Admin of the game realm only. Cancel and Buy keep working, so a move to a newer market never strands a plane: sellers cancel here and list there.

Open
OID
01b76d…8286:21
SetPaused details

Inspect func

ReturnStray

func(id int, to .uverse.address)

ReturnStray gives back a plane this realm holds outside any listing: one someone sent here by mistake. Admin of the game realm only; to is who it came from, as the chain's transfer events show.

Open
OID
01b76d…8286:22
ReturnStray details

Inspect func

Paused

func() bool

Paused reports whether new listings are stopped.

Open
OID
01b76d…8286:23
Paused details

Inspect func

checkPrice

func(p int64)

checkPrice panics unless p is a price this market takes.

Open
OID
01b76d…8286:24
checkPrice details

Inspect func

mustListing

func(id int) *gnofly.listing

mustListing returns the listing of plane id, or panics.

Open
OID
01b76d…8286:25
mustListing details

Inspect func

getListing

func(id int) *gnofly.listing

getListing returns the listing of plane id, or nil.

Open
OID
01b76d…8286:26
getListing details

Inspect func

ownerOf

func(id int) .uverse.address
Open
OID
01b76d…8286:27
ownerOf details

Inspect func

key

func(id int) string

key is the listings key of plane id: three digits, "042".

Open
OID
01b76d…8286:28
key details

Inspect func

slug

untyped string

slug is the last element of this realm's path.

Value

"gnofly"

maxOpen

untyped bigint

maxOpen is the most listings ListOpen returns, as Bazaar's own realms do.

Value

(50 <untyped> bigint)

Name

func() string

Name and Symbol are the planes collection's: the market sells nothing else.

Open
OID
01b76d…8286:30
Name details

Inspect func

Minted

func() int

Minted returns how many planes were minted.

Open
OID
01b76d…8286:33
Minted details

Inspect func

OwnerOf

func(tid string) (.uverse.address, .uverse.error)
Open
OID
01b76d…8286:34
OwnerOf details

Inspect func

TokenURI

func(tid string) string

TokenURI returns the image of a plane, an https URL.

Open
OID
01b76d…8286:35
TokenURI details

Inspect func

TokensOf

func(owner string) string

TokensOf returns the ids of the planes owner holds, comma-separated, in id order: "3,42,700". A listed plane is not among them: it is held here.

Open
OID
01b76d…8286:36
TokensOf details

Inspect func

ListOpen

func() string

ListOpen returns the listings, one line each, in id order, at most 50.

Open
OID
01b76d…8286:37
ListOpen details

Inspect func

ItemLine

func(id int) string

ItemLine returns the line of plane id, listed or not. It panics for an id that is not a minted plane: Bazaar's site skips the ids it cannot read.

Open
OID
01b76d…8286:38
ItemLine details

Inspect func

line

func(id int, l *gnofly.listing) string

line builds the line of plane id; l is its listing, nil when it has none.

Open
OID
01b76d…8286:39
line details

Inspect func

plane

type

Value

gnofly.plane

planeInfo

func(id int) gnofly.plane

planeInfo reads plane id from the planes realm's PlaneJSON.

Open
OID
01b76d…8286:40
planeInfo details

Inspect func

clean

func(s string) string

clean keeps a field from breaking a line: no "|" and no line break. The planes realm's names and URLs have none; this is a guard, not a filter.

Open
OID
01b76d…8286:41
clean details

Inspect func

Render

func(string) string

Render shows the listings on gnoweb.

Open
OID
01b76d…8286:42
Render details

Inspect func

gnot

func(ugnot int64) string

gnot writes ugnot as GNOT: 1000000 is "1 GNOT", 1500000 "1.5 GNOT".

Open
OID
01b76d…8286:43
gnot details

Inspect func

authority

type

authority is the one question this realm asks about roles.

Value

gnofly.authority

gameRoles

type

gameRoles answers with the roles of the game realm.

Value

gnofly.gameRoles

roles

gnofly.gameRoles

roles is the authority of this realm. It is a variable only so that the tests can answer for the game realm, which has no admin under \`gno test\`.

Open
OID
01b76d…8286:45
roles details

Inspect ref

callerOf

func(int, rlm .uverse.realm) .uverse.address
Open
OID
01b76d…8286:46
callerOf details

Inspect func

userOf

func(int, rlm .uverse.realm) .uverse.address
Open
OID
01b76d…8286:48
userOf details

Inspect func

assertAdmin

func(int, rlm .uverse.realm) .uverse.address
Open
OID
01b76d…8286:49
assertAdmin details

Inspect func
collectionName : untyped string ="gnofly planes"
collectionSymbol : untyped string ="PLANE"
collectionCover : untyped string ="https://gnofly.xyz/nft/collections/planes/777.png"
collectionSupply : untyped bigint =(777 <untyped> bigint)
collectionMintPrice : int64 =77000000
registered : bool =true
Init : func() Inspect
noteMinted : func(int, rlm .uverse.realm) Inspect
bazaarFee : func(price int64, seller .uverse.address, buyer .uverse.address) (genesis int64, protocol int64) Inspect
Registered : func() bool Inspect
itoa64 : func(n int64) string Inspect
errSpoofedRealm : untyped string ="gnofly market: spoofed realm"
errNotAdmin : untyped string ="gnofly market: caller is not an admin"
errNotUserCall : untyped string ="gnofly market: call it directly from a wallet (maketx call or Adena)"
errUnknownPlane : untyped string ="gnofly market: no such plane"
errNotOwner : untyped string ="gnofly market: caller does not own this plane"
errNotSeller : untyped string ="gnofly market: caller is not the seller of this plane"
errListed : untyped string ="gnofly market: this plane is listed"
errNotListed : untyped string ="gnofly market: this plane is not listed"
errOwnListing : untyped string ="gnofly market: a seller cannot buy their own listing"
errPaused : untyped string ="gnofly market: new listings are paused"
errBadPrice : untyped string ="gnofly market: price must be between 1000000 and 1000000000000 ugnot"
errNotApproved : untyped string ="gnofly market: approve the market on the planes realm first (Approve or SetApprovalForAll)"
errBadRecipient : untyped string ="gnofly market: invalid recipient address"
errNotStray : untyped string ="gnofly market: this plane is not held by the market outside a listing"
errRegistered : untyped string ="gnofly market: already registered on Bazaar"
payDenom : untyped string ="ugnot"
minPrice : int64 =1000000
maxPrice : int64 =1000000000000
supply : untyped bigint =(777 <untyped> bigint)
listing : type =gnofly.listing
listings : v0.BPTree Inspect
paused : bool =false
self : .uverse.address =<gnolang.StringValue>
init.34 : func() Inspect
List : func(id int, priceUgnot int64) Inspect
UpdatePrice : func(id int, priceUgnot int64) Inspect
Cancel : func(id int) Inspect
Buy : func(id int) Inspect
Transfer : func(to .uverse.address, id int) Inspect
SetPaused : func(p bool) Inspect
ReturnStray : func(id int, to .uverse.address) Inspect
Paused : func() bool Inspect
checkPrice : func(p int64) Inspect
mustListing : func(id int) *gnofly.listing Inspect
getListing : func(id int) *gnofly.listing Inspect
ownerOf : func(id int) .uverse.address Inspect
key : func(id int) string Inspect
tid : func(id int) v0.TokenID Inspect
slug : untyped string ="gnofly"
maxOpen : untyped bigint =(50 <untyped> bigint)
Name : func() string Inspect
Symbol : func() string Inspect
Minted : func() int Inspect
OwnerOf : func(tid string) (.uverse.address, .uverse.error) Inspect
TokenURI : func(tid string) string Inspect
TokensOf : func(owner string) string Inspect
ListOpen : func() string Inspect
ItemLine : func(id int) string Inspect
line : func(id int, l *gnofly.listing) string Inspect
plane : type =gnofly.plane
planeInfo : func(id int) gnofly.plane Inspect
clean : func(s string) string Inspect
Render : func(string) string Inspect
gnot : func(ugnot int64) string Inspect
authority : type =gnofly.authority
gameRoles : type =gnofly.gameRoles
roles : gnofly.gameRoles Inspect
callerOf : func(int, rlm .uverse.realm) .uverse.address Inspect
userOf : func(int, rlm .uverse.realm) .uverse.address Inspect
assertAdmin : func(int, rlm .uverse.realm) .uverse.address Inspect