Clarify `pure`.

This commit is contained in:
chriseth 2021-11-08 13:22:23 +01:00
parent ea3c34a082
commit aa4d3cabf1

View File

@ -222,6 +222,9 @@ Pure Functions
--------------
Functions can be declared ``pure`` in which case they promise not to read from or modify the state.
In particular, it should be possible to evaluate a ``pure`` function at compile-time given
only its inputs and ``msg.data``, but without any knowledge of the current blockchain state.
This means that reading from ``immutable`` variables can be a non-pure operation.
.. note::
If the compiler's EVM target is Byzantium or newer (default) the opcode ``STATICCALL`` is used,