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 package

Overview

Package bubblerumble3 is the third Bubble Rumble realm. v2's money stays: of every bid 55% goes to the pot, 30% is paid at once to the pool's earlier bidders pro-rata to what they paid in, 10% to whoever invited the bidder, 5% to the pool's creator. What v3 adds:

  • A last day. Every pool has a life (creator-set, 1h..30d) that starts at its first bid. The pool closes when its clock runs out OR its life does, whichever comes first. While the life runs out, the winner's share slides toward nothing and that part of the pot is instead split among all the pool's bidders pro-rata to what they paid in. A pool still contested on its last day ends as a shared pot, so nobody is stuck in a loop and bots gain nothing by outlasting people.

  • Flag war. At the close, TeamShare of the pot goes to the OTHER bidders who flew the winner's flag, pro-rata by paid-in; the winner never takes it. A winner whose flag nobody else flew hands it to all the other bidders instead, so a private flag buys nothing. A flag is locked per pool at the first bid there. The winner's own part is what slides.

  • Rebidding on yourself is allowed (it pays the others as any bid does).

  • Earnings are credited, not pushed: dividends, team shares and the close split accrue to each address and Withdraw sends them, so no bid or close ever loops over a hundred transfers, and nothing can brick a pool.

  • A bid's clock can be shortened by paying more, but never under MinClock, so paying up is never a way to close a pool before anyone can answer.

  • Shots. A bid may carry extra money as a shot at the bubble: a chance to pop it at once. The chance is 0.8 × shot / prize, at most 1% a shot, where the prize is the pot or ShotCap, whichever is smaller; a pot over ShotCap pays a ShotCap slice instead of popping. The shot goes into the pot, hit or miss, and every miss is counted on the bubble.

    The draw is the chain's block time, which on tm2 is the median of the validators' vote timestamps for the block before: public one block ahead, and nudgeable by a validator who is the median vote. Two things follow. A shot is drawn only in the blocks ShotDelay to ShotDelay+ ShotWindow after it was paid for, by whoever touches the pool then, and is void after that: a shooter cannot wait for a block whose time suits them, and the two blocks of leeway are worth less than the bid a shot must ride on. And the prize is capped at ShotCap, small enough that a validator grinding a timestamp is stealing lunch money, with SetShots as the switch if one does. Raise the cap when gno.land has real randomness.

Functions

Bid

func Bid(cur realm, 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.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Bid" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Bid" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Cancel

func Cancel(cur realm, id int64)

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

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Cancel" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Cancel" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Claim

func Claim(cur realm, 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.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Claim" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Claim" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

ClockFor

func ClockFor(window, price, 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.

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3.ClockFor(,,)"

Result

CreatePool

func CreatePool(cur realm, 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).

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "CreatePool" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "CreatePool" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

Draw

func Draw(cur realm, 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.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Draw" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Draw" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

GNOT

func GNOT(ugnot int64) string

GNOT formats ugnot as GNOT with the trailing zeros trimmed.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3.GNOT()"

Result

Owed

func Owed(a address) int64

Owed is what an address could withdraw right now.

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3.Owed()"

Result

Price

func Price(base, n int64) int64

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3.Price(,)"

Result

Render

func Render(path string) string

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

Param

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3.Render()"

Result

SetShots

func SetShots(cur realm, on bool)

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

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "SetShots" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "SetShots" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx
  

ShotBps

func ShotBps(shot, prize int64) int64

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3.ShotBps(,)"

Result

Withdraw

func Withdraw(cur realm) int64

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

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Withdraw" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "gnoland-1" -remote "https://rpc.gno.land" ADDRESSgnokey query -remote "https://rpc.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubblerumble3" -func "Withdraw" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "gnoland-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land" call.tx