diff --git a/pkg/core/native/native_gas.go b/pkg/core/native/native_gas.go index 2903e10f9..e06925741 100644 --- a/pkg/core/native/native_gas.go +++ b/pkg/core/native/native_gas.go @@ -54,7 +54,7 @@ func (g *GAS) increaseBalance(_ *interop.Context, _ util.Uint160, si *state.Stor err = errors.New("insufficient funds") } return err - } else if sign == -1 && acc.Balance.Cmp(new(big.Int).Neg(amount)) == -1 { + } else if sign == -1 && acc.Balance.CmpAbs(amount) == -1 { return errors.New("insufficient funds") } acc.Balance.Add(&acc.Balance, amount) diff --git a/pkg/core/native/native_neo.go b/pkg/core/native/native_neo.go index eb5291d87..163525080 100644 --- a/pkg/core/native/native_neo.go +++ b/pkg/core/native/native_neo.go @@ -405,7 +405,7 @@ func (n *NEO) increaseBalance(ic *interop.Context, h util.Uint160, si *state.Sto if err != nil { return err } - if (amount.Sign() == -1 && acc.Balance.Cmp(new(big.Int).Neg(amount)) == -1) || + if (amount.Sign() == -1 && acc.Balance.CmpAbs(amount) == -1) || (amount.Sign() == 0 && checkBal != nil && acc.Balance.Cmp(checkBal) == -1) { return errors.New("insufficient funds") }