0

In Ethereum you can implement a selfdestruct opcode in a smart contract to remove its code from the blockchain and free up storage space.

Is there an equivalent on Tezos ?

2

No, Tezos doesn't have such an instruction currently.

You can find the available instructions here.

2

No, there is no such opcode. You can however add functionality to you contract that puts it in a final state, sends any funds in it to a designated heir contract, and then rejects all incoming transactions.

1

The main benefit of such an instruction would be an automatic transfer of existing resources and tokens to a heir contract. However, the current Tezos token contracts do not seem to support "inheritance".

It also would allow to save space for the contract storage, but this is secondary issue as compared to the safety of resources.

Without such a special support of inheritance by token contracts, any blocked contract would also start burning all funds sent to it. This is also a problem with Ethereum's selfdestruct

If you want your contract to enter final state, where it no longer accepts any interaction, please still accept requests to withdraw funds if it keeps any.

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.