mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-30 09:33:36 +00:00
core: fix NEP17 Transfer event
`Transfer` event declaration was placed at the wrong part of `newNEP17Native`, that's why it had incorrect parameters. Fixed.
This commit is contained in:
parent
2fee69f26f
commit
eca27055b8
1 changed files with 5 additions and 3 deletions
|
@ -74,11 +74,13 @@ func newNEP17Native(name string) *nep17TokenNative {
|
||||||
md = newMethodAndPrice(n.balanceOf, 1000000, smartcontract.AllowStates)
|
md = newMethodAndPrice(n.balanceOf, 1000000, smartcontract.AllowStates)
|
||||||
n.AddMethod(md, desc, true)
|
n.AddMethod(md, desc, true)
|
||||||
|
|
||||||
desc = newDescriptor("transfer", smartcontract.BoolType,
|
transferParams := []manifest.Parameter{
|
||||||
manifest.NewParameter("from", smartcontract.Hash160Type),
|
manifest.NewParameter("from", smartcontract.Hash160Type),
|
||||||
manifest.NewParameter("to", smartcontract.Hash160Type),
|
manifest.NewParameter("to", smartcontract.Hash160Type),
|
||||||
manifest.NewParameter("amount", smartcontract.IntegerType),
|
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)
|
md = newMethodAndPrice(n.Transfer, 8000000, smartcontract.AllowModifyStates)
|
||||||
n.AddMethod(md, desc, false)
|
n.AddMethod(md, desc, false)
|
||||||
|
@ -91,7 +93,7 @@ func newNEP17Native(name string) *nep17TokenNative {
|
||||||
md = newMethodAndPrice(getOnPersistWrapper(postPersistBase), 0, smartcontract.AllowModifyStates)
|
md = newMethodAndPrice(getOnPersistWrapper(postPersistBase), 0, smartcontract.AllowModifyStates)
|
||||||
n.AddMethod(md, desc, false)
|
n.AddMethod(md, desc, false)
|
||||||
|
|
||||||
n.AddEvent("Transfer", desc.Parameters...)
|
n.AddEvent("Transfer", transferParams...)
|
||||||
|
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue