Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Jul 5, 2024
1 parent e1a79fe commit 3f83d01
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 66 deletions.
2 changes: 2 additions & 0 deletions examples/gno.land/r/demo/bar20/bar20.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"gno.land/p/demo/grc/grc20"
"gno.land/p/demo/ufmt"
"gno.land/r/demo/grc20reg"
)

var (
Expand All @@ -19,6 +20,7 @@ var (
func init() {
banker = grc20.NewAdminToken("Bar", "BAR", 4)
Token = banker.GRC20()
grc20reg.Register(token, "")
}

func Faucet() string {
Expand Down
1 change: 1 addition & 0 deletions examples/gno.land/r/demo/bar20/gno.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ require (
gno.land/p/demo/grc/grc20 v0.0.0-latest
gno.land/p/demo/testutils v0.0.0-latest
gno.land/p/demo/ufmt v0.0.0-latest
gno.land/r/demo/grc20reg v0.0.0-latest
)
4 changes: 1 addition & 3 deletions examples/gno.land/r/demo/foo20/foo20.gno
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ var (

func init() {
foo = grc20.NewAdminToken("Foo", "FOO", 4)
pub := foo.GRC20()
proxy := grc20reg.Proxify(pub)
grc20reg.Register(proxy.GetName, "")
foo.Mint(admin, 1000000*10000) // @administrator (1M)
foo.Mint("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq", 10000*10000) // @manfred (10k)
grc20reg.Register(foo.GRC20(), "")
}

// method proxies as public functions.
Expand Down
2 changes: 2 additions & 0 deletions examples/gno.land/r/demo/grc20factory/grc20factory.gno
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"gno.land/p/demo/avl"
"gno.land/p/demo/grc/grc20"
"gno.land/r/demo/grc20reg"
)

// XXX: the p/grc20 library needs a refactor to change names (i.e., adminToken)
Expand Down Expand Up @@ -36,6 +37,7 @@ func NewTokenWithAdmin(name, symbol string, decimals uint, initialMint uint64, a
admin: admin,
}
tokens.Set(symbol, &t)
grc20reg.Register(newToken.GRC20(), symbol)
}

// method proxies as public functions.
Expand Down
8 changes: 2 additions & 6 deletions examples/gno.land/r/demo/grc20reg/grc20reg.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ import (
"gno.land/p/demo/ufmt"
)

var registry = avl.NewTree() // pkg path -> IGRC20

// func Register(getName func() string, slug string) {
var registry = avl.NewTree() // rlmPath[.slug] -> IGRC20

func Register(token grc20.IGRC20, slug string) {
// proxy := tmpproxy{getName: getName}
proxy := Proxify(token)
rlmPath := std.PrevRealm().PkgPath()
key := fqname.Construct(rlmPath, slug)
registry.Set(key, proxy)
registry.Set(key, token)
std.Emit(
registerEvent,
"pkgpath", rlmPath,
Expand Down
57 changes: 0 additions & 57 deletions examples/gno.land/r/demo/grc20reg/tmp_proxy.gno

This file was deleted.

0 comments on commit 3f83d01

Please sign in to comment.