🌴 Empowering everyone to build reliable and efficient smart contracts.
Find a file
Joshua Batty 8103f0d02f
Some checks are pending
Codspeed Benchmarks / benchmarks (push) Waiting to run
CI / verifications-complete (push) Blocked by required conditions
CI / check-dependency-version-formats (push) Waiting to run
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / build-forc-test-project (push) Waiting to run
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / pre-publish-check (push) Waiting to run
CI / publish (push) Blocked by required conditions
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
github pages / deploy (push) Waiting to run
Migrate forc-tracing and forc-crypto to forc monorepo (#7507)
## Summary

This PR completes the sway-side of migrating `forc-tracing` and
`forc-crypto` to the new [forc
monorepo](https://github.com/FuelLabs/forc), as outlined in [RFC
#49](https://github.com/FuelLabs/sway-rfcs/pull/49).

The corresponding forc repo PR:
https://github.com/FuelLabs/forc/pull/119

### Changes

- Remove `forc-tracing` crate from workspace (now uses crates.io
`0.71.1`)
- Remove `forc-crypto` crate from workspace
- Update CI to no longer build/package `forc-crypto` binary (it's now
built from forc repo)
- Update gh-pages workflow to install `forc-crypto` from forc repo for
documentation generation

### Distribution

Going forward, `forc-crypto` will be built and distributed from the forc
repo by:
- sway-nightly-binaries
- fuelup  
- fuel.nix

### Documentation

For now, documentation for all tooling will continue to live in this
repo. The `gh-pages` workflow now pulls `forc-crypto` from the forc repo
rather than building it locally, so docs generation continues to work as
before.
2025-12-10 08:58:01 +11:00
.devcontainer Create devcontainer.json (#4377) 2023-06-06 00:53:23 +03:00
.github Migrate forc-tracing and forc-crypto to forc monorepo (#7507) 2025-12-10 08:58:01 +11:00
.vscode Fix function_cache garbage collection bug (#6555) 2024-09-18 09:18:02 +01:00
deployment Update Rust in dockerfile to 1.87 (#7201) 2025-05-28 14:14:07 +04:00
docs Introduce alloc intrinsic to avoid using asm (#7499) 2025-11-26 10:18:25 +00:00
examples Contract self impl (#7275) 2025-07-11 11:02:37 +00:00
forc Optionally remove test gas limit in forc test (#7495) 2025-12-02 15:36:41 +13:00
forc-pkg feat: add support for patching registry dependencies (#7469) 2025-11-20 00:34:47 -08:00
forc-plugins Migrate forc-tracing and forc-crypto to forc monorepo (#7507) 2025-12-10 08:58:01 +11:00
forc-test Optionally remove test gas limit in forc test (#7495) 2025-12-02 15:36:41 +13:00
forc-util feat: forc-call abi backtracing (#7502) 2025-11-26 13:01:36 +04:00
scripts Add perf-diff-stats just recipe (#7480) 2025-11-04 09:48:07 +11:00
sway-ast Introduce alloc intrinsic to avoid using asm (#7499) 2025-11-26 10:18:25 +00:00
sway-core Introduce alloc intrinsic to avoid using asm (#7499) 2025-11-26 10:18:25 +00:00
sway-error Add event support via #[event] and #[indexed] attributes (#7158) 2025-11-05 12:43:59 +01:00
sway-features Excute E2E tests in parallel (#7456) 2025-10-14 10:22:11 +11:00
sway-ir Introduce alloc intrinsic to avoid using asm (#7499) 2025-11-26 10:18:25 +00:00
sway-lib-std Introduce alloc intrinsic to avoid using asm (#7499) 2025-11-26 10:18:25 +00:00
sway-lsp Improve Contract Call by not encoding method name (#7455) 2025-10-26 07:21:50 -03:00
sway-parse Add relative jump instructions to asm blocks (#7485) 2025-11-05 20:57:49 +05:30
sway-types Compile runtime backtracing to ASM and compile-time to ABI JSON (#7387) 2025-10-09 08:45:51 +00:00
sway-utils chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
swayfmt Removing todo const generics (#7391) 2025-10-10 00:07:12 +00:00
templates chore: update templates to use newer fuels SDK (#7024) 2025-03-18 07:13:19 +11:00
test Optionally remove test gas limit in forc test (#7495) 2025-12-02 15:36:41 +13:00
.gitattributes Remove syntax highlighting of Sway files as Rust (#5926) 2024-04-26 11:06:49 -07:00
.gitignore Add --perf option to test to collect and diff performance data (#7459) 2025-10-21 18:41:35 +04:00
.markdownlint.yaml add docs CI, rename docs README to index (#4874) 2023-08-09 10:51:10 -06:00
.markdownlintignore add docs CI, rename docs README to index (#4874) 2023-08-09 10:51:10 -06:00
.typos.toml Optionally remove test gas limit in forc test (#7495) 2025-12-02 15:36:41 +13:00
benchmark.sh ci: fixing typos programmatically (#5975) 2024-05-09 10:21:32 +10:00
Cargo.lock Migrate forc-tracing and forc-crypto to forc monorepo (#7507) 2025-12-10 08:58:01 +11:00
Cargo.toml Migrate forc-tracing and forc-crypto to forc monorepo (#7507) 2025-12-10 08:58:01 +11:00
ci_checks.sh remove archived forc-explore plugin from CI and docs (#7257) 2025-06-27 12:53:25 +00:00
clippy.toml chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
justfile Add perf-diff-stats just recipe (#7480) 2025-11-04 09:48:07 +11:00
LICENSE Create LICENSE (#452) 2021-12-11 22:28:09 -05:00
README.md One justfile to run them all (#7369) 2025-09-04 10:05:41 +10:00
rustfmt.toml chore: rename fn_args_layout to fn_params_layout in rustfmt.toml (#4530) 2023-05-04 08:23:35 +00:00
SECURITY.md feat: update security policy 2024-08-21 16:06:11 -07:00
update_fuel_dependencies.sh chore: add a script to bump all fuel maintained dependencies (#6684) 2024-11-03 22:20:09 -08:00

Sway

build crates.io docs twitter discord

Sway is a language developed for the Fuel blockchain. It is heavily inspired by Rust and aims to bring modern language development and performance to the blockchain ecosystem.

Documentation

For user documentation, including installing release builds, see the Sway Book: https://fuellabs.github.io/sway/latest/.

For Sway Standard library documentation, see: https://fuellabs.github.io/sway/master/std/

Also view the technical reference for the Sway programming language: https://fuellabs.github.io/sway/master/reference/

Building from Source

This section is for developing the Sway compiler and toolchain. For developing contracts and using Sway, see the above documentation section.

Dependencies

Sway is built in Rust. To begin, install the Rust toolchain following instructions at https://www.rust-lang.org/tools/install. Then configure your Rust toolchain to use Rust stable:

rustup default stable

If not already done, add the Cargo bin directory to your PATH by adding the following line to ~/.profile and restarting the shell session.

export PATH="${HOME}/.cargo/bin:${PATH}"

Building Forc

Clone the repository and build the Sway toolchain:

git clone git@github.com:FuelLabs/sway.git
cd sway
cargo build

Confirm the Sway toolchain built successfully:

cargo run --bin forc -- --help

All other scripts/commands

For all other scripts and commands use https://github.com/casey/just:

> just --list
Available recipes:
    [automation]
    update-contract-ids
    update-fuel-dependencies

    [benchmark]
    benchmark
    benchmark-tests
    collect-gas-usage

    [build]
    build-highlightjs
    build-prism
    generate-sway-lib-std

    [ci]
    ci-check
    install-ci-check

    [test]
    test-forc-fmt-check-panic

Contributing to Sway

We welcome contributions to Sway!

Please see the Contributing To Sway section of the Sway book for guidelines and instructions to help you get started.