2015-12-07 20:16:25 +00:00
|
|
|
.. index:: ! contract
|
|
|
|
|
2018-06-19 19:32:03 +00:00
|
|
|
.. _contracts:
|
|
|
|
|
2015-12-07 20:16:25 +00:00
|
|
|
##########
|
|
|
|
Contracts
|
|
|
|
##########
|
|
|
|
|
2016-09-05 14:29:08 +00:00
|
|
|
Contracts in Solidity are similar to classes in object-oriented languages. They
|
2019-12-12 11:52:18 +00:00
|
|
|
contain persistent data in state variables, and functions that can modify these
|
2016-03-10 19:53:13 +00:00
|
|
|
variables. Calling a function on a different contract (instance) will perform
|
2019-12-12 11:52:18 +00:00
|
|
|
an EVM function call and thus switch the context such that state variables
|
|
|
|
in the calling contract are
|
2019-01-16 15:39:29 +00:00
|
|
|
inaccessible. A contract and its functions need to be called for anything to happen.
|
|
|
|
There is no "cron" concept in Ethereum to call a function at a particular event automatically.
|
2015-12-07 20:16:25 +00:00
|
|
|
|
2019-01-07 10:04:31 +00:00
|
|
|
.. include:: contracts/creating-contracts.rst
|
2015-12-07 20:16:25 +00:00
|
|
|
|
2019-01-07 10:58:11 +00:00
|
|
|
.. include:: contracts/visibility-and-getters.rst
|
2015-12-07 20:16:25 +00:00
|
|
|
|
2019-01-07 12:52:17 +00:00
|
|
|
.. include:: contracts/function-modifiers.rst
|
2015-12-07 20:16:25 +00:00
|
|
|
|
2019-01-07 13:14:26 +00:00
|
|
|
.. include:: contracts/constant-state-variables.rst
|
2019-01-07 13:27:32 +00:00
|
|
|
.. include:: contracts/functions.rst
|
2017-11-21 11:01:59 +00:00
|
|
|
|
2019-01-07 13:50:21 +00:00
|
|
|
.. include:: contracts/events.rst
|
2015-12-07 20:16:25 +00:00
|
|
|
|
2019-01-07 14:37:33 +00:00
|
|
|
.. include:: contracts/inheritance.rst
|
2017-01-03 18:40:50 +00:00
|
|
|
|
2019-01-07 14:45:39 +00:00
|
|
|
.. include:: contracts/abstract-contracts.rst
|
2019-01-07 16:49:34 +00:00
|
|
|
.. include:: contracts/interfaces.rst
|
2018-09-20 20:07:04 +00:00
|
|
|
|
2019-01-07 17:05:27 +00:00
|
|
|
.. include:: contracts/libraries.rst
|
2018-01-19 15:52:23 +00:00
|
|
|
|
2019-01-07 17:08:00 +00:00
|
|
|
.. include:: contracts/using-for.rst
|