mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adds more specific explanation of library view functions calls.
This commit is contained in:
parent
4beabf6686
commit
8a15058a21
@ -486,8 +486,10 @@ Functions can be declared ``view`` in which case they promise not to modify the
|
||||
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. 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.
|
||||
``DELEGATECALL`` is used, because there is no combined ``DELEGATECALL`` and ``STATICCALL``.
|
||||
This means library ``view`` functions do not have run-time checks that prevent state
|
||||
modifications. This should not impact security negatively because library code is
|
||||
usually known at compile-time and the static checker performs compile-time checks.
|
||||
|
||||
The following statements are considered modifying the state:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user