Solidity

Solidity 是一種物件導向的高階語言,用於實作智慧合約。智慧合約是管理以太坊狀態內帳戶行為的程式。

Solidity 是一種花括號語言,旨在針對以太坊虛擬機(EVM)進行設計。它受到 C++、Python 和 JavaScript 的影響。您可以在語言影響章節中找到更多關於 Solidity 受到哪些語言啟發的詳細資訊。

Solidity 是一種靜態型別語言,支援繼承、 程式庫和複雜的使用者定義型別等功能。

With Solidity, you can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets.

When deploying contracts, you should use the latest released version of Solidity. Apart from exceptional cases, only the latest version receives security fixes. Furthermore, breaking changes, as well as new features, are introduced regularly. We currently use a 0.y.z version number to indicate this fast pace of change.

警告

Solidity recently released the 0.8.x version that introduced a lot of breaking changes. Make sure you read the full list.

Ideas for improving Solidity or this documentation are always welcome, read our contributors guide for more details.

提示

You can download this documentation as PDF, HTML or Epub by clicking on the versions flyout menu in the bottom-right corner and selecting the preferred download format.

開始使用

1. 理解智慧合約基礎知識

If you are new to the concept of smart contracts, we recommend you to get started by digging into the "Introduction to Smart Contracts" section, which covers the following:

2. 了解 Solidity

Once you are accustomed to the basics, we recommend you read the "Solidity by Example" and “Language Description” sections to understand the core concepts of the language.

3. 安裝 Solidity 編譯器

There are various ways to install the Solidity compiler, simply choose your preferred option and follow the steps outlined on the installation page.

提示

You can try out code examples directly in your browser with the Remix IDE. Remix is a web browser-based IDE that allows you to write, deploy and administer Solidity smart contracts, without the need to install Solidity locally.

警告

As humans write software, it can have bugs. Therefore, you should follow established software development best practices when writing your smart contracts. This includes code review, testing, audits, and correctness proofs. Smart contract users are sometimes more confident with code than their authors, and blockchains and smart contracts have their own unique issues to watch out for, so before working on production code, make sure you read the Security Considerations section.

4. 了解更多

If you want to learn more about building decentralized applications on Ethereum, the Ethereum Developer Resources can help you with further general documentation around Ethereum, and a wide selection of tutorials, tools, and development frameworks.

If you have any questions, you can try searching for answers or asking on the Ethereum StackExchange, or our Gitter channel.

翻譯

社群貢獻者協助將此文件翻譯成多種語言。請注意,各語言版本的完整度與即時性不盡相同,應以英文版本作為參考基準。

You can switch between languages by clicking on the flyout menu in the bottom-right corner and selecting the preferred language.

備註

We set up a GitHub organization and translation workflow to help streamline the community efforts. Please refer to the translation guide in the solidity-docs org for information on how to start a new language or contribute to the community translations.

目次

Keyword Index, Search Page