mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Clarify `pure
`.
This commit is contained in:
parent
ea3c34a082
commit
aa4d3cabf1
@ -222,6 +222,9 @@ Pure Functions
|
|||||||
--------------
|
--------------
|
||||||
|
|
||||||
Functions can be declared ``pure`` in which case they promise not to read from or modify the state.
|
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::
|
.. note::
|
||||||
If the compiler's EVM target is Byzantium or newer (default) the opcode ``STATICCALL`` is used,
|
If the compiler's EVM target is Byzantium or newer (default) the opcode ``STATICCALL`` is used,
|
||||||
|
Loading…
Reference in New Issue
Block a user