mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Document STATICCALL usage in experimental 0.5.0.
This commit is contained in:
parent
a3593df43b
commit
3057aeece4
@ -472,6 +472,13 @@ The following statements are considered modifying the state:
|
||||
.. note::
|
||||
Getter methods are marked ``view``.
|
||||
|
||||
.. note::
|
||||
If invalid explicit type conversions are used, state modifications are possible
|
||||
even though a ``view`` function was called.
|
||||
You can switch the compiler to use ``STATICCALL`` when calling such functions and thus
|
||||
prevent modifications to the state on the level of the EVM by adding
|
||||
``pragma experimental "v0.5.0";``
|
||||
|
||||
.. warning::
|
||||
The compiler does not enforce yet that a ``view`` method is not modifying state. It raises a warning though.
|
||||
|
||||
@ -502,6 +509,18 @@ In addition to the list of state modifying statements explained above, the follo
|
||||
}
|
||||
}
|
||||
|
||||
.. note::
|
||||
If invalid explicit type conversions are used, state modifications are possible
|
||||
even though a ``pure`` function was called.
|
||||
You can switch the compiler to use ``STATICCALL`` when calling such functions and thus
|
||||
prevent modifications to the state on the level of the EVM by adding
|
||||
``pragma experimental "v0.5.0";``
|
||||
|
||||
.. warning::
|
||||
It is not possible to prevent functions from reading the state at the level
|
||||
of the EVM, it is only possible to prevent them from writing to the state
|
||||
(i.e. only ``view`` can be enforced at the EVM level, ``pure`` can not).
|
||||
|
||||
.. warning::
|
||||
Before version 0.4.17 the compiler didn't enforce that ``pure`` is not reading the state.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user