This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Docs] Add documentation for ENI types.
- Loading branch information
Yi Huang
committed
Sep 7, 2018
1 parent
8324ff5
commit cae76b1
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This section does not exist yet. `(´-ι_-\`)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
============= | ||
Documentation | ||
============= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ Contents | |
|
||
getting-started | ||
developer-guide | ||
documentation | ||
contributing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
===== | ||
Types | ||
===== | ||
|
||
ENI Types | ||
--------- | ||
|
||
These types are provided to be coherent with `Lity <lity_>`__ | ||
(`Solidity <solidity_>`__) primitive types. | ||
|
||
.. _lity: http://lity.readthedocs.io/ | ||
.. _solidity: https://solidity.readthedocs.io/ | ||
|
||
.. _types-eni-int: | ||
|
||
ENI Integers | ||
```````````` | ||
|
||
All integer types in ENI is implemented using `boost::multiprecision::number <boostnumber_>`__. | ||
Some of them are aliases for types predefined in `boost::multiprecision::cpp_int <boostcppint_>`__. | ||
|
||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| Integer Type | Size (bits) | Signed | Note | | ||
+===============+=============+========+=================================================+ | ||
| ``eni::s256`` | 256 | ✔ | Alias for ``boost::multiprecision::int256_t``. | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| ``eni::Int`` | 256 | ✔ | Alias for ``eni::s256``. | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| ``eni::u256`` | 256 | ✘ | Alias for ``boost::multiprecision::uint256_t``. | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| ``eni::u160`` | 160 | ✘ | Size of an Ethereum address. | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| ``eni::u128`` | 128 | ✘ | Alias for ``boost::multiprecision::uint128_t``. | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| ``eni::u64`` | 64 | ✘ | | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
| ``eni::UInt`` | 256 | ✘ | Alias for ``eni::u256``. | | ||
+---------------+-------------+--------+-------------------------------------------------+ | ||
|
||
Operations on ENI Integers | ||
'''''''''''''''''''''''''' | ||
|
||
See `the documentation for boost::multiprecision::number <boostnumber_>`__ for | ||
supported operations. | ||
|
||
You may use `boost::lexical_cast <boostlexcast_>`__ to convert ENI integers to strings. | ||
|
||
.. _boostnumber: https://www.boost.org/doc/libs/1_58_0/libs/multiprecision/doc/html/boost_multiprecision/ref/number.html | ||
.. _boostcppint: https://www.boost.org/doc/libs/1_58_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html | ||
|
||
.. _boostlexcast: https://www.boost.org/doc/libs/1_58_0/doc/html/boost_lexical_cast.html | ||
|
||
Suggested Use of ENI Integers | ||
''''''''''''''''''''''''''''' | ||
|
||
.. include:: 404.rst | ||
|
||
.. _types-eni-bool: | ||
|
||
ENI Boolean | ||
``````````` | ||
|
||
``eni::Bool`` is an alias for C++ ``bool``. | ||
|
||
.. _types-eni-addr: | ||
|
||
ENI Address | ||
``````````` | ||
|
||
``eni::Address`` is an alias for ``eni::u160`` (20 bytes, size of an Ethereum address). | ||
|
||
.. _types-json: | ||
|
||
Abstract Data Types | ||
------------------- | ||
|
||
See ``eni::Vector`` and ``eni::StringMap``. | ||
|
||
.. include:: 404.rst | ||
|
||
JSON Types | ||
---------- | ||
|
||
.. include:: 404.rst |