Repolode
FuelLabs

FuelLabs/sway

Sway is a Rust-inspired programming language for writing smart contracts on the Fuel blockchain.

Stars
61,374
Forks
5,410
Open issues
956
Last commit
2 days ago

What is it?

Sway is a programming language built for the Fuel blockchain, used to write smart contracts. It is heavily inspired by Rust and aims to bring modern language design and performance to blockchain development.

The project includes the Sway compiler and the Forc toolchain, which provides the command-line tooling for building and working with Sway projects. The repository also contains the Sway standard library and the language's technical reference and user documentation.

Developers who want to use Sway should install release builds through the documented channels. Contributors building the compiler from source need a stable Rust toolchain and can build the workspace with cargo.

Key features

  • 01Rust-inspired syntax for writing smart contracts on Fuel
  • 02Forc command-line toolchain for building Sway projects
  • 03Sway standard library included in the repository
  • 04Published language reference and standard library documentation

Use cases

  • Writing smart contracts for the Fuel blockchain
  • Contributing to the Sway compiler and toolchain
  • Learning the Sway language through its official documentation

Quick start

  1. 1

    Install the Rust toolchain and set it to stable

    rustup default stable
  2. 2

    Clone the Sway repository

    git clone git@github.com:FuelLabs/sway.git
  3. 3

    Build the Sway toolchain from the cloned repository

    cd sway && cargo build
  4. 4

    Confirm the forc tool runs by printing its help

    cargo run --bin forc -- --help

Things to know

  • Building from source is intended for developers of the Sway compiler; most users should install a release build instead.
  • The master documentation may describe unreleased behavior, so check the version you are running with forc --version.

Topics

FAQ

What is sway?
Sway is a Rust-inspired programming language for writing smart contracts on the Fuel blockchain. Sway is a programming language built for the Fuel blockchain, used to write smart contracts. It is heavily inspired by Rust and aims to bring modern language design and performance to blockchain development.
Is sway free to use? What license does it have?
sway is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is sway still maintained?
Actively maintained. The last commit to sway was on Oct 19, 2026.
What can I use sway for?
Writing smart contracts for the Fuel blockchain Contributing to the Sway compiler and toolchain Learning the Sway language through its official documentation
How do I install sway?
Install the Rust toolchain and set it to stable: rustup default stable Clone the Sway repository: git clone git@github.com:FuelLabs/sway.git Build the Sway toolchain from the cloned repository: cd sway && cargo build Confirm the forc tool runs by printing its help: cargo run --bin forc -- --help
Where can I get sway?
The source code and installation instructions are on GitHub: https://github.com/FuelLabs/sway

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects