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

planes state

Back to all declarations

pool

[]uint8 (len=1158)

pool holds the ids not minted yet, two bytes each. Its length over two is how many are left.

Open
OID
011fde…9bbe:131
pool details (len=1158)

+1158 more Inspect slice

mintedBits

[]uint8 (len=98)

mintedBits has one bit per id, set once the id is minted (burned or not): what tells a burned plane from one not minted yet, without scanning pool.

Open
OID
011fde…9bbe:132
mintedBits details (len=98)

+98 more Inspect slice

lastDraw

[32]uint8

lastDraw is the hash of the previous draw, chained into the next.

Open
OID
011fde…9bbe:3685
lastDraw details

Inspect array

testDraw

func(...)

testDraw, when set by a test, replaces the hash to pick an index in a pool of n ids. It is never set outside the tests.

Value

<zero>

resetPool

func(pkgPath string)

resetPool fills the pool with every id, from 777 down to 1, and seeds the chain of draws from the realm's path.

Open
OID
011fde…9bbe:8
resetPool details

Inspect func

left

func() int64

left returns how many ids are not minted yet.

Open
OID
011fde…9bbe:10
left details

Inspect func

drawHash

func(height int64, nanos int64, minter .uverse.address, minted int64, prev [32]uint8) [32]uint8

drawHash is the hash a draw picks its index from. It is a pure function of its inputs, so that the tests can check what moves it.

Open
OID
011fde…9bbe:11
drawHash details

Inspect func

drawID

func(minter .uverse.address) int64

drawID takes one id out of the pool, at random, for minter, and marks it minted. The pool must not be empty.

Open
OID
011fde…9bbe:12
drawID details

Inspect func

wasMinted

func(id int64) bool

wasMinted reports whether id was ever minted, burned since or not.

Open
OID
011fde…9bbe:13
wasMinted details

Inspect func

errSpoofedRealm

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: spoofed realm"

errNotAdmin

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: caller is not an admin"

errBadTable

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: the plane table does not run from 1 to 777"

errCorruptRow

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: corrupt plane row"

errUnknownPlane

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: unknown plane"

errNotMinted

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: plane not minted"

errNotPlaneOwner

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: caller does not own this plane"

errMintClosed

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: the mint is closed"

errSoldOut

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: every plane is minted"

errCapReached

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: this wallet minted as many planes as the cap allows"

errNotUserCall

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: Mint must be called directly by a user (maketx call)"

errInvalidCount

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: mint 1 to 7 planes at a time"

errInvalidPrice

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: price must be between 1000000 and 10000000000 ugnot"

errInvalidCap

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: cap must be between 1 and 777"

errInvalidBase

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: image base must be an https URL ending in /, 12 to 200 characters of [A-Za-z0-9./_-:]"

errInvalidRoyalty

untyped string

The refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.

Value

"gnofly: royalty must be between 0 and 1000 basis points"

PlaneJSON

func(id int64) string

PlaneJSON returns one plane as a JSON object, minted or not: { "id": 42, "name": "Storm Saint", "model": "delta", "pilot": "gnome", "body": "#1e1b4b", "wing": "#1e293b", "accent": "#00f5ff", "tier": "epic", "laser": "#39ff14", "image": "https://gnofly.xyz/nft/collections/planes/042.png", "owner": "g1..." } The output has no whitespace. "owner" is "" for a plane not minted, or burned. An id outside 1 to 777 returns "". Which plane a pilot flies is not on-chain: the game server checks the owner when a pilot picks one.

Open
OID
011fde…9bbe:14
PlaneJSON details

Inspect func

PlanesOf

func(addr .uverse.address) string

PlanesOf returns the ids of the planes addr owns as a JSON array, in ascending order: \[3,42,700]. It is \[] for an address without planes.

Open
OID
011fde…9bbe:16
PlanesOf details

Inspect func

maxMintedPage

int64

maxMintedPage is the most ids MintedJSON looks at in one call.

Value

200

MintedJSON

func(offset int64, limit int64) string

MintedJSON returns who owns the minted planes among the ids offset+1 to offset+limit, as a JSON array in id order: [{"id":3,"owner":"g1..."},{"id":42,"owner":""},...] Ids not minted are left out; "owner" is "" for a burned plane. limit is capped at 200, so four calls (offsets 0, 200, 400, 600) cover the 777, whatever was minted: planes are drawn at random, minted ids are not a prefix. It is what the website's grid reads. An empty range is \[].

Open
OID
011fde…9bbe:17
MintedJSON details

Inspect func

CollectionJSON

func() string

CollectionJSON returns the state of the collection as one JSON object: { "name": "gnofly planes", "symbol": "PLANE", "supply": 777, "minted": 12, "burned": 0, "price": 77000000, "open": true, "cap": 7, "royaltyBps": 500, "treasury": "g1...", "imageBase": "https://gnofly.xyz/nft/collections/planes/", "tiers": { "common": { "supply": 500, "minted": 8 }, "rare": { "supply": 200, "minted": 3 }, "epic": { "supply": 70, "minted": 1 }, "legendary": { "supply": 7, "minted": 0 } } } The output has no whitespace. "minted" counts every mint so far, burned planes included; "minted" minus "burned" is what exists.

Open
OID
011fde…9bbe:18
CollectionJSON details

Inspect func

writePlane

func(b *v0.NodeBuilder, p planes.plane)

writePlane writes the nine fields of a plane, in the order of a row, so that a caller can add fields after them.

Open
OID
011fde…9bbe:19
writePlane details

Inspect func

encode

func(n *v0.Node) string

encode marshals a document built above. It cannot fail on a document built from the builder, so a failure is a bug and panics.

Open
OID
011fde…9bbe:20
encode details

Inspect func

maxBatch

int64

maxBatch is the most planes one Mint call mints. It is a constant, apart from the per-wallet cap that admins tune with SetMintCap.

Value

7

Mint

func(count int64) []int64

Mint mints count planes for the caller, 1 to 7 in one call, drawn at random among the ids not minted yet (draw.gno), and returns their ids in the order drawn. Exactly count times the price must be attached to the transaction (-send "\<count\*price>ugnot"); it is forwarded to the treasury of the game realm, in one send, before the call returns. Each id comes out once, while the mint is open. A batch is minted whole or not at all: one that would take the caller over the per-wallet cap, or past the last plane, is refused with how many are left. It must be called directly by a user (maketx call): a call relayed by another realm or by a maketx run script is refused. That is also what keeps the draw fair: a contract could otherwise look at the ids it got and panic to draw again. The caller pays the storage of their planes as a deposit on top of the price, given back on burn: the ledger entries only, the traits stay in the table (see the numbers in docs/spec.md, section 9.2).

Open
OID
011fde…9bbe:21
Mint details

Inspect func

mintedBy

func(addr .uverse.address) int64

mintedBy returns how many planes addr minted so far.

Open
OID
011fde…9bbe:23
mintedBy details

Inspect func

TokenMetadata

func(tid v0.TokenID) (string, .uverse.error)

TokenMetadata returns the metadata of a minted plane as JSON, built from the table on every read: the realm stores no metadata per token. {"name":"Storm Saint","description":"Plane 42 of 777, ...", "image":"https://gnofly.xyz/nft/collections/planes/042.png", "attributes":[{"traitType":"model","value":"delta"}, ...]} The keys are the ones Adena reads, traitType included.

Open
OID
011fde…9bbe:24
TokenMetadata details

Inspect func

mintedID

func(tid v0.TokenID) (int64, .uverse.error)

mintedID reads a token id, "1" to "777", and checks the plane is minted.

Open
OID
011fde…9bbe:25
mintedID details

Inspect func

parseID

func(s string) int64

parseID reads "1" to "777" in decimal, 0 for anything else.

Open
OID
011fde…9bbe:26
parseID details

Inspect func

description

func(p planes.plane) string

description is one sentence about a plane: "Plane 42 of 777, an epic delta flown by a gnome." The tier is the only word that may start with a vowel.

Open
OID
011fde…9bbe:27
description details

Inspect func

Burn

func(id int64)

Burn destroys a plane. Only its owner can, and nobody can mint it again: the id stays out of circulation.

Open
OID
011fde…9bbe:28
Burn details

Inspect func

TransferFrom

func(from .uverse.address, to .uverse.address, id int64)

TransferFrom moves plane id from one address to another. The caller must own it or be approved for it.

Open
OID
011fde…9bbe:29
TransferFrom details

Inspect func

Approve

func(to .uverse.address, id int64)

Approve lets to move plane id once. The caller must own it. An empty address revokes.

Open
OID
011fde…9bbe:30
Approve details

Inspect func

SetApprovalForAll

func(operator .uverse.address, approved bool)

SetApprovalForAll lets operator move every plane of the caller, or revokes it.

Open
OID
011fde…9bbe:31
SetApprovalForAll details

Inspect func

ownerOf

func(id int64) .uverse.address
Open
OID
011fde…9bbe:32
ownerOf details

Inspect func

OwnerOf

func(tid v0.TokenID) (.uverse.address, .uverse.error)
Open
OID
011fde…9bbe:33
OwnerOf details

Inspect func

BalanceOf

func(addr .uverse.address) (int64, .uverse.error)

BalanceOf returns how many planes addr owns.

Open
OID
011fde…9bbe:34
BalanceOf details

Inspect func

TotalSupply

func() int64

TotalSupply returns how many planes exist: minted and not burned.

Open
OID
011fde…9bbe:35
TotalSupply details

Inspect func

GetApproved

func(id int64) .uverse.address
Open
OID
011fde…9bbe:36
GetApproved details

Inspect func

IsApprovedForAll

func(owner .uverse.address, operator .uverse.address) bool

IsApprovedForAll reports whether operator may move every plane of owner.

Open
OID
011fde…9bbe:37
IsApprovedForAll details

Inspect func

TokenURI

func(tid v0.TokenID) (string, .uverse.error)

TokenURI returns the image of a minted plane, "\<image base>\<nnn>.png": what a wallet shows (Adena puts it in an \<img>). The metadata is TokenMetadata, or "\<image base>\<id>.json" on the website. It is computed, not stored: a mint writes no URI.

Open
OID
011fde…9bbe:38
TokenURI details

Inspect func

RoyaltyInfo

func(id int64, salePrice int64) (.uverse.address, int64)
Open
OID
011fde…9bbe:39
RoyaltyInfo details

Inspect func

RoyaltyBps

func() int64

RoyaltyBps returns the royalty of a resale, in basis points.

Open
OID
011fde…9bbe:40
RoyaltyBps details

Inspect func

Token

*v0.Token

// name, symbol, owners, balances, approvals

Open
OID
011fde…9bbe:111
Token details

Inspect pointer

ledger

*v0.PrivateLedger

// the collection, write side: mint, burn

Open
OID
011fde…9bbe:113
ledger details

Inspect pointer

teller

*v0.fnTeller

// acts as the caller of this realm: transfers and approvals

Open
OID
011fde…9bbe:120
teller details

Inspect pointer

royaltyLedger

*v0.Ledger

// royalty, write side

Open
OID
011fde…9bbe:129
royaltyLedger details

Inspect pointer

mintCount

int64

// planes minted so far, burned ones included; the ids left are in pool (draw.gno)

Value

198

price

int64

// ugnot, what a mint costs

Value

77000000

mintOpen

bool

// whether Mint is accepting calls

Value

true

mintCap

int64

// how many planes one wallet may mint, over its lifetime

Value

7

imageBase

string

// "[https://gnofly.xyz/nft/collections/planes/](https://gnofly.xyz/nft/collections/planes/)", the image of plane 42 is at \<base>042.png

Value

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

mints

v0.BPTree

// minter address -> int64, planes minted so far, for the cap

Open
OID
011fde…9bbe:135
mints details

Inspect ref

tierMinted

[4]int64

// planes minted so far per tier, in the order of tiers

Open
OID
011fde…9bbe:136
tierMinted details

Inspect array

recent

[5]int64

// the last ids minted, newest first, 0 for none, for Render

Open
OID
011fde…9bbe:134
recent details

Inspect array

webPath

string

// "/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes", used to build links in Render

Value

"/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes"

supply

int64

The collection, and the settings at deploy.

Value

777

tokenName

untyped string

The collection, and the settings at deploy.

Value

"gnofly planes"

tokenSymbol

untyped string

The collection, and the settings at deploy.

Value

"PLANE"

payDenom

untyped string

// the only coin planes are sold for

Value

"ugnot"

defaultPrice

int64

// 77 GNOT

Value

77000000

minPrice

int64

The collection, and the settings at deploy.

Value

1000000

maxPrice

int64

The collection, and the settings at deploy.

Value

10000000000

defaultMintCap

int64

The collection, and the settings at deploy.

Value

7

defaultImageBase

untyped string

The collection, and the settings at deploy.

Value

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

defaultRoyaltyBps

int64

// 5% of a resale, to the treasury

Value

500

maxRoyaltyBps

int64

// the most SetRoyaltyBps accepts

Value

1000

models

untyped string

The collection, and the settings at deploy.

Value

"prop,biplane,stunt,jet,seaplane,twin,delta,glider,supergnome"

pilots

untyped string

The collection, and the settings at deploy.

Value

"none,gnome"

tiers

untyped string

The collection, and the settings at deploy.

Value

"common,rare,epic,legendary"

tierSupply

[4]int64

tierSupply is how many planes of each tier the table holds, in the order of tiers. The tests check it against the table.

Open
OID
011fde…9bbe:59
tierSupply details

Inspect array

tierIndex

func(tier string) int

tierIndex returns the position of tier in tiers, or -1.

Open
OID
011fde…9bbe:60
tierIndex details

Inspect func

bootstrap

func(int, rlm .uverse.realm)

bootstrap (re)creates the initial state: the token, its extensions and the settings. The tests call it to start from a clean slate. rlm is the live realm of the caller: grc721 records its package path as the home of the Token.

Open
OID
011fde…9bbe:63
bootstrap details

Inspect func

setRoyalty

func(bps int64)

setRoyalty points the royalty of every plane at the treasury of the game realm, as it is now, at bps basis points.

Open
OID
011fde…9bbe:64
setRoyalty details

Inspect func

SetMintOpen

func(open bool)

SetMintOpen opens or closes the mint. Admin only. The mint starts closed.

Open
OID
011fde…9bbe:65
SetMintOpen details

Inspect func

SetPrice

func(ugnot int64)

SetPrice sets what a mint costs, from 1 to 10000 GNOT. Admin only. It applies to the next mint.

Open
OID
011fde…9bbe:66
SetPrice details

Inspect func

SetMintCap

func(n int64)

SetMintCap sets how many planes one wallet may mint over its lifetime, from 1 to 777. Admin only. A wallet already over a lowered cap keeps its planes and mints no more.

Open
OID
011fde…9bbe:67
SetMintCap details

Inspect func

SetImageBase

func(base string)

SetImageBase sets where the images and the metadata of the planes are served from: the image of plane 42 is \<base>042.png and its token URI is \<base>42.json. Admin only. It applies at once to every plane: the URLs are computed on read, nothing is stored per token.

Open
OID
011fde…9bbe:68
SetImageBase details

Inspect func

SetRoyaltyBps

func(bps int64)

SetRoyaltyBps sets the royalty of a resale, from 0 to 1000 basis points, and points it at the treasury of the game realm as it is now. Admin only. The royalty is advisory, as EIP-2981 is: a marketplace reads RoyaltyInfo and pays it, the realm cannot enforce it on a transfer.

Open
OID
011fde…9bbe:69
SetRoyaltyBps details

Inspect func

Minted

func() int64

Minted returns how many planes were minted so far, burned ones included. Planes are drawn at random, so it says nothing of which ids. The settings (price, open, cap, image base, royalty) are read with CollectionJSON: every exported function costs storage at deploy, measured at about 650 bytes each, so there is no getter per setting.

Open
OID
011fde…9bbe:70
Minted details

Inspect func

webPathOf

func(pkgPath string) string

webPathOf turns "gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes" into "/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes".

Open
OID
011fde…9bbe:71
webPathOf details

Inspect func

imageURL

func(id int64) string

imageURL returns where the image of plane id is: \<image base>\<id>.png, the id on three digits, "042.png", as the image files are named. The token URI keeps the plain id, "42.json".

Open
OID
011fde…9bbe:72
imageURL details

Inspect func

pad3

func(id int64) string

pad3 writes an id of 1 to 777 on three digits: 7 -> "007", 42 -> "042".

Open
OID
011fde…9bbe:73
pad3 details

Inspect func

boolString

func(b bool) string
Open
OID
011fde…9bbe:75
boolString details

Inspect func

Render

func(path string) string

Render returns the state of the collection as markdown, for gnoweb: "" the collection: minted, price, tiers, the last mints "plane/<id>" one plane: traits, owner "player/<addr>" the planes of one address Everything printed here is a row of the table, whose charset the tests pin, a setting validated when it was written, or an address the chain gave the realm. The two caller-supplied values, an id and an address, are printed only once parsed and found valid. Nothing needs markdown escaping. No images: the planes are drawn by the game and by the website.

Open
OID
011fde…9bbe:76
Render details

Inspect func

renderPlane

func(p planes.plane) string
Open
OID
011fde…9bbe:80
renderPlane details

Inspect func

renderPlayer

func(addr .uverse.address) string
Open
OID
011fde…9bbe:81
renderPlayer details

Inspect func

gnot

func(ugnot int64) string

gnot formats an amount of ugnot in GNOT, without trailing zeros: 77000000 gives "77 GNOT", 9500000 gives "9.5 GNOT".

Open
OID
011fde…9bbe:84
gnot details

Inspect func

percent

func(bps int64) string

percent formats basis points as a percentage, without trailing zeros: 500 gives "5%", 250 gives "2.5%", 1 gives "0.01%".

Open
OID
011fde…9bbe:85
percent details

Inspect func

recentIDs

func() []int64

recentIDs returns the last ids minted, newest first.

Open
OID
011fde…9bbe:88
recentIDs details

Inspect func

authority

type

authority is the set of questions this realm asks about roles.

Value

planes.authority

gameRoles

type

gameRoles answers with the roles of the game realm.

Value

planes.gameRoles

roles

planes.gameRoles

roles is the authority of this realm: the game realm, always. It is a variable for one reason. Under \`gno test\` an imported realm is initialized without a deployer, and a test of this package has no way to become an admin of the game realm, so the tests put their own answers here. Nothing outside the test files assigns it, and there is no setter.

Open
OID
011fde…9bbe:90
roles details

Inspect ref

callerOf

func(int, rlm .uverse.realm) .uverse.address
Open
OID
011fde…9bbe:91
callerOf details

Inspect func

assertAdmin

func(int, rlm .uverse.realm) .uverse.address
Open
OID
011fde…9bbe:93
assertAdmin details

Inspect func

plane

type

plane is one row of the table: what a plane looks like. Nothing here is stored per token, the table is the only copy.

Value

planes.plane

row

func(id int64) string

row returns the line of plane id, or "" when there is no such row.

Open
OID
011fde…9bbe:94
row details

Inspect func

lineAt

func(i int) (start int, end int)

lineAt returns the bounds of the line containing offset i: start is its first byte, end the offset of its newline, or len(table) for the last line.

Open
OID
011fde…9bbe:96
lineAt details

Inspect func

rowID

func(i int) int64

rowID reads the id of the line containing offset i, or 0 when the line does not start with a number.

Open
OID
011fde…9bbe:97
rowID details

Inspect func

idAt

func(start int, end int) int64

idAt reads the id at the start of the line table\[start:end].

Open
OID
011fde…9bbe:98
idAt details

Inspect func

parsePlane

func(line string) (planes.plane, bool)

parsePlane turns a row into a plane. It checks the shape of the row, not its values: those are the table's promise, checked by the tests.

Open
OID
011fde…9bbe:99
parsePlane details

Inspect func

getPlane

func(id int64) (planes.plane, bool)

getPlane returns plane id from the table, or false when the id is out of range.

Open
OID
011fde…9bbe:100
getPlane details

Inspect func

mustPlane

func(id int64) planes.plane

mustPlane returns plane id from the table, or panics.

Open
OID
011fde…9bbe:101
mustPlane details

Inspect func

tokenID

func(id int64) v0.TokenID

tokenID is the GRC721 id of plane id: its number, in decimal.

Open
OID
011fde…9bbe:102
tokenID details

Inspect func

validName

func(s string) bool

validName reports whether s matches \[A-Za-z0-9 -]{1,24}.

Open
OID
011fde…9bbe:103
validName details

Inspect func

validColor

func(s string) bool

validColor reports whether s is "#rrggbb" with lowercase hex digits.

Open
OID
011fde…9bbe:104
validColor details

Inspect func

validBase

func(s string) bool

validBase reports whether s can be an image base: an https URL ending in "/", 12 to 200 characters of \[A-Za-z0-9./\_-:]. The charset keeps it safe in JSON and markdown without escaping.

Open
OID
011fde…9bbe:105
validBase details

Inspect func

validAddress

func(addr .uverse.address) bool

validAddress reports whether addr is a valid address in its canonical, lowercase form, the only form the game realm and this one key on.

Open
OID
011fde…9bbe:106
validAddress details

Inspect func

oneOf

func(s string, list string) bool

oneOf reports whether s is one of the comma-separated words of list.

Open
OID
011fde…9bbe:107
oneOf details

Inspect func

table

untyped string

table holds the traits of the 777 planes, one per line, in id order: id|name|model|pilot|body|wing|accent|tier|laser Ids run from 1 to 777 with no gap. Names are unique and match \[A-Za-z0-9 -]{1,24}. Tiers are common (500), rare (200), epic (70) and legendary (7). Models are those the client draws: prop, biplane, stunt for a common plane, jet, seaplane, twin for a rare one, delta, glider for an epic one, any of them for a legendary one, and supergnome for id 777 alone. Pilot is none or gnome; the super-gnome is the gnome, its pilot is none. Colours are #rrggbb in lowercase, the first three all different; on the super-gnome they are its cape, its suit and its emblem. The laser is the colour of the shots the plane fires; it comes last, added after the first version of the table. It is one string, parsed on read: 777 rows as structs would cost about ten times the storage deposit at deploy. See rows.gno for the parser.

Value

"1|Storm Sentinel|delta|gnome|#172554|#27272a|#ff4d6d|epic|#ff9e00\n2|Windy Thrush|biplane|none|#ddd5c7|#8c7b6b|#f2cc8f|common|#ffb347\n3|Humble Bucket|prop|none|#b5a27a|#4f5d75|#c9a227|common|#ffc971\n4|Lonely Pony|prop|none|#c2b280|#5c5c5c|#588157|common|#ff"...
pool : []uint8 (len=1158) Inspect
mintedBits : []uint8 (len=98) Inspect
lastDraw : [32]uint8 Inspect
testDraw : func(...) =<zero>
resetPool : func(pkgPath string) Inspect
left : func() int64 Inspect
drawHash : func(height int64, nanos int64, minter .uverse.address, minted int64, prev [32]uint8) [32]uint8 Inspect
drawID : func(minter .uverse.address) int64 Inspect
wasMinted : func(id int64) bool Inspect
errSpoofedRealm : untyped string ="gnofly: spoofed realm"
errNotAdmin : untyped string ="gnofly: caller is not an admin"
errBadTable : untyped string ="gnofly: the plane table does not run from 1 to 777"
errCorruptRow : untyped string ="gnofly: corrupt plane row"
errUnknownPlane : untyped string ="gnofly: unknown plane"
errNotMinted : untyped string ="gnofly: plane not minted"
errNotPlaneOwner : untyped string ="gnofly: caller does not own this plane"
errMintClosed : untyped string ="gnofly: the mint is closed"
errSoldOut : untyped string ="gnofly: every plane is minted"
errCapReached : untyped string ="gnofly: this wallet minted as many planes as the cap allows"
errNotUserCall : untyped string ="gnofly: Mint must be called directly by a user (maketx call)"
errInvalidCount : untyped string ="gnofly: mint 1 to 7 planes at a time"
errInvalidPrice : untyped string ="gnofly: price must be between 1000000 and 10000000000 ugnot"
errInvalidCap : untyped string ="gnofly: cap must be between 1 and 777"
errInvalidBase : untyped string ="gnofly: image base must be an https URL ending in /, 12 to 200 characters of [A-Za-z0-9./_-:]"
errInvalidRoyalty : untyped string ="gnofly: royalty must be between 0 and 1000 basis points"
PlaneJSON : func(id int64) string Inspect
PlanesOf : func(addr .uverse.address) string Inspect
maxMintedPage : int64 =200
MintedJSON : func(offset int64, limit int64) string Inspect
CollectionJSON : func() string Inspect
writePlane : func(b *v0.NodeBuilder, p planes.plane) Inspect
encode : func(n *v0.Node) string Inspect
maxBatch : int64 =7
Mint : func(count int64) []int64 Inspect
mintedBy : func(addr .uverse.address) int64 Inspect
TokenMetadata : func(tid v0.TokenID) (string, .uverse.error) Inspect
mintedID : func(tid v0.TokenID) (int64, .uverse.error) Inspect
parseID : func(s string) int64 Inspect
description : func(p planes.plane) string Inspect
Burn : func(id int64) Inspect
TransferFrom : func(from .uverse.address, to .uverse.address, id int64) Inspect
Approve : func(to .uverse.address, id int64) Inspect
SetApprovalForAll : func(operator .uverse.address, approved bool) Inspect
ownerOf : func(id int64) .uverse.address Inspect
OwnerOf : func(tid v0.TokenID) (.uverse.address, .uverse.error) Inspect
BalanceOf : func(addr .uverse.address) (int64, .uverse.error) Inspect
TotalSupply : func() int64 Inspect
GetApproved : func(id int64) .uverse.address Inspect
IsApprovedForAll : func(owner .uverse.address, operator .uverse.address) bool Inspect
TokenURI : func(tid v0.TokenID) (string, .uverse.error) Inspect
RoyaltyInfo : func(id int64, salePrice int64) (.uverse.address, int64) Inspect
RoyaltyBps : func() int64 Inspect
Token : *v0.Token Inspect
Royalties : *v0.Royalty Inspect
ledger : *v0.PrivateLedger Inspect
teller : *v0.fnTeller Inspect
royaltyLedger : *v0.Ledger Inspect
mintCount : int64 =198
price : int64 =77000000
mintOpen : bool =true
mintCap : int64 =7
imageBase : string ="https://gnofly.xyz/nft/collections/planes/"
mints : v0.BPTree Inspect
tierMinted : [4]int64 Inspect
recent : [5]int64 Inspect
webPath : string ="/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes"
supply : int64 =777
tokenName : untyped string ="gnofly planes"
tokenSymbol : untyped string ="PLANE"
payDenom : untyped string ="ugnot"
defaultPrice : int64 =77000000
minPrice : int64 =1000000
maxPrice : int64 =10000000000
defaultMintCap : int64 =7
defaultImageBase : untyped string ="https://gnofly.xyz/nft/collections/planes/"
defaultRoyaltyBps : int64 =500
maxRoyaltyBps : int64 =1000
models : untyped string ="prop,biplane,stunt,jet,seaplane,twin,delta,glider,supergnome"
pilots : untyped string ="none,gnome"
tiers : untyped string ="common,rare,epic,legendary"
tierSupply : [4]int64 Inspect
tierIndex : func(tier string) int Inspect
init.82 : func() Inspect
bootstrap : func(int, rlm .uverse.realm) Inspect
setRoyalty : func(bps int64) Inspect
SetMintOpen : func(open bool) Inspect
SetPrice : func(ugnot int64) Inspect
SetMintCap : func(n int64) Inspect
SetImageBase : func(base string) Inspect
SetRoyaltyBps : func(bps int64) Inspect
Minted : func() int64 Inspect
webPathOf : func(pkgPath string) string Inspect
imageURL : func(id int64) string Inspect
pad3 : func(id int64) string Inspect
itoa : func(n int64) string Inspect
boolString : func(b bool) string Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderPlane : func(p planes.plane) string Inspect
renderPlayer : func(addr .uverse.address) string Inspect
gnot : func(ugnot int64) string Inspect
percent : func(bps int64) string Inspect
plural : func(n int64) string Inspect
yesNo : func(b bool) string Inspect
recentIDs : func() []int64 Inspect
authority : type =planes.authority
gameRoles : type =planes.gameRoles
roles : planes.gameRoles Inspect
callerOf : func(int, rlm .uverse.realm) .uverse.address Inspect
assertAdmin : func(int, rlm .uverse.realm) .uverse.address Inspect
plane : type =planes.plane
row : func(id int64) string Inspect
lineAt : func(i int) (start int, end int) Inspect
rowID : func(i int) int64 Inspect
idAt : func(start int, end int) int64 Inspect
parsePlane : func(line string) (planes.plane, bool) Inspect
getPlane : func(id int64) (planes.plane, bool) Inspect
mustPlane : func(id int64) planes.plane Inspect
tokenID : func(id int64) v0.TokenID Inspect
validName : func(s string) bool Inspect
validColor : func(s string) bool Inspect
validBase : func(s string) bool Inspect
validAddress : func(addr .uverse.address) bool Inspect
oneOf : func(s string, list string) bool Inspect
table : untyped string ="1|Storm Sentinel|delta|gnome|#172554|#27272a|#ff4d6d|epic|#ff9e00\n2|Windy Thrush|biplane|none|#ddd5c7|#8c7b6b|#f2cc8f|common|#ffb347\n3|Humble Bucket|prop|none|#b5a27a|#4f5d75|#c9a227|common|#ffc971\n4|Lonely Pony|prop|none|#c2b280|#5c5c5c|#588157|common|#ff"...