github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/internal/basicchain/testdata/verify/verification_contract.go (about)

     1  package verify
     2  
     3  import (
     4  	"github.com/nspcc-dev/neo-go/pkg/interop/lib/address"
     5  	"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
     6  	"github.com/nspcc-dev/neo-go/pkg/interop/util"
     7  )
     8  
     9  // Verify is a verification contract method.
    10  // It returns true iff it is signed by Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn (id-0 private key from testchain).
    11  func Verify() bool {
    12  	tx := runtime.GetScriptContainer()
    13  	addr := address.ToHash160("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
    14  	return util.Equals(string(tx.Sender), string(addr))
    15  }