From a17dccff316ac1d8b3133bce4c2b8e362465afb4 Mon Sep 17 00:00:00 2001 From: Lee ByeongJun Date: Mon, 2 Sep 2024 11:32:39 +0900 Subject: [PATCH] update event types --- examples/gno.land/p/demo/grc/grc20/banker.gno | 8 +++----- examples/gno.land/p/demo/grc/grc20/types.gno | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/gno.land/p/demo/grc/grc20/banker.gno b/examples/gno.land/p/demo/grc/grc20/banker.gno index f643d3e2635..7a3ebb18ef5 100644 --- a/examples/gno.land/p/demo/grc/grc20/banker.gno +++ b/examples/gno.land/p/demo/grc/grc20/banker.gno @@ -64,7 +64,7 @@ func (b *Banker) Mint(address std.Address, amount uint64) error { b.balances.Set(string(address), newBalance) std.Emit( - TransferEvent, + MintEvent, "from", "", "to", string(address), "value", strconv.Itoa(int(amount)), @@ -90,7 +90,7 @@ func (b *Banker) Burn(address std.Address, amount uint64) error { b.balances.Set(string(address), newBalance) std.Emit( - TransferEvent, + BurnEvent, "from", string(address), "to", "", "value", strconv.Itoa(int(amount)), @@ -146,9 +146,6 @@ func (b *Banker) Transfer(from, to std.Address, amount uint64) error { toBalance := b.BalanceOf(to) fromBalance := b.BalanceOf(from) - // debug. - // println("from", from, "to", to, "amount", amount, "fromBalance", fromBalance, "toBalance", toBalance) - if fromBalance < amount { return ErrInsufficientBalance } @@ -165,6 +162,7 @@ func (b *Banker) Transfer(from, to std.Address, amount uint64) error { "to", to.String(), "value", strconv.Itoa(int(amount)), ) + return nil } diff --git a/examples/gno.land/p/demo/grc/grc20/types.gno b/examples/gno.land/p/demo/grc/grc20/types.gno index fe3aef349d9..201c6638914 100644 --- a/examples/gno.land/p/demo/grc/grc20/types.gno +++ b/examples/gno.land/p/demo/grc/grc20/types.gno @@ -56,6 +56,8 @@ type Token interface { } const ( + MintEvent = "Mint" + BurnEvent = "Burn" TransferEvent = "Transfer" ApprovalEvent = "Approval" )