aboutsummaryrefslogtreecommitdiffstats
path: root/docs/contracts.rst
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-03-07 00:07:03 +0800
committerGitHub <noreply@github.com>2018-03-07 00:07:03 +0800
commit14b12ae7452388516d0c4eb833b0c83fe5156b44 (patch)
treeff814ac430ddc4fc56ba8753777e5bf32f7663b7 /docs/contracts.rst
parent83dacbf669f58ad40e3035837d4ea8a846c46949 (diff)
parent3057aeece495276265d9632b97e3faffcb57fe71 (diff)
downloaddexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.tar
dexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.tar.gz
dexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.tar.bz2
dexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.tar.lz
dexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.tar.xz
dexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.tar.zst
dexon-solidity-14b12ae7452388516d0c4eb833b0c83fe5156b44.zip
Merge pull request #2966 from ethereum/useStaticCall
Use STATICCALL for pure function calls.
Diffstat (limited to 'docs/contracts.rst')
-rw-r--r--docs/contracts.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/contracts.rst b/docs/contracts.rst
index 67d4a249..121c4de0 100644
--- a/docs/contracts.rst
+++ b/docs/contracts.rst
@@ -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.