0

Given that it seems possible, using somehow CREATE2, to deploy a new smart contract at a certain address where a different smart contract existed before to be killed...

(see @smarx answer here Can you selfdestruct a contract more than once?)

is it the case? How can I do it in practice?

2 Answers 2

2

The CREATE2 is a new opcode introduced in the Constantinople update earlier this year. It's otherwise similar to the traditional CREATE opcode which creates a new smart contract but with CREATE2 you can more freely influence the resulting contract address - for example to create a contract to the same address where another contract existed earlier (but which was selfdestructed).

Given the complexity of the topic I'm not going to explain here how it works (and because I haven't tried it and don't really understand all how it works).

This feature is still very new and there is not much information (and even less written experiences) about it yet. Here's one decent article: https://blog.ricmoo.com/wisps-the-magical-world-of-create2-5c2177027604 . Here are some more links: https://www.reddit.com/r/ethereum/comments/cqlnwd/eli5_create2/

2

Here is an example.

Contract 0x00000000002bde777710c370e08fc83d61b2b8e1 is killed in tx : https://etherscan.io/tx/0x026a971c7cf5476c93be05742abe56fe640331eb9bb36c53926ff95cb0529b62, and new contract at same address is created in tx: https://etherscan.io/tx/0x272dd4eb0b2073d3e5ecee1c62155790760ec818e6f37c86df02e60d75d7be2f#internal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.