-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Prevent overwriting contracts #684
Comments
Resolves #83. |
|
Nevermind, this wording actually answers my question |
There was an issue with contract creation that would overwrite contracts. The solution is to check for a positive nonce or nonempty code hash in an account. If that's the case, the contract creation needs to fail instead of overwriting the account. For more information see ethereum/EIPs#684
There was an issue with contract creation that could overwrite contracts. The solution is to check for a positive nonce or nonempty code hash in the account that is about to be created. If that's the case, the contract creation needs to fail instead of overwriting the account. For more information see ethereum/EIPs#684
There was an issue with contract creation that could overwrite contracts. The solution is to check for a positive nonce or nonempty code hash in the account that is about to be created. If that's the case, the contract creation needs to fail instead of overwriting the account. For more information see ethereum/EIPs#684
Does this proposal means that if a |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
Specification
If a contract creation is attempted, due to either a creation transaction or the CREATE (or future CREATE2) opcode, and the destination address already has either nonzero nonce, or nonempty code, then the creation throws immediately, with exactly the same behavior as would arise if the first byte in the init code were an invalid opcode. This applies retroactively starting from genesis.
Rationale
This is the most correct approach for handling the case where a contract is created in a slot where a contract already exists, as the current behavior of overwriting contract code is highly unintuitive and dangerous.
Currently this is not an issue because there is no way to create a contract with the same address twice without spending >2^80 computational effort to find an address collision, but with #86 this will change. Hence it is important to have correct behavior for this situation in the long term. This can be safely applied retroactively for simplicity, because currently creating a contract with the same address twice is computationally infeasible.
The text was updated successfully, but these errors were encountered: