7

How can I invalidate a smart contract that has already been deployed? I might want to do so because of business reasons, and maybe beneficial network effects.

Is it possible to invalidate a smart contract?

J-B
  • 8,941
  • 16
  • 46
  • 77
niksmac
  • 9,673
  • 2
  • 40
  • 72

2 Answers2

6

Unless the contract has a function that calls selfdestruct (initial name suicide), the contract will remain on the blockchain.

eth
  • 85,679
  • 53
  • 285
  • 406
  • self-destruct can it be called after doing some api calls to a remote server? I am not sure whether remote api calls in allowed in the smart-contract – niksmac Feb 14 '16 at 05:09
  • 1
    There are no remote API calls in Ethereum. See http://ethereum.stackexchange.com/q/301/131.You have to use a service like http://oraclize.it. You can call selfdestruct at any time, but you need to explicitly code it into the contract. Otherwise the contract will live forever – Tjaden Hess Feb 14 '16 at 05:53
  • 1
    @TjadenHess thats a valid point, edit the answer and add your point. – niksmac Feb 14 '16 at 09:31
1

Yes, there is a SUICIDE call which will render the contract inoperable. Notably, calling a deleted account won't result in an error so you would want to also have the application check the state of the account.

In Solidity the SUICIDE EVM call is performed by the selfdestruct function.

nessence
  • 570
  • 2
  • 7
  • @niksmac The yellow paper doesn't have "selfdestruct" – that is a solidity function. Not sure editing answer makes sense for a comment. – nessence May 16 '16 at 00:38