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

v0 state

Back to all declarations

renderOne

func(symbol string) string
Open
OID
097d01…a3e4:6
renderOne details

Inspect func

entry

type

entry is one issued token: either a wrapper over a single underlying, or a fusion over several. Exactly one of vault/basket is set.

Value

v0.entry

ids

v0.ID

Value

<zero>

created

[]string

// symbols, in creation order, for a stable Render

Value

<zero>

home

.uverse.address

// this realm's address: the escrow account

Value

<gnolang.StringValue>

NewWrapper

func(tokenKey string, mode string, symbol string) string

NewWrapper issues a token wrapping \`tokenKey\`, a key in grc20reg, under the given mode, and registers it. It returns the new token's own registry key. \`symbol\` is yours to choose, must be unique in this realm, and follows the GRC20 rules: 1 to 11 characters of \[A-Za-z0-9\_-].

Open
OID
097d01…a3e4:16
NewWrapper details

Inspect func

NewFusion

func(keyA string, perA int64, keyB string, perB int64, symbol string) string

NewFusion issues a meta-token backed by two registered tokens at a fixed proportion: one smallest unit of the meta-token is always worth \`perA\` smallest units of A plus \`perB\` of B. It returns the new token's registry key. The proportion never changes, and the meta-token is minted and burned only against the real thing, so it cannot drift from its backing or be arbitraged. What it can do is make the pair one transferable object.

Open
OID
097d01…a3e4:17
NewFusion details

Inspect func

Deposit

func(symbol string, amount int64) int64

Deposit escrows \`amount\` of the underlying and mints \`symbol\` to the caller. It returns how much was minted, which is not \`amount\` unless the mode is plain. Approve Home() on the underlying first.

Open
OID
097d01…a3e4:18
Deposit details

Inspect func

Withdraw

func(symbol string, amount int64) int64

Withdraw burns \`amount\` of \`symbol\` and returns the underlying to the caller. It returns how much came back.

Open
OID
097d01…a3e4:19
Withdraw details

Inspect func

Donate

func(symbol string, amount int64)

Donate escrows \`amount\` of the underlying for \`symbol\` and mints nothing. Under a pool or sticky mode this is a gift to every current holder at once, and it is irreversible: there is no share to redeem it with. Under any other mode it is a gift to nobody, since the rate ignores the escrow.

Open
OID
097d01…a3e4:20
Donate details

Inspect func

Fuse

func(symbol string, units int64)

Fuse escrows every leg of \`symbol\` and mints \`units\` of it to the caller. Approve Home() on BOTH legs first.

Open
OID
097d01…a3e4:21
Fuse details

Inspect func

Defuse

func(symbol string, units int64)

Defuse burns \`units\` of \`symbol\` and returns every leg to the caller.

Open
OID
097d01…a3e4:22
Defuse details

Inspect func

Transfer

func(symbol string, to .uverse.address, amount int64)

Transfer moves the caller's own units of \`symbol\`. A soulbound wrapper refuses here, and nowhere else.

Open
OID
097d01…a3e4:23
Transfer details

Inspect func

Approve

func(symbol string, spender .uverse.address, amount int64)

Approve lets \`spender\` draw \`amount\` of \`symbol\` from the caller's balance.

Open
OID
097d01…a3e4:24
Approve details

Inspect func

TransferFrom

func(symbol string, from .uverse.address, to .uverse.address, amount int64)

TransferFrom spends an allowance the caller was granted on \`symbol\`.

Open
OID
097d01…a3e4:25
TransferFrom details

Inspect func

Key

func(symbol string) string

Key returns the grc20reg key of the token this realm issued as \`symbol\`.

Open
OID
097d01…a3e4:26
Key details

Inspect func

TotalSupply

func(symbol string) int64

TotalSupply returns how much of \`symbol\` is outstanding.

Open
OID
097d01…a3e4:27
TotalSupply details

Inspect func

BalanceOf

func(symbol string, owner .uverse.address) int64

BalanceOf returns \`owner\`'s balance of \`symbol\`.

Open
OID
097d01…a3e4:28
BalanceOf details

Inspect func

Allowance

func(symbol string, owner .uverse.address, spender .uverse.address) int64

Allowance returns what \`owner\` let \`spender\` draw of \`symbol\`.

Open
OID
097d01…a3e4:29
Allowance details

Inspect func

Escrow

func(symbol string) int64

Escrow returns the underlying escrowed behind a wrapper.

Open
OID
097d01…a3e4:30
Escrow details

Inspect func

Legs

func(symbol string) int

Legs returns how many components a fusion has.

Open
OID
097d01…a3e4:31
Legs details

Inspect func

Leg

func(symbol string, i int) (string, int64, int64)

Leg describes the i-th component of a fusion: its symbol, the units escrowed per meta unit, and the units escrowed so far.

Open
OID
097d01…a3e4:32
Leg details

Inspect func

Count

func() int

Count is how many tokens this realm has issued.

Open
OID
097d01…a3e4:33
Count details

Inspect func

modePolicy

func(mode string) (v0.Policy, int)

modePolicy maps a mode name to its policy and to the extra decimals the wrapped token needs to represent the same value.

Open
OID
097d01…a3e4:34
modePolicy details

Inspect func

requireFree

func(symbol string)
Open
OID
097d01…a3e4:36
requireFree details

Inspect func

mustVault

func(symbol string) *v0.Vault
Open
OID
097d01…a3e4:38
mustVault details

Inspect func

mustBasket

func(symbol string) *v0.Basket
Open
OID
097d01…a3e4:39
mustBasket details

Inspect func

checkErr

func(err .uverse.error)
Open
OID
097d01…a3e4:41
checkErr details

Inspect func
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderOne : func(symbol string) string Inspect
entry : type =v0.entry
ids : v0.ID =<zero>
byName : *v0.Tree Inspect
created : []string =<zero>
home : .uverse.address =<gnolang.StringValue>
init.8 : func() Inspect
Home : func() .uverse.address Inspect
NewWrapper : func(tokenKey string, mode string, symbol string) string Inspect
NewFusion : func(keyA string, perA int64, keyB string, perB int64, symbol string) string Inspect
Deposit : func(symbol string, amount int64) int64 Inspect
Withdraw : func(symbol string, amount int64) int64 Inspect
Donate : func(symbol string, amount int64) Inspect
Fuse : func(symbol string, units int64) Inspect
Defuse : func(symbol string, units int64) Inspect
Transfer : func(symbol string, to .uverse.address, amount int64) Inspect
Approve : func(symbol string, spender .uverse.address, amount int64) Inspect
TransferFrom : func(symbol string, from .uverse.address, to .uverse.address, amount int64) Inspect
Key : func(symbol string) string Inspect
TotalSupply : func(symbol string) int64 Inspect
BalanceOf : func(symbol string, owner .uverse.address) int64 Inspect
Allowance : func(symbol string, owner .uverse.address, spender .uverse.address) int64 Inspect
Escrow : func(symbol string) int64 Inspect
Legs : func(symbol string) int Inspect
Leg : func(symbol string, i int) (string, int64, int64) Inspect
Count : func() int Inspect
modePolicy : func(mode string) (v0.Policy, int) Inspect
record : func(e *v0.entry) Inspect
requireFree : func(symbol string) Inspect
must : func(symbol string) *v0.entry Inspect
mustVault : func(symbol string) *v0.Vault Inspect
mustBasket : func(symbol string) *v0.Basket Inspect
caller : func() .uverse.address Inspect
checkErr : func(err .uverse.error) Inspect