Explain why code remains after an Ethereum SELFDESTRUCT

A trace can show SELFDESTRUCT and a balance transfer while the contract code remains readable. The relevant fork rules and the account’s creation transaction determine the outcome.

Look up the creation boundary

Consider a contract deployed in transaction A. During a later transaction B under EIP-6780 rules, its code executes SELFDESTRUCT with a distinct beneficiary. Read its code after B and inspect the balance movement in the trace.

transaction A: CREATE
transaction B: SELFDESTRUCT → beneficiary

This case transfers the remaining balance and halts the executing frame while preserving account code and storage. A monitoring rule that marks every observed SELFDESTRUCT as account deletion would report a false removal.

Handle the same-transaction exception

If creation and SELFDESTRUCT occur in the same transaction, deletion behavior is retained. Creation and destruction in different transactions within one block do not satisfy that exception. Check the network’s active fork rules when analyzing old blocks or other EVM chains. eips.ethereum.org EIP-6780