The Sway Programming Language
1.
Introduction
1.1.
Getting Started
1.2.
The Fuel Toolchain
1.3.
A Forc Project
1.4.
Standard Library
2.
Examples
2.1.
Counter
2.2.
FizzBuzz
2.3.
Wallet Smart Contract
2.4.
Liquidity Pool
3.
Program Types
3.1.
Contracts
3.2.
Libraries
3.3.
Scripts
3.4.
Predicates
4.
Sway Language Basics
4.1.
Variables
4.2.
Built-in Types
4.3.
Commonly Used Library Types
4.4.
Blockchain Types
4.5.
Converting Types
4.6.
Functions
4.7.
Structs, Tuples, and Enums
4.8.
Methods and Associated Functions
4.9.
Constants
4.10.
Comments and Logging
4.11.
Control Flow
5.
Blockchain Development with Sway
5.1.
Hashing and Cryptography
5.2.
Contract Storage
5.3.
Function Purity
5.4.
Identifiers
5.5.
Native Assets
5.6.
Access Control
5.7.
Calling Contracts
6.
Advanced Concepts
6.1.
Advanced Types
6.2.
Advanced Storage
6.3.
Generic Types
6.4.
Traits
6.5.
Associated Types
6.6.
Generics and Trait Constraints
6.7.
Assembly
6.8.
Never Type
7.
Common Collections
7.1.
Vectors on the Heap
7.2.
Storage Vectors
7.3.
Storage Maps
8.
Testing
8.1.
Unit Testing
8.2.
Testing with Rust
9.
Debugging
9.1.
Debugging with CLI
9.2.
Debugging with IDE
10.
Application Frontend
10.1.
TypeScript SDK
11.
Sway LSP
11.1.
Installation
11.2.
Features
11.3.
Troubleshooting
12.
Sway Reference
12.1.
Compiler Intrinsics
12.2.
Attributes
12.3.
Style Guide
12.4.
Known Issues and Workarounds
12.5.
Differences From Solidity
12.6.
Differences From Rust
12.7.
Contributing To Sway
12.8.
Keywords
13.
Forc Reference
13.1.
Manifest Reference
13.2.
Workspaces
13.3.
Dependencies
13.4.
Commands
13.4.1.
forc addr2line
13.4.2.
forc build
13.4.3.
forc check
13.4.4.
forc clean
13.4.5.
forc completions
13.4.6.
forc contract-id
13.4.7.
forc init
13.4.8.
forc new
13.4.9.
forc parse-bytecode
13.4.10.
forc plugins
13.4.11.
forc predicate-root
13.4.12.
forc test
13.4.13.
forc update
13.4.14.
forc template
13.5.
Plugins
13.5.1.
forc client
13.5.1.1.
forc deploy
13.5.1.2.
forc run
13.5.1.3.
forc submit
13.5.2.
forc crypto
13.5.3.
forc debug
13.5.4.
forc doc
13.5.5.
forc explore
13.5.6.
forc fmt
13.5.7.
forc lsp
Light
Rust
Coal
Navy
Ayu
The Sway Programming Language
Application Frontend Development
TypeScript SDK