Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Nightly /
Sway Libs

Icon LinkSway Libraries

The purpose of Sway Libraries is to contain libraries which users can import and use that are not part of the standard library.

There are several types of libraries that Sway Libs encompases. These include libraries that provide convenience functions, Sway-Standards Icon Link supporting libraries, data type libraries, security functionality libraries, and other tools valuable to blockchain development.

For implementation details on the libraries please see the Sway Libs Docs Icon Link.

Icon LinkAssets Libraries

Asset Libraries are any libraries that use Native Assets Icon Link on the Fuel Network.

Icon LinkAsset Library

The Asset Library provides helper functions for the SRC-20 Icon Link, SRC-3 Icon Link, and SRC-7 Icon Link standards.

Icon LinkAccess Control and Security Libraries

Access Control and Security Libraries are any libraries that are built and intended to provide additional safety when developing smart contracts.

Icon LinkOwnership Library

The Ownership Library is used to apply restrictions on functions such that only a single user may call them.

Icon LinkAdmin Library

The Admin Library is used to apply restrictions on functions such that only a select few users may call them like a whitelist.

Icon LinkPausable Library

The Pausable Library allows contracts to implement an emergency stop mechanism.

Icon LinkReentrancy Guard Library

The Reentrancy Guard Library is used to detect and prevent reentrancy attacks.

Icon LinkCryptography Libraries

Cryptography Libraries are any libraries that provided cryptographic functionality beyond what the std-lib provides.

Icon LinkBytecode Library

The Bytecode Library is used for on-chain verification and computation of bytecode roots for contracts and predicates.

Icon LinkMerkle Library

The Merkle Proof Library is used to verify Binary Merkle Trees computed off-chain.

Icon LinkMath Libraries

Math Libraries are libraries which provide mathematic functions or number types that are outside of the std-lib's scope.

Icon LinkSigned Integers

The Signed Integers Library is an interface to implement signed integers.

Icon LinkData Structures Libraries

Data Structure Libraries are libraries which provide complex data structures which unlock additional functionality for Smart Contracts.

Icon LinkQueue

The Queue Library is a linear data structure that provides First-In-First-Out (FIFO) operations.

Icon LinkUpgradability Libraries

Upgradability Libraries are libraries which provide functions to implement contract upgrades.

Icon LinkUpgradability

The Upgradability Library provides functions that can be used to implement contract upgrades via simple upgradable proxies.