Merge pull request #8290 from gitpusha/docs-update-staticcall-gascounting

added note about gas counting and its effect on staticall.gas(gasLimi…
This commit is contained in:
chriseth 2020-03-17 10:47:30 +01:00 committed by GitHub
commit 435c9dae71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -300,6 +300,11 @@ All three functions ``call``, ``delegatecall`` and ``staticcall`` are very low-l
The ``gas`` option is available on all three methods, while the ``value`` option is not
supported for ``delegatecall``.
.. note::
It is best to avoid relying on hardcoded gas values in your smart contract code,
regardless of whether state is read from or written to, as this can have many pitfalls.
Also, access to gas might change in the future.
.. note::
All contracts can be converted to ``address`` type, so it is possible to query the balance of the
current contract using ``address(this).balance``.