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

bubblerumble5 state

Back to all declarations

MinWindow

int64

// seconds

Value

10

MaxWindow

int64

// 30 days

Value

2592000

MinLife

int64

// an hour

Value

3600

MaxLife

int64

// 30 days

Value

2592000

MinBasePrice

int64

// ugnot, 0.001 GNOT

Value

1000

MaxBasePrice

int64

// ugnot, 1,000,000 GNOT

Value

1000000000000

MaxNameLen

untyped bigint

Value

(40 <untyped> bigint)

HistoryLen

untyped bigint

// bids kept per pool for the feed

Value

(50 <untyped> bigint)

RosterMax

untyped bigint

// distinct bidders a pool pays dividends, team shares and the close split to

Value

(100 <untyped> bigint)

MaxBoost

int64

// the shortest clock a bid can buy is window/MaxBoost...

Value

10

MinClock

int64

// ...and never under five minutes: people must be able to answer

Value

300

PotShare

int64

Value

50

DivShare

int64

// to earlier bidders of the pool, pro-rata by weight

Value

30

RefShare

int64

// to the bidder's inviter

Value

10

CreatorShare

int64

Value

5

TreasuryShare

int64

// to the BUBBLE treasury: the token realm's sub-realm, spent only by the holders' vote

Value

5

TeamShare

int64

Value

35

ShotMaxBps

int64

// 1% a shot, whatever is paid

Value

100

ShotFair

int64

// chance in bps = ShotFair × shot / take (0.8 of fair odds)

Value

8000

ShotDelay

int64

// blocks after the shot was paid for before it can be revealed...

Value

3

ShotWindow

int64

// ...and how many more blocks it may still be revealed in: three blocks, as v3 drew; three rolls at most for the secret's holder

Value

2

MinShot

int64

// ugnot: no shot under 0.1 GNOT, so dust cannot make reveals cost more than they tip

Value

100000

RevealTip

int64

// ugnot: off every shot, to whoever reveals it

Value

20000

KeeperFresh

int64

// seconds: shots are sold only this soon after the keeper's last sign of life (it heartbeats every two minutes)

Value

300

LiveFloor

int64

// bps: no shots once the winner's live share has slid under a quarter (which also keeps every reveal window clear of the last day)

Value

2500

MaxCommits

untyped bigint

// unused commitments the queue holds at most

Value

(500 <untyped> bigint)

CommitBatch

untyped bigint

// hashes one Commit may bring

Value

(100 <untyped> bigint)

CommitCompact

untyped bigint

// used commitments kept before the queue is compacted

Value

(200 <untyped> bigint)

admin

.uverse.address

admin is the realm's deployer: the only address that may turn shots off.

Value

<gnolang.StringValue>

pkgPath

untyped string

pkgPath must match gnomod.toml: the realm's own address derives from it.

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble5"

bubblePath

untyped string

The BUBBLE treasury is the token realm's sub-realm for its \`treasury:spend\` kind (the realm bubbletreasury publishes the kind and says the same address): a distinct address the token's governor alone can spend from, after a vote of the holders. Derived here from the two paths, as the chain derives it.

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubble"

treasurySubpath

untyped string

The BUBBLE treasury is the token realm's sub-realm for its \`treasury:spend\` kind (the realm bubbletreasury publishes the kind and says the same address): a distinct address the token's governor alone can spend from, after a vote of the holders. Derived here from the two paths, as the chain derives it.

Value

"treasury-spend"

Entry

type

Value

bubblerumble5.Entry

Member

type

Member is a distinct bidder of a pool: dividends, team shares and the close split go to the roster. The flag is the one flown at the first bid here.

Value

bubblerumble5.Member

Shot

type

Shot is a shot at the bubble waiting to be revealed, or resolved.

Value

bubblerumble5.Shot

Pool

type

Value

bubblerumble5.Pool

Player

type

Player is what the realm remembers about an address across pools.

Value

bubblerumble5.Player

shotsOn

bool

Value

true

keeper

.uverse.address

// who commits and heartbeats (SetKeeper); the admin may too

Value

<gnolang.StringValue>

keeperSeen

time.Time

// the keeper's last Commit or Heartbeat

Open
OID
0d03f8…a482:15013
keeperSeen details

Inspect ref

commits

[]string (len=150)

// the hashes of the keeper's secrets (32 raw bytes each), in order; the first head are used

Open
OID
0d03f8…a482:8558
commits details (len=150)

+150 more Inspect slice

head

int

Value

64

voided

int64

// shots voided over all pools

Value

6

late

int64

// shots revealed after the first block of their window, over all pools

Value

58

players

map[.uverse.address]*bubblerumble5.Player
Open
OID
0d03f8…a482:13
players details

Inspect map

teamPaid

map[string]int64

// flag -> gross bid volume under it

Open
OID
0d03f8…a482:15
teamPaid details

Inspect map

teamWon

map[string]int64

// flag -> pots closed under it

Open
OID
0d03f8…a482:17
teamWon details

Inspect map

teamSize

map[string]int64

// flag -> players flying it

Open
OID
0d03f8…a482:19
teamSize details

Inspect map

realmAddr

.uverse.address

Value

<gnolang.StringValue>

treasuryAddr

.uverse.address

Value

<gnolang.StringValue>

treasuryPaid

int64

// the royalty over all pools

Value

365866189

TreasuryAddr

func() .uverse.address
Open
OID
0d03f8…a482:23
TreasuryAddr details

Inspect func

TreasuryPaid

func() int64

TreasuryPaid is what every pool of this realm has sent there.

Open
OID
0d03f8…a482:25
TreasuryPaid details

Inspect func

Price

func(base int64, n int64) int64

Price of the next bid in a pool with the given base price and n bids so far.

Open
OID
0d03f8…a482:26
Price details

Inspect func

ClockFor

func(window int64, price int64, sent int64) int64

ClockFor is the clock a bid buys by paying sent against a price: the window divided by the multiple paid, never below window/MaxBoost.

Open
OID
0d03f8…a482:27
ClockFor details

Inspect func

mulDiv

func(a int64, b int64, c int64) int64

mulDiv is a×b/c without overflowing on the way: pots and paid-ins are both in ugnot and their product passes int64 at a few thousand GNOT each.

Open
OID
0d03f8…a482:28
mulDiv details

Inspect func

ShotBps

func(shot int64, take int64) int64

ShotBps is the chance a shot buys against what a pop would pay, in basis points.

Open
OID
0d03f8…a482:29
ShotBps details

Inspect func

CreatePool

func(name string, window int64, basePrice int64, life int64) int64

CreatePool opens a pool. Any ugnot sent with the call seeds its pot. The creator earns CreatorShare of every bid. life is the pool's life in seconds from its first bid; 0 means ten windows (at least an hour, at most 30 days).

Open
OID
0d03f8…a482:30
CreatePool details

Inspect func

newPool

func(name string, creator .uverse.address, window int64, basePrice int64, life int64, seed int64) *bubblerumble5.Pool
Open
OID
0d03f8…a482:31
newPool details

Inspect func

Bid

func(id int64, ref string, flag string, shot int64)

Bid pays at least the current price and resets the clock. ref is the address that invited the bidder ("" for none; only the first bid ever sets it), flag a two-letter country to play under ("" keeps the last one; the flag is locked per pool at the first bid there), shot how much of the money sent is a shot at popping the bubble (0 for none): the rest must cover the price, and paying more than the price shortens the clock.

Open
OID
0d03f8…a482:32
Bid details

Inspect func

SetShots

func(on bool)

SetShots turns shots off (or on again); only the deployer may.

Open
OID
0d03f8…a482:33
SetShots details

Inspect func

SetKeeper

func(addr .uverse.address)

SetKeeper names the address that commits and heartbeats; only the deployer may. Every unused commitment is dropped with it: a rotated or compromised keeper's secrets never decide a shot.

Open
OID
0d03f8…a482:34
SetKeeper details

Inspect func

keeperCaller

func() .uverse.address
Open
OID
0d03f8…a482:35
keeperCaller details

Inspect func

keeperOrAdmin

func() .uverse.address
Open
OID
0d03f8…a482:36
keeperOrAdmin details

Inspect func

Heartbeat

func()

Heartbeat is the keeper's sign of life: shots are sold only within KeeperFresh of the last one (a Commit counts too).

Open
OID
0d03f8…a482:37
Heartbeat details

Inspect func

Commit

func(hashes string)

Commit queues the hashes of secrets the keeper will reveal later, in order, as a comma-separated list of 64 hex characters each; only the keeper, whose box holds the secrets. A hash still in the queue (used or not) is refused: a repeated secret would be public after its first reveal (a safety net against the keeper repeating itself; compaction forgets the oldest). The queue holds at most MaxCommits unused; the used ones in front of it are compacted away past CommitCompact.

Open
OID
0d03f8…a482:38
Commit details

Inspect func

Retire

func(n int64)

Retire drops the first n unused commitments: a keeper that lost the secrets behind them (the box rebuilt, the file gone) clears them so shots can go on. The deployer may too. It is not a sign of life.

Open
OID
0d03f8…a482:39
Retire details

Inspect func

Reveal

func(reveals string)

Reveal draws shots with the secrets behind their commitments: a comma-separated list of pool:shot:secretHex, any pools, in one transaction — the keeper sends every shot that is due in one call, so a run of shots on one block never outpaces it. Anyone may call it; the secret is the proof, and the caller is tipped RevealTip out of each shot revealed. Shots go in order: an earlier one still pending must come first (in the list, or before). An entry not yet due is skipped, one with a wrong secret or already resolved is skipped with an event, so a stale entry never voids the rest; a malformed one (no such pool or shot, a cancelled pool, not pool:shot:secret) aborts the whole call, which only the keeper's own bug could send. The reveal must land in the blocks CommitH+ShotDelay through CommitH+ShotDelay+ShotWindow; later, or on a pool that has closed, the shot is already void (settleShots runs first): into the pot as a miss. A hit pops the bubble: the pool closes now with the shooter as its winner, settled at Claim.

Open
OID
0d03f8…a482:40
Reveal details

Inspect func

Settle

func(id int64)

Settle voids the shots at a pool that nobody revealed in time, or that its close overtook. Anyone may call it; every bid, reveal and claim on the pool does the same first.

Open
OID
0d03f8…a482:41
Settle details

Inspect func

jif

func(c bool, a string, b string) string
Open
OID
0d03f8…a482:42
jif details

Inspect func

seedFor

func(poolID int64, t *bubblerumble5.Shot, secret []uint8, h int64) uint64

seedFor is the draw's seed: the secret with the shot's own facts and the reveal block's height and time. Everything but the secret is public, and the secret is the keeper's until the reveal; the block's time is the validators'.

Open
OID
0d03f8…a482:43
seedFor details

Inspect func

shotHits

func(seed uint64, bps int64) bool

shotHits is the draw: a uniform number in \[0, 10000) under the chance.

Open
OID
0d03f8…a482:44
shotHits details

Inspect func

Claim

func(id int64)

Claim settles a finished pool: everything is credited, and Withdraw sends it. TeamShare of the pot goes to the OTHER roster members flying the winner's flag, pro-rata by paid-in — or, when nobody else flew it, to all the other roster members. Of the rest, the live part (LiveBps) is the winner's and the shared part is split among the whole roster pro-rata by paid-in. A pool with a single bidder credits them everything. Rounding goes to the winner. Anyone may call it.

Open
OID
0d03f8…a482:45
Claim details

Inspect func

Cancel

func(id int64)

Cancel lets the creator take the seed back from a pool nobody has bid on.

Open
OID
0d03f8…a482:46
Cancel details

Inspect func

player

func(a .uverse.address) *bubblerumble5.Player
Open
OID
0d03f8…a482:47
player details

Inspect func

send

func(to .uverse.address, ugnot int64)
Open
OID
0d03f8…a482:48
send details

Inspect func

credit

func(to .uverse.address, ugnot int64)

credit books ugnot to an address; Withdraw pays it out.

Open
OID
0d03f8…a482:49
credit details

Inspect func

Withdraw

func() int64

Withdraw sends the caller everything credited to them: dividends, team shares, close splits, slices and won pots.

Open
OID
0d03f8…a482:50
Withdraw details

Inspect func

Owed

func(a .uverse.address) int64

Owed is what an address could withdraw right now.

Open
OID
0d03f8…a482:51
Owed details

Inspect func

pool

func(id int64) *bubblerumble5.Pool
Open
OID
0d03f8…a482:52
pool details

Inspect func

userCaller

func() .uverse.address
Open
OID
0d03f8…a482:53
userCaller details

Inspect func

cleanName

func(s string) string
Open
OID
0d03f8…a482:55
cleanName details

Inspect func

cleanFlag

func(s string) string

cleanFlag accepts a two-letter country code, upper-cased; anything else is "".

Open
OID
0d03f8…a482:56
cleanFlag details

Inspect func

GNOT

func(ugnot int64) string

GNOT formats ugnot as GNOT with the trailing zeros trimmed.

Open
OID
0d03f8…a482:60
GNOT details

Inspect func

short

func(a .uverse.address) string
Open
OID
0d03f8…a482:61
short details

Inspect func

Render

func(path string) string

Render serves gnoweb ("" and "\<id>") and the page ("json", "json/\<id>", "me/\<address>", "teams").

Open
OID
0d03f8…a482:63
Render details

Inspect func

jsonCommits

func() string

jsonCommits lists the unused commitments in order, hex, so a keeper that starts can tell which of them it holds the secrets for and Retire the rest.

Open
OID
0d03f8…a482:66
jsonCommits details

Inspect func

commitHead

func() string

commitHead is the next commitment a shot would take, hex, "" when none is free.

Open
OID
0d03f8…a482:67
commitHead details

Inspect func

jsonTeams

func() string

jsonTeams is the country leaderboard: paid in, won, and players per flag.

Open
OID
0d03f8…a482:69
jsonTeams details

Inspect func

jsonMe

func(a .uverse.address) string

jsonMe is what the page shows a connected wallet about itself.

Open
OID
0d03f8…a482:70
jsonMe details

Inspect func
MinWindow : int64 =10
MaxWindow : int64 =2592000
MinLife : int64 =3600
MaxLife : int64 =2592000
MinBasePrice : int64 =1000
MaxBasePrice : int64 =1000000000000
MaxNameLen : untyped bigint =(40 <untyped> bigint)
HistoryLen : untyped bigint =(50 <untyped> bigint)
RosterMax : untyped bigint =(100 <untyped> bigint)
MaxBoost : int64 =10
MinClock : int64 =300
PotShare : int64 =50
DivShare : int64 =30
RefShare : int64 =10
CreatorShare : int64 =5
TreasuryShare : int64 =5
TeamShare : int64 =35
ShotMaxBps : int64 =100
ShotFair : int64 =8000
ShotDelay : int64 =3
ShotWindow : int64 =2
MinShot : int64 =100000
RevealTip : int64 =20000
KeeperFresh : int64 =300
LiveFloor : int64 =2500
MaxCommits : untyped bigint =(500 <untyped> bigint)
CommitBatch : untyped bigint =(100 <untyped> bigint)
CommitCompact : untyped bigint =(200 <untyped> bigint)
admin : .uverse.address =<gnolang.StringValue>
pkgPath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble5"
bubblePath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubble"
treasurySubpath : untyped string ="treasury-spend"
Entry : type =bubblerumble5.Entry
Member : type =bubblerumble5.Member
Shot : type =bubblerumble5.Shot
Pool : type =bubblerumble5.Pool
Player : type =bubblerumble5.Player
shotsOn : bool =true
keeper : .uverse.address =<gnolang.StringValue>
keeperSeen : time.Time Inspect
commits : []string (len=150) Inspect
head : int =64
voided : int64 =6
late : int64 =58
pools : []*bubblerumble5.Pool (len=79) Inspect
players : map[.uverse.address]*bubblerumble5.Player Inspect
teamPaid : map[string]int64 Inspect
teamWon : map[string]int64 Inspect
teamSize : map[string]int64 Inspect
realmAddr : .uverse.address =<gnolang.StringValue>
treasuryAddr : .uverse.address =<gnolang.StringValue>
treasuryPaid : int64 =365866189
TreasuryAddr : func() .uverse.address Inspect
TreasuryPaid : func() int64 Inspect
Price : func(base int64, n int64) int64 Inspect
ClockFor : func(window int64, price int64, sent int64) int64 Inspect
mulDiv : func(a int64, b int64, c int64) int64 Inspect
ShotBps : func(shot int64, take int64) int64 Inspect
CreatePool : func(name string, window int64, basePrice int64, life int64) int64 Inspect
newPool : func(name string, creator .uverse.address, window int64, basePrice int64, life int64, seed int64) *bubblerumble5.Pool Inspect
Bid : func(id int64, ref string, flag string, shot int64) Inspect
SetShots : func(on bool) Inspect
SetKeeper : func(addr .uverse.address) Inspect
keeperCaller : func() .uverse.address Inspect
keeperOrAdmin : func() .uverse.address Inspect
Heartbeat : func() Inspect
Commit : func(hashes string) Inspect
Retire : func(n int64) Inspect
Reveal : func(reveals string) Inspect
Settle : func(id int64) Inspect
jif : func(c bool, a string, b string) string Inspect
seedFor : func(poolID int64, t *bubblerumble5.Shot, secret []uint8, h int64) uint64 Inspect
shotHits : func(seed uint64, bps int64) bool Inspect
Claim : func(id int64) Inspect
Cancel : func(id int64) Inspect
player : func(a .uverse.address) *bubblerumble5.Player Inspect
send : func(to .uverse.address, ugnot int64) Inspect
credit : func(to .uverse.address, ugnot int64) Inspect
Withdraw : func() int64 Inspect
Owed : func(a .uverse.address) int64 Inspect
pool : func(id int64) *bubblerumble5.Pool Inspect
userCaller : func() .uverse.address Inspect
ugnotSent : func() int64 Inspect
cleanName : func(s string) string Inspect
cleanFlag : func(s string) string Inspect
itoa : func(n int64) string Inspect
parseID : func(s string) int64 Inspect
parseNum : func(s string) int64 Inspect
GNOT : func(ugnot int64) string Inspect
short : func(a .uverse.address) string Inspect
dur : func(sec int64) string Inspect
Render : func(path string) string Inspect
unix : func(t time.Time) string Inspect
jbool : func(b bool) string Inspect
jsonCommits : func() string Inspect
commitHead : func() string Inspect
jsonAll : func() string Inspect
jsonTeams : func() string Inspect
jsonMe : func(a .uverse.address) string Inspect
markdownAll : func() string Inspect