Merge pull request #12606 from ethereum/chriseth-patch-1

[docs] Correct type of address.code
This commit is contained in:
Daniel Kirchner 2022-02-01 11:02:10 +01:00 committed by GitHub
commit e87d959f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,7 +331,9 @@ on ``call``.
* ``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.
You can query the deployed code for any smart contract. Use ``.code`` to get the EVM bytecode as a
``bytes memory``, which might be empty. Use ``.codehash`` get the Keccak-256 hash of that code
(as a ``bytes32``). Note that ``addr.codehash`` is cheaper than using ``keccak256(addr.code)``.
.. note::
All contracts can be converted to ``address`` type, so it is possible to query the balance of the