The Sway Programming Language
1.
Introduction
1.1.
Installation
1.2.
Getting Started
1.3.
The Sway 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.
Blockchain Types
4.4.
Functions
4.5.
Structs and Tuples
4.6.
Methods and Associated Functions
4.7.
Comments and Logging
4.8.
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.
Forc
6.1.
Manifest Reference
6.2.
Dependencies
6.3.
Commands
6.3.1.
forc addr2line
6.3.2.
forc build
6.3.3.
forc clean
6.3.4.
forc completions
6.3.5.
forc deploy
6.3.6.
forc init
6.3.7.
forc json-abi
6.3.8.
forc parse-bytecode
6.3.9.
forc plugins
6.3.10.
forc run
6.3.11.
forc test
6.3.12.
forc update
6.3.13.
forc template
6.4.
Plugins
6.4.1.
forc explore
6.4.2.
forc fmt
6.4.3.
forc lsp
7.
Testing
7.1.
Testing with Rust
8.
Advanced Concepts
8.1.
Generic Types
8.2.
Traits
8.3.
Trait Constraints
8.4.
Assembly
9.
Application Frontend
9.1.
TypeScript SDK
10.
Reference
10.1.
Style Guide
10.2.
Temporary Workarounds
10.3.
Differences From Solidity
10.4.
Differences From Rust
10.5.
Contributing To Sway
Light (default)
Rust
Coal
Navy
Ayu
The Sway Programming Language
Advanced Concepts
Advanced concepts.
Generic Types
Traits
Trait Constraints
Assembly