neo_solidity/runtime/spec/
syscalls.rs

1// Syscall registry – the names are authoritative; IDs are derived via SHA-256.
2//
3// IMPORTANT: This list is aligned to Neo N3 `ApplicationEngine.Register(...)` syscall names.
4pub static SYSCALLS: Lazy<HashMap<[u8; 4], SyscallSpec>> = Lazy::new(|| {
5    let names = [
6        // Storage
7        "System.Storage.GetContext",
8        "System.Storage.GetReadOnlyContext",
9        "System.Storage.AsReadOnly",
10        "System.Storage.Get",
11        "System.Storage.Put",
12        "System.Storage.Delete",
13        "System.Storage.Find",
14        "System.Storage.Local.Get",
15        "System.Storage.Local.Put",
16        "System.Storage.Local.Delete",
17        "System.Storage.Local.Find",
18        // Iterator
19        "System.Iterator.Next",
20        "System.Iterator.Value",
21        // Crypto
22        "System.Crypto.CheckSig",
23        "System.Crypto.CheckMultisig",
24        // Contract
25        "System.Contract.Call",
26        "System.Contract.GetCallFlags",
27        "System.Contract.CreateStandardAccount",
28        "System.Contract.CreateMultisigAccount",
29        // Runtime
30        "System.Runtime.GetTrigger",
31        "System.Runtime.Platform",
32        "System.Runtime.GetNetwork",
33        "System.Runtime.GetAddressVersion",
34        "System.Runtime.GetTime",
35        "System.Runtime.GetScriptContainer",
36        "System.Runtime.GetExecutingScriptHash",
37        "System.Runtime.GetCallingScriptHash",
38        "System.Runtime.GetEntryScriptHash",
39        "System.Runtime.LoadScript",
40        "System.Runtime.CheckWitness",
41        "System.Runtime.GetInvocationCounter",
42        "System.Runtime.GetRandom",
43        "System.Runtime.Log",
44        "System.Runtime.Notify",
45        "System.Runtime.GetNotifications",
46        "System.Runtime.GasLeft",
47        "System.Runtime.BurnGas",
48        "System.Runtime.CurrentSigners",
49    ];
50
51    let mut m = HashMap::new();
52    for name in names {
53        m.insert(
54            interop_id_bytes(name),
55            SyscallSpec {
56                id: interop_id_bytes(name),
57                name,
58            },
59        );
60    }
61    m
62});
63
64pub fn syscall_name(id: &[u8; 4]) -> Option<&'static str> {
65    SYSCALLS.get(id).map(|s| s.name)
66}