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

wbubble state

Back to all declarations

Token

*v0.Token

Token is the registered token, exported as wugnot exports its own: a \*grc20.Token carries no spend authority (its tellers act only for the realm that builds them, and only with an allowance), and the registry hands the same pointer to anyone. ledger is the mint and burn, and it never leaves this package.

Open
OID
0c415c…e13a:24
Token details

Inspect pointer

ledger

*v0.PrivateLedger

Token is the registered token, exported as wugnot exports its own: a \*grc20.Token carries no spend authority (its tellers act only for the realm that builds them, and only with an allowance), and the registry hands the same pointer to anyone. ledger is the mint and burn, and it never leaves this package.

Open
OID
0c415c…e13a:26
ledger details

Inspect pointer

tokenName

untyped string

Value

"Bubble Rumble BUBBLE (wrapped)"

tokenSymbol

untyped string

Value

"BUBBLE"

tokenDecimals

untyped bigint

Value

(6 <untyped> bigint)

pkgPath

untyped string

// must match gnomod.toml

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/wbubble"

RegistryKey

untyped string

Value

"gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/wbubble.BUBBLE"

one

int64

// one BUBBLE in base units

Value

1000000

Reserve

func() int64

Reserve is the BUBBLE this realm holds. It covers TotalSupply after every call (checkReserve).

Open
OID
0c415c…e13a:8
Reserve details

Inspect func

Wrap

func(amount int64)

Wrap takes amount BUBBLE from the caller and mints as much wrapped BUBBLE to them. First, on the bubble realm, the caller approves THIS realm for the amount (bubble.Approve with spender Address()): bubble reads its own caller as the spender, and its caller here is this realm, not the user. A failure inside bubble panics across the realm boundary and aborts the whole transaction, so nothing is minted for BUBBLE that did not arrive.

Open
OID
0c415c…e13a:9
Wrap details

Inspect func

Unwrap

func(amount int64)

Unwrap burns amount of the caller's wrapped BUBBLE and sends them as much BUBBLE. The burn goes first: a caller without the wrapped tokens is refused before anything moves.

Open
OID
0c415c…e13a:10
Unwrap details

Inspect func

checkReserve

func(self .uverse.address, want int64)

checkReserve is the invariant after every move: the reserve moved by exactly the amount, and it covers the supply. Not \`reserve == supply\`: anyone can send BUBBLE straight to this realm's address, and a wrapper that demanded equality would then refuse every Wrap and Unwrap for good. Such a gift only puts the reserve over the supply; it belongs to nobody and stays.

Open
OID
0c415c…e13a:11
checkReserve details

Inspect func

BalanceOf

func(owner .uverse.address) int64
Open
OID
0c415c…e13a:13
BalanceOf details

Inspect func

Allowance

func(owner .uverse.address, spender .uverse.address) int64
Open
OID
0c415c…e13a:14
Allowance details

Inspect func

Transfer

func(to .uverse.address, amount int64)
Open
OID
0c415c…e13a:15
Transfer details

Inspect func

Approve

func(spender .uverse.address, amount int64)
Open
OID
0c415c…e13a:16
Approve details

Inspect func

TransferFrom

func(from .uverse.address, to .uverse.address, amount int64)
Open
OID
0c415c…e13a:17
TransferFrom details

Inspect func

Render

func(path string) string

Render: "" the token's page; "balance/\<addr>" one wrapped balance as a number (wugnot's path); "json" the figures for the box.

Open
OID
0c415c…e13a:18
Render details

Inspect func

amount

func(n int64) string

amount prints base units as BUBBLE with up to six decimals, trailing zeros dropped.

Open
OID
0c415c…e13a:21
amount details

Inspect func

require

func(condition bool, msg string)
Open
OID
0c415c…e13a:22
require details

Inspect func

checkErr

func(err .uverse.error)
Open
OID
0c415c…e13a:23
checkErr details

Inspect func
Token : *v0.Token Inspect
ledger : *v0.PrivateLedger Inspect
tokenName : untyped string ="Bubble Rumble BUBBLE (wrapped)"
tokenSymbol : untyped string ="BUBBLE"
tokenDecimals : untyped bigint =(6 <untyped> bigint)
pkgPath : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/wbubble"
RegistryKey : untyped string ="gno.land/r/g1leu8d2vsplhehcfkjg50mwgdpxdkt8tztu95wr/wbubble.BUBBLE"
one : int64 =1000000
init.8 : func() Inspect
Address : func() .uverse.address Inspect
Reserve : func() int64 Inspect
Wrap : func(amount int64) Inspect
Unwrap : func(amount int64) Inspect
checkReserve : func(self .uverse.address, want int64) Inspect
TotalSupply : func() int64 Inspect
BalanceOf : func(owner .uverse.address) int64 Inspect
Allowance : func(owner .uverse.address, spender .uverse.address) int64 Inspect
Transfer : func(to .uverse.address, amount int64) Inspect
Approve : func(spender .uverse.address, amount int64) Inspect
TransferFrom : func(from .uverse.address, to .uverse.address, amount int64) Inspect
Render : func(path string) string Inspect
home : func() string Inspect
json : func() string Inspect
amount : func(n int64) string Inspect
require : func(condition bool, msg string) Inspect
checkErr : func(err .uverse.error) Inspect