Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

ModuleDescriptionChapter
std::stringProvides basic string operationsString
std::asciiProvides basic ASCII operationsString
std::optionImplements Option<T>Option
std::vectorNative operations on the vector typeVector
std::bit_vectorProvides operations on bit vectors-
std::fixed_point32Provides 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, sqrt and pow.

ModuleDescription
std::u8Functions for the u8 type
std::u16Functions for the u16 type
std::u32Functions for the u32 type
std::u64Functions for the u64 type
std::u128Functions for the u128 type
std::u256Functions for the u256 type

Source Code

The source code of the Move Standard Library is available in the Move for Stylus repository.