Crate arb_stylus

Crate arb_stylus 

Source
Expand description

Stylus WASM smart contract runtime.

Provides the execution pipeline for Stylus programs: WASM compilation and caching, ink metering, host I/O functions, and EVM interop.

Re-exports§

pub use cache::InitCache;
pub use config::CompileConfig;
pub use config::StylusConfig;
pub use evm_api::EvmApi;
pub use evm_api_impl::StylusEvmApi;
pub use ink::Gas;
pub use ink::Ink;
pub use meter::MachineMeter;
pub use meter::MeteredMachine;
pub use meter::STYLUS_ENTRY_POINT;
pub use native::NativeInstance;
pub use run::RunProgram;

Modules§

cache
config
env
error
evm_api
evm_api_impl
host
ink
meter
middleware
native
pages
pricing
run
trace
Host-I/O trace buffer for debug_traceTransaction on Stylus programs.

Constants§

STYLUS_DISCRIMINANT
Prefix bytes that identify a Stylus WASM program in contract bytecode.
STYLUS_FRAGMENT_DISCRIMINANT
Fragment prefix: [0xEF, 0xF0, 0x01].
STYLUS_ROOT_DISCRIMINANT
Root Stylus program prefix: [0xEF, 0xF0, 0x02].

Functions§

activate_program
Activate a Stylus program.
decompress_wasm
Decompress a Stylus WASM program from its contract bytecode. The bytecode format is [0xEF, 0xF0, 0x00, dict_byte, ...compressed_wasm]. Returns the decompressed WASM bytes.
is_stylus_classic
Returns true if the bytecode is a classic Stylus program ([0xEF, 0xF0, 0x00, ...]).
is_stylus_deployable
Returns true if the bytecode is a deployable Stylus program.
is_stylus_fragment
Returns true if the bytecode is a Stylus fragment ([0xEF, 0xF0, 0x01, ...]).
is_stylus_program
Returns true if the bytecode is a Stylus WASM program.
is_stylus_root
Returns true if the bytecode is a Stylus root program ([0xEF, 0xF0, 0x02, ...]).
strip_stylus_prefix
Strips the 4-byte Stylus prefix from contract bytecode.