Document address members code and codehash

This commit is contained in:
William Entriken 2022-01-13 01:19:03 -05:00
parent bc4436c57e
commit 78f0be56c3

View File

@ -329,6 +329,10 @@ on ``call``.
regardless of whether state is read from or written to, as this can have many pitfalls. 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. Also, access to gas might change in the future.
* ``code`` and ``codehash``
You can query the deployed code for any smart contract. Use ``code`` to get the EVM bytecode as a string, which might be empty. Use ``codehash`` get the Keccak-256 hash of that code.
.. 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``.