9

As I know, in ETH, when a contract would be useless, it could be destroyed by using the "selfdestruct" action. So, is there any same method to remove a useless contract from the eos blockchain?

2 Answers 2

3

As of v1.3.0, it is now possible to delete the smart contract from an account using the --clear flag ($ cleos set contract <account> --clear)

1
  • That would be very great
    – Harry Ma
    Sep 20, 2018 at 15:15
1

There isn't a selfdestruct action, but there is a setcode action. A contract can use that to destroy itself like in this example.

2
  • thanks for your help man, but this method is using dead code to cover the contract byte, right ? is it too heavy for a contract developer to do that ?
    – Harry Ma
    May 12, 2018 at 3:36
  • 1
    Correct. It's hard to judge too heavy right now until the ram market is active. May 12, 2018 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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