From dde9e2408b2fd89dcc16bdc9c4b0d08a4dfd017c Mon Sep 17 00:00:00 2001 From: Ustas <82833595+ustas-eth@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:00:16 +0000 Subject: [PATCH] Update value-types.rst --- docs/types/value-types.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index 34e1d434e1ed..ef8482de2581 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -339,10 +339,11 @@ You can query the deployed code for any smart contract. Use ``.code`` to get the (as a ``bytes32``). Note that ``addr.codehash`` is cheaper than using ``keccak256(addr.code)``. .. warning:: - The output of ``addr.codehash`` depends on the ``addr`` balance. If ``addr`` has no code deployed - and the balance is 0, ``addr.codehash`` will output 0. If the balance is greater than 0, then - ``addr.codehash`` will output ``keccak256("")``. See `EIP-1052 `_ - and `EIP-161 `_. + The output of ``addr.codehash`` also depends on the ``addr`` balance and nonce. If ``addr`` + is empty or non-existent (it has no code, zero balance, and zero nonce), ``addr.codehash`` + will output ``0``. If balance or nonce is greater than 0, then ``addr.codehash`` will output + ``keccak256("")``. See `EIP-1052 `_ for test cases + and `EIP-161 `_ for the definition of an empty account. .. note:: All contracts can be converted to ``address`` type, so it is possible to query the balance of the