Enum HostFnImpl

Source
pub enum HostFnImpl {}
Expand description

Implements HostFn when compiled on supported architectures (RISC-V).

Trait Implementations§

Source§

impl HostFn for HostFnImpl

Source§

fn instantiate( ref_time_limit: u64, proof_size_limit: u64, deposit_limit: &[u8; 32], value: &[u8; 32], input: &[u8], address: Option<&mut [u8; 20]>, output: Option<&mut &mut [u8]>, salt: Option<&[u8; 32]>, ) -> Result<(), ReturnErrorCode>

Instantiate a contract with the specified code hash. Read more
Source§

fn call( flags: CallFlags, callee: &[u8; 20], ref_time_limit: u64, proof_size_limit: u64, deposit_limit: &[u8; 32], value: &[u8; 32], input: &[u8], output: Option<&mut &mut [u8]>, ) -> Result<(), ReturnErrorCode>

Call (possibly transferring some amount of funds) into the specified account. Read more
Source§

fn delegate_call( flags: CallFlags, address: &[u8; 20], ref_time_limit: u64, proof_size_limit: u64, deposit_limit: &[u8; 32], input: &[u8], output: Option<&mut &mut [u8]>, ) -> Result<(), ReturnErrorCode>

Execute code in the context (storage, caller, value) of the current contract. Read more
Source§

fn deposit_event(topics: &[[u8; 32]], data: &[u8])

Deposit a contract event with the data buffer and optional list of topics. There is a limit on the maximum number of topics specified by event_topics. Read more
Source§

fn set_storage( flags: StorageFlags, key: &[u8], encoded_value: &[u8], ) -> Option<u32>

Set the value at the given key in the contract storage. Read more
Source§

fn get_storage( flags: StorageFlags, key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>

Retrieve the value under the given key from storage. Read more
Source§

fn call_data_load(out_ptr: &mut [u8; 32], offset: u32)

Stores the U256 value at given offset from the input passed by the caller into the supplied buffer. Read more
Source§

fn gas_limit() -> u64

Returns the block ref_time limit.
Source§

fn call_data_size() -> u64

Returns the call data size.
Source§

fn return_value(flags: ReturnFlags, return_value: &[u8]) -> !

Cease contract execution and save a data buffer as a result of the execution. Read more
Source§

fn gas_price() -> u64

Returns the price per ref_time, akin to the EVM GASPRICE opcode.
Source§

fn base_fee(output: &mut [u8; 32])

Returns the base fee, akin to the EVM BASEFEE opcode.
Source§

fn balance(output: &mut [u8; 32])

Stores the reducible balance of the current account into the supplied buffer. Read more
Source§

fn value_transferred(output: &mut [u8; 32])

Stores the value transferred along with this call/instantiate into the supplied buffer. Read more
Source§

fn now(output: &mut [u8; 32])

Load the latest block timestamp in seconds into the supplied buffer Read more
Source§

fn chain_id(output: &mut [u8; 32])

Returns the EIP-155 chain ID.
Source§

fn address(output: &mut [u8; 20])

Stores the address of the current contract into the supplied buffer. Read more
Source§

fn caller(output: &mut [u8; 20])

Stores the address of the caller into the supplied buffer. Read more
Source§

fn origin(output: &mut [u8; 20])

Stores the origin address (initator of the call stack) into the supplied buffer. Read more
Source§

fn block_number(output: &mut [u8; 32])

Stores the current block number of the current contract into the supplied buffer. Read more
Source§

fn block_author(output: &mut [u8; 20])

Stores the current block author of into the supplied buffer. Read more
Source§

fn weight_to_fee( ref_time_limit: u64, proof_size_limit: u64, output: &mut [u8; 32], )

Stores the price for the specified amount of gas into the supplied buffer. Read more
Source§

fn hash_keccak_256(input: &[u8], output: &mut [u8; 32])

Computes the keccak_256 32-bit hash on the given input buffer. Read more
Source§

fn get_immutable_data(output: &mut &mut [u8])

Get the contract immutable data. Read more
Source§

fn set_immutable_data(data: &[u8])

Set the contract immutable data. Read more
Source§

fn balance_of(address: &[u8; 20], output: &mut [u8; 32])

Stores the reducible balance of the supplied address into the supplied buffer. Read more
Source§

fn code_hash(address: &[u8; 20], output: &mut [u8; 32])

Retrieve the code hash for a specified contract address. Read more
Source§

fn code_size(address: &[u8; 20]) -> u64

Returns the code size for a specified contract address. Read more
Source§

fn return_data_size() -> u64

Returns the size of the returned data of the last contract call or instantiation.
Source§

fn return_data_copy(output: &mut &mut [u8], offset: u32)

Stores the returned data of the last contract call or contract instantiation. Read more
Source§

fn ref_time_left() -> u64

Returns the amount of ref_time left.
Source§

fn to_account_id(address: &[u8; 20], output: &mut [u8])

Available on crate feature unstable-hostfn only.
Retrieve the account id for a specified address. Read more
Source§

fn block_hash(block_number_ptr: &[u8; 32], output: &mut [u8; 32])

Available on crate feature unstable-hostfn only.
Stores the block hash of the given block number into the supplied buffer. Read more
Source§

fn call_chain_extension( func_id: u32, input: &[u8], output: Option<&mut &mut [u8]>, ) -> u32

Available on crate feature unstable-hostfn only.
Call into the chain extension provided by the chain if any. Read more
Source§

fn call_data_copy(output: &mut [u8], offset: u32)

Stores the input data passed by the caller into the supplied output buffer, starting from the given input data offset. Read more
Source§

fn call_runtime(call: &[u8]) -> Result<(), ReturnErrorCode>

Available on crate feature unstable-hostfn only.
Call some dispatchable of the runtime. Read more
Source§

fn caller_is_origin() -> bool

Available on crate feature unstable-hostfn only.
Checks whether the caller of the current contract is the origin of the whole call stack. Read more
Source§

fn caller_is_root() -> bool

Available on crate feature unstable-hostfn only.
Checks whether the caller of the current contract is root. Read more
Source§

fn clear_storage(flags: StorageFlags, key: &[u8]) -> Option<u32>

Available on crate feature unstable-hostfn only.
Clear the value at the given key in the contract storage. Read more
Source§

fn contains_storage(flags: StorageFlags, key: &[u8]) -> Option<u32>

Available on crate feature unstable-hostfn only.
Checks whether there is a value stored under the given key. Read more
Source§

fn ecdsa_to_eth_address( pubkey: &[u8; 33], output: &mut [u8; 20], ) -> Result<(), ReturnErrorCode>

Available on crate feature unstable-hostfn only.
Calculates Ethereum address from the ECDSA compressed public key and stores it into the supplied buffer. Read more
Source§

fn hash_blake2_256(input: &[u8], output: &mut [u8; 32])

Available on crate feature unstable-hostfn only.
Computes the blake2_256 32-bit hash on the given input buffer. Read more
Source§

fn hash_blake2_128(input: &[u8], output: &mut [u8; 16])

Available on crate feature unstable-hostfn only.
Computes the blake2_128 16-bit hash on the given input buffer. Read more
Source§

fn is_contract(address: &[u8; 20]) -> bool

Available on crate feature unstable-hostfn only.
Checks whether a specified address belongs to a contract. Read more
Source§

fn minimum_balance(output: &mut [u8; 32])

Available on crate feature unstable-hostfn only.
Stores the minimum balance (a.k.a. existential deposit) into the supplied buffer. Read more
Source§

fn own_code_hash(output: &mut [u8; 32])

Available on crate feature unstable-hostfn only.
Retrieve the code hash of the currently executing contract. Read more
Source§

fn set_code_hash(code_hash: &[u8; 32])

Available on crate feature unstable-hostfn only.
Replace the contract code at the specified address with new code. Read more
Source§

fn sr25519_verify( signature: &[u8; 64], message: &[u8], pub_key: &[u8; 32], ) -> Result<(), ReturnErrorCode>

Available on crate feature unstable-hostfn only.
Verify a sr25519 signature Read more
Source§

fn take_storage( flags: StorageFlags, key: &[u8], output: &mut &mut [u8], ) -> Result<(), ReturnErrorCode>

Available on crate feature unstable-hostfn only.
Retrieve and remove the value under the given key from storage. Read more
Source§

fn terminate(beneficiary: &[u8; 20]) -> !

Available on crate feature unstable-hostfn only.
Remove the calling account and transfer remaining free balance. Read more
Source§

fn weight_left(output: &mut &mut [u8])

Available on crate feature unstable-hostfn only.
Stores the amount of weight left into the supplied buffer. The data is encoded as Weight. Read more
Source§

fn xcm_execute(msg: &[u8]) -> Result<(), ReturnErrorCode>

Available on crate feature unstable-hostfn only.
Execute an XCM program locally, using the contract’s address as the origin. This is equivalent to dispatching pallet_xcm::execute through call_runtime, except that the function is called directly instead of being dispatched. Read more
Source§

fn xcm_send( dest: &[u8], msg: &[u8], output: &mut [u8; 32], ) -> Result<(), ReturnErrorCode>

Available on crate feature unstable-hostfn only.
Send an XCM program from the contract to the specified destination. This is equivalent to dispatching pallet_xcm::send through call_runtime, except that the function is called directly instead of being dispatched. Read more

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.
Source§

impl<T> JsonSchemaMaybe for T