From 7e586cc6abcf85085e4f7929812682818f96bd96 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 27 May 2020 22:51:44 +0300 Subject: [PATCH] native: deduce transferred assets from sender on transfer When money is being sent usually they go away from someone's pocket, so that there is a little less money left there. Not in our case as it turns out, we actually were adding money both to sender and receiver which is nice, but a bit different from usual economic's expectations. --- pkg/core/native/native_nep5.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/core/native/native_nep5.go b/pkg/core/native/native_nep5.go index 7ea25e20f..e969805cb 100644 --- a/pkg/core/native/native_nep5.go +++ b/pkg/core/native/native_nep5.go @@ -169,6 +169,8 @@ func (c *nep5TokenNative) transfer(ic *interop.Context, from, to util.Uint160, a inc := amount if isEmpty { inc = big.NewInt(0) + } else { + inc = new(big.Int).Neg(inc) } if err := c.incBalance(ic, from, siFrom, inc); err != nil { return err