pub struct NeoVMSyscall;Expand description
Neo N3 System Call Wrapper
Implementations§
Source§impl NeoVMSyscall
impl NeoVMSyscall
Sourcepub fn set_active_contract_hash(hash: &NeoByteString) -> NeoResult<()>
pub fn set_active_contract_hash(hash: &NeoByteString) -> NeoResult<()>
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,
) -> NeoResult<()>
pub fn set_active_script_hashes( calling: &NeoByteString, entry: &NeoByteString, executing: &NeoByteString, ) -> NeoResult<()>
Configure host-mode calling/entry/executing script hashes.
Sourcepub fn set_active_calling_script_hash(hash: &NeoByteString) -> NeoResult<()>
pub fn set_active_calling_script_hash(hash: &NeoByteString) -> NeoResult<()>
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) -> NeoResult<()>
pub fn set_active_entry_script_hash(hash: &NeoByteString) -> NeoResult<()>
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) -> NeoResult<()>
pub fn set_active_executing_script_hash(hash: &NeoByteString) -> NeoResult<()>
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) -> NeoResult<()>
pub fn set_active_call_flags(call_flags: &NeoInteger) -> NeoResult<()>
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,
) -> NeoResult<()>
pub fn begin_contract_invocation( next_executing: &NeoByteString, ) -> NeoResult<()>
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() -> NeoResult<()>
pub fn end_contract_invocation() -> NeoResult<()>
Exit the most recent nested contract invocation frame in host mode.
Sourcepub fn with_contract_invocation<T, F>(
next_executing: &NeoByteString,
operation: F,
) -> NeoResult<T>
pub fn with_contract_invocation<T, F>( next_executing: &NeoByteString, operation: F, ) -> NeoResult<T>
Run an operation in a nested host invocation frame, always unwinding the frame.
Sourcepub fn reset_host_state() -> NeoResult<()>
pub fn reset_host_state() -> NeoResult<()>
Clear host-mode syscall/storage simulation state.
Sourcepub fn seed_storage(entries: &[(&[u8], &[u8])]) -> NeoResult<()>
pub fn seed_storage(entries: &[(&[u8], &[u8])]) -> NeoResult<()>
Seed host-mode storage with the given key/value pairs (D6: bridges
neo-test::TestEnvironment::set_storage to the global syscall mock so
contract code reading via NeoStorage/RawStorage sees the same
store). Pairs are written under the currently executing contract
hash (set via set_active_contract_hash / set_current_contract_hash;
default zero-sentinel). On wasm32 this is a no-op.
Sourcepub fn set_active_witnesses(witnesses: &[NeoByteString]) -> NeoResult<()>
pub fn set_active_witnesses(witnesses: &[NeoByteString]) -> NeoResult<()>
Replace the active witness set used by host-mode check_witness.
Sourcepub fn set_active_random(value: i64) -> NeoResult<()>
pub fn set_active_random(value: i64) -> NeoResult<()>
B5: set the value returned by host-mode get_random.
On the wasm32 path this is a no-op (the extern returns
the chain’s real random value).
Sourcepub fn set_active_time(value: i64) -> NeoResult<()>
pub fn set_active_time(value: i64) -> NeoResult<()>
B6: set the value returned by host-mode get_time.
On the wasm32 path this is a no-op.
Sourcepub fn set_active_invocation_counter(value: i32) -> NeoResult<()>
pub fn set_active_invocation_counter(value: i32) -> NeoResult<()>
B6: set the value returned by host-mode
get_invocation_counter. On the wasm32 path this is a
no-op.
Sourcepub fn set_active_gas_left(value: i64) -> NeoResult<()>
pub fn set_active_gas_left(value: i64) -> NeoResult<()>
B7: set the value returned by host-mode get_gas_left.
On the wasm32 path this is a no-op.
Sourcepub fn set_crypto_verification_results(
check_sig: bool,
check_multisig: bool,
) -> NeoResult<()>
pub fn set_crypto_verification_results( check_sig: bool, check_multisig: bool, ) -> NeoResult<()>
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,
) -> NeoResult<()>
pub fn set_crypto_verification_results_full( check_sig: bool, check_multisig: bool, verify_with_ecdsa: bool, ) -> NeoResult<()>
Configure host-mode crypto syscall results (secure default: all false).
Sourcepub fn set_verify_with_ecdsa_result(result: bool) -> NeoResult<()>
pub fn set_verify_with_ecdsa_result(result: bool) -> NeoResult<()>
Configure host-mode VerifyWithECDsa syscall result.
Sourcepub fn get_time() -> NeoResult<NeoInteger>
pub fn get_time() -> NeoResult<NeoInteger>
Get current timestamp
Sourcepub fn get_time_i64() -> NeoResult<i64>
pub fn get_time_i64() -> NeoResult<i64>
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) -> NeoResult<NeoBoolean>
pub fn check_witness(account: &NeoByteString) -> NeoResult<NeoBoolean>
Check if the specified account is a witness
Sourcepub fn check_witness_bytes(account: &[u8]) -> NeoResult<NeoBoolean>
pub fn check_witness_bytes(account: &[u8]) -> NeoResult<NeoBoolean>
Check if the specified account hash/public key bytes are a witness.
Sourcepub fn check_witness_i64(account: i64) -> NeoResult<NeoBoolean>
pub fn check_witness_i64(account: i64) -> NeoResult<NeoBoolean>
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>) -> NeoResult<()>
pub fn notify(event: &NeoString, state: &NeoArray<NeoValue>) -> NeoResult<()>
Send notification to the runtime.
Sourcepub fn notify_event(event: &str) -> NeoResult<()>
pub fn notify_event(event: &str) -> NeoResult<()>
Send a notification with an empty state array.
pub fn get_trigger() -> NeoResult<NeoInteger>
pub fn get_invocation_counter() -> NeoResult<NeoInteger>
pub fn get_random() -> NeoResult<NeoInteger>
pub fn get_network() -> NeoResult<NeoInteger>
pub fn get_address_version() -> NeoResult<NeoInteger>
pub fn get_gas_left() -> NeoResult<NeoInteger>
pub fn get_calling_script_hash() -> NeoResult<NeoByteString>
pub fn get_calling_script_hash_i64() -> NeoResult<i64>
pub fn get_entry_script_hash() -> NeoResult<NeoByteString>
pub fn get_entry_script_hash_i64() -> NeoResult<i64>
pub fn get_executing_script_hash() -> NeoResult<NeoByteString>
pub fn get_executing_script_hash_i64() -> NeoResult<i64>
Sourcepub fn get_notifications(
script_hash: Option<&NeoByteString>,
) -> NeoResult<NeoArray<NeoValue>>
pub fn get_notifications( script_hash: Option<&NeoByteString>, ) -> NeoResult<NeoArray<NeoValue>>
Get notifications for the specified script hash, or all notifications if None.
pub fn get_script_container() -> NeoResult<NeoArray<NeoValue>>
Sourcepub fn burn_gas(gas: &NeoInteger) -> NeoResult<()>
pub fn burn_gas(gas: &NeoInteger) -> NeoResult<()>
Burn GAS.
Sourcepub fn current_signers() -> NeoResult<NeoArray<NeoValue>>
pub fn current_signers() -> NeoResult<NeoArray<NeoValue>>
Get active transaction signers.
Sourcepub fn load_script(
script: &NeoByteString,
call_flags: &NeoInteger,
args: &NeoArray<NeoValue>,
) -> NeoResult<()>
pub fn load_script( script: &NeoByteString, call_flags: &NeoInteger, args: &NeoArray<NeoValue>, ) -> NeoResult<()>
Dynamically load and execute a script.
Sourcepub fn contract_call(
script_hash: &NeoByteString,
method: &NeoString,
call_flags: &NeoInteger,
args: &NeoArray<NeoValue>,
) -> NeoResult<NeoValue>
pub fn contract_call( script_hash: &NeoByteString, method: &NeoString, call_flags: &NeoInteger, args: &NeoArray<NeoValue>, ) -> NeoResult<NeoValue>
Call any contract method.
Sourcepub fn contract_call_native(native_id: &NeoInteger) -> NeoResult<NeoValue>
pub fn contract_call_native(native_id: &NeoInteger) -> NeoResult<NeoValue>
Call a native contract by id.