1

equivalent solidity code :

suicide(this);

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 ?

Rob Hitchens
  • 55,151
  • 11
  • 89
  • 145
user2284570
  • 1,008
  • 1
  • 12
  • 30

1 Answers1

1

EDIT

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

user19510
  • 27,999
  • 2
  • 30
  • 48
  • 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 05 '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 05 '19 at 15:45
  • Perhaps there's some strange happening with CREATE2 but in this article's notes (near the end) https://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 07 '19 at 17:41
  • Interesting! I stand corrected. Editing my answer. – user19510 Oct 07 '19 at 18:56