Documents library view functions and adds unit test.

This commit is contained in:
Erik Kundt
2018-10-10 12:28:24 +02:00
parent 7d2dc14304
commit 4beabf6686
2 changed files with 28 additions and 1 deletions
+3 -1
View File
@@ -485,7 +485,9 @@ Functions can be declared ``view`` in which case they promise not to modify the
.. note::
If the compiler's EVM target is Byzantium or newer (default) the opcode
``STATICCALL`` is used for ``view`` functions which enforces the state
to stay unmodified as part of the EVM execution.
to stay unmodified as part of the EVM execution. For library ``view`` functions
``DELEGATECALL`` is used. Since they are executed in the context of the calling
contract, the static checker is extended to the library.
The following statements are considered modifying the state: