Skip to main content

NeoRuntime

Struct NeoRuntime 

Source
pub struct NeoRuntime;
Expand description

Direct wrappers for the canonical System.Runtime syscalls.

Implementations§

Source§

impl NeoRuntime

Source

pub fn get_time() -> NeoResult<NeoInteger>

Source

pub fn get_time_i64() -> NeoResult<i64>

Source

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

Source

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

Source

pub fn check_witness_i64(account: i64) -> NeoResult<NeoBoolean>

Source

pub fn require_witness_i64(account: i64) -> bool

Canonical witness guard for i64-encoded accounts: returns true if the runtime confirms the caller controls account, false on any syscall error or denial. This is the single helper every state-changing contract entry point should call before acting on a caller-supplied identity, to prevent the “caller passed as a parameter” authorization-bypass class (audit X1–X5). Mirrors the ad-hoc ensure_witness_i64 already used by timelock-vault, staking-rewards, and crowdfunding.

Source

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

Source

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

Source

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

Source

pub fn platform() -> NeoResult<NeoString>

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

Source

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

Source

pub fn get_storage_context() -> NeoResult<NeoStorageContext>

Source

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

Burn the specified amount of GAS from the calling contract.

Source

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

Get the signers of the current transaction.

Source

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

Load and execute a script dynamically.

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> Same for T

Source§

type Output = T

Should always be Self
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.