2015-12-07 20:16:25 +00:00
.. index :: type
2016-02-19 10:30:00 +00:00
.. _types:
2015-12-07 20:16:25 +00:00
*****
Types
*****
Solidity is a statically typed language, which means that the type of each
2018-06-18 13:58:10 +00:00
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` .
2018-11-23 16:16:18 +00:00
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
2020-04-20 16:24:31 +00:00
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
2019-01-09 11:15:58 +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
2019-01-09 11:37:20 +00:00
.. include :: types/operators.rst
2015-12-07 20:16:25 +00:00
2020-04-20 16:24:31 +00:00
.. include :: types/conversion.rst