Library std

Modules

The Address type used for interacting with addresses on the fuel network.

A library for allocating memory inspired by Rust’s std::alloc.

Functions to assert a given condition.

Functionality for performing common operations with assets.

The AssetId type used for interacting with an asset on the fuel network.

Functionality for determining who is calling a contract.

The B512 type supports the usage of 64-byte values in Sway which are needed when working with public keys and signatures.

Functionality for accessing block-related data.

The Bytes type is used when a collection of tightly-packed arbitrary bytes is needed.

Helper functions for accessing data from call frames.

The clone trait, for explicit duplication.

Definitions for constant values in Sway.

Functionality for accessing context-specific information about the current contract or message.

The ContractId type used for interacting with contracts on the fuel network.

Traits for conversions between types.

Helper functions to verify signatures.

Values which signify special types of errors when passed to std::revert::revert.

Helper functions to load and run external contract code.

Functions to work with external contracts.

Functionality for setting and unsetting FuelVM flags to modify behavior related to the $err and $of registers.

Utility functions for cryptographic hashing.

A wrapper type with two variants, Address and ContractId.

Getters for fields on transaction inputs.

Exposes compiler intrinsics as stdlib wrapper functions.

The iterator trait to iterate over elements.

Allows logging of arbitrary stack types, emitted as either Log or Logd receipts.

Utilities to help with low level calls.

Utilities for common math operations.

Helper functions to sign and send messages.

A type for optional values.

Getters for fields on transaction outputs.

Functions to expose 14 of the reserved FuelVM registers for ease of use.

Error handling with the Result type.

Functions to panic or revert with a given error code.

Contract storage utilities.

A UTF-8 encoded growable string.

Transaction field getters.

A 128-bit unsigned integer type.

A vector type for dynamically sized arrays outside of storage.

VM-specific utilities.

Primitives

256 bits (32 bytes), i.e. a hash
Boolean true or false
string slice
16-bit unsigned integer
256-bit unsigned integer
32-bit unsigned integer
64-bit unsigned integer
8-bit unsigned integer