From 78f0be56c3ed7a6c60e39871cdca877644a67afc Mon Sep 17 00:00:00 2001 From: William Entriken Date: Thu, 13 Jan 2022 01:19:03 -0500 Subject: [PATCH] Document address members code and codehash --- docs/types/value-types.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/types/value-types.rst b/docs/types/value-types.rst index 49e35d9ea..215a18cee 100644 --- a/docs/types/value-types.rst +++ b/docs/types/value-types.rst @@ -329,6 +329,10 @@ on ``call``. 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. +* ``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:: All contracts can be converted to ``address`` type, so it is possible to query the balance of the current contract using ``address(this).balance``.