mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
36e128516b
It's useful to keep the ordered set of native contract names. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
43 lines
867 B
Go
43 lines
867 B
Go
package nativenames
|
|
|
|
// Names of all native contracts.
|
|
const (
|
|
Management = "ContractManagement"
|
|
Ledger = "LedgerContract"
|
|
Neo = "NeoToken"
|
|
Gas = "GasToken"
|
|
Policy = "PolicyContract"
|
|
Oracle = "OracleContract"
|
|
Designation = "RoleManagement"
|
|
Notary = "Notary"
|
|
CryptoLib = "CryptoLib"
|
|
StdLib = "StdLib"
|
|
)
|
|
|
|
// All contains the list of all native contract names ordered by the contract ID.
|
|
var All = []string{
|
|
Management,
|
|
StdLib,
|
|
CryptoLib,
|
|
Ledger,
|
|
Neo,
|
|
Gas,
|
|
Policy,
|
|
Designation,
|
|
Oracle,
|
|
Notary,
|
|
}
|
|
|
|
// IsValid checks if the name is a valid native contract's name.
|
|
func IsValid(name string) bool {
|
|
return name == Management ||
|
|
name == Ledger ||
|
|
name == Neo ||
|
|
name == Gas ||
|
|
name == Policy ||
|
|
name == Oracle ||
|
|
name == Designation ||
|
|
name == Notary ||
|
|
name == CryptoLib ||
|
|
name == StdLib
|
|
}
|