mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added note recommending to avoid relying on hardcoded gas values
This commit is contained in:
parent
d033c2f767
commit
1b63b8822e
@ -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
|
The ``gas`` option is available on all three methods, while the ``value`` option is not
|
||||||
supported for ``delegatecall``.
|
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::
|
.. note::
|
||||||
All contracts can be converted to ``address`` type, so it is possible to query the balance of the
|
All contracts can be converted to ``address`` type, so it is possible to query the balance of the
|
||||||
current contract using ``address(this).balance``.
|
current contract using ``address(this).balance``.
|
||||||
|
Loading…
Reference in New Issue
Block a user