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
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
)
There isn't a selfdestruct action, but there is a setcode action. A contract can use that to destroy itself like in this example.
-
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 MaMay 12, 2018 at 3:36
-
1Correct. It's hard to judge too heavy right now until the ram market is active. May 12, 2018 at 12:14