Skip to content

Commit cbad85f

Browse files
authored
Update eip-1052.md
1 parent 6a190a3 commit cbad85f

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

EIPS/eip-1052.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
eip: 1052
33
title: EXTCODEHASH opcode
4-
author: Nick Johnson <arachnid@notdot.net>, Paweł Bylica <pawel@ethereum.org>
4+
description: Returns the keccak256 hash of a contract's code
5+
author: Nick Johnson (@arachnid), Paweł Bylica (@chfast)
56
discussions-to: https://ethereum-magicians.org/t/extcodehash-opcode/262
67
status: Final
78
type: Standards Track
@@ -19,8 +20,8 @@ code.
1920

2021
Many contracts need to perform checks on a contract's bytecode, but do not
2122
necessarily need the bytecode itself. For instance, a contract may want to check
22-
if another contract's bytecode is one of a set of permitted implementations, or
23-
it may perform analyses on code and whitelist any contract with matching
23+
if another contract's bytecode is one of a set of permitted implementations,
24+
or it may perform analyses on code and whitelist any contract with matching
2425
bytecode if the analysis passes.
2526

2627
Contracts can presently do this using the `EXTCODECOPY` (`0x3c`) opcode, but this
@@ -53,7 +54,7 @@ The gas cost is the same as the gas cost for the `BALANCE` opcode because the
5354
execution of the `EXTCODEHASH` requires the same account lookup as in `BALANCE`.
5455

5556
Only the last 20 bytes of the argument are significant (the first 12 bytes are
56-
ignored), similarly to the semantics of the `BALANCE` (`0x31`), `EXTCODESIZE`
57+
ignored), similarly to the semantics of `BALANCE` (`0x31`), `EXTCODESIZE`
5758
(`0x3b`), and `EXTCODECOPY` (`0x3c`).
5859

5960
The `EXTCODEHASH` distinguishes accounts without code and non-existing accounts.
@@ -64,6 +65,13 @@ also allows smart contracts to check when an account exists.
6465

6566
There are no backwards compatibility concerns.
6667

68+
## Security Considerations
69+
70+
This opcode does not introduce new security risks beyond those already
71+
associated with the usage of code-hashing. However, it allows for more efficient
72+
code checks, so developers should be aware that this may enable cheaper
73+
verification of contracts, potentially influencing design decisions.
74+
6775
## Test Cases
6876

6977
1. The `EXTCODEHASH` of the account without code is
@@ -84,11 +92,6 @@ There are no backwards compatibility concerns.
8492
10. The `EXTCODEHASH` of an empty account that will be cleared by
8593
the state clearing rule.
8694

87-
## Implementation
95+
## Reference Implementation
8896

8997
TBD
90-
91-
## Copyright
92-
93-
Copyright and related rights waived via
94-
[CC0](../LICENSE.md).

0 commit comments

Comments
 (0)