-
Notifications
You must be signed in to change notification settings - Fork 20k
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
CREATE2 can be ran twice creating code at the same address instead of reverting (no storage is changed) #17881
Comments
Nope, the EIP reads:
If a create-operation succeeds, the new address will be returned on the top of the stack. If you get a |
@holiman I think it is quite reasonable to state this in the EIP more explicitly. Right now, EIP-684 says:
And EIP-1014 says: "The behaviour at collisions is specified by EIP-684". And even quotes the line above. So it doesn't feel obvious that after the words "throws immediately", the phase "the create-operation fails" means "zero on top of the stack". |
System information
Geth version:
Version: 1.8.17-stable
OS & Version: OSX
Expected behaviour
CREATE2 reverts tx if a contract is tried to be deployed twice at the same address
Actual behaviour
Does not revert. Uses more gas than in the initial creation. For some reason does not alter the storage even though there is a check to see if the storage is altered. Does return address 0x0 on the second create.
Steps to reproduce the behaviour
Note: you cannot pass "argument" in the constructor because this changes the init_code.
By EIP 1014 create2 at an address which has already code OR a nonce it should revert.
The text was updated successfully, but these errors were encountered: