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

The Sway Programming Language

Advanced Concepts

Advanced concepts.

  • Advanced Types
  • Advanced Storage
  • Generic Types
  • Traits
  • Associated Types
  • Generics and Trait Constraints
  • Assembly
  • Never Type