From eca27055b854fe115197cdd8dca1ff6a1f41dc6c Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 25 Nov 2020 12:44:49 +0300 Subject: [PATCH] core: fix NEP17 Transfer event `Transfer` event declaration was placed at the wrong part of `newNEP17Native`, that's why it had incorrect parameters. Fixed. --- pkg/core/native/native_nep17.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/core/native/native_nep17.go b/pkg/core/native/native_nep17.go index 5ebf99a1e..c5853503d 100644 --- a/pkg/core/native/native_nep17.go +++ b/pkg/core/native/native_nep17.go @@ -74,11 +74,13 @@ func newNEP17Native(name string) *nep17TokenNative { md = newMethodAndPrice(n.balanceOf, 1000000, smartcontract.AllowStates) n.AddMethod(md, desc, true) - desc = newDescriptor("transfer", smartcontract.BoolType, + transferParams := []manifest.Parameter{ manifest.NewParameter("from", smartcontract.Hash160Type), manifest.NewParameter("to", smartcontract.Hash160Type), manifest.NewParameter("amount", smartcontract.IntegerType), - manifest.NewParameter("data", smartcontract.AnyType), + } + desc = newDescriptor("transfer", smartcontract.BoolType, + append(transferParams, manifest.NewParameter("data", smartcontract.AnyType))..., ) md = newMethodAndPrice(n.Transfer, 8000000, smartcontract.AllowModifyStates) n.AddMethod(md, desc, false) @@ -91,7 +93,7 @@ func newNEP17Native(name string) *nep17TokenNative { md = newMethodAndPrice(getOnPersistWrapper(postPersistBase), 0, smartcontract.AllowModifyStates) n.AddMethod(md, desc, false) - n.AddEvent("Transfer", desc.Parameters...) + n.AddEvent("Transfer", transferParams...) return n }