pub struct NeoVMSyscall;Expand description
Neo N3 System Call Wrapper
Implementations§
Source§impl NeoVMSyscall
impl NeoVMSyscall
Sourcepub fn set_active_contract_hash(hash: &NeoByteString) -> Result<(), NeoError>
pub fn set_active_contract_hash(hash: &NeoByteString) -> Result<(), NeoError>
Set the active contract hash used by host-mode storage contexts and script-hash syscalls.
Sourcepub fn set_active_script_hashes(
calling: &NeoByteString,
entry: &NeoByteString,
executing: &NeoByteString,
) -> Result<(), NeoError>
pub fn set_active_script_hashes( calling: &NeoByteString, entry: &NeoByteString, executing: &NeoByteString, ) -> Result<(), NeoError>
Configure host-mode calling/entry/executing script hashes.
Sourcepub fn set_active_calling_script_hash(
hash: &NeoByteString,
) -> Result<(), NeoError>
pub fn set_active_calling_script_hash( hash: &NeoByteString, ) -> Result<(), NeoError>
Configure host-mode calling script hash. Clears nested invocation frames and applies this value as a new base state.
Sourcepub fn set_active_entry_script_hash(
hash: &NeoByteString,
) -> Result<(), NeoError>
pub fn set_active_entry_script_hash( hash: &NeoByteString, ) -> Result<(), NeoError>
Configure host-mode entry script hash. Clears nested invocation frames and applies this value as a new base state.
Sourcepub fn set_active_executing_script_hash(
hash: &NeoByteString,
) -> Result<(), NeoError>
pub fn set_active_executing_script_hash( hash: &NeoByteString, ) -> Result<(), NeoError>
Configure host-mode executing script hash. Clears nested invocation frames and applies this value as a new base state.
Sourcepub fn set_active_call_flags(call_flags: &NeoInteger) -> Result<(), NeoError>
pub fn set_active_call_flags(call_flags: &NeoInteger) -> Result<(), NeoError>
Configure host-mode active call flags (Neo N3 CallFlags mask: 0x00..=0x0F). Clears nested invocation frames and applies this value as a new base state.
Sourcepub fn begin_contract_invocation(
next_executing: &NeoByteString,
) -> Result<(), NeoError>
pub fn begin_contract_invocation( next_executing: &NeoByteString, ) -> Result<(), NeoError>
Enter a nested contract invocation frame in host mode.
The new frame preserves entry, shifts calling <- previous executing,
and sets executing to next_executing.
Sourcepub fn end_contract_invocation() -> Result<(), NeoError>
pub fn end_contract_invocation() -> Result<(), NeoError>
Exit the most recent nested contract invocation frame in host mode.
Sourcepub fn with_contract_invocation<T, F>(
next_executing: &NeoByteString,
operation: F,
) -> Result<T, NeoError>
pub fn with_contract_invocation<T, F>( next_executing: &NeoByteString, operation: F, ) -> Result<T, NeoError>
Run an operation in a nested host invocation frame, always unwinding the frame.
Sourcepub fn reset_host_state() -> Result<(), NeoError>
pub fn reset_host_state() -> Result<(), NeoError>
Clear host-mode syscall/storage simulation state.
Sourcepub fn set_active_witnesses(witnesses: &[NeoByteString]) -> Result<(), NeoError>
pub fn set_active_witnesses(witnesses: &[NeoByteString]) -> Result<(), NeoError>
Replace the active witness set used by host-mode check_witness.
Sourcepub fn set_crypto_verification_results(
check_sig: bool,
check_multisig: bool,
) -> Result<(), NeoError>
pub fn set_crypto_verification_results( check_sig: bool, check_multisig: bool, ) -> Result<(), NeoError>
Configure host-mode CheckSig/CheckMultisig results.
verify_with_ecdsa tracks check_sig unless overridden explicitly.
Sourcepub fn set_crypto_verification_results_full(
check_sig: bool,
check_multisig: bool,
verify_with_ecdsa: bool,
) -> Result<(), NeoError>
pub fn set_crypto_verification_results_full( check_sig: bool, check_multisig: bool, verify_with_ecdsa: bool, ) -> Result<(), NeoError>
Configure host-mode crypto syscall results (secure default: all false).
Sourcepub fn set_verify_with_ecdsa_result(result: bool) -> Result<(), NeoError>
pub fn set_verify_with_ecdsa_result(result: bool) -> Result<(), NeoError>
Configure host-mode VerifyWithECDsa syscall result.
Sourcepub fn get_time() -> Result<NeoInteger, NeoError>
pub fn get_time() -> Result<NeoInteger, NeoError>
Get current timestamp
Sourcepub fn get_time_i64() -> Result<i64, NeoError>
pub fn get_time_i64() -> Result<i64, NeoError>
Get current timestamp as a plain i64.
This keeps wasm contracts on the direct syscall import path and avoids pulling arbitrary-precision integer conversion code into small contracts that only need the native timestamp.
Sourcepub fn check_witness(account: &NeoByteString) -> Result<NeoBoolean, NeoError>
pub fn check_witness(account: &NeoByteString) -> Result<NeoBoolean, NeoError>
Check if the specified account is a witness
Sourcepub fn check_witness_bytes(account: &[u8]) -> Result<NeoBoolean, NeoError>
pub fn check_witness_bytes(account: &[u8]) -> Result<NeoBoolean, NeoError>
Check if the specified account hash/public key bytes are a witness.
Sourcepub fn check_witness_i64(account: i64) -> Result<NeoBoolean, NeoError>
pub fn check_witness_i64(account: i64) -> Result<NeoBoolean, NeoError>
Check a compact sample-account identifier as a witness.
This helper exists for the repository sample contracts that expose
account IDs as integers. Production contracts should prefer
check_witness/check_witness_bytes with real Hash160 account bytes.
Sourcepub fn notify(
event: &NeoString,
state: &NeoArray<NeoValue>,
) -> Result<(), NeoError>
pub fn notify( event: &NeoString, state: &NeoArray<NeoValue>, ) -> Result<(), NeoError>
Send notification to the runtime.
Sourcepub fn notify_event(event: &str) -> Result<(), NeoError>
pub fn notify_event(event: &str) -> Result<(), NeoError>
Send a notification with an empty state array.
pub fn get_trigger() -> Result<NeoInteger, NeoError>
pub fn get_invocation_counter() -> Result<NeoInteger, NeoError>
pub fn get_random() -> Result<NeoInteger, NeoError>
pub fn get_network() -> Result<NeoInteger, NeoError>
pub fn get_address_version() -> Result<NeoInteger, NeoError>
pub fn get_gas_left() -> Result<NeoInteger, NeoError>
pub fn get_calling_script_hash() -> Result<NeoByteString, NeoError>
pub fn get_calling_script_hash_i64() -> Result<i64, NeoError>
pub fn get_entry_script_hash() -> Result<NeoByteString, NeoError>
pub fn get_entry_script_hash_i64() -> Result<i64, NeoError>
pub fn get_executing_script_hash() -> Result<NeoByteString, NeoError>
pub fn get_executing_script_hash_i64() -> Result<i64, NeoError>
Sourcepub fn get_notifications(
script_hash: Option<&NeoByteString>,
) -> Result<NeoArray<NeoValue>, NeoError>
pub fn get_notifications( script_hash: Option<&NeoByteString>, ) -> Result<NeoArray<NeoValue>, NeoError>
Get notifications for the specified script hash, or all notifications if None.
pub fn get_script_container() -> Result<NeoArray<NeoValue>, NeoError>
Sourcepub fn current_signers() -> Result<NeoArray<NeoValue>, NeoError>
pub fn current_signers() -> Result<NeoArray<NeoValue>, NeoError>
Get active transaction signers.
Sourcepub fn load_script(
script: &NeoByteString,
call_flags: &NeoInteger,
args: &NeoArray<NeoValue>,
) -> Result<(), NeoError>
pub fn load_script( script: &NeoByteString, call_flags: &NeoInteger, args: &NeoArray<NeoValue>, ) -> Result<(), NeoError>
Dynamically load and execute a script.
Sourcepub fn contract_call(
script_hash: &NeoByteString,
method: &NeoString,
call_flags: &NeoInteger,
args: &NeoArray<NeoValue>,
) -> Result<NeoValue, NeoError>
pub fn contract_call( script_hash: &NeoByteString, method: &NeoString, call_flags: &NeoInteger, args: &NeoArray<NeoValue>, ) -> Result<NeoValue, NeoError>
Call any contract method.
Sourcepub fn contract_call_native(
native_id: &NeoInteger,
) -> Result<NeoValue, NeoError>
pub fn contract_call_native( native_id: &NeoInteger, ) -> Result<NeoValue, NeoError>
Call a native contract by id.