User Tools

Site Tools


Sidebar

Welcome to DIDO WIKI

dido:public:ra:xapend:xapend.b_stds:defact:ethereum:eip:1052

EIP 1052: EXTCODEHASH opcode

Return to Ethereum ERCs

: Note: The following is an excerpt from the official Ethereum site. It is provided here as a convenience and is not authoritative. Refer to the original document as the authoritative reference.

Table 1: Data sheet for EXTCODEHASH opcode
Title EXTCODEHASH opcode
EIP 1052
Author
Status Final
Created 1018-05-02
Description https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1052.md
Specification https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1052.md#Specification
Category Core

Abstract

This EIP specifies a new opcode, which returns the keccak256 hash of a contract's code.

Motivation

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

Contracts can presently do this using the EXTCODECOPY (0x3c) opcode, but this is expensive, especially for large contracts, in cases where only the hash is required. As a result, we propose a new opcode, EXTCODEHASH, which returns the keccak256 hash of a contract's bytecode.

dido/public/ra/xapend/xapend.b_stds/defact/ethereum/eip/1052.txt · Last modified: 2022/05/21 15:15 by nick
Translations of this page: