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 stringValue
"ugnot"
WeekLen
int64Value
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 bigintValue
(60 <untyped> bigint)
maxLink
untyped bigintValue
(200 <untyped> bigint)
maxReason
untyped bigintValue
(120 <untyped> bigint)
maxPanelsSpec
untyped bigintValue
(2000 <untyped> bigint)
listMax
untyped bigintValue
(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
typeAd is one approved-or-not picture with its link and title; immutable once made, so an approval covers exactly it.
Value
adstation.Ad
Offer
typeOffer 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
typeWeek holds a week's bids and, once settled, its winners.
Value
adstation.Week
owner
.uverse.addressValue
<gnolang.StringValue>
nextOwner
.uverse.addressValue
<zero>
approvers
v0.Tree// address → true
- OID
- 08faf5…d60f:6
approvers details
minBid
int64Value
100000000
panels
intValue
108
paused
boolValue
false
ads
v0.Tree// padded id → \*Ad
- OID
- 08faf5…d60f:11
ads details
bids
v0.Tree// padded id → \*Offer
- OID
- 08faf5…d60f:13
bids details
weeks
v0.Tree// padded start → \*Week
- OID
- 08faf5…d60f:15
weeks details
owed
v0.Tree// address → int64 ugnot
- OID
- 08faf5…d60f:17
owed details
lastAd
int64Value
0
lastBid
int64Value
0
byOwner
v0.Tree// advertiser → \[]int64: their latest ads, oldest first (their own record: json/by/\<address>)
- OID
- 08faf5…d60f:21
byOwner details
byBidder
v0.Tree// bidder → \[]int64: their latest bids, oldest first — a bumped or refunded bid leaves its week, not this
- OID
- 08faf5…d60f:23
byBidder details
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
- OID
- 08faf5…d60f:26
pendingBy details
earned
int64// all weeks' winning bids, paid to the treasury
Value
0
init.41
func()- OID
- 08faf5…d60f:28
init.41 details
WeekOf
func(t int64) int64WeekOf is the start of the week holding t (unix seconds).
- OID
- 08faf5…d60f:30
WeekOf details
ThisWeek
func() int64ThisWeek is the start of the week running now; NextWeek the one after it.
- OID
- 08faf5…d60f:31
ThisWeek details
NextWeek
func() int64- OID
- 08faf5…d60f:32
NextWeek details
Closes
func(week int64) int64Closes is when bidding for a week ends.
- OID
- 08faf5…d60f:33
Closes details
isWeek
func(w int64) bool- OID
- 08faf5…d60f:34
isWeek details
Owner
func() .uverse.address- OID
- 08faf5…d60f:35
Owner details
NextOwner
func() .uverse.address- OID
- 08faf5…d60f:36
NextOwner details
IsApprover
func(a .uverse.address) bool- OID
- 08faf5…d60f:37
IsApprover details
MinBid
func() int64- OID
- 08faf5…d60f:38
MinBid details
Panels
func() int- OID
- 08faf5…d60f:39
Panels details
Paused
func() bool- OID
- 08faf5…d60f:40
Paused details
Earned
func() int64- OID
- 08faf5…d60f:41
Earned details
Treasury
func() .uverse.address- OID
- 08faf5…d60f:42
Treasury details
Address
func() .uverse.address- OID
- 08faf5…d60f:43
Address details
Owed
func(a .uverse.address) int64Owed is what an address could withdraw now: refunds of lost and turned-down bids.
- OID
- 08faf5…d60f:44
Owed details
GetAd
func(id int64) adstation.AdGetAd and GetBid are copies.
- OID
- 08faf5…d60f:45
GetAd details
GetBid
func(id int64) adstation.Offer- OID
- 08faf5…d60f:46
GetBid details
Approvers
func() [].uverse.address- OID
- 08faf5…d60f:47
Approvers details
pad
func(n int64) string- OID
- 08faf5…d60f:48
pad details
ad
func(id int64) *adstation.Ad- OID
- 08faf5…d60f:49
ad details
bid
func(id int64) *adstation.Offer- OID
- 08faf5…d60f:50
bid details
weekRec
func(w int64) *adstation.Week- OID
- 08faf5…d60f:51
weekRec details
caller
func() .uverse.address- OID
- 08faf5…d60f:52
caller details
payer
func() .uverse.address- OID
- 08faf5…d60f:53
payer details
sent
func() int64sent is the ugnot carried by the call; any other coin is refused.
- OID
- 08faf5…d60f:54
sent details
credit
func(to .uverse.address, ugnot int64)- OID
- 08faf5…d60f:55
credit details
pay
func(to .uverse.address, ugnot int64)- OID
- 08faf5…d60f:56
pay details
Bid
func(week int64, panelSpec string, image string, link string, title string) int64Bid 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.
- OID
- 08faf5…d60f:57
Bid details
BidAd
func(adID int64, week int64, panelSpec string) int64BidAd bids again with an ad of yours, approved or still waiting: the GNOT sent is the bid.
- OID
- 08faf5…d60f:58
BidAd details
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).
- OID
- 08faf5…d60f:59
appendTo details
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.
- OID
- 08faf5…d60f:60
queueRoom details
waitingOf
func(o .uverse.address) int- OID
- 08faf5…d60f:61
waitingOf details
queue
func(a *adstation.Ad)- OID
- 08faf5…d60f:62
queue details
unqueue
func(a *adstation.Ad)- OID
- 08faf5…d60f:63
unqueue details
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).
- OID
- 08faf5…d60f:64
admit details
place
func(who .uverse.address, a *adstation.Ad, week int64, n int, bits []uint64, count int, ugnot int64, bump int64) int64place writes an admitted bid, after the bid it bumps (if any) is refunded and out of the week.
- OID
- 08faf5…d60f:65
place details
Raise
func(bidID int64)Raise adds the GNOT sent to an open bid of yours, before its week closes.
- OID
- 08faf5…d60f:66
Raise details
mustApprove
func() .uverse.address- OID
- 08faf5…d60f:67
mustApprove details
Approve
func(adID int64)Approve passes a waiting ad: its bids compete when their weeks settle.
- OID
- 08faf5…d60f:68
Approve details
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.
- OID
- 08faf5…d60f:69
Reject details
RejectMany
func(adIDs string, reason string) intRejectMany 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.
- OID
- 08faf5…d60f:70
RejectMany details
checkReason
func(reason string)- OID
- 08faf5…d60f:71
checkReason details
reject
func(a *adstation.Ad, who .uverse.address, reason string)- OID
- 08faf5…d60f:72
reject details
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.
- OID
- 08faf5…d60f:73
unlist details
Settle
func(week int64) int64Settle 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.
- OID
- 08faf5…d60f:74
Settle details
dropOpen
func(b *adstation.Offer)- OID
- 08faf5…d60f:75
dropOpen details
allocate
func(w *adstation.Week) []int64allocate 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.
- OID
- 08faf5…d60f:76
allocate details
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.
- OID
- 08faf5…d60f:77
greedy details
byAmount
typebyAmount orders bids by the whole amount, then price per panel, then the earlier id.
Value
adstation.byAmount
byPrice
typebyPrice orders bids best first: price per panel (cross-multiplied, no rounding), then amount, then the earlier id.
Value
adstation.byPrice
Winners
func(week int64) []int64Winners is the week's winning bids: final once it is settled, else as things stand now.
- OID
- 08faf5…d60f:78
Winners details
Withdraw
func() int64Withdraw pays you what you are owed.
- OID
- 08faf5…d60f:79
Withdraw details
PayOut
func(to .uverse.address) int64PayOut pays an address what it is owed; anyone may call it for anyone (the money has one destination).
- OID
- 08faf5…d60f:80
PayOut details
payOut
func(to .uverse.address) int64- OID
- 08faf5…d60f:81
payOut details
mustOwn
func() .uverse.address- OID
- 08faf5…d60f:82
mustOwn details
AddApprover
func(a .uverse.address)AddApprover and RemoveApprover name who may pass or turn down ads.
- OID
- 08faf5…d60f:83
AddApprover details
RemoveApprover
func(a .uverse.address)- OID
- 08faf5…d60f:84
RemoveApprover details
SetMinBid
func(ugnot int64)SetMinBid sets the least bid, in ugnot, for bids placed from now on.
- OID
- 08faf5…d60f:85
SetMinBid details
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).
- OID
- 08faf5…d60f:86
SetPanels details
SetPaused
func(p bool)SetPaused stops (true) or resumes new bids and raises; approving, settling and refunds go on.
- OID
- 08faf5…d60f:87
SetPaused details
SetOwner
func(to .uverse.address)SetOwner names the next owner; nothing changes until they AcceptOwner. "" withdraws the offer.
- OID
- 08faf5…d60f:88
SetOwner details
AcceptOwner
func()AcceptOwner takes the owner role, by the one named (a user or a realm).
- OID
- 08faf5…d60f:89
AcceptOwner details
checkImage
func(s string)- OID
- 08faf5…d60f:90
checkImage details
checkLink
func(s string)checkLink: https only, from a character set that cannot break the pages (markdown, JSON) that show it.
- OID
- 08faf5…d60f:91
checkLink details
checkTitle
func(s string)- OID
- 08faf5…d60f:92
checkTitle details
plain
func(s string, what string)plain refuses control characters and anything the pages would read as markup or that breaks their JSON.
- OID
- 08faf5…d60f:93
plain details
words
func(n int) int- OID
- 08faf5…d60f:94
words details
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.
- OID
- 08faf5…d60f:95
parsePanels details
overlaps
func(a []uint64, b []uint64) bool- OID
- 08faf5…d60f:96
overlaps details
canonical
func(bits []uint64, n int) stringcanonical writes a set of panels as sorted ranges: "0-8,27-35".
- OID
- 08faf5…d60f:97
canonical details
Render
func(path string) stringRender: "" 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.
- OID
- 08faf5…d60f:98
Render details
q
func(s string) string- OID
- 08faf5…d60f:99
q details
i64
func(n int64) string- OID
- 08faf5…d60f:100
i64 details
stateJSON
func() string- OID
- 08faf5…d60f:101
stateJSON details
Unsettled
func() []int64Unsettled is the latest ten weeks that have started, hold bids, and were never settled.
- OID
- 08faf5…d60f:102
Unsettled details
bidJSON
func(x *adstation.Offer) string- OID
- 08faf5…d60f:103
bidJSON details
adJSON
func(a *adstation.Ad) string- OID
- 08faf5…d60f:104
adJSON details
ids
func(xs []int64) string- OID
- 08faf5…d60f:105
ids details
weekJSON
func(start int64) string- OID
- 08faf5…d60f:106
weekJSON details
pendingJSON
func() string- OID
- 08faf5…d60f:107
pendingJSON details
byJSON
func(who .uverse.address) stringbyJSON 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.
- OID
- 08faf5…d60f:108
byJSON details
owedJSON
func() string- OID
- 08faf5…d60f:109
owedJSON details
home
func() string- OID
- 08faf5…d60f:110
home details
writeWinners
func(b *strings.Builder, w int64)- OID
- 08faf5…d60f:111
writeWinners details
gnot
func(ugnot int64) stringgnot formats ugnot as GNOT, the trailing zeros trimmed.
- OID
- 08faf5…d60f:112