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.

adstation state

Back to all declarations

pkgPath

untyped string

// must match gnomod.toml

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/adstation"

coldKey

.uverse.address

// Jae's: the first owner and approver

Value

<gnolang.StringValue>

GNOT

untyped string

Value

"ugnot"

WeekLen

int64

Value

604800

Monday0

int64

// 1970-01-05 00:00 UTC, the first Monday after the epoch

Value

345600

CloseAhead

int64

// a week's bidding closes a day before it starts

Value

86400

AheadWeeks

int64

// weeks open for bidding, counting from the next one

Value

8

MaxPanels

untyped bigint

// the most panels a week may have

Value

(1024 <untyped> bigint)

MaxBidsWeek

untyped bigint

// bids a week holds (Settle ranks them all in one call); a full week takes a larger bid in place of its smallest

Value

(200 <untyped> bigint)

MaxBidsBidderWeek

untyped bigint

// open bids one wallet may hold in one week

Value

(10 <untyped> bigint)

MaxOpenBidsAd

untyped bigint

// open bids one ad may carry (a turn-down refunds them in one call)

Value

(32 <untyped> bigint)

MaxPending

untyped bigint

// ads waiting for an approver with a bid at stake, at once

Value

(100 <untyped> bigint)

MaxPendingOwner

untyped bigint

// … of them one advertiser's

Value

(5 <untyped> bigint)

maxRejectMany

untyped bigint

// ads one RejectMany turns down: ten with 32 open bids each in full weeks cost ~0.94B gas on a node, fifty ~3.57B, more than a block (review round 2, R2-3)

Value

(10 <untyped> bigint)

maxTitle

untyped bigint

Value

(60 <untyped> bigint)

maxReason

untyped bigint

Value

(120 <untyped> bigint)

maxPanelsSpec

untyped bigint

Value

(2000 <untyped> bigint)

listMax

untyped bigint

Value

(50 <untyped> bigint)

defaultPanels

untyped bigint

// the ring: 27 columns × 2 rows × 2 faces

Value

(108 <untyped> bigint)

defaultMinBid

untyped bigint

// 100 GNOT (jae: "100 GNOT (~$7)")

Value

(100000000 <untyped> bigint)

Ad

type

Ad is one approved-or-not picture with its link and title; immutable once made, so an approval covers exactly it.

Value

adstation.Ad

Offer

type

Offer is one bid: a price for a set of panels in one week, for one ad, its GNOT held here until the week settles.

Value

adstation.Offer

Week

type

Week holds a week's bids and, once settled, its winners.

Value

adstation.Week

owner

.uverse.address

Value

<gnolang.StringValue>

nextOwner

.uverse.address

Value

<zero>

approvers

v0.Tree

// address → true

Open
OID
08faf5…d60f:6
approvers details

Inspect ref

minBid

int64

Value

100000000

panels

int

Value

108

paused

bool

Value

false

ads

v0.Tree

// padded id → \*Ad

Open
OID
08faf5…d60f:11
ads details

Inspect ref

bids

v0.Tree

// padded id → \*Offer

Open
OID
08faf5…d60f:13
bids details

Inspect ref

weeks

v0.Tree

// padded start → \*Week

Open
OID
08faf5…d60f:15
weeks details

Inspect ref

owed

v0.Tree

// address → int64 ugnot

Open
OID
08faf5…d60f:17
owed details

Inspect ref

lastAd

int64

Value

0

lastBid

int64

Value

0

byOwner

v0.Tree

// advertiser → \[]int64: their latest ads, oldest first (their own record: json/by/\<address>)

Open
OID
08faf5…d60f:21
byOwner details

Inspect ref

byBidder

v0.Tree

// bidder → \[]int64: their latest bids, oldest first — a bumped or refunded bid leaves its week, not this

Open
OID
08faf5…d60f:23
byBidder details

Inspect ref

pending

int

// ads waiting for an approver with an open bid (queue, unqueue)

Value

0

pendingBy

v0.Tree

// advertiser → how many of theirs are counted in pending

Open
OID
08faf5…d60f:26
pendingBy details

Inspect ref

earned

int64

// all weeks' winning bids, paid to the treasury

Value

0

WeekOf

func(t int64) int64

WeekOf is the start of the week holding t (unix seconds).

Open
OID
08faf5…d60f:30
WeekOf details

Inspect func

ThisWeek

func() int64

ThisWeek is the start of the week running now; NextWeek the one after it.

Open
OID
08faf5…d60f:31
ThisWeek details

Inspect func

Closes

func(week int64) int64

Closes is when bidding for a week ends.

Open
OID
08faf5…d60f:33
Closes details

Inspect func

NextOwner

func() .uverse.address
Open
OID
08faf5…d60f:36
NextOwner details

Inspect func

IsApprover

func(a .uverse.address) bool
Open
OID
08faf5…d60f:37
IsApprover details

Inspect func

Owed

func(a .uverse.address) int64

Owed is what an address could withdraw now: refunds of lost and turned-down bids.

Open
OID
08faf5…d60f:44
Owed details

Inspect func

GetAd

func(id int64) adstation.Ad

GetAd and GetBid are copies.

Open
OID
08faf5…d60f:45
GetAd details

Inspect func

GetBid

func(id int64) adstation.Offer
Open
OID
08faf5…d60f:46
GetBid details

Inspect func

Approvers

func() [].uverse.address
Open
OID
08faf5…d60f:47
Approvers details

Inspect func

weekRec

func(w int64) *adstation.Week
Open
OID
08faf5…d60f:51
weekRec details

Inspect func

sent

func() int64

sent is the ugnot carried by the call; any other coin is refused.

Open
OID
08faf5…d60f:54
sent details

Inspect func

credit

func(to .uverse.address, ugnot int64)
Open
OID
08faf5…d60f:55
credit details

Inspect func

pay

func(to .uverse.address, ugnot int64)
Open
OID
08faf5…d60f:56
pay details

Inspect func

Bid

func(week int64, panelSpec string, image string, link string, title string) int64

Bid opens an ad (its picture by hash, a link, a title) and bids for it in one call: the GNOT sent is the bid, for the panels named ("3", "0-8", "0-8,27-35") in the week starting at week (a Monday 00:00 UTC, unix seconds). Returns the bid's id; the ad's id is GetBid(id).Ad.

Open
OID
08faf5…d60f:57
Bid details

Inspect func

BidAd

func(adID int64, week int64, panelSpec string) int64

BidAd bids again with an ad of yours, approved or still waiting: the GNOT sent is the bid.

Open
OID
08faf5…d60f:58
BidAd details

Inspect func

appendTo

func(t *v0.Tree, who .uverse.address, id int64)

appendTo adds an id to an address's list in an index. Only the latest listMax are ever shown, so the list keeps at most twice that: a bid costs the same however many came before it (review round 2, R2-5: the whole history was read and written on every bid).

Open
OID
08faf5…d60f:59
appendTo details

Inspect func

queueRoom

func(who .uverse.address)

THE APPROVERS' QUEUE counts only the waiting ads that have a bid at stake (the review of 2026-10-14, F2: an ad whose bids had all been decided still held one of the queue's places, so a hundred of them, every GNOT already refunded, shut the queue for nothing), at most MaxPendingOwner of them one advertiser's. queueRoom checks before anything is written; queue and unqueue keep the counts.

Open
OID
08faf5…d60f:60
queueRoom details

Inspect func

waitingOf

func(o .uverse.address) int
Open
OID
08faf5…d60f:61
waitingOf details

Inspect func

admit

func(who .uverse.address, week int64, panelSpec string, ugnot int64) (int, []uint64, int, int64)

admit checks a bid before anything is written: the pause, the least bid, the week (a Monday, still open, not too far ahead), the bidder's open bids in it, room for another bid, and the panels against the week's count. Returns that count, the parsed set, and the bid a full week gives up for this one (0 for none).

Open
OID
08faf5…d60f:64
admit details

Inspect func

place

func(who .uverse.address, a *adstation.Ad, week int64, n int, bits []uint64, count int, ugnot int64, bump int64) int64

place writes an admitted bid, after the bid it bumps (if any) is refunded and out of the week.

Open
OID
08faf5…d60f:65
place details

Inspect func

Raise

func(bidID int64)

Raise adds the GNOT sent to an open bid of yours, before its week closes.

Open
OID
08faf5…d60f:66
Raise details

Inspect func

mustApprove

func() .uverse.address
Open
OID
08faf5…d60f:67
mustApprove details

Inspect func

Approve

func(adID int64)

Approve passes a waiting ad: its bids compete when their weeks settle.

Open
OID
08faf5…d60f:68
Approve details

Inspect func

Reject

func(adID int64, reason string)

Reject turns an ad down, waiting or approved, with a reason (plain text): every open bid of it is refunded now and leaves its week, whose place it frees. Weeks it already won stay paid.

Open
OID
08faf5…d60f:69
Reject details

Inspect func

RejectMany

func(adIDs string, reason string) int

RejectMany turns down several ads in one call ("4,9,12", at most 50), with one reason; ads already turned down are passed over. Returns how many it turned down.

Open
OID
08faf5…d60f:70
RejectMany details

Inspect func

checkReason

func(reason string)
Open
OID
08faf5…d60f:71
checkReason details

Inspect func

reject

func(a *adstation.Ad, who .uverse.address, reason string)
Open
OID
08faf5…d60f:72
reject details

Inspect func

unlist

func(b *adstation.Offer)

unlist takes a bid out of its week's list (it stays readable by GetBid): a refunded bid holds no place there, and no longer counts among its bidder's.

Open
OID
08faf5…d60f:73
unlist details

Inspect func

Settle

func(week int64) int64

Settle closes the books of a week that has started (anyone may call it, once): it picks the winners among the open bids whose ad is approved (allocate), pays the winners' GNOT to the treasury and credits everyone else's back. Returns the winning bids' total.

Open
OID
08faf5…d60f:74
Settle details

Inspect func

dropOpen

func(b *adstation.Offer)
Open
OID
08faf5…d60f:75
dropOpen details

Inspect func

allocate

func(w *adstation.Week) []int64

allocate picks a week's winners among its open bids for approved ads: each in turn of an order wins if none of its panels is taken yet, and of two orders — price per panel (cross-multiplied, so no rounding), and the whole amount — the one that pays the treasury more wins (then the one that sells more panels, then price per panel). THE REVIEW OF 2026-10-14, F3: by price per panel alone, one least bid for one panel placed a minute before the close voided a bid five times its size for the whole ring, and the treasury took the small one with 107 panels dark. Deterministic.

Open
OID
08faf5…d60f:76
allocate details

Inspect func

greedy

func(order []*adstation.Offer, n int) ([]int64, int64, int)

greedy takes the bids in order, each if none of its panels is taken: the winners, what they pay, the panels sold.

Open
OID
08faf5…d60f:77
greedy details

Inspect func

byAmount

type

byAmount orders bids by the whole amount, then price per panel, then the earlier id.

Value

adstation.byAmount

byPrice

type

byPrice orders bids best first: price per panel (cross-multiplied, no rounding), then amount, then the earlier id.

Value

adstation.byPrice

Winners

func(week int64) []int64

Winners is the week's winning bids: final once it is settled, else as things stand now.

Open
OID
08faf5…d60f:78
Winners details

Inspect func

Withdraw

func() int64

Withdraw pays you what you are owed.

Open
OID
08faf5…d60f:79
Withdraw details

Inspect func

PayOut

func(to .uverse.address) int64

PayOut pays an address what it is owed; anyone may call it for anyone (the money has one destination).

Open
OID
08faf5…d60f:80
PayOut details

Inspect func

payOut

func(to .uverse.address) int64
Open
OID
08faf5…d60f:81
payOut details

Inspect func

AddApprover

func(a .uverse.address)

AddApprover and RemoveApprover name who may pass or turn down ads.

Open
OID
08faf5…d60f:83
AddApprover details

Inspect func

RemoveApprover

func(a .uverse.address)
Open
OID
08faf5…d60f:84
RemoveApprover details

Inspect func

SetMinBid

func(ugnot int64)

SetMinBid sets the least bid, in ugnot, for bids placed from now on.

Open
OID
08faf5…d60f:85
SetMinBid details

Inspect func

SetPanels

func(n int)

SetPanels sets the panel count of weeks nobody has bid on yet (the station's panels can change; a week keeps the count it had at its first bid).

Open
OID
08faf5…d60f:86
SetPanels details

Inspect func

SetPaused

func(p bool)

SetPaused stops (true) or resumes new bids and raises; approving, settling and refunds go on.

Open
OID
08faf5…d60f:87
SetPaused details

Inspect func

SetOwner

func(to .uverse.address)

SetOwner names the next owner; nothing changes until they AcceptOwner. "" withdraws the offer.

Open
OID
08faf5…d60f:88
SetOwner details

Inspect func

AcceptOwner

func()

AcceptOwner takes the owner role, by the one named (a user or a realm).

Open
OID
08faf5…d60f:89
AcceptOwner details

Inspect func

plain

func(s string, what string)

plain refuses control characters and anything the pages would read as markup or that breaks their JSON.

Open
OID
08faf5…d60f:93
plain details

Inspect func

parsePanels

func(s string, n int) ([]uint64, int)

parsePanels reads "3", "0-8", "0-8,27-35" against n panels: the set as bits and how many.

Open
OID
08faf5…d60f:95
parsePanels details

Inspect func

overlaps

func(a []uint64, b []uint64) bool
Open
OID
08faf5…d60f:96
overlaps details

Inspect func

canonical

func(bits []uint64, n int) string

canonical writes a set of panels as sorted ranges: "0-8,27-35".

Open
OID
08faf5…d60f:97
canonical details

Inspect func

Render

func(path string) string

Render: "" the station's market; "json" its settings; "json/week/\<start>" a week's bids and winners; "json/ad/\<id>" an ad; "json/pending" the ads waiting; "json/owed" who is owed refunds; "json/by/\<address>" one address's own ads and bids, every state, and what it is owed.

Open
OID
08faf5…d60f:98
Render details

Inspect func

Unsettled

func() []int64

Unsettled is the latest ten weeks that have started, hold bids, and were never settled.

Open
OID
08faf5…d60f:102
Unsettled details

Inspect func

bidJSON

func(x *adstation.Offer) string
Open
OID
08faf5…d60f:103
bidJSON details

Inspect func

adJSON

func(a *adstation.Ad) string
Open
OID
08faf5…d60f:104
adJSON details

Inspect func

weekJSON

func(start int64) string
Open
OID
08faf5…d60f:106
weekJSON details

Inspect func

byJSON

func(who .uverse.address) string

byJSON is one address's own record: its latest ads (with their state and any reason they were turned down) and bids (every state: open, won, lost, bumped, refunded), and what it is owed. The weeks' lists carry only their listed bids; this is where an advertiser sees what happened to the others.

Open
OID
08faf5…d60f:108
byJSON details

Inspect func

writeWinners

func(b *strings.Builder, w int64)
Open
OID
08faf5…d60f:111
writeWinners details

Inspect func

gnot

func(ugnot int64) string

gnot formats ugnot as GNOT, the trailing zeros trimmed.

Open
OID
08faf5…d60f:112
gnot details

Inspect func
pkgPath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/adstation"
coldKey : .uverse.address =<gnolang.StringValue>
GNOT : untyped string ="ugnot"
WeekLen : int64 =604800
Monday0 : int64 =345600
CloseAhead : int64 =86400
AheadWeeks : int64 =8
MaxPanels : untyped bigint =(1024 <untyped> bigint)
MaxBidsWeek : untyped bigint =(200 <untyped> bigint)
MaxBidsBidderWeek : untyped bigint =(10 <untyped> bigint)
MaxOpenBidsAd : untyped bigint =(32 <untyped> bigint)
MaxPending : untyped bigint =(100 <untyped> bigint)
MaxPendingOwner : untyped bigint =(5 <untyped> bigint)
maxRejectMany : untyped bigint =(10 <untyped> bigint)
maxTitle : untyped bigint =(60 <untyped> bigint)
maxReason : untyped bigint =(120 <untyped> bigint)
maxPanelsSpec : untyped bigint =(2000 <untyped> bigint)
listMax : untyped bigint =(50 <untyped> bigint)
defaultPanels : untyped bigint =(108 <untyped> bigint)
defaultMinBid : untyped bigint =(100000000 <untyped> bigint)
Ad : type =adstation.Ad
Offer : type =adstation.Offer
Week : type =adstation.Week
owner : .uverse.address =<gnolang.StringValue>
nextOwner : .uverse.address =<zero>
approvers : v0.Tree Inspect
minBid : int64 =100000000
panels : int =108
paused : bool =false
ads : v0.Tree Inspect
bids : v0.Tree Inspect
weeks : v0.Tree Inspect
owed : v0.Tree Inspect
lastAd : int64 =0
lastBid : int64 =0
byOwner : v0.Tree Inspect
byBidder : v0.Tree Inspect
pending : int =0
pendingBy : v0.Tree Inspect
earned : int64 =0
init.41 : func() Inspect
WeekOf : func(t int64) int64 Inspect
ThisWeek : func() int64 Inspect
NextWeek : func() int64 Inspect
Closes : func(week int64) int64 Inspect
isWeek : func(w int64) bool Inspect
Owner : func() .uverse.address Inspect
NextOwner : func() .uverse.address Inspect
IsApprover : func(a .uverse.address) bool Inspect
MinBid : func() int64 Inspect
Panels : func() int Inspect
Paused : func() bool Inspect
Earned : func() int64 Inspect
Treasury : func() .uverse.address Inspect
Address : func() .uverse.address Inspect
Owed : func(a .uverse.address) int64 Inspect
GetAd : func(id int64) adstation.Ad Inspect
GetBid : func(id int64) adstation.Offer Inspect
Approvers : func() [].uverse.address Inspect
pad : func(n int64) string Inspect
ad : func(id int64) *adstation.Ad Inspect
bid : func(id int64) *adstation.Offer Inspect
weekRec : func(w int64) *adstation.Week Inspect
caller : func() .uverse.address Inspect
payer : func() .uverse.address Inspect
sent : func() int64 Inspect
credit : func(to .uverse.address, ugnot int64) Inspect
pay : func(to .uverse.address, ugnot int64) Inspect
Bid : func(week int64, panelSpec string, image string, link string, title string) int64 Inspect
BidAd : func(adID int64, week int64, panelSpec string) int64 Inspect
appendTo : func(t *v0.Tree, who .uverse.address, id int64) Inspect
queueRoom : func(who .uverse.address) Inspect
waitingOf : func(o .uverse.address) int Inspect
queue : func(a *adstation.Ad) Inspect
unqueue : func(a *adstation.Ad) Inspect
admit : func(who .uverse.address, week int64, panelSpec string, ugnot int64) (int, []uint64, int, int64) Inspect
place : func(who .uverse.address, a *adstation.Ad, week int64, n int, bits []uint64, count int, ugnot int64, bump int64) int64 Inspect
Raise : func(bidID int64) Inspect
mustApprove : func() .uverse.address Inspect
Approve : func(adID int64) Inspect
Reject : func(adID int64, reason string) Inspect
RejectMany : func(adIDs string, reason string) int Inspect
checkReason : func(reason string) Inspect
reject : func(a *adstation.Ad, who .uverse.address, reason string) Inspect
unlist : func(b *adstation.Offer) Inspect
Settle : func(week int64) int64 Inspect
dropOpen : func(b *adstation.Offer) Inspect
allocate : func(w *adstation.Week) []int64 Inspect
greedy : func(order []*adstation.Offer, n int) ([]int64, int64, int) Inspect
byAmount : type =adstation.byAmount
byPrice : type =adstation.byPrice
Winners : func(week int64) []int64 Inspect
Withdraw : func() int64 Inspect
PayOut : func(to .uverse.address) int64 Inspect
payOut : func(to .uverse.address) int64 Inspect
mustOwn : func() .uverse.address Inspect
AddApprover : func(a .uverse.address) Inspect
RemoveApprover : func(a .uverse.address) Inspect
SetMinBid : func(ugnot int64) Inspect
SetPanels : func(n int) Inspect
SetPaused : func(p bool) Inspect
SetOwner : func(to .uverse.address) Inspect
AcceptOwner : func() Inspect
checkImage : func(s string) Inspect
checkTitle : func(s string) Inspect
plain : func(s string, what string) Inspect
words : func(n int) int Inspect
parsePanels : func(s string, n int) ([]uint64, int) Inspect
overlaps : func(a []uint64, b []uint64) bool Inspect
canonical : func(bits []uint64, n int) string Inspect
Render : func(path string) string Inspect
q : func(s string) string Inspect
i64 : func(n int64) string Inspect
stateJSON : func() string Inspect
Unsettled : func() []int64 Inspect
bidJSON : func(x *adstation.Offer) string Inspect
adJSON : func(a *adstation.Ad) string Inspect
ids : func(xs []int64) string Inspect
weekJSON : func(start int64) string Inspect
pendingJSON : func() string Inspect
byJSON : func(who .uverse.address) string Inspect
owedJSON : func() string Inspect
home : func() string Inspect
writeWinners : func(b *strings.Builder, w int64) Inspect
gnot : func(ugnot int64) string Inspect