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
|
|
|
|
|
2018-09-17 13:21:33 +00:00
|
|
|
Solidity is an object-oriented, high-level language for implementing smart
|
|
|
|
contracts. Smart contracts are programs which govern the behaviour of accounts
|
|
|
|
within the Ethereum state.
|
|
|
|
|
|
|
|
Solidity 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
|
|
|
|
2018-09-17 13:21:33 +00:00
|
|
|
With Solidity you can create contracts for uses such as voting, crowdfunding, blind auctions,
|
|
|
|
and multi-signature wallets.
|
2015-12-07 20:16:25 +00:00
|
|
|
|
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
|
|
|
|
------------
|
|
|
|
|
2018-09-05 08:47:38 +00:00
|
|
|
This documentation is translated into several languages by community volunteers
|
|
|
|
with varying degrees of completeness and up-to-dateness. The English version stands as a reference.
|
2017-11-21 12:03:47 +00:00
|
|
|
|
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)
|
2018-10-17 13:26:39 +00:00
|
|
|
* `French <http://solidity-fr.readthedocs.io>`_ (in progress)
|
2017-11-21 12:03:47 +00:00
|
|
|
|
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
|
2018-09-05 08:47:38 +00:00
|
|
|
useful :ref:`example contracts <voting>`.
|
2015-12-07 20:16:25 +00:00
|
|
|
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
|
|
|
|
2018-09-05 08:47:38 +00:00
|
|
|
The fourth and most extensive section will cover all aspects of Solidity in depth.
|
2015-12-07 20:16:25 +00:00
|
|
|
|
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
|
2018-10-17 13:54:35 +00:00
|
|
|
resources.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
|