Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'EXTCODEHASH' opcode #1052

Merged
merged 5 commits into from
May 2, 2018
Merged

'EXTCODEHASH' opcode #1052

merged 5 commits into from
May 2, 2018

Conversation

Arachnid
Copy link
Contributor

@Arachnid Arachnid commented May 2, 2018

This EIP proposes an 'EXTCODEHASH' opcode, which returns the keccak256 hash of a contract's code.

@Arachnid Arachnid merged commit 8f362ab into ethereum:master May 2, 2018
@Arachnid Arachnid deleted the codehash branch May 2, 2018 19:46
@jochem-brouwer
Copy link
Member

@Arachnid

If I call extcodehash on an empty account it pushes bytes32(0) on the stack - which is according to the specification.

However, if I now create an account and then selfdestruct it (in the same transaction) I would suppose that after creation of the account it returns the hash of the code (which it does). But after I selfdestruct it, I would suppose that the hash is now either bytes32(0) since the account is destroyed or it is another hash than the hash which got pushed before I selfdestructed it (since the code is now empty). However, the same hash gets pushed on the stack. What is the reasonable for this? Does the code in an account get emptied after a transaction?

Please see this ropsten account:
https://ropsten.etherscan.io/address/0x1b3ebbd2a941e38db6f274a905581a4664dd9708

(array added for clarity)

I expect the 0-index of the array to be bytes32(0), the 1-index to be the actual hash and the 2-index to be bytes32(0) again.

@fulldecent
Copy link
Contributor

There is a bug in 1052 and it should not be included in Constantinople in its current form.

I submitted it for the Ethereum Bug Bounty. And I didn't read the details of whether I am allowed to fully disclose details while it is being considered for bug bounty, so I won't say anything else here yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants