github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/core/native/nativenames/names.go (about)

     1  package nativenames
     2  
     3  // Names of all native contracts.
     4  const (
     5  	Management  = "ContractManagement"
     6  	Ledger      = "LedgerContract"
     7  	Neo         = "NeoToken"
     8  	Gas         = "GasToken"
     9  	Policy      = "PolicyContract"
    10  	Oracle      = "OracleContract"
    11  	Designation = "RoleManagement"
    12  	Notary      = "Notary"
    13  	CryptoLib   = "CryptoLib"
    14  	StdLib      = "StdLib"
    15  )
    16  
    17  // All contains the list of all native contract names ordered by the contract ID.
    18  var All = []string{
    19  	Management,
    20  	StdLib,
    21  	CryptoLib,
    22  	Ledger,
    23  	Neo,
    24  	Gas,
    25  	Policy,
    26  	Designation,
    27  	Oracle,
    28  	Notary,
    29  }
    30  
    31  // IsValid checks if the name is a valid native contract's name.
    32  func IsValid(name string) bool {
    33  	return name == Management ||
    34  		name == Ledger ||
    35  		name == Neo ||
    36  		name == Gas ||
    37  		name == Policy ||
    38  		name == Oracle ||
    39  		name == Designation ||
    40  		name == Notary ||
    41  		name == CryptoLib ||
    42  		name == StdLib
    43  }