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

bubblerumble3 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

55

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

TeamShare

int64

Value

35

ShotCap

int64

// ugnot: the most a shot can take, 10 GNOT

Value

10000000

ShotMaxBps

int64

// 1% a shot, whatever is paid

Value

100

ShotFair

int64

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

Value

8000

ShotDelay

int64

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

Value

3

ShotWindow

int64

// ...and how many more blocks it may still be drawn in

Value

2

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/bubblerumble3"

Entry

type

Value

bubblerumble3.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

bubblerumble3.Member

Shot

type

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

Value

bubblerumble3.Shot

Pool

type

Value

bubblerumble3.Pool

Player

type

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

Value

bubblerumble3.Player

shotsOn

bool

Value

true

players

map[.uverse.address]*bubblerumble3.Player
Open
OID
0e55e1…d964:6
players details

Inspect map

teamPaid

map[string]int64

// flag -> gross bid volume under it

Open
OID
0e55e1…d964:8
teamPaid details

Inspect map

teamWon

map[string]int64

// flag -> pots closed under it

Open
OID
0e55e1…d964:10
teamWon details

Inspect map

teamSize

map[string]int64

// flag -> players flying it

Open
OID
0e55e1…d964:12
teamSize details

Inspect map

realmAddr

.uverse.address

Value

<gnolang.StringValue>

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
0e55e1…d964:14
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
0e55e1…d964:16
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
0e55e1…d964:17
mulDiv details

Inspect func

ShotBps

func(shot int64, prize int64) int64

ShotBps is the chance a shot buys against a prize, in basis points.

Open
OID
0e55e1…d964:18
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
0e55e1…d964:19
CreatePool details

Inspect func

newPool

func(name string, creator .uverse.address, window int64, basePrice int64, life int64, seed int64) *bubblerumble3.Pool
Open
OID
0e55e1…d964:20
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
0e55e1…d964:21
Bid details

Inspect func

SetShots

func(on bool)

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

Open
OID
0e55e1…d964:22
SetShots details

Inspect func

Draw

func(id int64)

Draw draws the shots at a pool that are due. Anyone may call it; every bid and claim on the pool does the same first.

Open
OID
0e55e1…d964:23
Draw details

Inspect func

seedFor

func(poolID int64, t *bubblerumble3.Shot, h int64) uint64
Open
OID
0e55e1…d964:24
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
0e55e1…d964:25
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
0e55e1…d964:26
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
0e55e1…d964:27
Cancel details

Inspect func

player

func(a .uverse.address) *bubblerumble3.Player
Open
OID
0e55e1…d964:28
player details

Inspect func

send

func(to .uverse.address, ugnot int64)
Open
OID
0e55e1…d964:29
send details

Inspect func

credit

func(to .uverse.address, ugnot int64)

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

Open
OID
0e55e1…d964:30
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
0e55e1…d964:31
Withdraw details

Inspect func

Owed

func(a .uverse.address) int64

Owed is what an address could withdraw right now.

Open
OID
0e55e1…d964:32
Owed details

Inspect func

pool

func(id int64) *bubblerumble3.Pool
Open
OID
0e55e1…d964:33
pool details

Inspect func

userCaller

func() .uverse.address
Open
OID
0e55e1…d964:34
userCaller details

Inspect func

cleanName

func(s string) string
Open
OID
0e55e1…d964:36
cleanName details

Inspect func

cleanFlag

func(s string) string

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

Open
OID
0e55e1…d964:37
cleanFlag details

Inspect func

GNOT

func(ugnot int64) string

GNOT formats ugnot as GNOT with the trailing zeros trimmed.

Open
OID
0e55e1…d964:40
GNOT details

Inspect func

short

func(a .uverse.address) string
Open
OID
0e55e1…d964:41
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
0e55e1…d964:43
Render details

Inspect func

jsonTeams

func() string

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

Open
OID
0e55e1…d964:47
jsonTeams details

Inspect func

jsonMe

func(a .uverse.address) string

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

Open
OID
0e55e1…d964:48
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 =55
DivShare : int64 =30
RefShare : int64 =10
CreatorShare : int64 =5
TeamShare : int64 =35
ShotCap : int64 =10000000
ShotMaxBps : int64 =100
ShotFair : int64 =8000
ShotDelay : int64 =3
ShotWindow : int64 =2
admin : .uverse.address =<gnolang.StringValue>
pkgPath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3"
Entry : type =bubblerumble3.Entry
Member : type =bubblerumble3.Member
Shot : type =bubblerumble3.Shot
Pool : type =bubblerumble3.Pool
Player : type =bubblerumble3.Player
shotsOn : bool =true
pools : []*bubblerumble3.Pool (len=46) Inspect
players : map[.uverse.address]*bubblerumble3.Player Inspect
teamPaid : map[string]int64 Inspect
teamWon : map[string]int64 Inspect
teamSize : map[string]int64 Inspect
realmAddr : .uverse.address =<gnolang.StringValue>
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, prize 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) *bubblerumble3.Pool Inspect
Bid : func(id int64, ref string, flag string, shot int64) Inspect
SetShots : func(on bool) Inspect
Draw : func(id int64) Inspect
seedFor : func(poolID int64, t *bubblerumble3.Shot, 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) *bubblerumble3.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) *bubblerumble3.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
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
jsonAll : func() string Inspect
jsonTeams : func() string Inspect
jsonMe : func(a .uverse.address) string Inspect
markdownAll : func() string Inspect