<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Solidity</id>
	<title>Solidity - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Solidity"/>
	<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Solidity&amp;action=history"/>
	<updated>2026-07-09T05:48:59Z</updated>
	<subtitle>在这个wiki上该页的修订历史</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://arolstar52-zhtest.hf.space/index.php?title=Solidity&amp;diff=3024975&amp;oldid=prev</id>
		<title>imported&gt;SolvYra 来自 2025年12月30日 (二) 08:38</title>
		<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Solidity&amp;diff=3024975&amp;oldid=prev"/>
		<updated>2025-12-30T08:38:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{noteTA&lt;br /&gt;
|G1=IT&lt;br /&gt;
}}&lt;br /&gt;
{{Infobox programming language&lt;br /&gt;
| name = Solidity&lt;br /&gt;
| logo = Solidity logo.svg&lt;br /&gt;
| logo caption = Solidity的標誌&lt;br /&gt;
| logo size = 100px&lt;br /&gt;
| influenced_by = [[JavaScript]]、[[C++]]、[[Python]]、[[PowerShell]]&lt;br /&gt;
| website = {{URL|github.com/ethereum/solidity}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solidity&amp;#039;&amp;#039;&amp;#039;是一種合約導向式語言，被應用於各種不同的[[區塊鏈]]平台&amp;lt;ref name=&amp;quot;IBTimes12AUG2016&amp;quot;&amp;gt;{{Cite news|url=http://www.ibtimes.co.uk/pwc-blockchain-expert-pinpoints-sources-ambiguity-smart-contracts-1575778|title=PwC blockchain expert pinpoints sources of ambiguity in smart contracts|last=Allison|first=Ian|date=12 August 2016|work=IBTimes|accessdate=14 December 2016|type=News|archive-date=2018-06-27|archive-url=https://web.archive.org/web/20180627005233/https://www.ibtimes.co.uk/pwc-blockchain-expert-pinpoints-sources-ambiguity-smart-contracts-1575778|dead-url=no}}&amp;lt;/ref&amp;gt;，其主要開發者為{{link-en|加文·伍德|Gavin Wood}}，Christian Reitwiessner，Alex Beregszaszi，Liana Husikyan，Yoichi Hirai和其他幾位早期[[以太坊]]核心貢獻者。&amp;lt;ref name=&amp;quot;:CoinDesk14Dec2016&amp;quot;&amp;gt;{{cite web|url=http://www.coindesk.com/blockchain-veterans-unveil-secure-smart-contracts-framework/|title=Blockchain Veterans Unveil Secure Smart Contracts Framework|accessdate=14 December 2016|author=Alyssa Hertig|date=15 September 2016|work=CoinDesk|archive-date=2018-04-06|archive-url=https://web.archive.org/web/20180406214833/https://www.coindesk.com/blockchain-veterans-unveil-secure-smart-contracts-framework/|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;:CCN09062016&amp;quot;&amp;gt;{{cite web|url=https://www.cryptocoinsnews.com/counterparty-brings-ethereum-smart-contracts-to-the-bitcoin-blockchain/|title=Counterparty Brings Ethereum Smart Contracts to the Bitcoin Blockchain|accessdate=14 December 2016|author=Rebecca Campbell|date=6 September 2016|work=CCN|archive-date=2017-09-24|archive-url=https://web.archive.org/web/20170924093549/https://www.cryptocoinsnews.com/counterparty-brings-ethereum-smart-contracts-to-the-bitcoin-blockchain/|dead-url=no}}&amp;lt;/ref&amp;gt;Solidity 可使程式開發人員能在區塊鏈上（例如以太坊）編寫[[智能合約]]。&amp;lt;ref name=&amp;quot;CoinDesk28Setp2016&amp;quot;&amp;gt;{{Cite news |title=In Formal Verification Push, Ethereum Seeks Smart Contract Certainty |url=http://www.coindesk.com/ethereum-formal-verification-smart-contracts/ |last=Rizzo |first=Pete |work=CoinDesk |date=28 September 2016 |type=News |accessdate=12 December 2016 |archive-url=https://web.archive.org/web/20180227094312/https://www.coindesk.com/ethereum-formal-verification-smart-contracts/ |archive-date=2018-02-27 |dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;TheMerkle24Nov2016&amp;quot;&amp;gt;{{Cite news|url=http://themerkle.com/a-consensus-issue-between-the-geth-and-parity-ethereum-clients-caused-an-unintentional-fork-of-the-network/|title=A Consensus Issue Between The Geth and Parity Ethereum Clients Caused an Unintentional Fork of the Network|last=Gomez|first=Eduardo|date=24 November 2016|work=TheMerkle|accessdate=14 December 2016|type=News|archive-date=2018-02-26|archive-url=https://web.archive.org/web/20180226211802/http://themerkle.com/a-consensus-issue-between-the-geth-and-parity-ethereum-clients-caused-an-unintentional-fork-of-the-network/|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;browning2016&amp;quot;&amp;gt;{{Cite book|url=https://books.google.co.th/books?id=2zMlDAAAQBAJ&amp;amp;pg=PT35&amp;amp;dq=solidity+blockchain&amp;amp;hl=en&amp;amp;sa=X&amp;amp;redir_esc=y#v=onepage&amp;amp;q=solidity%20blockchain&amp;amp;f=false|title=Digital Siege: Why Young Entrepreneurs Are Winning|last=Browning|first=David|date=May 2016|accessdate=2017-01-08|isbn=978-1628652963|archive-url=https://web.archive.org/web/20170109034037/https://books.google.co.th/books?id=2zMlDAAAQBAJ&amp;amp;pg=PT35&amp;amp;dq=solidity+blockchain&amp;amp;hl=en&amp;amp;sa=X&amp;amp;redir_esc=y#v=onepage&amp;amp;q=solidity%20blockchain&amp;amp;f=false|archive-date=2017-01-09|dead-url=yes}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 歷史 ==&lt;br /&gt;
Solidity的語法概念最早是由{{link-en|加文·伍德|Gavin Wood}}在2014年提出，&amp;lt;ref&amp;gt;{{Cite web|url=https://stackedit.io/viewer#!url=https://gist.githubusercontent.com/gavofyork/31b35cd2252a00d0d057/raw/16de06189d2175d2e31b300f1f8531e20c927635/solidity-original|title=StackEdit Viewer|last=Benoit Schweblin|work=stackedit.io|access-date=2018-02-26|archive-date=2016-04-01|archive-url=https://web.archive.org/web/20160401170211/https://stackedit.io/viewer#!url=https://gist.githubusercontent.com/gavofyork/31b35cd2252a00d0d057/raw/16de06189d2175d2e31b300f1f8531e20c927635/solidity-original|dead-url=yes}}&amp;lt;/ref&amp;gt;後期則以Christian Reitwiessner所領導的以太坊團隊Solidity接手開發。該語言是針對[[以太坊虛擬機]]（EVM）所設計的四種語言之一（其他的還有[[Serpent]]，LLL，Viper（實驗中）和Mutan（已棄用））。有關這些語言的更多信息，請參閱[[以太坊#程式語言|以太坊編程語言]]。&lt;br /&gt;
&lt;br /&gt;
Solidity是目前在以太坊及其他以太坊競爭平台中的主要編程語言，例如Monax及其Burrow Hyperledger的區塊鏈就是使用Tendermint完成共識機制。 SWIFT亦已經使用Solidity在Burrow上完成了概念驗證。&amp;lt;ref name=&amp;quot;finops&amp;quot;&amp;gt;{{Cite news|url=http://finops.co/operations/blockchains-smart-contracts-what-smart-whats-not/|title=Blockchain’s Smart Contracts: What’s Smart, What’s Not|last=KENTOURIS|first=CHRIS|date=13 December 2016|work=Finops|accessdate=14 December 2016|type=News|archive-date=2018-02-27|archive-url=https://web.archive.org/web/20180227153614/https://finops.co/operations/blockchains-smart-contracts-what-smart-whats-not/|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[康奈爾大學]]的研究人員指出，Solidity即是導致DAO在2016年被駭客攻擊的部分原因之一。他表示：“這實際上並不是DAO合同本身的缺陷或漏洞；技術上來說，DAO確實是在EVM上如預期般地被執行，反而是Solidity將安全上的漏洞引入了合約之中，而這些漏洞不僅沒被開發社群察覺，Solidity語言的設計者們也忽略了。&amp;lt;ref name=&amp;quot;CCN19June2016&amp;quot;&amp;gt;{{Cite news|url=https://www.cryptocoinsnews.com/ethereum-solidity-flaw-dao/|title=Ethereum’s Solidity Flaw Exploited in DAO Attack Says Cornell Researcher|last=Quentson|first=Andrew|date=19 June 2016|work=CryptocoinNews|accessdate=14 December 2016|type=News|archive-date=2017-07-19|archive-url=https://web.archive.org/web/20170719195604/https://www.cryptocoinsnews.com/ethereum-solidity-flaw-dao/|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;wiredjune18th2016&amp;quot;&amp;gt;{{Cite news|url=https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/|title=A $50 MILLION HACK JUST SHOWED THAT THE DAO WAS ALL TOO HUMAN|last=Finley|first=Klint|date=18 June 2016|work=Wired|accessdate=18 February 2017|type=News|archive-date=2016-07-26|archive-url=https://web.archive.org/web/20160726195036/http://www.wired.com/2016/06/50-million-hack-just-showed-dao-human|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 描述 ==&lt;br /&gt;
Solidity是一種靜態型別的[[程式語言]]，用於開發在EVM上執行的智能合約。 Solidity被編譯為可在EVM上執行的[[位元組碼]]。&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;{{Cite book|url=https://books.google.com/books?id=CEsPDAAAQBAJ&amp;amp;pg=PT58&amp;amp;dq=solidity+ethereum&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwi3lsC-mdLMAhUCLmMKHY_9DtwQ6AEIKzAA#v=onepage&amp;amp;q=solidity%20ethereum&amp;amp;f=false|title=The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology|last=Mougayar|first=William|date=2016-04-26|publisher=[[Wiley Publishing]]|isbn=978-1119300311}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;ibtimes.co.uk&amp;quot;&amp;gt;{{Cite web|url=http://www.ibtimes.co.uk/microsoft-adds-ethereum-language-solidity-visual-studio-1552171|title=Microsoft adds Ethereum language Solidity to Visual Studio|date=2016-03-30|last=Allison|first=Ian|publisher=[[International Business Times]]|access-date=2016-05-11|archive-date=2016-05-29|archive-url=https://web.archive.org/web/20160529164519/http://www.ibtimes.co.uk/microsoft-adds-ethereum-language-solidity-visual-studio-1552171|dead-url=no}}&amp;lt;/ref&amp;gt; 藉由Solidity，開發人員能夠編寫出可自我執行其欲實現之商業邏輯的應用程式，該程式可被視為一份具權威性且永不可悔改的交易合約。&amp;lt;ref&amp;gt;{{Cite web|url=https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|title=Ethereum&amp;#039;s Solidity Now Available in Microsoft Visual Studio|accessdate=2016-05-11|date=2016-05-04|last=Bradley|first=Joseph|publisher=Cryptocoinnews|archive-date=2016-04-18|archive-url=https://web.archive.org/web/20160418015636/https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;ibtimes.co.uk&amp;quot; /&amp;gt;對已具備程式編輯能力的人而言，編寫Solidity的難易度就如同編寫一般的程式語言。&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gavin Wood最初在規劃Solidity語言時參照了[[ECMAScript]]的語法概念，使其對現有的Web開發者更容易入門；與ECMAScript不同的地方在於Solidity具有靜態型別和可變返回型別。而與目前其他EVM目標語言（如Serpent和Mutan）相比，其重要的差異在於Solidity具有一組複雜的成員變數使得合約可支援任意階層的映射和結構。Solidity也支援繼承，包含C3線性化多重繼承。 另外還引入了一個[[應用程序二進制接口]]（ABI），該接口（ABI）可在單一合同中實現多種類型安全的功能。 &lt;br /&gt;
&lt;br /&gt;
以下為使用Solidity編寫的程式範例:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;js&amp;quot;&amp;gt;&lt;br /&gt;
contract GavCoin&lt;br /&gt;
{&lt;br /&gt;
  mapping(address=&amp;gt;uint) balances;&lt;br /&gt;
  uint constant totalCoins = 100000000000;&lt;br /&gt;
&lt;br /&gt;
  /// Endows creator of contract with 1m GAV.&lt;br /&gt;
  function GavCoin(){&lt;br /&gt;
      balances[msg.sender] = totalCoins;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /// Send $((valueInmGAV / 1000).fixed(0,3)) GAV from the account of $(message.caller.address()), to an account accessible only by $(to.address()).&lt;br /&gt;
  function send(address to, uint256 valueInmGAV) {&lt;br /&gt;
    if (balances[msg.sender] &amp;gt;= valueInmGAV) {&lt;br /&gt;
      balances[to] += valueInmGAV;&lt;br /&gt;
      balances[msg.sender] -= valueInmGAV;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /// getter function for the balance&lt;br /&gt;
  function balance(address who) constant returns (uint256 balanceInmGAV) {&lt;br /&gt;
    balanceInmGAV = balances[who];&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 批評 ==&lt;br /&gt;
&lt;br /&gt;
智慧型合約的許多安全屬性本質上很難直接推理，而 Solidity 的圖靈完備性意味著任意屬性的驗證無法確定地自動化。目前用於智慧型合約安全分析的自動化解決方案可能會遺漏掉一些嚴重的違規行為，產生誤報，並且無法在現實合約上達到足夠的程式碼覆蓋率。&amp;lt;ref&amp;gt;{{Cite journal |last=Tsankov |first=Petar |last2=Dan |first2=Andrei |last3=Drachsler-Cohen |first3=Dana |last4=Gervais |first4=Arthur |last5=Bünzli |first5=Florian |last6=Vechev |first6=Martin |title=Securify: Practical Security Analysis of Smart Contracts |url=https://www.vtrader.io/en-us/eth-gas-tracker/ |journal=Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security |series=CCS &amp;#039;18 |location=New York, NY, USA |publisher=[[Association for Computing Machinery]] |date=2018-10-15 |doi=10.1145/3243734.3243780 |isbn=978-1-4503-5693-0 |s2cid=15494854 |archive-url=https://web.archive.org/web/20240412215737/https://dl.acm.org/doi/10.1145/3243734.3243780 |archive-date=2024-04-12 |access-date=2025-12-29 |via= |doi-access=free }}&amp;lt;/ref&amp;gt;由於其違反直覺的性質、缺乏處理區塊鏈領域特定方面的結構以及缺乏已知漏洞的中心化文件，Solidity 被批評為以太坊智能合約的實施容易出錯。&amp;lt;ref&amp;gt;{{Cite journal | last=Atzei |first=Nicola |last2=Bartoletti |first2=Massimo |last3=Cimoli |first3=Tiziana |editor-last=Maffei |editor-first=Matteo |editor2-last=Ryan |editor2-first=Mark |title=A Survey of Attacks on Ethereum Smart Contracts (SoK) |url=https://link.springer.com/chapter/10.1007/978-3-662-54455-6_8 |journal=Principles of Security and Trust |language=en |location=Berlin, Heidelberg |publisher=Springer |date=2017 |doi=10.1007/978-3-662-54455-6_8 |isbn=978-3-662-54455-6 |s2cid=15494854 |access-date=2025-12-30 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2016 年，[[康奈尔大学|康奈爾大學]]的一位研究人員表示，Solidity 是當年發生的 DAO 駭客攻擊的部分原因。他表示：“這實際上不是 DAO 合約本身的缺陷或漏洞：就技術而言，以太坊虛擬機 (EVM) 正在按預期運行，但 Solidity 將安全漏洞導入到合約中，這些漏洞不僅被社區遺漏，還包括原本的語言設計人。”&amp;lt;ref&amp;gt;{{Cite news |title=Someone Just Stole $50 Million from the Biggest Crowdfunded Project Ever. (Humans Can&amp;#039;t Be Trusted) |url=https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/ |last=Finley |first=Klint |work=[[Wired]] |date=2016-06-18 |language=en-US |issn=1059-1028 |access-date=2025-12-30 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 開發平台 ==&lt;br /&gt;
* {{URL|https://remix.ethereum.org|Remix}}，Solidity官方[[集成开发环境|IDE]]&lt;br /&gt;
* {{URL|https://chainide.com/|ChainIDE}}&lt;br /&gt;
* [[Microsoft Visual Studio]]&amp;lt;ref&amp;gt;{{Cite web|url=https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|title=Ethereum&amp;#039;s Solidity Now Available in Microsoft Visual Studio|accessdate=1 May 2016|work=CCN: Financial Bitcoin &amp;amp; Cryptocurrency News|archive-date=2016-04-18|archive-url=https://web.archive.org/web/20160418015636/https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{Cite web|url=http://www.coindesk.com/microsoft-ethereum-3-million-developers/|title=Microsoft Adds Ethereum to Windows Platform For Over 3 Million Developers|accessdate=1 May 2016|work=CoinDesk|archive-date=2018-01-09|archive-url=https://web.archive.org/web/20180109181245/https://www.coindesk.com/microsoft-ethereum-3-million-developers/|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* [[ConsenSys]] Enterprise&lt;br /&gt;
* Tendermint &lt;br /&gt;
* [[亞馬遜網路服務系統|AWS]]的ErisDB&lt;br /&gt;
&lt;br /&gt;
== 區塊鏈平台 ==&lt;br /&gt;
Solidity可在下列平台中運作:&lt;br /&gt;
*[[以太坊]]（Ethereum）&lt;br /&gt;
* [[幣安]]智能鏈（Binance Smart Chain）&lt;br /&gt;
* [[以太坊經典]]（Ethereum Classic）&lt;br /&gt;
* 雪崩合約鏈（Avalanche C-Chain）&lt;br /&gt;
* Counterparty&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[波場]]（TRON）&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== 参考文献 ==&lt;br /&gt;
{{Reflist|30em&lt;br /&gt;
&amp;lt;ref name=Allison-2016-12-20&amp;gt;{{cite web|url=http://www.ibtimes.co.uk/blockchain-big-data-worth-watching-2017-1596721|date=December 20, 2016|title=Blockchain and big data worth watching in the coming year|department=[[Business]]|website=[[International Business Times]]|language=en|access-date=2017-09-28|archive-url=https://web.archive.org/web/20220812145515/https://www.ibtimes.co.uk/blockchain-big-data-worth-watching-2017-1596721|dead-url=no|archive-date=2022-08-12}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* [http://cat.lib.unimelb.edu.au/search~S42?/aInternational+Conference+on+Applicable+Algebra%2C+Error-Correcting+Codes%2C+Combinatorics+and+Computer+Algebra%2C+AAECC+%284+%3A+1986+-+26-09-1986+%3A+Karlsruhe%2C+FRG%29/ainternational+conference+on+applicable+algebra+error+correcting+codes+combinatorics+and+computer+algebra+aaecc++++++++4+++++1/47,-1,0,B/browse International Conference on Applications of Natural Language to Information Systems (13th : 2008 : London, England)], NLDB 2008, London, UK, June 24-27, 2008 : proceedings / Epaminondas Kapetanios, Vijayan Sugumaran, Myra Spiliopoulou (eds.), ISBN 978-3-540-69857-9&lt;br /&gt;
&amp;lt;ref name=Bhargavan-2016-08-27&amp;gt;{{cite journal|url=http://research.microsoft.com/en-us/um/people/nswamy/papers/solidether.pdf|last1=Schneier|first1=Karthikeyan|last2=Schneier|first2=Antoine|last3=Bhargavan|first3=Cedric|last4=Delignat-Lavaud|first4=Anitha|last5=Fournet|first5=Gollamudi|last6=Schneier|first6=Bruce|last7=Rastogi|first7=Nadim|last8=Sibut-Pinote|first8=Aseem|last9=Rastogi1|first9=Thomas|last10=Swamy|first10=Nikhil|last11=Zanella-Beguelin|first11=Santiago|date=August 27, 2016|title=Short Paper: Formal Verification of Smart Contracts|journal=[[Microsoft Research]], [[French Institute for Research in Computer Science and Automation]], [[Harvard University]]|language=en|archive-url=https://web.archive.org/web/20160827092146/http://research.microsoft.com/en-us/um/people/nswamy/papers/solidether.pdf|dead-url=no|archive-date=August 23, 2017}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== 外部連結 ==&lt;br /&gt;
* {{URL|https://solidity.readthedocs.org/|Solidity home and documentation}}&lt;br /&gt;
&lt;br /&gt;
[[Category:特定领域语言]]&lt;br /&gt;
[[Category:静态类型编程语言]]&lt;/div&gt;</summary>
		<author><name>imported&gt;SolvYra</name></author>
	</entry>
</feed>