tokenhub package

Function

RegisterToken

func RegisterToken(cur realm, token *grc20.Token, slug string) string

RegisterToken is a function that uses gno.land/r/demo/defi/grc20reg to register a token It uses the slug to construct a key and then registers the token in the registry The logic is the same as in grc20reg, but it's done here so the key path is callers pkgpath and not of this realm After doing so, the token hub realm uses grc20reg's registry as a read-only avl.Tree Note: register token returns the key path that can be used to retrieve the token

Params

Command

gnokey query -remote "https://rpc.gno.land:443" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/matijamarjanovic/tokenhub" -func "RegisterToken"  -args "" -args "" -gas-fee 1000000ugnot -gas-wanted 5000000 -send "" ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "staging" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.gno.land:443" call.tx