RealmPath
untyped stringValue
"gno.land/r/g1k6cl2huxpps9fxls8tqyxknvl7fgq9hua3f2yt/fairdrop"
PackagePath
untyped stringValue
"gno.land/p/g1k6cl2huxpps9fxls8tqyxknvl7fgq9hua3f2yt/fairness"
PhaseOpen
untyped string// entries are being sealed
Value
"open"
PhaseReveal
untyped string// entries closed, secrets being revealed
Value
"reveal"
PhaseDrawable
untyped string// reveal window over, waiting for Draw
Value
"drawable"
PhaseDrawn
untyped string// winners recorded
Value
"drawn"
PhaseCancelled
untyped string// voided by the organizer before entries closed
Value
"cancelled"
MaxSlots
untyped bigintValue
(100 <untyped> bigint)
MaxWeightCap
untyped bigintValue
(100 <untyped> bigint)
MinWindowSeconds
untyped bigintValue
(30 <untyped> bigint)
MaxWindowSeconds
untyped bigintValue
(2592000 <untyped> bigint)
MaxTitleLen
untyped bigintValue
(80 <untyped> bigint)
MaxPrizeLen
untyped bigintValue
(240 <untyped> bigint)
Event
typeEvent is one draw.
Value
fairdrop.Event
events
[]*fairdrop.Event- OID
- 0d87f6…e18e:4
byID
map[uint64]*fairdrop.Event- OID
- 0d87f6…e18e:6
byID details
nextID
uint64Value
0
Create
func(title string, prize string, slots int, maxWeight int, regSeconds int, revealSeconds int) uint64Create opens a draw and returns its id. The organizer pays nothing: FairDrop never holds funds, it only records the draw.
- OID
- 0d87f6…e18e:8
Create details
Vouch
func(eventID uint64, who string, weight int)Vouch grants an address extra ticket weight before it seals its ticket. One ticket per address is the floor; a vouch is how an organizer recognises a member who should carry more weight (a role holder, an allowlisted guest). Weight cannot be granted after the address has sealed, because the sealed digest commits to the weight.
- OID
- 0d87f6…e18e:10
Vouch details
Register
func(eventID uint64, commit string, weight int)Register seals a ticket: commit is the hex SHA-256 of the entrant's secret bound to their address, this event and their weight. Weight must be 1 unless the organizer vouched for more.
- OID
- 0d87f6…e18e:11
Register details
Reveal
func(eventID uint64, secret string)Reveal opens a seal. It is accepted only inside the reveal window and only when the secret re-hashes to the seal already on chain.
- OID
- 0d87f6…e18e:12
Reveal details
Draw
func(eventID uint64)Draw records the winners. It is permissionless on purpose: once the reveal window is over the result is already determined by public data, so anyone — entrant, organizer or passer-by — may pay the gas to write it down.
- OID
- 0d87f6…e18e:13
Draw details
Cancel
func(eventID uint64)Cancel voids a draw before entries close. After close the entries are committed and only the draw can settle them.
- OID
- 0d87f6…e18e:14
Cancel details
EventCount
func() intEventCount is the number of events ever opened.
- OID
- 0d87f6…e18e:15
EventCount details
Winner
typeWinner is one recorded winner, resolved from the roster at render time.
Value
fairdrop.Winner
Proof
func(id uint64) stringProof returns the draw's verifiable inputs as a JSON object, so an off-chain checker can recompute the seed and the winners from chain state without trusting this realm's pages. Every value is an address, a hex digest or a printable-ASCII secret, so the JSON needs no escaping.
- OID
- 0d87f6…e18e:16
Proof details
GetEvent
func(id uint64) *fairdrop.EventGetEvent looks an event up by id, or nil.
- OID
- 0d87f6…e18e:17
GetEvent details
revealedCount
func(e *fairdrop.Event) int- OID
- 0d87f6…e18e:18
revealedCount details
mustEvent
func(id uint64) *fairdrop.Event- OID
- 0d87f6…e18e:19
mustEvent details
nowUnix
func() int64- OID
- 0d87f6…e18e:20
nowUnix details
require
func(ok bool, msg string)- OID
- 0d87f6…e18e:21
require details
errString
func(err .uverse.error) string- OID
- 0d87f6…e18e:22
errString details
uitoa
func(u uint64) string- OID
- 0d87f6…e18e:23
uitoa details
trimSpace
func(s string) string- OID
- 0d87f6…e18e:24
trimSpace details
normalizeAddress
func(s string) stringnormalizeAddress accepts the shape of a bech32 gno address (g1 + 38 lower-case alphanumerics) as typed. It deliberately does not convert through the address type: a bad checksum would panic, and vouching for an address nobody holds is harmless — the vouch just never matches a ticket.
- OID
- 0d87f6…e18e:25
normalizeAddress details
gnowebURL
func(pkgPath string) stringgnowebURL turns a package path into the path part of its gnoweb URL by dropping the chain domain: gno.land/r/x/y -> /r/x/y.
- OID
- 0d87f6…e18e:26
gnowebURL details
Render
func(path string) stringRender dispatches gnoweb paths: "" board home: open and past draws "event/<id>" one draw, with the actions it accepts right now "event/<id>/verify" the seed's inputs and how to recompute it "event/<id>/receipt/<rank>" "create" how to open a draw
- OID
- 0d87f6…e18e:28
Render details
renderHome
func() string- OID
- 0d87f6…e18e:29
renderHome details
renderEvent
func(id uint64) string- OID
- 0d87f6…e18e:30
renderEvent details
renderActions
func(b *strings.Builder, e *fairdrop.Event, ph string)- OID
- 0d87f6…e18e:31
renderActions details
renderRoster
func(b *strings.Builder, e *fairdrop.Event, ph string)- OID
- 0d87f6…e18e:32
renderRoster details
renderResult
func(b *strings.Builder, e *fairdrop.Event)- OID
- 0d87f6…e18e:33
renderResult details
renderVerify
func(id uint64) string- OID
- 0d87f6…e18e:34
renderVerify details
renderReceipt
func(id uint64, rank int) string- OID
- 0d87f6…e18e:35
renderReceipt details
renderCreate
func() string- OID
- 0d87f6…e18e:36
renderCreate details
renderNotFound
func(path string) string- OID
- 0d87f6…e18e:37
renderNotFound details
phaseBadge
func(ph string) string- OID
- 0d87f6…e18e:38
phaseBadge details
phaseTick
func(active bool) string- OID
- 0d87f6…e18e:39
phaseTick details
closeLine
func(e *fairdrop.Event, now int64) string- OID
- 0d87f6…e18e:40
closeLine details
left
func(until int64, from int64) stringleft renders a positive duration in seconds as "2d 3h", "4h 12m", "3m 40s".
- OID
- 0d87f6…e18e:41
left details
stamp
func(unix int64) stringstamp renders a unix second in both UTC and KST, the two clocks this board's audience reads.
- OID
- 0d87f6…e18e:42
stamp details
short
func(s string) string- OID
- 0d87f6…e18e:43
short details
cell
func(s string) stringcell keeps a free-text field from breaking a markdown table.
- OID
- 0d87f6…e18e:44
cell details
quoteList
func(items []string) string- OID
- 0d87f6…e18e:45
quoteList details
parseUint
func(s string) (uint64, bool)- OID
- 0d87f6…e18e:46