equivalent solidity code :


Does the operation succeeds at not transferring the balances while still erasing the code ?
Or is contract’s code destroyed only after sending balances which means a recursion infinite loop can occur if the contract’s does no stop if called through this way ?



My original answer was wrong. Ether selfdestructed to a contract that's scheduled for deletion is actually completely destroyed.

| improve this answer | |
  • Sending funds to a contract is calling it’s code so the still existing code of the contract being destroyed as nonce isn’t unset until the top end of the transaction, are you sure this works? – user2284570 Oct 5 '19 at 15:44
  • It's trivial to try, so I encourage you to do it. :-) But selfdestruct doesn't really "send funds to a contract". It never invokes that contract's code. – user19510 Oct 5 '19 at 15:45
  • Perhaps there's some strange happening with CREATE2 but in this article's notes (near the end) blog.ricmoo.com/wisps-the-magical-world-of-create2-5c2177027604, they mention that if you send ether to a contract scheduled for deletion it will simply vanish. – Ismael Oct 7 '19 at 17:41
  • Interesting! I stand corrected. Editing my answer. – user19510 Oct 7 '19 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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