selfdestruct Explained in Detail
selfdestruct is an EVM instruction that sends a contract's Ether balance to a target address. After EIP-6780, code and storage removal is limited in most cases, but forced Ether transfer remains important for audits.
Contracts cannot prevent Ether from arriving through selfdestruct.
selfdestruct is deprecated, so new usage should be treated as a design red flag unless there is a strong reason.
Smart contract example
A contract can force Ether into a target:
contract ForceSend {
constructor() payable {}
function boom(address payable target) external {
selfdestruct(target);
}
}
The target receives Ether even if it has no receive() function.
selfdestruct in Auditing
Forced Ether can break accounting that assumes address(this).balance only changes through deposits. It also matters when reviewing receive functions, vault solvency checks, upgrade flows, and emergency shutdown logic. See the full SELFDESTRUCT attack patterns for forced-balance and authorization failures.
Red flags in code
-
Contract logic depends directly on
address(this).balance. -
Exact-balance checks such as
balance == totalDeposits. -
Privileged
selfdestructor shutdown function with weak access control. -
Assumptions that a contract cannot receive Ether without calling
deposit(). -
Old documentation or comments that rely on pre-EIP-6780 destruction behavior.
How to test or review it
-
Force-send Ether to the contract and check accounting invariants.
-
Review shutdown and rescue functions for authorization and ordering.
-
Avoid using raw contract balance as the only source of accounting truth.
-
Check whether external calls depend on exact Ether balances.
-
Confirm the codebase's threat model matches current EVM semantics.
Keep learning this topic
External Call
An external call is an interaction where one smart contract calls another address, creating a trust boundary and possible control-flow risk.
Receive Function
A receive function is a Solidity function that runs when a contract receives plain Ether with empty calldata.
Access Control Vulnerability
An access control vulnerability lets an unauthorized caller perform privileged actions such as moving funds, changing roles, upgrading contracts, or changing protocol settings.
Self Destruct Attacks
See how this vulnerability appears in real smart contract audits.
Dos Attacks
See how this vulnerability appears in real smart contract audits.
Smart Contract Audit Checklist
Use this SCH tool to turn the concept into practical audit work.
Practice this in real audit scenarios
Definitions help, but auditors need reps. SCH turns concepts like SELFDESTRUCT (Solidity/EVM) into exploit labs, code review habits, and report-writing practice.
Start the free trial or see the full smart contract auditing course.