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

registry

*v0.Tree

// rlmPath.symbol -> \*Token

Open
OID
01d127…ed0b:4
registry details

Inspect pointer

Register

func(token *v0.Token, slug string) string

Register records token under its rlmPath.symbol key and returns that key. Token.ID() carries a trailing sequence id (rlmPath.symbol.\<id>) that keeps token identities/events unique, but the registry deliberately keys by rlmPath.symbol so lookups don't need to know the id, and so a realm cannot register two tokens under the same symbol (overwrite/alias guard).

Open
OID
01d127…ed0b:6
Register details

Inspect func

MustGet

func(key string) *v0.Token
Open
OID
01d127…ed0b:9
MustGet details

Inspect func

Transfer

func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64)

Transfer moves \`amount\` out of the CALLING REALM's own balance. Call it non-crossing, forwarding your own \`cur\`: grc20reg.Transfer(0, cur, "gno.land/r/demo/defi/foo20.FOO", to, 100)

Open
OID
01d127…ed0b:10
Transfer details

Inspect func

Approve

func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64)

Approve sets an allowance owned by the CALLING REALM, letting \`spender\` draw on the calling realm's balance. It does not touch the signing user's allowances.

Open
OID
01d127…ed0b:11
Approve details

Inspect func

TransferFrom

func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64)

TransferFrom spends an allowance with the CALLING REALM as the spender. Note the allowance direction this implies: \`from\` must have approved the calling realm, not the signing user. That is the supported way for a realm to move a user's funds — the user grants the realm an allowance, and the realm draws on it as itself, so every debit is one the owner authorized against that specific realm.

Open
OID
01d127…ed0b:12
TransferFrom details

Inspect func

checkErr

func(err .uverse.error)
Open
OID
01d127…ed0b:13
checkErr details

Inspect func

registerEvent

untyped string

Value

"register"

maxSlugLen

untyped bigint

Value

(128 <untyped> bigint)

GetRegistry

func() *v0.ReadOnlyTree
Open
OID
01d127…ed0b:15
GetRegistry details

Inspect func

validateSlug

func(slug string)

validateSlug panics if the slug is too long or contains non-alphanumeric characters. Only letters, digits, dashes, and underscores are allowed.

Open
OID
01d127…ed0b:16
validateSlug details

Inspect func

isAlphanumeric

func(c int32) bool
Open
OID
01d127…ed0b:17
isAlphanumeric details

Inspect func
registry : *v0.Tree Inspect
Register : func(token *v0.Token, slug string) string Inspect
Get : func(key string) *v0.Token Inspect
MustGet : func(key string) *v0.Token Inspect
Transfer : func(int, rlm .uverse.realm, tokenKey string, to .uverse.address, amount int64) Inspect
Approve : func(int, rlm .uverse.realm, tokenKey string, spender .uverse.address, amount int64) Inspect
TransferFrom : func(int, rlm .uverse.realm, tokenKey string, from .uverse.address, to .uverse.address, amount int64) Inspect
checkErr : func(err .uverse.error) Inspect
Render : func(path string) string Inspect
registerEvent : untyped string ="register"
maxSlugLen : untyped bigint =(128 <untyped> bigint)
GetRegistry : func() *v0.ReadOnlyTree Inspect
validateSlug : func(slug string) Inspect
isAlphanumeric : func(c int32) bool Inspect