Sway is a domain-specific language for the FuelVM. Write fast, safe, and efficient smart contracts with Rust-like syntax.
contract;
abi Counter {
#[storage(read, write)]
fn increment(amount: u64) -> u64;
#[storage(read)]
fn get() -> u64;
}
storage {
counter: u64 = 0,
}
impl Counter for Contract {
#[storage(read, write)]
fn increment(amount: u64) -> u64 {
let incremented = storage.counter.read() + amount;
storage.counter.write(incremented);
incremented
}
#[storage(read)]
fn get() -> u64 {
storage.counter.read()
}
}Purpose-built for the next generation of blockchain applications
Memory safety without garbage collection, preventing common smart contract vulnerabilities.
Compiled directly to Fuel VM bytecode for maximum efficiency and minimal gas costs.
Familiar Rust-like syntax with powerful tooling, testing, and debugging capabilities.
Everything you need to build secure, efficient, and scalable smart contracts
It is a statically typed, compiled language with type inference and traits.
Built for the Fuel Virtual Machine with optimal gas efficiency and fast execution times.
Rust-inspired syntax with compile-time memory safety checks and zero-cost abstractions.
Familiar syntax for Rust developers with powerful tooling and comprehensive documentation.
Purpose-built for Fuel's high-performance virtual machine with native UTXO support.
Complete development ecosystem with compiler, debugger, and testing framework.
From zero to deployed smart contract in just a few simple steps
curl -fsSL https://install.fuel.network | shInstalls fuelup, Forc CLI, and all development tools
Start building with Sway instantly in your browser, or migrate from Solidity with zero friction.
// Paste your Solidity code → Get Sway output ✨The complete toolkit for Sway development. Build, test, and deploy with ease.
$ forc new my-contract
$ forc build
$ forc testBattle-tested libraries and utilities that power the Sway ecosystem. From security primitives to core data structures, these packages accelerate your smart contract development.
Community-driven standards for interoperability and best practices.
Add libraries and standards to your project seamlessly from the registry.
forc.pub - The central registry for Sway packages and libraries.
forc add <package-name>Add any library or standard to your Sway project instantly.
forc publishShare your own libraries with the Sway community.