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

bubble source realm

Package bubble is BUBBLE, the Bubble Rumble token: a GRC20 that remembers voting power (kourt's grc20votes), minted b...

Overview

Package bubble is BUBBLE, the Bubble Rumble token: a GRC20 that remembers voting power (kourt's grc20votes), minted by the box for referrals under hard caps, and governed by kourt's governor on the same ledger.

What is fixed here and what is not. The identity, the decimals, the max supply, the premine and the split between the referral pool and the reserve are constants: a realm cannot be redeployed at its path, so a number that must never move is a constant, not a setting. Who administers, who mints, whether minting is paused and how much may be minted a day are settings — the admin's until the holders vote them away (kinds.gno).

The box (presence/bubble.go) decides which referral earns what; this realm only enforces the walls: the supply, the pools, the daily ceiling, the batch shape. See growth/BUBBLE.md.

Constants 2

const ReserveMaxPer, ReserveGap, turnoutKeep

1const (
2	ReserveMaxPer = 2_000_000 * one          // per proposal
3	ReserveGap    = int64(90 * 24 * 60 * 60) // seconds between two reserve mints: a full drain is 25 votes over 6 years
4	turnoutKeep   = 8                        // money votes the mean remembers
5)
source

The money kinds (everything but the signal) pass on kourt's own terms (Jae, room 201: "use the system from kourt.xyz … it should auto adjust"): a fifth of the supply turning out, two thirds of yes+no, a week to vote, two days' delay, a fortnight's grace — and the turnout bar ADJUSTS: it is the greater of that fifth and the mean turnout of the last few money votes (never above a third of the supply), kourt's min(X̄, votable/3) with the bootstrap fifth as the base. Nobody sets it; the holders' own habit does. A signal decides nothing and asks less.

const MaxSupply, premine, ReferralPool, Reserve, MaxBatch, MaxEntry

1const (
2	MaxSupply    = 100_000_000 * one
3	premine      = 10_000_000 * one // Jae's, at init
4	ReferralPool = 40_000_000 * one // the minter's, for referrals, under the day cap
5	Reserve      = 50_000_000 * one // the holders', by govern:reserve only
6
7	MaxBatch = 100          // entries in one MintMany
8	MaxEntry = 50_000 * one // per address per batch: room for a big inviter's day, never a whole day's cap
9)
source

The supply, in three pools that add up to the maximum and never mix.

Functions 51

func Approve

crossing Action
1func Approve(cur realm, spender address, amount int64)
source

Approve lets a spender move some of the caller's balance.

func Burn

crossing Action
1func Burn(cur realm, amount int64)
source

Burn destroys the caller's own tokens. What is burned is gone from the supply and never re-minted: the pools count what was minted, not what exists.

func Cancel

crossing Action
1func Cancel(cur realm, id int64)
source

Cancel withdraws the proposer's own open proposal.

func Delegate

crossing Action
1func Delegate(cur realm, to address)
source

Delegate points the caller's voting power at someone else (one hop; self is the default).

func Execute

crossing Action
1func Execute(cur realm, id int64)
source

Execute runs a decided proposal after its delay. Permissionless.

func Mint

crossing Action
1func Mint(cur realm, to address, amount int64)
source

Mint credits one address. The minter's hand tool; the box mints through MintMany.

func MintMany

crossing Action
1func MintMany(cur realm, batchID string, list string)
source

MintMany credits a batch: "g1…:amount,g1…:amount" (base units), at most MaxBatch entries, no address twice, under the pool and the day cap. All or nothing — a bad entry panics, which aborts the whole transaction, and names the entry ("entry 3 g1…: over today's cap") so the box can drop it and send the rest. batchID is eight ASCII digits that must exceed the last one landed, so a batch the box re-sends after a lost receipt cannot land twice.

func MintedToday

Action
1func MintedToday() (minted, ceiling int64)
source

MintedToday is what the minter has minted on the current UTC day, and the day's cap.

func Offer

crossing Action
1func Offer(cur realm, k Kind, r Rules)
source

Offer publishes a kind. It grants nothing: the holders adopt it by vote.

func Propose

crossing Action
1func Propose(cur realm, kind, payload, title string) int64
source

Propose asks a question under an adopted kind. A money kind carries its absolute turnout floor (kinds.gno).

func Render

1func Render(path string) string
source

Render: "" the front page (the token's figures, then the governor's page); "gov/…" the governor's pages alone; "json" the figures for the box; "me/<addr>" one holder's balance and votes.

func RenounceAdmin

crossing Action
1func RenounceAdmin(cur realm)
source

RenounceAdmin gives the settings up for good: from here they move only by vote.

func SetAdmin

crossing Action
1func SetAdmin(cur realm, to address)
source

SetAdmin hands the settings to another address.

func SetDayCap

crossing Action
1func SetDayCap(cur realm, n int64)
source

SetDayCap lowers the daily ceiling. Raising it is the holders' (govern:daycap): the cap is what bounds a stolen key, so the key it bounds may not raise it.

func SetMinter

crossing Action
1func SetMinter(cur realm, to address)
source

SetMinter names who mints; "" is nobody (the referral mint stops until a vote names one).

func SetPaused

crossing Action
1func SetPaused(cur realm, on bool)
source

SetPaused stops the mint, or lets it go on.

func Settle

crossing Action
1func Settle(cur realm, id int64)
source

Settle writes down a conclusion the rules already reached. Permissionless. A decided money vote's turnout goes into the bar's memory (kinds.gno).

func Transfer

crossing Action
1func Transfer(cur realm, to address, amount int64)
source

Transfer moves the caller's own tokens.

func TransferFrom

crossing Action
1func TransferFrom(cur realm, from, to address, amount int64)
source

TransferFrom spends an allowance.

func Vote

crossing Action
1func Vote(cur realm, id int64, choice string)
source

Vote casts the caller's weight as of the proposal's sealed epoch: "yes", "no" or "abstain".

func VoteOf

Action
1func VoteOf(id int64, who address) (choice string, weight int64, ok bool)
source

func NewRules

Action
1func NewRules(quorumBps, thresholdBps, votingBlocks, delayBlocks, graceBlocks, proposeBps int64) Rules
source

Types 2

type Kind

ident
1type Kind = governor.Kind
source

Imports 6

Source Files 7