Require 0.4.16 for view/pure in docs examples#2792
Conversation
|
Can you take a look at gitter, please? Thanks! |
474e311 to
d4d967d
Compare
| #. Writing to state variables. | ||
| #. :ref:`Creating other contracts <creating-contracts>` | ||
| #. Sending Ether via calls. | ||
| #. Using ``selfdestruct``. |
docs/contracts.rst
Outdated
| #. :ref:`Creating other contracts <creating-contracts>` | ||
| #. Sending Ether via calls. | ||
| #. Using ``selfdestruct``. | ||
|
|
There was a problem hiding this comment.
Calling functions that are not marked view or pure.
There was a problem hiding this comment.
Using low-level calls.
Using inline assembly that contains certain opcodes?
There was a problem hiding this comment.
Actually, do we want to mark modifiers as view and pure, or do we just infer that?
There was a problem hiding this comment.
Calling functions was a remark below the list, but moved it into.
There was a problem hiding this comment.
There is a separate issue (#1402) about having view/pure modifiers, I assume at this point we infer it.
docs/contracts.rst
Outdated
|
|
||
| Functions can be declared ``view`` in which case they promise not to modify the state. | ||
|
|
||
| The following statements are modifying the state: |
There was a problem hiding this comment.
... are considered modifying ....
docs/contracts.rst
Outdated
|
|
||
| In addition to the list of state modifying statements explained above, the following are reading from the state: | ||
| #. Reading from state variables. | ||
| #. :ref:`Emitting events. <events>` |
docs/contracts.rst
Outdated
| #. Reading from state variables. | ||
| #. :ref:`Emitting events. <events>` | ||
| #. Accessing ``this.balance`` or ``<address>.balance`` | ||
| #. Accessing any of the members of ``tx``, ``msg`` or ``block``. |
There was a problem hiding this comment.
Apart from msg.sender, msg.data and msg.value. Actually all msg members should be fine, shouldn't they?
There was a problem hiding this comment.
I guess only msg.sig and msg.data is safe.
d4d967d to
f5ad39b
Compare
|
@chriseth updated, please review. |
| #. :ref:`Emitting events. <events>` | ||
| #. :ref:`Creating other contracts <creating-contracts>` | ||
| #. Using ``selfdestruct``. | ||
| #. Sending Ether via calls. |
There was a problem hiding this comment.
This is redundant as a function cannot be marked view/pure and payable, but I guess it cannot hurt atm (since it is not enforced).
26ce843 to
ef3817f
Compare
ef3817f to
2af949b
Compare
Depends on #2745. To be merged after the release.