diff options
author | William Morriss <wjmelements@gmail.com> | 2018-05-30 07:31:26 +0800 |
---|---|---|
committer | William Morriss <wjmelements@gmail.com> | 2018-05-30 07:31:26 +0800 |
commit | 7bc36204d385893702a944f32aa1902aca1e7377 (patch) | |
tree | 3dbb2df0e0b4d974a50b1969eef38e24353f84d7 /docs | |
parent | 8f04c59046595216e9fffd93435055aa864fbd1f (diff) | |
download | dexon-solidity-7bc36204d385893702a944f32aa1902aca1e7377.tar.gz dexon-solidity-7bc36204d385893702a944f32aa1902aca1e7377.tar.zst dexon-solidity-7bc36204d385893702a944f32aa1902aca1e7377.zip |
move bytes and string to complex types section
Diffstat (limited to 'docs')
-rw-r--r-- | docs/types.rst | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/types.rst b/docs/types.rst index 794a70de..400c6fde 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -218,18 +218,6 @@ Members: It is possible to use an array of bytes as ``byte[]``, but it is wasting a lot of space, 31 bytes every element, to be exact, when passing in calls. It is better to use ``bytes``. -Dynamically-sized byte array ----------------------------- - -``bytes``: - Dynamically-sized byte array, see :ref:`arrays`. Not a value-type! -``string``: - Dynamically-sized UTF-8-encoded string, see :ref:`arrays`. Not a value-type! - -As a rule of thumb, use ``bytes`` for arbitrary-length raw byte data and ``string`` -for arbitrary-length string (UTF-8) data. If you can limit the length to a certain -number of bytes, always use one of ``bytes1`` to ``bytes32`` because they are much cheaper. - .. index:: address, literal;address .. _address_literals: @@ -517,6 +505,18 @@ them can be quite expensive, we have to think about whether we want them to be stored in **memory** (which is not persisting) or **storage** (where the state variables are held). +Dynamically-sized byte array +---------------------------- + +``bytes``: + Dynamically-sized byte array, see :ref:`arrays`. Not a value-type! +``string``: + Dynamically-sized UTF-8-encoded string, see :ref:`arrays`. Not a value-type! + +As a rule of thumb, use ``bytes`` for arbitrary-length raw byte data and ``string`` +for arbitrary-length string (UTF-8) data. If you can limit the length to a certain +number of bytes, always use one of ``bytes1`` to ``bytes32`` because they are much cheaper. + Data location ------------- |