The Sway Programming Language
1.
Introduction
1.1.
Installation
1.2.
Sway Quickstart
1.3.
The Fuel Toolchain
1.4.
A Forc Project
1.5.
Standard Library
2.
Examples
2.1.
Counter
2.2.
Subcurrency
2.3.
FizzBuzz
2.4.
Wallet Smart Contract
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.
Functions
4.6.
Structs, Tuples, and Enums
4.7.
Methods and Associated Functions
4.8.
Constants
4.9.
Comments and Logging
4.10.
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.
Generic Types
6.3.
Traits
6.4.
Generics and Trait Constraints
6.5.
Assembly
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.
Application Frontend
9.1.
TypeScript SDK
10.
Sway LSP
10.1.
Installation
10.2.
Features
11.
Sway Reference
11.1.
Compiler Intrinsics
11.2.
Attributes
11.3.
Style Guide
11.4.
Known Issues and Workarounds
11.5.
Differences From Solidity
11.6.
Differences From Rust
11.7.
Contributing To Sway
12.
Forc Reference
12.1.
Manifest Reference
12.2.
Workspaces
12.3.
Dependencies
12.4.
Commands
12.4.1.
forc addr2line
12.4.2.
forc build
12.4.3.
forc check
12.4.4.
forc clean
12.4.5.
forc completions
12.4.6.
forc contract-id
12.4.7.
forc init
12.4.8.
forc new
12.4.9.
forc parse-bytecode
12.4.10.
forc plugins
12.4.11.
forc predicate-root
12.4.12.
forc test
12.4.13.
forc update
12.4.14.
forc template
12.5.
Plugins
12.5.1.
forc client
12.5.1.1.
forc deploy
12.5.1.2.
forc run
12.5.1.3.
forc submit
12.5.2.
forc doc
12.5.3.
forc explore
12.5.4.
forc fmt
12.5.5.
forc lsp
Light
Rust
Coal
Navy
Ayu
The Sway Programming Language
Application Frontend Development
TypeScript SDK