Skip to main content

NeoVMSyscall

Struct NeoVMSyscall 

Source
pub struct NeoVMSyscall;
Expand description

Neo N3 System Call Wrapper

Implementations§

Source§

impl NeoVMSyscall

Source

pub fn set_active_contract_hash(hash: &NeoByteString) -> NeoResult<()>

Set the active contract hash used by host-mode storage contexts and script-hash syscalls.

Source

pub fn set_active_script_hashes( calling: &NeoByteString, entry: &NeoByteString, executing: &NeoByteString, ) -> NeoResult<()>

Configure host-mode calling/entry/executing script hashes.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn end_contract_invocation() -> NeoResult<()>

Exit the most recent nested contract invocation frame in host mode.

Source

pub fn with_contract_invocation<T, F>( next_executing: &NeoByteString, operation: F, ) -> NeoResult<T>
where F: FnOnce() -> NeoResult<T>,

Run an operation in a nested host invocation frame, always unwinding the frame.

Source

pub fn reset_host_state() -> NeoResult<()>

Clear host-mode syscall/storage simulation state.

Source

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.

Source

pub fn set_active_witnesses(witnesses: &[NeoByteString]) -> NeoResult<()>

Replace the active witness set used by host-mode check_witness.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

pub fn set_verify_with_ecdsa_result(result: bool) -> NeoResult<()>

Configure host-mode VerifyWithECDsa syscall result.

Source

pub fn get_time() -> NeoResult<NeoInteger>

Get current timestamp

Source

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.

Source

pub fn check_witness(account: &NeoByteString) -> NeoResult<NeoBoolean>

Check if the specified account is a witness

Source

pub fn check_witness_bytes(account: &[u8]) -> NeoResult<NeoBoolean>

Check if the specified account hash/public key bytes are a witness.

Source

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.

Source

pub fn notify(event: &NeoString, state: &NeoArray<NeoValue>) -> NeoResult<()>

Send notification to the runtime.

Source

pub fn notify_event(event: &str) -> NeoResult<()>

Send a notification with an empty state array.

Source

pub fn log(message: &NeoString) -> NeoResult<()>

Log message to the runtime.

Source

pub fn platform() -> NeoResult<NeoString>

Platform identifier

Source

pub fn get_trigger() -> NeoResult<NeoInteger>

Source

pub fn get_invocation_counter() -> NeoResult<NeoInteger>

Source

pub fn get_random() -> NeoResult<NeoInteger>

Source

pub fn get_network() -> NeoResult<NeoInteger>

Source

pub fn get_address_version() -> NeoResult<NeoInteger>

Source

pub fn get_gas_left() -> NeoResult<NeoInteger>

Source

pub fn get_calling_script_hash() -> NeoResult<NeoByteString>

Source

pub fn get_calling_script_hash_i64() -> NeoResult<i64>

Source

pub fn get_entry_script_hash() -> NeoResult<NeoByteString>

Source

pub fn get_entry_script_hash_i64() -> NeoResult<i64>

Source

pub fn get_executing_script_hash() -> NeoResult<NeoByteString>

Source

pub fn get_executing_script_hash_i64() -> NeoResult<i64>

Source

pub fn get_notifications( script_hash: Option<&NeoByteString>, ) -> NeoResult<NeoArray<NeoValue>>

Get notifications for the specified script hash, or all notifications if None.

Source

pub fn get_script_container() -> NeoResult<NeoArray<NeoValue>>

Source

pub fn burn_gas(gas: &NeoInteger) -> NeoResult<()>

Burn GAS.

Source

pub fn current_signers() -> NeoResult<NeoArray<NeoValue>>

Get active transaction signers.

Source

pub fn load_script( script: &NeoByteString, call_flags: &NeoInteger, args: &NeoArray<NeoValue>, ) -> NeoResult<()>

Dynamically load and execute a script.

Source

pub fn contract_call( script_hash: &NeoByteString, method: &NeoString, call_flags: &NeoInteger, args: &NeoArray<NeoValue>, ) -> NeoResult<NeoValue>

Call any contract method.

Source

pub fn contract_call_native(native_id: &NeoInteger) -> NeoResult<NeoValue>

Call a native contract by id.

Source

pub fn get_call_flags() -> NeoResult<NeoInteger>

Source

pub fn create_standard_account( pubkey: &NeoByteString, ) -> NeoResult<NeoByteString>

Source

pub fn create_multisig_account( threshold: &NeoInteger, public_keys: &NeoArray<NeoValue>, ) -> NeoResult<NeoByteString>

Source

pub fn native_on_persist() -> NeoResult<()>

Source

pub fn native_post_persist() -> NeoResult<()>

Source

pub fn check_sig( pubkey: &NeoByteString, signature: &NeoByteString, ) -> NeoResult<NeoBoolean>

Source

pub fn check_multisig( pubkeys: &NeoArray<NeoValue>, signatures: &NeoArray<NeoValue>, ) -> NeoResult<NeoBoolean>

Source

pub fn verify_with_ecdsa( message: &NeoByteString, public_key: &NeoByteString, signature: &NeoByteString, curve: &NeoInteger, ) -> NeoResult<NeoBoolean>

Source

pub fn iterator_next(items: &NeoArray<NeoValue>) -> NeoResult<NeoBoolean>

Source

pub fn iterator_value(items: &NeoArray<NeoValue>) -> NeoResult<NeoValue>

Source

pub fn storage_get_context() -> NeoResult<NeoStorageContext>

Source

pub fn storage_get_read_only_context() -> NeoResult<NeoStorageContext>

Source

pub fn storage_as_read_only( context: &NeoStorageContext, ) -> NeoResult<NeoStorageContext>

Source

pub fn storage_get( context: &NeoStorageContext, key: &NeoByteString, ) -> NeoResult<NeoByteString>

Source

pub fn storage_try_get( context: &NeoStorageContext, key: &NeoByteString, ) -> NeoResult<Option<NeoByteString>>

Source

pub fn storage_put( context: &NeoStorageContext, key: &NeoByteString, value: &NeoByteString, ) -> NeoResult<()>

Source

pub fn storage_delete( context: &NeoStorageContext, key: &NeoByteString, ) -> NeoResult<()>

Source

pub fn storage_find( context: &NeoStorageContext, prefix: &NeoByteString, ) -> NeoResult<NeoIterator<NeoValue>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.