referrerpolicy=no-referrer-when-downgrade

Trait pallet_contracts::api_doc::Version0

source ·
pub trait Version0 {
Show 95 methods // Required methods fn noop() -> Result<(), TrapReason>; fn set_storage( key_ptr: u32, value_ptr: u32, value_len: u32, ) -> Result<(), TrapReason>; fn clear_storage(key_ptr: u32) -> Result<(), TrapReason>; fn get_storage( key_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn contains_storage(key_ptr: u32) -> Result<u32, TrapReason>; fn take_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn set_transient_storage( key_ptr: u32, key_len: u32, value_ptr: u32, value_len: u32, ) -> Result<u32, TrapReason>; fn clear_transient_storage( key_ptr: u32, key_len: u32, ) -> Result<u32, TrapReason>; fn get_transient_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn contains_transient_storage( key_ptr: u32, key_len: u32, ) -> Result<u32, TrapReason>; fn take_transient_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn transfer( account_ptr: u32, _account_len: u32, value_ptr: u32, _value_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn call( callee_ptr: u32, _callee_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn delegate_call( flags: u32, code_hash_ptr: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn instantiate( code_hash_ptr: u32, _code_hash_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, address_ptr: u32, address_len_ptr: u32, output_ptr: u32, output_len_ptr: u32, salt_ptr: u32, salt_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn terminate( beneficiary_ptr: u32, _beneficiary_len: u32, ) -> Result<(), TrapReason>; fn input(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_return( flags: u32, data_ptr: u32, data_len: u32, ) -> Result<(), TrapReason>; fn caller(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn is_contract(account_ptr: u32) -> Result<u32, TrapReason>; fn code_hash( account_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn own_code_hash(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn caller_is_origin() -> Result<u32, TrapReason>; fn caller_is_root() -> Result<u32, TrapReason>; fn address(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn weight_to_fee( gas: u64, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn gas_left(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn balance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn value_transferred( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn random( subject_ptr: u32, subject_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn now(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn minimum_balance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn tombstone_deposit( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn restore_to( _dest_ptr: u32, _dest_len: u32, _code_hash_ptr: u32, _code_hash_len: u32, _rent_allowance_ptr: u32, _rent_allowance_len: u32, _delta_ptr: u32, _delta_count: u32, ) -> Result<(), TrapReason>; fn set_rent_allowance( _value_ptr: u32, _value_len: u32, ) -> Result<(), TrapReason>; fn rent_allowance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn deposit_event( topics_ptr: u32, topics_len: u32, data_ptr: u32, data_len: u32, ) -> Result<(), TrapReason>; fn block_number(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn hash_sha2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn hash_keccak_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn hash_blake2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn hash_blake2_128( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn call_chain_extension( id: u32, input_ptr: u32, input_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<u32, TrapReason>; fn debug_message( str_ptr: u32, str_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn call_runtime( call_ptr: u32, call_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn xcm_execute( msg_ptr: u32, msg_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn xcm_send( dest_ptr: u32, msg_ptr: u32, msg_len: u32, output_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn ecdsa_recover( signature_ptr: u32, message_hash_ptr: u32, output_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn sr25519_verify( signature_ptr: u32, pub_key_ptr: u32, message_len: u32, message_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn set_code_hash(code_hash_ptr: u32) -> Result<ReturnErrorCode, TrapReason>; fn ecdsa_to_eth_address( key_ptr: u32, out_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn reentrance_count() -> Result<u32, TrapReason>; fn account_reentrance_count(account_ptr: u32) -> Result<u32, TrapReason>; fn instantiation_nonce() -> Result<u64, TrapReason>; fn lock_delegate_dependency(code_hash_ptr: u32) -> Result<(), TrapReason>; fn unlock_delegate_dependency(code_hash_ptr: u32) -> Result<(), TrapReason>; fn seal_set_storage( key_ptr: u32, value_ptr: u32, value_len: u32, ) -> Result<(), TrapReason>; fn seal_clear_storage(key_ptr: u32) -> Result<(), TrapReason>; fn seal_get_storage( key_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_contains_storage(key_ptr: u32) -> Result<u32, TrapReason>; fn seal_take_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_transfer( account_ptr: u32, _account_len: u32, value_ptr: u32, _value_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_call( callee_ptr: u32, _callee_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_delegate_call( flags: u32, code_hash_ptr: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_instantiate( code_hash_ptr: u32, _code_hash_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, address_ptr: u32, address_len_ptr: u32, output_ptr: u32, output_len_ptr: u32, salt_ptr: u32, salt_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_terminate( beneficiary_ptr: u32, _beneficiary_len: u32, ) -> Result<(), TrapReason>; fn seal_input(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_caller(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_is_contract(account_ptr: u32) -> Result<u32, TrapReason>; fn seal_code_hash( account_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_own_code_hash( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_caller_is_origin() -> Result<u32, TrapReason>; fn seal_address(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_weight_to_fee( gas: u64, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_gas_left(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_balance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_value_transferred( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_random( subject_ptr: u32, subject_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_now(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>; fn seal_minimum_balance( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_tombstone_deposit( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_restore_to( _dest_ptr: u32, _dest_len: u32, _code_hash_ptr: u32, _code_hash_len: u32, _rent_allowance_ptr: u32, _rent_allowance_len: u32, _delta_ptr: u32, _delta_count: u32, ) -> Result<(), TrapReason>; fn seal_set_rent_allowance( _value_ptr: u32, _value_len: u32, ) -> Result<(), TrapReason>; fn seal_rent_allowance( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_deposit_event( topics_ptr: u32, topics_len: u32, data_ptr: u32, data_len: u32, ) -> Result<(), TrapReason>; fn seal_block_number( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>; fn seal_hash_sha2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn seal_hash_keccak_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn seal_hash_blake2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn seal_hash_blake2_128( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>; fn seal_call_chain_extension( id: u32, input_ptr: u32, input_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<u32, TrapReason>; fn seal_debug_message( str_ptr: u32, str_len: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_ecdsa_recover( signature_ptr: u32, message_hash_ptr: u32, output_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_set_code_hash( code_hash_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>; fn seal_ecdsa_to_eth_address( key_ptr: u32, out_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>;
}
Expand description

All functions available in the seal0 module

Required Methods§

source

fn noop() -> Result<(), TrapReason>

Noop function used to benchmark the time it takes to execute an empty function.

§Wasm Import Statement
(import "seal0" "noop" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn set_storage( key_ptr: u32, value_ptr: u32, value_len: u32, ) -> Result<(), TrapReason>

Set the value at the given key in the contract storage. See [pallet_contracts_uapi::HostFn::set_storage]

§Wasm Import Statement
(import "seal0" "set_storage" (func ...))
source

fn clear_storage(key_ptr: u32) -> Result<(), TrapReason>

Clear the value at the given key in the contract storage. See [pallet_contracts_uapi::HostFn::clear_storage]

§Wasm Import Statement
(import "seal0" "clear_storage" (func ...))
source

fn get_storage( key_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Retrieve the value under the given key from storage. See [pallet_contracts_uapi::HostFn::get_storage]

§Wasm Import Statement
(import "seal0" "get_storage" (func ...))
source

fn contains_storage(key_ptr: u32) -> Result<u32, TrapReason>

Checks whether there is a value stored under the given key. See [pallet_contracts_uapi::HostFn::contains_storage]

§Wasm Import Statement
(import "seal0" "contains_storage" (func ...))
source

fn take_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Retrieve and remove the value under the given key from storage. See [pallet_contracts_uapi::HostFn::take_storage]

§Wasm Import Statement
(import "seal0" "take_storage" (func ...))
source

fn set_transient_storage( key_ptr: u32, key_len: u32, value_ptr: u32, value_len: u32, ) -> Result<u32, TrapReason>

Set the value at the given key in the contract transient storage.

§Wasm Import Statement
(import "seal0" "set_transient_storage" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn clear_transient_storage( key_ptr: u32, key_len: u32, ) -> Result<u32, TrapReason>

Clear the value at the given key in the contract storage.

§Wasm Import Statement
(import "seal0" "clear_transient_storage" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn get_transient_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Retrieve the value under the given key from transient storage.

§Wasm Import Statement
(import "seal0" "get_transient_storage" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn contains_transient_storage( key_ptr: u32, key_len: u32, ) -> Result<u32, TrapReason>

Checks whether there is a value stored under the given key in transient storage.

§Wasm Import Statement
(import "seal0" "contains_transient_storage" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn take_transient_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Retrieve and remove the value under the given key from transient storage.

§Wasm Import Statement
(import "seal0" "take_transient_storage" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn transfer( account_ptr: u32, _account_len: u32, value_ptr: u32, _value_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

Transfer some value to another account. See [pallet_contracts_uapi::HostFn::transfer].

§Wasm Import Statement
(import "seal0" "transfer" (func ...))
source

fn call( callee_ptr: u32, _callee_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Make a call to another contract.

§Note

The values _callee_len and _value_len are ignored because the encoded sizes of those types are fixed through [codec::MaxEncodedLen]. The fields exist for backwards compatibility. Consider switching to the newest version of this function.

§Wasm Import Statement
(import "seal0" "call" (func ...))
source

fn delegate_call( flags: u32, code_hash_ptr: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Execute code in the context (storage, caller, value) of the current contract. See [pallet_contracts_uapi::HostFn::delegate_call].

§Wasm Import Statement
(import "seal0" "delegate_call" (func ...))
source

fn instantiate( code_hash_ptr: u32, _code_hash_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, address_ptr: u32, address_len_ptr: u32, output_ptr: u32, output_len_ptr: u32, salt_ptr: u32, salt_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

Instantiate a contract with the specified code hash. See [pallet_contracts_uapi::HostFn::instantiate].

§Note

The values _code_hash_len and _value_len are ignored because the encoded sizes of those types are fixed through [codec::MaxEncodedLen]. The fields exist for backwards compatibility. Consider switching to the newest version of this function.

§Wasm Import Statement
(import "seal0" "instantiate" (func ...))
source

fn terminate( beneficiary_ptr: u32, _beneficiary_len: u32, ) -> Result<(), TrapReason>

Remove the calling account and transfer remaining balance. See [pallet_contracts_uapi::HostFn::terminate].

§Note

The value _beneficiary_len is ignored because the encoded sizes this type is fixed through [MaxEncodedLen`]. The field exist for backwards compatibility. Consider switching to the newest version of this function.

§Wasm Import Statement
(import "seal0" "terminate" (func ...))
source

fn input(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the input passed by the caller into the supplied buffer. See [pallet_contracts_uapi::HostFn::input].

§Wasm Import Statement
(import "seal0" "input" (func ...))
source

fn seal_return( flags: u32, data_ptr: u32, data_len: u32, ) -> Result<(), TrapReason>

Cease contract execution and save a data buffer as a result of the execution. See [pallet_contracts_uapi::HostFn::return_value].

§Wasm Import Statement
(import "seal0" "seal_return" (func ...))
source

fn caller(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the address of the caller into the supplied buffer. See [pallet_contracts_uapi::HostFn::caller].

§Wasm Import Statement
(import "seal0" "caller" (func ...))
source

fn is_contract(account_ptr: u32) -> Result<u32, TrapReason>

Checks whether a specified address belongs to a contract. See [pallet_contracts_uapi::HostFn::is_contract].

§Wasm Import Statement
(import "seal0" "is_contract" (func ...))
source

fn code_hash( account_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Retrieve the code hash for a specified contract address. See [pallet_contracts_uapi::HostFn::code_hash].

§Wasm Import Statement
(import "seal0" "code_hash" (func ...))
source

fn own_code_hash(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Retrieve the code hash of the currently executing contract. See [pallet_contracts_uapi::HostFn::own_code_hash].

§Wasm Import Statement
(import "seal0" "own_code_hash" (func ...))
source

fn caller_is_origin() -> Result<u32, TrapReason>

Checks whether the caller of the current contract is the origin of the whole call stack. See [pallet_contracts_uapi::HostFn::caller_is_origin].

§Wasm Import Statement
(import "seal0" "caller_is_origin" (func ...))
source

fn caller_is_root() -> Result<u32, TrapReason>

Checks whether the caller of the current contract is root. See [pallet_contracts_uapi::HostFn::caller_is_root].

§Wasm Import Statement
(import "seal0" "caller_is_root" (func ...))
source

fn address(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the address of the current contract into the supplied buffer. See [pallet_contracts_uapi::HostFn::address].

§Wasm Import Statement
(import "seal0" "address" (func ...))
source

fn weight_to_fee( gas: u64, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

Stores the price for the specified amount of gas into the supplied buffer. See [pallet_contracts_uapi::HostFn::weight_to_fee].

§Wasm Import Statement
(import "seal0" "weight_to_fee" (func ...))
source

fn gas_left(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the weight left into the supplied buffer. See [pallet_contracts_uapi::HostFn::gas_left].

§Wasm Import Statement
(import "seal0" "gas_left" (func ...))
source

fn balance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the free balance of the current account into the supplied buffer. See [pallet_contracts_uapi::HostFn::balance].

§Wasm Import Statement
(import "seal0" "balance" (func ...))
source

fn value_transferred(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the value transferred along with this call/instantiate into the supplied buffer. See [pallet_contracts_uapi::HostFn::value_transferred].

§Wasm Import Statement
(import "seal0" "value_transferred" (func ...))
source

fn random( subject_ptr: u32, subject_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. Stores a random number for the current block and the given subject into the supplied buffer.

The value is stored to linear memory at the address pointed to by out_ptr. out_len_ptr must point to a u32 value that describes the available space at out_ptr. This call overwrites it with the size of the value. If the available space at out_ptr is less than the size of the value a trap is triggered.

The data is encoded as T::Hash.

§Wasm Import Statement
(import "seal0" "random" (func ...))
source

fn now(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Load the latest block timestamp into the supplied buffer See [pallet_contracts_uapi::HostFn::now].

§Wasm Import Statement
(import "seal0" "now" (func ...))
source

fn minimum_balance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the minimum balance (a.k.a. existential deposit) into the supplied buffer. See [pallet_contracts_uapi::HostFn::minimum_balance].

§Wasm Import Statement
(import "seal0" "minimum_balance" (func ...))
source

fn tombstone_deposit(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. Stores the tombstone deposit into the supplied buffer.

The value is stored to linear memory at the address pointed to by out_ptr. out_len_ptr must point to a u32 value that describes the available space at out_ptr. This call overwrites it with the size of the value. If the available space at out_ptr is less than the size of the value a trap is triggered.

§Note

There is no longer a tombstone deposit. This function always returns 0.

§Wasm Import Statement
(import "seal0" "tombstone_deposit" (func ...))
source

fn restore_to( _dest_ptr: u32, _dest_len: u32, _code_hash_ptr: u32, _code_hash_len: u32, _rent_allowance_ptr: u32, _rent_allowance_len: u32, _delta_ptr: u32, _delta_count: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. Was used to restore the given destination contract sacrificing the caller.

§Note

The state rent functionality was removed. This is stub only exists for backwards compatibility

§Wasm Import Statement
(import "seal0" "restore_to" (func ...))
source

fn set_rent_allowance( _value_ptr: u32, _value_len: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. Was used to set rent allowance of the contract.

§Note

The state rent functionality was removed. This is stub only exists for backwards compatibility.

§Wasm Import Statement
(import "seal0" "set_rent_allowance" (func ...))
source

fn rent_allowance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. Was used to store the rent allowance into the supplied buffer.

§Note

The state rent functionality was removed. This is stub only exists for backwards compatibility.

§Wasm Import Statement
(import "seal0" "rent_allowance" (func ...))
source

fn deposit_event( topics_ptr: u32, topics_len: u32, data_ptr: u32, data_len: u32, ) -> Result<(), TrapReason>

Deposit a contract event with the data buffer and optional list of topics. See [pallet_contracts_uapi::HostFn::deposit_event]

§Wasm Import Statement
(import "seal0" "deposit_event" (func ...))
source

fn block_number(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

Stores the current block number of the current contract into the supplied buffer. See [pallet_contracts_uapi::HostFn::block_number].

§Wasm Import Statement
(import "seal0" "block_number" (func ...))
source

fn hash_sha2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

Computes the SHA2 256-bit hash on the given input buffer. See [pallet_contracts_uapi::HostFn::hash_sha2_256].

§Wasm Import Statement
(import "seal0" "hash_sha2_256" (func ...))
source

fn hash_keccak_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

Computes the KECCAK 256-bit hash on the given input buffer. See [pallet_contracts_uapi::HostFn::hash_keccak_256].

§Wasm Import Statement
(import "seal0" "hash_keccak_256" (func ...))
source

fn hash_blake2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

Computes the BLAKE2 256-bit hash on the given input buffer. See [pallet_contracts_uapi::HostFn::hash_blake2_256].

§Wasm Import Statement
(import "seal0" "hash_blake2_256" (func ...))
source

fn hash_blake2_128( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

Computes the BLAKE2 128-bit hash on the given input buffer. See [pallet_contracts_uapi::HostFn::hash_blake2_128].

§Wasm Import Statement
(import "seal0" "hash_blake2_128" (func ...))
source

fn call_chain_extension( id: u32, input_ptr: u32, input_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<u32, TrapReason>

Call into the chain extension provided by the chain if any. See [pallet_contracts_uapi::HostFn::call_chain_extension].

§Wasm Import Statement
(import "seal0" "call_chain_extension" (func ...))
source

fn debug_message( str_ptr: u32, str_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

Emit a custom debug message.

No newlines are added to the supplied message. Specifying invalid UTF-8 just drops the message with no trap.

This is a no-op if debug message recording is disabled which is always the case when the code is executing on-chain. The message is interpreted as UTF-8 and appended to the debug buffer which is then supplied to the calling RPC client.

§Note

Even though no action is taken when debug message recording is disabled there is still a non trivial overhead (and weight cost) associated with calling this function. Contract languages should remove calls to this function (either at runtime or compile time) when not being executed as an RPC. For example, they could allow users to disable logging through compile time flags (cargo features) for on-chain deployment. Additionally, the return value of this function can be cached in order to prevent further calls at runtime.

§Wasm Import Statement
(import "seal0" "debug_message" (func ...))
source

fn call_runtime( call_ptr: u32, call_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

Call some dispatchable of the runtime. See [frame_support::traits::call_runtime].

§Wasm Import Statement
(import "seal0" "call_runtime" (func ...))
source

fn xcm_execute( msg_ptr: u32, msg_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

Execute an XCM program locally, using the contract’s address as the origin. See [pallet_contracts_uapi::HostFn::execute_xcm].

§Wasm Import Statement
(import "seal0" "xcm_execute" (func ...))
source

fn xcm_send( dest_ptr: u32, msg_ptr: u32, msg_len: u32, output_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Send an XCM program from the contract to the specified destination. See [pallet_contracts_uapi::HostFn::send_xcm].

§Wasm Import Statement
(import "seal0" "xcm_send" (func ...))
source

fn ecdsa_recover( signature_ptr: u32, message_hash_ptr: u32, output_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Recovers the ECDSA public key from the given message hash and signature. See [pallet_contracts_uapi::HostFn::ecdsa_recover].

§Wasm Import Statement
(import "seal0" "ecdsa_recover" (func ...))
source

fn sr25519_verify( signature_ptr: u32, pub_key_ptr: u32, message_len: u32, message_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Verify a sr25519 signature See [pallet_contracts_uapi::HostFn::sr25519_verify].

§Wasm Import Statement
(import "seal0" "sr25519_verify" (func ...))
source

fn set_code_hash(code_hash_ptr: u32) -> Result<ReturnErrorCode, TrapReason>

Replace the contract code at the specified address with new code. See [pallet_contracts_uapi::HostFn::set_code_hash].

§Wasm Import Statement
(import "seal0" "set_code_hash" (func ...))
source

fn ecdsa_to_eth_address( key_ptr: u32, out_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

Calculates Ethereum address from the ECDSA compressed public key and stores See [pallet_contracts_uapi::HostFn::ecdsa_to_eth_address].

§Wasm Import Statement
(import "seal0" "ecdsa_to_eth_address" (func ...))
source

fn reentrance_count() -> Result<u32, TrapReason>

Returns the number of times the currently executing contract exists on the call stack in addition to the calling instance. See [pallet_contracts_uapi::HostFn::reentrance_count].

§Wasm Import Statement
(import "seal0" "reentrance_count" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn account_reentrance_count(account_ptr: u32) -> Result<u32, TrapReason>

Returns the number of times specified contract exists on the call stack. Delegated calls are not counted as separate calls. See [pallet_contracts_uapi::HostFn::account_reentrance_count].

§Wasm Import Statement
(import "seal0" "account_reentrance_count" (func ...))
§Unstable

This function is unstable and it is a subject to change (or removal) in the future. Do not deploy a contract using it to a production chain.

source

fn instantiation_nonce() -> Result<u64, TrapReason>

Returns a nonce that is unique per contract instantiation. See [pallet_contracts_uapi::HostFn::instantiation_nonce].

§Wasm Import Statement
(import "seal0" "instantiation_nonce" (func ...))
source

fn lock_delegate_dependency(code_hash_ptr: u32) -> Result<(), TrapReason>

Adds a new delegate dependency to the contract. See [pallet_contracts_uapi::HostFn::lock_delegate_dependency].

§Wasm Import Statement
(import "seal0" "lock_delegate_dependency" (func ...))
source

fn unlock_delegate_dependency(code_hash_ptr: u32) -> Result<(), TrapReason>

Removes the delegate dependency from the contract. see [pallet_contracts_uapi::HostFn::unlock_delegate_dependency].

§Wasm Import Statement
(import "seal0" "unlock_delegate_dependency" (func ...))
source

fn seal_set_storage( key_ptr: u32, value_ptr: u32, value_len: u32, ) -> Result<(), TrapReason>

This is just an alias function to set_storage() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_set_storage" (func ...))
source

fn seal_clear_storage(key_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to clear_storage() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_clear_storage" (func ...))
source

fn seal_get_storage( key_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to get_storage() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_get_storage" (func ...))
source

fn seal_contains_storage(key_ptr: u32) -> Result<u32, TrapReason>

This is just an alias function to contains_storage() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_contains_storage" (func ...))
source

fn seal_take_storage( key_ptr: u32, key_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to take_storage() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_take_storage" (func ...))
source

fn seal_transfer( account_ptr: u32, _account_len: u32, value_ptr: u32, _value_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to transfer() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_transfer" (func ...))
source

fn seal_call( callee_ptr: u32, _callee_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to call() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_call" (func ...))
source

fn seal_delegate_call( flags: u32, code_hash_ptr: u32, input_data_ptr: u32, input_data_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to delegate_call() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_delegate_call" (func ...))
source

fn seal_instantiate( code_hash_ptr: u32, _code_hash_len: u32, gas: u64, value_ptr: u32, _value_len: u32, input_data_ptr: u32, input_data_len: u32, address_ptr: u32, address_len_ptr: u32, output_ptr: u32, output_len_ptr: u32, salt_ptr: u32, salt_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to instantiate() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_instantiate" (func ...))
source

fn seal_terminate( beneficiary_ptr: u32, _beneficiary_len: u32, ) -> Result<(), TrapReason>

This is just an alias function to terminate() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_terminate" (func ...))
source

fn seal_input(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to input() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_input" (func ...))
source

fn seal_caller(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to caller() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_caller" (func ...))
source

fn seal_is_contract(account_ptr: u32) -> Result<u32, TrapReason>

This is just an alias function to is_contract() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_is_contract" (func ...))
source

fn seal_code_hash( account_ptr: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to code_hash() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_code_hash" (func ...))
source

fn seal_own_code_hash(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to own_code_hash() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_own_code_hash" (func ...))
source

fn seal_caller_is_origin() -> Result<u32, TrapReason>

This is just an alias function to caller_is_origin() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_caller_is_origin" (func ...))
source

fn seal_address(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to address() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_address" (func ...))
source

fn seal_weight_to_fee( gas: u64, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to weight_to_fee() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_weight_to_fee" (func ...))
source

fn seal_gas_left(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to gas_left() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_gas_left" (func ...))
source

fn seal_balance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to balance() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_balance" (func ...))
source

fn seal_value_transferred( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to value_transferred() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_value_transferred" (func ...))
source

fn seal_random( subject_ptr: u32, subject_len: u32, out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. This is just an alias function to random() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_random" (func ...))
source

fn seal_now(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to now() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_now" (func ...))
source

fn seal_minimum_balance( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to minimum_balance() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_minimum_balance" (func ...))
source

fn seal_tombstone_deposit( out_ptr: u32, out_len_ptr: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. This is just an alias function to tombstone_deposit() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_tombstone_deposit" (func ...))
source

fn seal_restore_to( _dest_ptr: u32, _dest_len: u32, _code_hash_ptr: u32, _code_hash_len: u32, _rent_allowance_ptr: u32, _rent_allowance_len: u32, _delta_ptr: u32, _delta_count: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. This is just an alias function to restore_to() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_restore_to" (func ...))
source

fn seal_set_rent_allowance( _value_ptr: u32, _value_len: u32, ) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. This is just an alias function to set_rent_allowance() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_set_rent_allowance" (func ...))
source

fn seal_rent_allowance(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

§Deprecated

This function is deprecated and will be removed in future versions. No new code or contracts with this API can be deployed. This is just an alias function to rent_allowance() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_rent_allowance" (func ...))
source

fn seal_deposit_event( topics_ptr: u32, topics_len: u32, data_ptr: u32, data_len: u32, ) -> Result<(), TrapReason>

This is just an alias function to deposit_event() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_deposit_event" (func ...))
source

fn seal_block_number(out_ptr: u32, out_len_ptr: u32) -> Result<(), TrapReason>

This is just an alias function to block_number() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_block_number" (func ...))
source

fn seal_hash_sha2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to hash_sha2_256() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_hash_sha2_256" (func ...))
source

fn seal_hash_keccak_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to hash_keccak_256() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_hash_keccak_256" (func ...))
source

fn seal_hash_blake2_256( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to hash_blake2_256() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_hash_blake2_256" (func ...))
source

fn seal_hash_blake2_128( input_ptr: u32, input_len: u32, output_ptr: u32, ) -> Result<(), TrapReason>

This is just an alias function to hash_blake2_128() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_hash_blake2_128" (func ...))
source

fn seal_call_chain_extension( id: u32, input_ptr: u32, input_len: u32, output_ptr: u32, output_len_ptr: u32, ) -> Result<u32, TrapReason>

This is just an alias function to call_chain_extension() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_call_chain_extension" (func ...))
source

fn seal_debug_message( str_ptr: u32, str_len: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to debug_message() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_debug_message" (func ...))
source

fn seal_ecdsa_recover( signature_ptr: u32, message_hash_ptr: u32, output_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to ecdsa_recover() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_ecdsa_recover" (func ...))
source

fn seal_set_code_hash(code_hash_ptr: u32) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to set_code_hash() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_set_code_hash" (func ...))
source

fn seal_ecdsa_to_eth_address( key_ptr: u32, out_ptr: u32, ) -> Result<ReturnErrorCode, TrapReason>

This is just an alias function to ecdsa_to_eth_address() with backwards-compatible prefixed identifier.

§Wasm Import Statement
(import "seal0" "seal_ecdsa_to_eth_address" (func ...))

Object Safety§

This trait is not object safe.

Implementors§