-
Notifications
You must be signed in to change notification settings - Fork 130
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
EVM: EXTCODEHASH and SELFDESTRUCT #1730
Comments
Well, sort of. The EVM returns 0 until funds are first sent to the address, after which it returns EMPTY. We could introduce an "if dead and balance is 0" check, but any code relying on that fact is likely broken anyways. Well, I guess it could be doing this as a short-cut to avoid calling the BALANCE instruction? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a contract self-destructs, it marks itself as dead. If a subsequent transaction calls EXTCODEHASH, we return whatever the EVM actor returned from
GetBytecodeHash
. For dead contracts, this is theEMPTY
hash. I believe we modelled this after EIP-1052.However, we have reports from the community saying that this behaviour diverges from Ethereum, who returns 0 when calling EXTCODEHASH on a self-destructed contract on a subsequent transaction.
Apprently this is the result of both https://eips.ethereum.org/EIPS/eip-161 and https://eips.ethereum.org/EIPS/eip-1052.
The text was updated successfully, but these errors were encountered: