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?
Unless the contract has a function that calls selfdestruct
(initial name suicide
), the contract will remain on the blockchain.
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
selfdestruct
at any time, but you need to explicitly code it into the contract. Otherwise the contract will live forever
Commented
Feb 14, 2016 at 5:53
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.