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_traceTransactionon 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
trueif the bytecode is a classic Stylus program ([0xEF, 0xF0, 0x00, ...]). - is_
stylus_ deployable - Returns
trueif the bytecode is a deployable Stylus program. - is_
stylus_ fragment - Returns
trueif the bytecode is a Stylus fragment ([0xEF, 0xF0, 0x01, ...]). - is_
stylus_ program - Returns
trueif the bytecode is a Stylus WASM program. - is_
stylus_ root - Returns
trueif the bytecode is a Stylus root program ([0xEF, 0xF0, 0x02, ...]). - strip_
stylus_ prefix - Strips the 4-byte Stylus prefix from contract bytecode.