From 6b2f4efdd4ff2916c6af4b5fd21d3dbef8b657af Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 19 May 2020 18:49:03 +0300 Subject: [PATCH] core: fix bug in nep5TokenNative.addTokens method Sometimes we want to add negative amount (e.g. when burning tokens). --- pkg/core/native/native_nep5.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/core/native/native_nep5.go b/pkg/core/native/native_nep5.go index 021eb6b9c..b599313da 100644 --- a/pkg/core/native/native_nep5.go +++ b/pkg/core/native/native_nep5.go @@ -205,9 +205,7 @@ func (c *nep5TokenNative) burn(ic *interop.Context, h util.Uint160, amount *big. } func (c *nep5TokenNative) addTokens(ic *interop.Context, h util.Uint160, amount *big.Int) { - if sign := amount.Sign(); sign == -1 { - panic("negative amount") - } else if sign == 0 { + if amount.Sign() == 0 { return }