From 8728971354c15b1a8147726fa8c3efe8c801f0ee Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 31 Jan 2022 19:07:01 +0100 Subject: [PATCH] Correct type of address.code --- docs/types/value-types.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index 215a18cee..30a857796 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -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