diff --git a/pkg/core/interop/context.go b/pkg/core/interop/context.go index aefbb2839..85daf01ae 100644 --- a/pkg/core/interop/context.go +++ b/pkg/core/interop/context.go @@ -176,7 +176,7 @@ func NewContractMD(name string, id int32) *ContractMD { c.NEF.Header.Compiler = "neo-core-v3.0" c.NEF.Header.Magic = nef.Magic c.NEF.Tokens = []nef.MethodToken{} // avoid `nil` result during JSON marshalling - c.Hash = state.CreateContractHash(util.Uint160{}, 0, c.Name) + c.Hash = state.CreateNativeContractHash(c.Name) c.Manifest = *manifest.DefaultManifest(name) return c diff --git a/pkg/core/state/contract.go b/pkg/core/state/contract.go index 4bc5df70a..0b89c4b5b 100644 --- a/pkg/core/state/contract.go +++ b/pkg/core/state/contract.go @@ -115,3 +115,9 @@ func CreateContractHash(sender util.Uint160, checksum uint32, name string) util. } return hash.Hash160(w.Bytes()) } + +// CreateNativeContractHash calculates the hash for the native contract with the +// given name. +func CreateNativeContractHash(name string) util.Uint160 { + return CreateContractHash(util.Uint160{}, 0, name) +}