diff options
author | chriseth <chris@ethereum.org> | 2018-01-16 17:31:13 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-06 22:32:45 +0800 |
commit | 3057aeece495276265d9632b97e3faffcb57fe71 (patch) | |
tree | 358d2a8e5a35d87e834044f686a8943f74c40dc1 /docs | |
parent | a3593df43b8d5639dd756d238cc744b1204cc3e8 (diff) | |
download | dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.tar dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.tar.gz dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.tar.bz2 dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.tar.lz dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.tar.xz dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.tar.zst dexon-solidity-3057aeece495276265d9632b97e3faffcb57fe71.zip |
Document STATICCALL usage in experimental 0.5.0.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/contracts.rst | 19 |
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. |