Sway Smart Contract Audit

A Sway audit is a security review of Fuel Network contracts written in Sway, covering the UTXO-based execution model, predicates and scripts, native asset handling, and the storage and access-control semantics that differ from account-model chains.

Why Sway code needs a specialist review

Sway looks like Rust and executes nothing like Ethereum. Fuel uses a UTXO model with predicates and scripts alongside contracts, native multi-asset support instead of token contracts, and a strict separation between what a script may do and what a contract may do. Reviewers who read Sway as "Rust for the EVM" miss the bugs, because the bugs live in exactly the places the models differ.

We maintain SwayScan, an open-source static analyser for Sway published on crates.io, which means our review starts from a codified list of Sway-specific patterns rather than from first principles each time. Manual review then covers what no analyser can: whether your predicate can be satisfied by an input you did not intend, whether your asset accounting survives a multi-asset transfer, and whether your storage access control holds under the call patterns Fuel permits.

Sway-specific security considerations

UTXO model and input validation

Transaction inputs and outputs verified inside the contract, coin ownership assumptions, and change-output handling an attacker can influence.

Predicate and script security

Predicates satisfiable by unintended inputs, script logic assuming a contract-level guarantee, and the boundary between the two.

Native asset handling

Fuel's native multi-asset support removes token contracts and adds asset-ID confusion, mis-attributed transfers and forced-send accounting errors.

Storage access and reentrancy

Storage namespaces and access control, plus the reentrancy surface that still exists despite the different execution model.

Type safety and conversion

u64-centric arithmetic, b256 conversions, and casts that silently truncate value.

Contract upgrade and configurables

Configurable constants set at deploy time, and whatever upgrade mechanism the project has built on top.

Tooling we run on Sway

How the engagement runs

  1. Scoping and threat modelling

    We fix a commit hash, agree the in-scope contracts and read your architecture docs, then build a threat model: who the actors are, what the trust boundaries are, and which invariants must never break. Nothing is reviewed against assumptions we have not written down.

  2. Manual review

    Line-by-line review by at least two auditors working independently, focused on authorisation, accounting, upgrade paths, external integrations and the gap between what the code does and what the documentation claims it does. Most critical findings come from this phase, not from tooling.

  3. Static and dynamic analysis

    Static analysers appropriate to the language, plus property-based fuzzing and invariant testing to push the system into states no unit test covers. Tooling is used to widen coverage, never to replace the manual pass.

  4. Exploit-path simulation

    Candidate findings are proven on a forked network with a working proof of concept. We report what an attacker can actually do and what it costs them, not a theoretical severity label.

  5. Reporting

    Every finding gets a severity rating, reproduction steps, the affected code, the impact in concrete terms and a specific remediation. You get a draft for discussion before anything is finalised.

  6. Fix review and re-test

    We re-test every remediation against the original proof of concept and check that the fix has not opened a new path. The final report is yours to publish.

What you receive

Sway audit: frequently asked questions

Who actually audits Sway code?

Very few firms. We built and maintain SwayScan, the open-source Sway static analyser, which is publicly verifiable on crates.io — that is the honest signal of depth here, rather than a claim about experience you cannot check.

How is auditing Sway different from Solidity?

The execution model. Fuel is UTXO-based with predicates and scripts and native assets, so input validation, asset attribution and the predicate boundary replace most of the ERC-20 and account-model bug classes you would look for on the EVM.

Do you audit predicates as well as contracts?

Yes — predicates, scripts and contracts, because a system is only as strong as the weakest of the three and predicates are where the least review attention usually goes.

Is SwayScan free to use?

Yes, it is open source and installable from crates.io. Run it yourself before you engage anyone, including us.

What do you need from us to start an audit?

A repository or contract address, a commit hash to freeze the scope, whatever architecture or spec documentation exists, and a point of contact who can answer design questions. If documentation is thin we will write our understanding of the system back to you and ask you to confirm it — that step alone catches design-level bugs.

How long does an audit take?

A single token contract is 24–48 hours. A typical dApp or mid-sized protocol runs one to two weeks. Large DeFi systems, L2s, bridges and ZK circuits are scoped per project after we have seen the code. We will give you a fixed timeline with the quote, not an estimate that moves.

Is a re-test included after we fix the issues?

Yes. Fix review is part of the engagement, not an upsell. We re-run the original proof of concept against your patched code and confirm the fix has not introduced a new path.

Related security services

Get a fixed quote in 24 hours

Send the repository and a commit hash through the contact form, message @bugtester25 on Telegram, or book a 30-minute scoping call. 200+ protocols audited · $4B+ secured · 0 hacks post-audit. Prefer email? info@safeedges.in.