diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index 911e9afa9..915321559 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -13,6 +13,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/core/native/nativenames" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/encoding/address" + "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/wallet" @@ -420,8 +421,8 @@ func importDeployed(ctx *cli.Context) error { return cli.NewExitError(fmt.Errorf("can't fetch contract info: %w", err), 1) } md := cs.Manifest.ABI.GetMethod(manifest.MethodVerify, -1) - if md == nil { - return cli.NewExitError("contract has no `verify` method", 1) + if md == nil || md.ReturnType != smartcontract.BoolType { + return cli.NewExitError("contract has no `verify` method with boolean return", 1) } acc.Address = address.Uint160ToString(cs.Hash) acc.Contract.Script = cs.NEF.Script diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 94052597c..0e4983d4b 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -28,6 +28,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/encoding/bigint" "github.com/nspcc-dev/neo-go/pkg/io" + "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/smartcontract/callflag" "github.com/nspcc-dev/neo-go/pkg/smartcontract/manifest" "github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger" @@ -1668,7 +1669,7 @@ func (bc *Blockchain) initVerificationVM(ic *interop.Context, hash util.Uint160, return ErrUnknownVerificationContract } md := cs.Manifest.ABI.GetMethod(manifest.MethodVerify, -1) - if md == nil { + if md == nil || md.ReturnType != smartcontract.BoolType { return ErrInvalidVerificationContract } initMD := cs.Manifest.ABI.GetMethod(manifest.MethodInit, 0)