solidity/docs/types.rst

29 lines
961 B
ReStructuredText
Raw Normal View History

2015-12-07 20:16:25 +00:00
.. index:: type
.. _types:
2015-12-07 20:16:25 +00:00
*****
Types
*****
Solidity is a statically typed language, which means that the type of each
variable (state and local) needs to be specified.
Solidity provides several elementary types which can be combined to form complex types.
2015-12-07 20:16:25 +00:00
2016-07-20 19:35:38 +00:00
In addition, types can interact with each other in expressions containing
operators. For a quick reference of the various operators, see :ref:`order`.
The concept of "undefined" or "null" values does not exist in Solidity, but newly
2018-11-23 09:16:30 +00:00
declared variables always have a :ref:`default value<default-value>` dependent
on its type. To handle any unexpected values, you should use the :ref:`revert function<assert-and-require>` to revert the whole transaction, or return a
tuple with a second `bool` value denoting success.
2018-11-15 11:02:38 +00:00
2019-01-09 11:06:37 +00:00
.. include:: types/value-types.rst
2016-10-19 16:43:07 +00:00
.. include:: types/reference-types.rst
2015-12-07 20:16:25 +00:00
2019-01-09 11:25:45 +00:00
.. include:: types/mapping-types.rst
2016-10-15 21:50:46 +00:00
.. include:: types/operators.rst
2015-12-07 20:16:25 +00:00
2019-01-09 11:48:36 +00:00
.. include:: types/conversion.rst