Skip to content

Commit e87d959

Browse files
authored
Merge pull request #12606 from ethereum/chriseth-patch-1
[docs] Correct type of address.code
2 parents d839624 + 8728971 commit e87d959

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/types/value-types.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ on ``call``.
331331

332332
* ``code`` and ``codehash``
333333

334-
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.
334+
You can query the deployed code for any smart contract. Use ``.code`` to get the EVM bytecode as a
335+
``bytes memory``, which might be empty. Use ``.codehash`` get the Keccak-256 hash of that code
336+
(as a ``bytes32``). Note that ``addr.codehash`` is cheaper than using ``keccak256(addr.code)``.
335337

336338
.. note::
337339
All contracts can be converted to ``address`` type, so it is possible to query the balance of the

0 commit comments

Comments
 (0)