2015-12-10 10:35:54 +00:00
Solidity
========
2015-12-07 20:16:25 +00:00
2017-06-05 10:25:48 +00:00
.. image :: logo.svg
:width: 120px
:alt: Solidity logo
:align: center
2017-11-15 02:18:30 +00:00
Solidity is a contract-oriented, high-level language for implementing smart contracts.
2017-11-13 17:39:27 +00:00
It was influenced by C++, Python and JavaScript
and is designed to target the Ethereum Virtual Machine (EVM).
2016-10-14 10:09:51 +00:00
Solidity is statically typed, supports inheritance, libraries and complex
2016-10-26 17:23:53 +00:00
user-defined types among other features.
2016-10-14 10:09:51 +00:00
2016-06-27 12:51:07 +00:00
As you will see, it is possible to create contracts for voting,
2015-12-07 20:16:25 +00:00
crowdfunding, blind auctions, multi-signature wallets and more.
2015-12-10 10:35:54 +00:00
.. note ::
2017-03-15 22:58:14 +00:00
The best way to try out Solidity right now is using
`Remix <https://remix.ethereum.org/> `_
2018-03-06 18:39:53 +00:00
(it can take a while to load, please be patient). Remix is a web browser
2018-07-18 12:28:58 +00:00
based IDE that allows you to write Solidity smart contracts, then deploy
and run the smart contracts.
2015-12-10 10:35:54 +00:00
2018-02-01 16:13:46 +00:00
.. warning ::
Since software is written by humans, it can have bugs. Thus, also
smart contracts should be created following well-known best-practices in
software development. This includes code review, testing, audits and correctness proofs.
Also note that users are sometimes more confident in code than its authors.
Finally, blockchains have their own things to watch out for, so please take
a look at the section :ref: `security_considerations` .
2017-11-21 12:03:47 +00:00
Translations
------------
This documentation is translated into several languages by community volunteers, but the English version stands as a reference.
2018-02-23 08:44:05 +00:00
* `Simplified Chinese <http://solidity-cn.readthedocs.io> `_ (in progress)
2017-11-21 12:03:47 +00:00
* `Spanish <https://solidity-es.readthedocs.io> `_
* `Russian <https://github.com/ethereum/wiki/wiki/%5BRussian%5D-%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE-%D0%BF%D0%BE-Solidity> `_ (rather outdated)
2018-03-10 02:27:23 +00:00
* `Korean <http://solidity-kr.readthedocs.io> `_ (in progress)
2017-11-21 12:03:47 +00:00
2015-12-10 10:35:54 +00:00
Useful links
------------
* `Ethereum <https://ethereum.org> `_
2016-10-12 08:26:22 +00:00
* `Changelog <https://github.com/ethereum/solidity/blob/develop/Changelog.md> `_
2015-12-10 10:35:54 +00:00
* `Story Backlog <https://www.pivotaltracker.com/n/projects/1189488> `_
* `Source Code <https://github.com/ethereum/solidity/> `_
2016-01-27 17:04:30 +00:00
* `Ethereum Stackexchange <https://ethereum.stackexchange.com/> `_
2015-12-10 10:35:54 +00:00
* `Gitter Chat <https://gitter.im/ethereum/solidity/> `_
2016-05-20 13:10:50 +00:00
Available Solidity Integrations
-------------------------------
2016-05-26 11:37:10 +00:00
2018-08-09 12:31:30 +00:00
* Generic:
2016-05-20 13:10:50 +00:00
2018-08-09 12:31:30 +00:00
* `Remix <https://remix.ethereum.org/> `_
Browser-based IDE with integrated compiler and Solidity runtime environment without server-side components.
2017-03-05 14:45:28 +00:00
2018-08-09 12:31:30 +00:00
* `Solium <https://github.com/duaraghav8/Solium/> `_
Linter to identify and fix style and security issues in Solidity.
2016-05-20 13:10:50 +00:00
2018-08-09 12:31:30 +00:00
* `Solhint <https://github.com/protofire/solhint> `_
Solidity linter that provides security, style guide and best practice rules for smart contract validation.
2016-05-20 13:10:50 +00:00
2018-08-09 12:31:30 +00:00
* Atom:
2016-05-20 13:10:50 +00:00
2018-08-09 12:31:30 +00:00
* `Etheratom <https://github.com/0mkara/etheratom> `_
Plugin for the Atom editor that features syntax highlighting, compilation and a runtime environment (Backend node & VM compatible).
2017-04-29 15:22:01 +00:00
2018-08-09 12:31:30 +00:00
* `Atom Solidity Linter <https://atom.io/packages/linter-solidity> `_
Plugin for the Atom editor that provides Solidity linting.
2017-06-13 23:33:58 +00:00
2018-08-09 12:31:30 +00:00
* `Atom Solium Linter <https://atom.io/packages/linter-solium> `_
Configurable Solidty linter for Atom using Solium as a base.
2018-07-18 12:28:58 +00:00
2018-08-09 12:31:30 +00:00
* Emacs:
2016-05-28 03:39:22 +00:00
2018-08-09 12:31:30 +00:00
* `Emacs Solidity <https://github.com/ethereum/emacs-solidity/> `_
Plugin for the Emacs editor providing syntax highlighting and compilation error reporting.
2016-05-26 11:37:10 +00:00
2018-08-09 12:31:30 +00:00
* IntelliJ:
2016-05-26 11:37:10 +00:00
2018-08-09 12:31:30 +00:00
* `IntelliJ IDEA plugin <https://plugins.jetbrains.com/plugin/9475-intellij-solidity> `_
Solidity plugin for IntelliJ IDEA (and all other JetBrains IDEs)
2016-05-20 13:10:50 +00:00
2018-08-09 12:31:30 +00:00
* Sublime:
* `Package for SublimeText — Solidity language syntax <https://packagecontrol.io/packages/Ethereum/> `_
Solidity syntax highlighting for SublimeText editor.
* Vim:
* `Vim Solidity <https://github.com/tomlion/vim-solidity/> `_
Plugin for the Vim editor providing syntax highlighting.
* `Vim Syntastic <https://github.com/scrooloose/syntastic> `_
Plugin for the Vim editor providing compile checking.
* Visual Studio Code:
* `Visual Studio Code extension <http://juan.blanco.ws/solidity-contracts-in-visual-studio-code/> `_
Solidity plugin for Microsoft Visual Studio Code that includes syntax highlighting and the Solidity compiler.
2016-08-16 11:12:19 +00:00
2016-07-27 15:42:21 +00:00
Discontinued:
* `Mix IDE <https://github.com/ethereum/mix/> `_
Qt based IDE for designing, debugging and testing solidity smart contracts.
2018-07-18 12:28:58 +00:00
* `Ethereum Studio <https://live.ether.camp/> `_
2017-07-25 15:56:18 +00:00
Specialized web IDE that also provides shell access to a complete Ethereum environment.
2016-07-27 15:42:21 +00:00
2018-08-09 12:29:31 +00:00
* `Visual Studio Extension <https://visualstudiogallery.msdn.microsoft.com/96221853-33c4-4531-bdd5-d2ea5acc4799/> `_
Solidity plugin for Microsoft Visual Studio that includes the Solidity compiler.
2016-07-06 15:39:32 +00:00
Solidity Tools
2016-08-29 15:00:11 +00:00
--------------
2016-07-06 15:39:32 +00:00
2018-08-09 12:29:31 +00:00
* `Dapp <https://dapp.tools/dapp/> `_
2017-04-15 02:01:57 +00:00
Build tool, package manager, and deployment assistant for Solidity.
2016-09-05 14:29:08 +00:00
2016-07-06 15:39:32 +00:00
* `Solidity REPL <https://github.com/raineorshine/solidity-repl> `_
Try Solidity instantly with a command-line Solidity console.
2016-07-11 15:23:17 +00:00
2016-07-06 15:39:32 +00:00
* `solgraph <https://github.com/raineorshine/solgraph> `_
Visualize Solidity control flow and highlight potential security vulnerabilities.
2018-07-18 12:28:58 +00:00
* `Doxity <https://github.com/DigixGlobal/doxity> `_
Documentation Generator for Solidity.
2016-07-06 15:39:32 +00:00
* `evmdis <https://github.com/Arachnid/evmdis> `_
EVM Disassembler that performs static analysis on the bytecode to provide a higher level of abstraction than raw EVM operations.
2018-07-30 08:08:51 +00:00
* `ABI to solidity interface converter <https://gist.github.com/chriseth/8f533d133fa0c15b0d6eaf3ec502c82b> `_
A script for generating contract interfaces from the ABI of a smart contract.
2018-08-09 11:47:05 +00:00
* `Securify <https://securify.ch/> `_
Fully automated online static analyzer for smart contracts, providing a security report based on vulnerability patterns.
* `Sūrya <https://github.com/ConsenSys/surya/> `_
Utility tool for smart contract systems, offering a number of visual outputs and information about the contracts' structure. Also supports querying the function call graph.
* `EVM Lab <https://github.com/ethereum/evmlab/> `_
Rich tool package to interact with the EVM. Includes a VM, Etherchain API, and a trace-viewer with gas cost display.
2018-07-30 08:08:51 +00:00
2018-07-18 12:28:58 +00:00
.. note ::
Information like variable names, comments, and source code formatting is lost in the compilation process and it is not possible to completely recover the original source code. Decompiling smart contracts to view the original source code might not be possible, or the end result that useful.
2017-04-29 15:22:01 +00:00
2016-12-27 18:29:25 +00:00
Third-Party Solidity Parsers and Grammars
-----------------------------------------
* `solidity-parser <https://github.com/ConsenSys/solidity-parser> `_
Solidity parser for JavaScript
* `Solidity Grammar for ANTLR 4 <https://github.com/federicobond/solidity-antlr4> `_
Solidity grammar for the ANTLR 4 parser generator
2015-12-10 10:35:54 +00:00
Language Documentation
----------------------
2015-12-07 20:16:25 +00:00
On the next pages, we will first see a :ref: `simple smart contract <simple-smart-contract>` written
in Solidity followed by the basics about :ref: `blockchains <blockchain-basics>`
and the :ref: `Ethereum Virtual Machine <the-ethereum-virtual-machine>` .
The next section will explain several *features* of Solidity by giving
useful :ref: `example contracts <voting>`
Remember that you can always try out the contracts
2017-03-15 22:58:14 +00:00
`in your browser <https://remix.ethereum.org> `_ !
2015-12-07 20:16:25 +00:00
The last and most extensive section will cover all aspects of Solidity in depth.
2016-01-27 17:06:41 +00:00
If you still have questions, you can try searching or asking on the
`Ethereum Stackexchange <https://ethereum.stackexchange.com/> `_
site, or come to our `gitter channel <https://gitter.im/ethereum/solidity/> `_ .
Ideas for improving Solidity or this documentation are always welcome!
2015-12-07 20:16:25 +00:00
Contents
========
2015-12-10 10:35:54 +00:00
:ref: `Keyword Index <genindex>` , :ref: `Search Page <search>`
2015-12-07 20:16:25 +00:00
.. toctree ::
:maxdepth: 2
introduction-to-smart-contracts.rst
2015-12-10 10:35:54 +00:00
installing-solidity.rst
2015-12-07 20:16:25 +00:00
solidity-by-example.rst
solidity-in-depth.rst
2016-06-28 15:29:08 +00:00
security-considerations.rst
2016-06-10 15:25:51 +00:00
using-the-compiler.rst
2017-09-05 13:20:53 +00:00
metadata.rst
2017-06-12 16:33:23 +00:00
abi-spec.rst
2018-06-05 17:43:23 +00:00
yul.rst
2015-12-07 20:16:25 +00:00
style-guide.rst
common-patterns.rst
2017-04-12 10:23:34 +00:00
bugs.rst
2016-08-29 17:24:28 +00:00
contributing.rst
2015-12-07 20:16:25 +00:00
frequently-asked-questions.rst