mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11923 from miohtama/patch-4
Clarify `block.*` and `tx.*` values in off-chain calls
This commit is contained in:
commit
7fba9ab245
@ -130,6 +130,12 @@ Global Variables
|
|||||||
- ``type(T).min`` (``T``): the minimum value representable by the integer type ``T``, see :ref:`Type Information<meta-type>`.
|
- ``type(T).min`` (``T``): the minimum value representable by the integer type ``T``, see :ref:`Type Information<meta-type>`.
|
||||||
- ``type(T).max`` (``T``): the maximum value representable by the integer type ``T``, see :ref:`Type Information<meta-type>`.
|
- ``type(T).max`` (``T``): the maximum value representable by the integer type ``T``, see :ref:`Type Information<meta-type>`.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
When contracts are evaluated off-chain rather than in context of a transaction included in a
|
||||||
|
block, you should not assume that ``block.*`` and ``tx.*`` refer to values from any specific
|
||||||
|
block or transaction. These values are provided by the EVM implementation that executes the
|
||||||
|
contract and can be arbitrary.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness,
|
Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness,
|
||||||
unless you know what you are doing.
|
unless you know what you are doing.
|
||||||
|
@ -92,6 +92,12 @@ Block and Transaction Properties
|
|||||||
``msg.value`` can change for every **external** function call.
|
``msg.value`` can change for every **external** function call.
|
||||||
This includes calls to library functions.
|
This includes calls to library functions.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
When contracts are evaluated off-chain rather than in context of a transaction included in a
|
||||||
|
block, you should not assume that ``block.*`` and ``tx.*`` refer to values from any specific
|
||||||
|
block or transaction. These values are provided by the EVM implementation that executes the
|
||||||
|
contract and can be arbitrary.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness,
|
Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness,
|
||||||
unless you know what you are doing.
|
unless you know what you are doing.
|
||||||
|
Loading…
Reference in New Issue
Block a user