🌴 Empowering everyone to build reliable and efficient smart contracts.
Find a file
Igor Rončević fc2aed7934
Some checks failed
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
Codspeed Benchmarks / benchmarks (push) Has been cancelled
CI / check-dependency-version-formats (push) Has been cancelled
CI / check-forc-manifest-version (push) Has been cancelled
CI / get-fuel-core-version (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / build-sway-examples (push) Has been cancelled
CI / build-reference-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / Build and test various forc tools (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
Fix build warnings in in-language tests (#7464)
## Description

This PR fixes warnings emitted in `in-language` tests and sets the
`--error-on-warnings` flag when running those tests on CI. This removes
unnecessary output, e.g., when extracting performance data (gas usages
and bytecode sizes) from the output of the `forc test` runs.

Removal of warnings revealed additional DCA issues that are marked as
`TODO-DCA` in code and linked to #7462.

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-10-25 20:10:34 +11:00
.devcontainer Create devcontainer.json (#4377) 2023-06-06 00:53:23 +03:00
.github Fix build warnings in in-language tests (#7464) 2025-10-25 20:10:34 +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 Add docs for ABI Backtracing (#7435) 2025-10-11 18:31:58 +11:00
examples Contract self impl (#7275) 2025-07-11 11:02:37 +00:00
forc Excute E2E tests in parallel (#7456) 2025-10-14 10:22:11 +11:00
forc-pkg Excute E2E tests in parallel (#7456) 2025-10-14 10:22:11 +11:00
forc-plugins Improve diff between generic argument generic type argument (#7453) 2025-10-20 07:51:33 -03:00
forc-test Excute E2E tests in parallel (#7456) 2025-10-14 10:22:11 +11:00
forc-tracing Revert feat: introduce fuel-telemetry macros (#7295) (#7451) 2025-10-09 19:27:37 +11:00
forc-util Compile runtime backtracing to ASM and compile-time to ABI JSON (#7387) 2025-10-09 08:45:51 +00:00
scripts Add --perf option to test to collect and diff performance data (#7459) 2025-10-21 18:41:35 +04:00
sway-ast chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
sway-core Improve diff between generic argument generic type argument (#7453) 2025-10-20 07:51:33 -03:00
sway-error Compile runtime backtracing to ASM and compile-time to ABI JSON (#7387) 2025-10-09 08:45:51 +00:00
sway-features Excute E2E tests in parallel (#7456) 2025-10-14 10:22:11 +11:00
sway-ir Compile runtime backtracing to ASM and compile-time to ABI JSON (#7387) 2025-10-09 08:45:51 +00:00
sway-lib-std Improve Contract Call by not encoding fuelvm protocol args (#7447) 2025-10-20 17:24:58 +00:00
sway-lsp Improve diff between generic argument generic type argument (#7453) 2025-10-20 07:51:33 -03:00
sway-parse chore: bumpt rust version to 1.90 (#7427) 2025-10-02 22:28:51 +13:00
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 Fix build warnings in in-language tests (#7464) 2025-10-25 20:10:34 +11: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 Compile runtime backtracing to ASM and compile-time to ABI JSON (#7387) 2025-10-09 08:45:51 +00:00
benchmark.sh ci: fixing typos programmatically (#5975) 2024-05-09 10:21:32 +10:00
Cargo.lock Add --perf option to test to collect and diff performance data (#7459) 2025-10-21 18:41:35 +04:00
Cargo.toml chore: bump version to v0.70.1 (#7454) 2025-10-10 18:34:56 +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 option to test to collect and diff performance data (#7459) 2025-10-21 18:41:35 +04: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.