neo-syscalls 0.14.0

Neo N3 Syscall Definitions
Documentation
// Copyright (c) 2025-2026 R3E Network
// Licensed under the MIT License

use super::NeoVMSyscallInfo;

/// Neo N3 System Calls
pub const SYSCALLS: &[NeoVMSyscallInfo] = &[
    NeoVMSyscallInfo {
        name: "System.Contract.Call",
        hash: 0x525b7d62,
        parameters: &["Hash160", "String", "Integer", "Array"],
        return_type: "StackItem",
        gas_cost: 32768,
        description: "Calls a method on a smart contract. Takes the script hash of the target contract, the method name to call, the operation method (0 for default), and an array of arguments. The call flags are inherited from the current execution context.",
    },
    NeoVMSyscallInfo {
        name: "System.Contract.CallNative",
        hash: 0x677bf71a,
        parameters: &["Integer"],
        return_type: "Void",
        gas_cost: 0,
        description: "Calls a native contract by its registered ID. The integer parameter specifies which native contract to invoke (e.g., NEO, GAS, Policy, etc.).",
    },
    NeoVMSyscallInfo {
        name: "System.Contract.CreateMultisigAccount",
        hash: 0x09e9336a,
        parameters: &["Integer", "Array"],
        return_type: "Hash160",
        gas_cost: 0,
        description: "Creates a multi-signature account from an array of public keys and the minimum number of signatures required (m-of-n). Returns the script hash of the resulting multi-signature account.",
    },
    NeoVMSyscallInfo {
        name: "System.Contract.CreateStandardAccount",
        hash: 0x028799cf,
        parameters: &["ByteString"],
        return_type: "Hash160",
        gas_cost: 0,
        description: "Creates a standard contract account from a single public key. Returns the script hash of the resulting account.",
    },
    NeoVMSyscallInfo {
        name: "System.Contract.GetCallFlags",
        hash: 0x813ada95,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 1024,
        description: "Gets the call flags of the current execution context. Call flags control what operations are permitted during contract execution, such as allowing state modifications or contract calls.",
    },
    NeoVMSyscallInfo {
        name: "System.Contract.NativeOnPersist",
        hash: 0x93bcdb2e,
        parameters: &[],
        return_type: "Void",
        gas_cost: 0,
        description: "Internal native contract callback triggered when a block is about to be persisted. Called by the VM during the persist phase of block processing.",
    },
    NeoVMSyscallInfo {
        name: "System.Contract.NativePostPersist",
        hash: 0x165da144,
        parameters: &[],
        return_type: "Void",
        gas_cost: 0,
        description: "Internal native contract callback triggered after a block has been persisted. Called by the VM after all block transactions have been processed.",
    },
    NeoVMSyscallInfo {
        name: "System.Crypto.CheckMultisig",
        hash: 0x3adcd09e,
        parameters: &["Array", "Array"],
        return_type: "Boolean",
        gas_cost: 0,
        description: "Verifies a multi-signature against the current script context. Takes an array of signatures and an array of public keys. Returns true if the signatures are valid for the accumulated script hash and enough signatures are verified.",
    },
    NeoVMSyscallInfo {
        name: "System.Crypto.CheckSig",
        hash: 0x27b3e756,
        parameters: &["ByteString", "ByteString"],
        return_type: "Boolean",
        gas_cost: 32768,
        description: "Verifies a single ECDSA signature against the current script context. Takes the signature and public key as byte strings. Returns true if the signature is valid for the accumulated script hash.",
    },
    NeoVMSyscallInfo {
        name: "Neo.Crypto.VerifyWithECDsa",
        hash: 0xcf822a6a,
        parameters: &["ByteString", "ByteString", "ByteString", "Integer"],
        return_type: "Boolean",
        gas_cost: 32768,
        description: "Verifies an ECDSA signature with an explicit curve parameter. Takes the message hash, public key, signature, and a curve identifier (0 = secp256k1, 1 = secp256r1).",
    },
    NeoVMSyscallInfo {
        name: "System.Iterator.Next",
        hash: 0x9ced089c,
        parameters: &["Iterator"],
        return_type: "Boolean",
        gas_cost: 32768,
        description: "Advances an iterator to its next element. Returns true if there is a next element available, or false if the iterator has been exhausted.",
    },
    NeoVMSyscallInfo {
        name: "System.Iterator.Value",
        hash: 0x1dbf54f3,
        parameters: &["Iterator"],
        return_type: "StackItem",
        gas_cost: 16,
        description: "Gets the current value of an iterator. Must be called after System.Iterator.Next returns true. Returns the value at the current iterator position.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.BurnGas",
        hash: 0xbc8c5ac3,
        parameters: &["Integer"],
        return_type: "Void",
        gas_cost: 16,
        description: "Burns a specified amount of GAS. The gas is permanently destroyed and cannot be recovered. Used for scenarios requiring deliberate GAS consumption beyond regular execution costs.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.CheckWitness",
        hash: 0x8cec27f8,
        parameters: &["ByteString"],
        return_type: "Boolean",
        gas_cost: 1024,
        description: "Checks if the specified account has provided a witness (signature) in the current verification context. Takes a script hash or public key hash as input. Returns true if the account is a witness in the current transaction.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.CurrentSigners",
        hash: 0x8b18f1ac,
        parameters: &[],
        return_type: "Array",
        gas_cost: 16,
        description: "Gets the list of signers (accounts) that signed the current transaction. Returns an array of script hashes representing the signers with their corresponding scopes.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GasLeft",
        hash: 0xced88814,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 16,
        description: "Gets the amount of GAS remaining for the current execution. Used to check available gas before performing gas-consuming operations.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetAddressVersion",
        hash: 0xdc92494c,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 8,
        description: "Gets the address version used by the current network. The address version is part of the Neo address format and differs between MainNet and TestNet.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetCallingScriptHash",
        hash: 0x3c6e5339,
        parameters: &[],
        return_type: "Hash160",
        gas_cost: 16,
        description: "Gets the script hash of the contract that called the current contract. Returns the script hash of the immediate caller in the call chain. Returns empty if called directly from an invocation transaction.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetEntryScriptHash",
        hash: 0x38e2b4f9,
        parameters: &[],
        return_type: "Hash160",
        gas_cost: 16,
        description: "Gets the script hash of the entry script that started the current execution chain. This is the script hash of the contract or transaction that initiated the entire call sequence.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetExecutingScriptHash",
        hash: 0x74a8fedb,
        parameters: &[],
        return_type: "Hash160",
        gas_cost: 16,
        description: "Gets the script hash of the currently executing script. Returns the script hash of the contract that is currently running.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetInvocationCounter",
        hash: 0x43112784,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 16,
        description: "Gets the number of times the current script has been invoked during the current execution. The counter starts at 1 and increments with each recursive or nested invocation.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetNetwork",
        hash: 0xe0a0fbc5,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 8,
        description: "Gets the network ID of the current blockchain. MainNet uses 1, TestNet uses 2, and other values are used for private networks.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetNotifications",
        hash: 0xf1354327,
        parameters: &["Hash160"],
        return_type: "Array",
        gas_cost: 4096,
        description: "Gets all notifications emitted during the execution of a specific contract. Takes a script hash parameter to filter notifications by source contract. Returns an array of notification objects containing the event name and data.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetRandom",
        hash: 0x28a9de6b,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 0,
        description: "Gets a pseudo-random number generated from the current block's random seed and the transaction hash. The value is deterministic for the same block and transaction.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetScriptContainer",
        hash: 0x3008512d,
        parameters: &[],
        return_type: "StackItem",
        gas_cost: 8,
        description: "Gets the current script container, which is typically the transaction that triggered the contract execution. Returns a StackItem representing the script container.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetTime",
        hash: 0x0388c3b7,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 8,
        description: "Gets the timestamp of the current block. The timestamp is in Unix epoch format (seconds since January 1, 1970).",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.GetTrigger",
        hash: 0xa0387de9,
        parameters: &[],
        return_type: "Integer",
        gas_cost: 8,
        description: "Gets the trigger type that started the contract execution. Returns 0x01 (Verification) for verification context, or 0x10 (Application) for application context.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.LoadScript",
        hash: 0x8f800cb3,
        parameters: &["ByteString", "Integer", "Array"],
        return_type: "Void",
        gas_cost: 32768,
        description: "Loads and executes a script from a byte string. Takes the script bytecode, the call flags to use, and an array of arguments. Used for dynamic script execution within a contract.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.Log",
        hash: 0x9647e7cf,
        parameters: &["ByteString"],
        return_type: "Void",
        gas_cost: 32768,
        description: "Emits a log message that is stored in the application log. The message is recorded as part of the transaction execution results and can be used for debugging and monitoring.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.Notify",
        hash: 0x616f0195,
        parameters: &["ByteString", "Array"],
        return_type: "Void",
        gas_cost: 32768,
        description: "Emits a notification event from the smart contract. Takes an event name and an array of data items. Notifications are stored in the application log and can be watched by external applications.",
    },
    NeoVMSyscallInfo {
        name: "System.Runtime.Platform",
        hash: 0xf6fc79b2,
        parameters: &[],
        return_type: "String",
        gas_cost: 8,
        description: "Returns the platform identifier string. For Neo N3, this returns \"NEO\" to identify the blockchain platform.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.AsReadOnly",
        hash: 0xe9bf4c76,
        parameters: &["StorageContext"],
        return_type: "StorageContext",
        gas_cost: 16,
        description: "Converts a storage context to a read-only context. The returned context can be used for read operations but any write attempts will fail. Useful for safely passing storage access to other contracts.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.Delete",
        hash: 0xedc5582f,
        parameters: &["StorageContext", "ByteString"],
        return_type: "Void",
        gas_cost: 32768,
        description: "Deletes a storage entry by its key. Takes a storage context and a key byte string. The entry is permanently removed from the contract's storage.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.Find",
        hash: 0x9ab830df,
        parameters: &["StorageContext", "ByteString", "Integer"],
        return_type: "Iterator",
        gas_cost: 32768,
        description: "Returns an iterator for searching storage entries. Takes a storage context, a prefix key, and a search options flags. The options can specify whether to search keys only, values only, or both.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.Get",
        hash: 0x31e85d92,
        parameters: &["StorageContext", "ByteString"],
        return_type: "ByteString",
        gas_cost: 32768,
        description: "Gets the value of a storage entry by its key. Takes a storage context and a key byte string. Returns the stored value as a byte string, or null if the key does not exist.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.GetContext",
        hash: 0xce67f69b,
        parameters: &[],
        return_type: "StorageContext",
        gas_cost: 16,
        description: "Gets the storage context for the current contract. The storage context is required for all storage operations and defines the current contract's storage partition.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.GetReadOnlyContext",
        hash: 0xe26bb4f6,
        parameters: &[],
        return_type: "StorageContext",
        gas_cost: 16,
        description: "Gets a read-only storage context for the current contract. Any attempts to modify storage using this context will fail. Useful for safely exposing storage access to other contracts.",
    },
    NeoVMSyscallInfo {
        name: "System.Storage.Put",
        hash: 0x84183fe6,
        parameters: &["StorageContext", "ByteString", "ByteString"],
        return_type: "Void",
        gas_cost: 32768,
        description: "Stores a key-value pair in the contract's persistent storage. Takes a storage context, a key, and a value as byte strings. If the key already exists, the value is overwritten.",
    },
];