3

For example say a contract with a compiler version of 0.7.5 (pragma solidity 0.7.5) contained selfdestruct(payable(address)) what happens to the contract when the self destruct opcode gets deprecated in the future? Will the contract still work the same or differently?

1 Answer 1

2

A contract that uses an opcode that is subsequently removed would no longer be working (its behavior would be unspecifiable). However, to my knowledge, no opcode has ever been removed from Ethereum.

SELFDESTRUCT will still exist as an opcode (value 0xFF) even after the Cancun hard fork - it's just that its behavior will be different. See EIP-6780.

After Cacncun, SELFDESTRUCT will only transfer ETH to the specified address if the contract is not created in the same transaction, and it will work as before in the reverse case (contract created in the same transaction).

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.