2020-12-13 18:25:04 +00:00
|
|
|
package nativenames
|
|
|
|
|
|
|
|
// Names of all native contracts.
|
|
|
|
const (
|
2020-12-16 10:50:29 +00:00
|
|
|
Management = "ContractManagement"
|
2021-02-03 19:01:20 +00:00
|
|
|
Ledger = "LedgerContract"
|
2020-12-13 18:25:04 +00:00
|
|
|
Neo = "NeoToken"
|
|
|
|
Gas = "GasToken"
|
|
|
|
Policy = "PolicyContract"
|
|
|
|
Oracle = "OracleContract"
|
2020-12-16 10:50:29 +00:00
|
|
|
Designation = "RoleManagement"
|
2020-12-13 18:25:04 +00:00
|
|
|
Notary = "Notary"
|
2021-02-15 15:43:10 +00:00
|
|
|
CryptoLib = "CryptoLib"
|
2021-03-03 15:59:10 +00:00
|
|
|
StdLib = "StdLib"
|
2020-12-13 18:25:04 +00:00
|
|
|
)
|
2021-03-12 10:04:41 +00:00
|
|
|
|
2024-04-18 13:46:21 +00:00
|
|
|
// 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,
|
|
|
|
}
|
|
|
|
|
2022-04-20 18:30:09 +00:00
|
|
|
// IsValid checks if the name is a valid native contract's name.
|
2021-03-12 10:04:41 +00:00
|
|
|
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
|
|
|
|
}
|