# 5.2 Sway的安全性 (Sway Safety)

Sway provides multiple layers of safety. For one, we provide canonical tooling and "one right way" to do things. This results in less ambiguity and more correct/helpful tools. This tooling ships a debugger, gas profiler, testing framework, SDK, formatter, and more. These tools ensure the programmer has nothing between them and the algorithm they are trying to implement. Safety comes from the foundation of a comfortable and ergonomic environment.

Sway 提供多层安全性。首先，我们提供规范的工具和“一种正确的方式”来做事。这会减少歧义并提供更正确/更有帮助的工具。该工具包含调试器、gas 分析器、测试框架、SDK、格式化程序等。这些工具确保程序员与试图实现的算法之间没有任何障碍。安全来自于舒适且符合人体工程学的环境。

In addition, Sway has implemented static analysis checks like a [*Checks, Effects, Interactions*](https://docs.soliditylang.org/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern) checker, state and storage purity checking, immutable-by-default semantics, and other static compile-time audits to promote safety.

此外，Sway 还实施了静态分析检查，如[检查、效果、交互](https://docs.soliditylang.org/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern)检查器、状态和存储纯度检查、默认不可变语义和其他静态编译时审计，进而提高安全性。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zenofchain.gitbook.io/fuel-shou-ce-the-fuel-book/5.sway-yu-yan-sway-language/5.2-sway-de-an-quan-xing-sway-safety.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
