mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge remote-tracking branch 'origin/develop' into HEAD
This commit is contained in:
@@ -700,7 +700,13 @@ The following example shows how to use an error string together with ``revert``
|
||||
}
|
||||
}
|
||||
|
||||
The two syntax options are equivalent, it's developer preference which to use.
|
||||
If you provide the reason string directly, then the two syntax options are equivalent, it is the developer's preference which one to use.
|
||||
|
||||
.. note::
|
||||
The ``require`` function is evaluated just as any other function.
|
||||
This means that all arguments are evaluated before the function itself is executed.
|
||||
In particular, in ``require(condition, f())`` the function ``f`` is executed even if
|
||||
``condition`` is true.
|
||||
|
||||
The provided string is :ref:`abi-encoded <ABI>` as if it were a call to a function ``Error(string)``.
|
||||
In the above example, ``revert("Not enough Ether provided.");`` returns the following hexadecimal as error return data:
|
||||
|
||||
@@ -457,19 +457,21 @@ The SMT encoding tries to be as precise as possible, mapping Solidity types
|
||||
and expressions to their closest `SMT-LIB <http://smtlib.cs.uiowa.edu/>`_
|
||||
representation, as shown in the table below.
|
||||
|
||||
+-----------------------+--------------+-----------------------------+
|
||||
|Solidity type |SMT sort |Theories (quantifier-free) |
|
||||
+=======================+==============+=============================+
|
||||
|Boolean |Bool |Bool |
|
||||
+-----------------------+--------------+-----------------------------+
|
||||
|intN, uintN, address, |Integer |LIA, NIA |
|
||||
|bytesN, enum | | |
|
||||
+-----------------------+--------------+-----------------------------+
|
||||
|array, mapping, bytes, |Array |Arrays |
|
||||
|string | | |
|
||||
+-----------------------+--------------+-----------------------------+
|
||||
|other types |Integer |LIA |
|
||||
+-----------------------+--------------+-----------------------------+
|
||||
+-----------------------+--------------------------------+-----------------------------+
|
||||
|Solidity type |SMT sort |Theories (quantifier-free) |
|
||||
+=======================+================================+=============================+
|
||||
|Boolean |Bool |Bool |
|
||||
+-----------------------+--------------------------------+-----------------------------+
|
||||
|intN, uintN, address, |Integer |LIA, NIA |
|
||||
|bytesN, enum | | |
|
||||
+-----------------------+--------------------------------+-----------------------------+
|
||||
|array, mapping, bytes, |Tuple |Datatypes, Arrays, LIA |
|
||||
|string |(Array elements, Integer length)| |
|
||||
+-----------------------+--------------------------------+-----------------------------+
|
||||
|struct |Tuple |Datatypes |
|
||||
+-----------------------+--------------------------------+-----------------------------+
|
||||
|other types |Integer |LIA |
|
||||
+-----------------------+--------------------------------+-----------------------------+
|
||||
|
||||
Types that are not yet supported are abstracted by a single 256-bit unsigned
|
||||
integer, where their unsupported operations are ignored.
|
||||
|
||||
Reference in New Issue
Block a user