Standard Library
The Move Standard Library offers functionality for native types and operations. It is a core collection of modules that do not interact with storage but instead provide essential tools for working with and manipulating data.
Exported address
The Standard Library is exported at address 0x1. It can also be used via the alias std.
Content
The Stylus Framework includes the following modules:
| Module | Description | Chapter |
|---|---|---|
std::string | Provides basic string operations | String |
std::ascii | Provides basic ASCII operations | String |
std::option | Implements Option<T> | Option |
std::vector | Native operations on the vector type | Vector |
std::bit_vector | Provides operations on bit vectors | - |
std::fixed_point32 | Provides the FixedPoint32 type | - |
Integers
The Move Standard Library provides a set of functions associated with integer types. These functions are split into multiple modules, each associated with a specific integer type. The modules should not be imported directly, as their functions are available on every integer value.
Note
All of the modules provide the same set of functions. Namely,
max,diff,divide_and_round_up,sqrtandpow.
| Module | Description |
|---|---|
std::u8 | Functions for the u8 type |
std::u16 | Functions for the u16 type |
std::u32 | Functions for the u32 type |
std::u64 | Functions for the u64 type |
std::u128 | Functions for the u128 type |
std::u256 | Functions for the u256 type |
Source Code
The source code of the Move Standard Library is available in the Move for Stylus repository.