diff --git a/docs/cheatsheet.rst b/docs/cheatsheet.rst index 4ff9118bc..d36a96360 100644 --- a/docs/cheatsheet.rst +++ b/docs/cheatsheet.rst @@ -130,6 +130,12 @@ Global Variables - ``type(T).min`` (``T``): the minimum value representable by the integer type ``T``, see :ref:`Type Information`. - ``type(T).max`` (``T``): the maximum value representable by the integer type ``T``, see :ref:`Type Information`. +.. 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:: Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness, unless you know what you are doing. diff --git a/docs/units-and-global-variables.rst b/docs/units-and-global-variables.rst index 95438b85a..8a6173280 100644 --- a/docs/units-and-global-variables.rst +++ b/docs/units-and-global-variables.rst @@ -92,6 +92,12 @@ Block and Transaction Properties ``msg.value`` can change for every **external** function call. 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:: Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness, unless you know what you are doing.