Libraries

There are several types of libraries that Sway Libs encompases. These include libraries that provide convenience functions, standards supporting libraries, data type libraries, security functionality libraries.

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

Assets Libraries

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

Asset Library

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

Access 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.

Ownership Library

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

Admin Library

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

Pausable Library

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

Reentrancy Guard Library

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

Cryptography Libraries

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

Bytecode Library

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

Merkle Library

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

Math Libraries

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

Fixed Point Number Library

The Fixed Point Number Library is an interface to implement fixed-point numbers.

Signed Integers

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

Data Structures Libraries

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

Queue

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