4

As we know, smart contracts are used for agreements between non-trusting parties. So let's take an example of an insurance provider creating a smart contract for a customer with the smart contract containing the all the terms of insurance. He then shares the address and json interface with the customer so that the customer can verify the contract on the blockchain, call the function "SignTheTerm(customer_address)" and the function transfers the premium to the insurance_provider_address. But in this case, since the insurance provider has created the smart contract, doesn't he have the control to go and delete it? Contract is gone and the customer loses money.

Any ideas on how this can be prevented and where I am going wrong in the use case?

5

You can't really "delete" a contract from the public blockchain. You can use selfdestruct to "delete" it, but the call needs to be in the contract before deploying it.

You can actually verify that a contract that is deployed on the chain does what it should. Etherscan has list of verified contracts. I picked one contract randomly, you can see in the "Contract Source" tab, that the EVM bytecode deployed on the chain is the same as the compiled source code.

  • Thanks Jacob. So in the use case that I outlined, the customer will need to consult a techie to confirm the insurance provider has not added any contract-delete mechanism, right? – Ashish Sinha Jun 30 '17 at 14:02
  • 1
    As smart contracts are code, you even need to consult someone to check if the smart contract actually does what it is supposed to do. – Jacob Jun 30 '17 at 14:21
  • @AshishSinha It's just like any contract -- you have to make sure the contract that you agree to assures that you get what you want or you shouldn't agree to that contract. – David Schwartz Jun 30 '17 at 17:28
  • @Jacob just wanted to add a clarification here and also for @Ashish; I would like to add that a selfDestruct is not necessary to be in the contract. One can also use other methods as mentioned in the doc – Rajat Jul 3 '17 at 13:15
0

Contract can be killed or stopped by the owner, but only in the case it has been written with that purpose. So by exploring the source code you may check if that is the case. Otherwise, there is no way to stop it or remove it.

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.