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

bubbletreasury state

Back to all declarations

bubblePath

untyped string

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubble"

ownPath

untyped string

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubbletreasury"

KindName

untyped string

Value

"treasury:spend"

subpath

untyped string

Value

"treasury-spend"

one

int64

// ugnot in one GNOT

Value

1000000

MaxSpend

int64

Value

100000

MaxShare

int64

// a proposal, and a window, may move at most balance/MaxShare…

Value

4

SmallTreasury

int64

// …or this many whole GNOT, whichever is more (up to the balance)

Value

40

Window

int64

// seconds: the pace — one quarter per window

Value

172800

poolRealms

[]string (len=5)

poolRealms are the game's realms: a spend to one of their addresses would strand the coins (a realm's balance is not a bubble's pot), and "seed a bubble" is exactly the spend the holders will think of first.

Open
OID
02b1be…e720:6
poolRealms details (len=5)

+5 more Inspect slice

treasury

.uverse.address

Value

<gnolang.StringValue>

offered

bool

Value

true

spentAt

int64

Value

0

spends

int64

// spends executed, ever

Value

0

spent

int64

// ugnot moved out, ever

Value

0

windowAt

int64

// block time the window opened

Value

0

windowBase

int64

// ugnot held when it opened, before its first spend

Value

0

windowSpent

int64

// ugnot moved in it

Value

0

WindowLeft

func() int64

WindowLeft is what may still move before the window closes, in ugnot — the whole cap for a window not open.

Open
OID
02b1be…e720:15
WindowLeft details

Inspect func

SpentAt

func() int64

SpentAt is the height of the last spend; Spends and Spent, the count and the sum — the realm's own log.

Open
OID
02b1be…e720:16
SpentAt details

Inspect func

noteSpend

func(amt int64)

noteSpend is the kind's way to write here: Do runs inside the token realm, which cannot touch this realm's variables, so it crosses back with the sub-realm token it was handed — and only that token is let in (its address is the treasury). Called BEFORE the coins move; a second call in one block panics so the transaction, and with it any batch, unwinds with nothing moved.

Open
OID
02b1be…e720:19
noteSpend details

Inspect func

Balance

func() int64

Balance is what the treasury holds right now, in ugnot.

Open
OID
02b1be…e720:21
Balance details

Inspect func

Offered

func() bool

Offered is whether the kind has been published to the token's governor.

Open
OID
02b1be…e720:22
Offered details

Inspect func

Offer

func()

Offer is the same publication for a realm loaded without its init having run it (a test harness): it does nothing once the token's governor knows the name. The holders still have to adopt the kind by vote before a spend can be proposed.

Open
OID
02b1be…e720:23
Offer details

Inspect func

MaxNow

func() int64

MaxNow is the most one proposal may move right now, in whole GNOT: the cap for a balance.

Open
OID
02b1be…e720:24
MaxNow details

Inspect func

minInt

func(a int64, b int64) int64
Open
OID
02b1be…e720:26
minInt details

Inspect func

Preview

func(payload string) string

Preview is what a proposal with this payload would say, and whether it could open now.

Open
OID
02b1be…e720:27
Preview details

Inspect func

spendKind

type

Value

bubbletreasury.spendKind

within

func(n int64) .uverse.error

within is the cap for the balance as it stands: the whole of a small treasury, a quarter of a large one.

Open
OID
02b1be…e720:28
within details

Inspect func

parse

func(p string) (.uverse.address, int64, .uverse.error)
Open
OID
02b1be…e720:29
parse details

Inspect func

treasuryErr

type

Value

bubbletreasury.treasuryErr

gnot

func(u int64) string

gnot prints ugnot as GNOT with up to six decimals, trailing zeros dropped.

Open
OID
02b1be…e720:31
gnot details

Inspect func

Render

func(path string) string

Render: the treasury for a reader — where, how much, and how it moves.

Open
OID
02b1be…e720:32
Render details

Inspect func
bubblePath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubble"
ownPath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/bubbletreasury"
KindName : untyped string ="treasury:spend"
subpath : untyped string ="treasury-spend"
one : int64 =1000000
MaxSpend : int64 =100000
MaxShare : int64 =4
SmallTreasury : int64 =40
Window : int64 =172800
init.9 : func() Inspect
poolRealms : []string (len=5) Inspect
treasury : .uverse.address =<gnolang.StringValue>
offered : bool =true
spentAt : int64 =0
spends : int64 =0
spent : int64 =0
windowAt : int64 =0
windowBase : int64 =0
windowSpent : int64 =0
WindowLeft : func() int64 Inspect
SpentAt : func() int64 Inspect
Spends : func() int64 Inspect
Spent : func() int64 Inspect
noteSpend : func(amt int64) Inspect
Address : func() .uverse.address Inspect
Balance : func() int64 Inspect
Offered : func() bool Inspect
Offer : func() Inspect
MaxNow : func() int64 Inspect
maxFor : func(balance int64) int64 Inspect
minInt : func(a int64, b int64) int64 Inspect
Preview : func(payload string) string Inspect
spendKind : type =bubbletreasury.spendKind
within : func(n int64) .uverse.error Inspect
parse : func(p string) (.uverse.address, int64, .uverse.error) Inspect
treasuryErr : type =bubbletreasury.treasuryErr
errf : func(s string) .uverse.error Inspect
gnot : func(u int64) string Inspect
Render : func(path string) string Inspect