Unprotected selfdestruct detector#
Name: unprotected-selfdestruct
Reports selfdestruct calls that are not protected by an onlyOwner
modifier or similar logic.
More precisely, access controls based on msg.sender
are checked in the detector.
Addresses set in a constructor or in functions protected by onlyOwner
(or similar) are considered trusted.
Example#
- The selfdestruct call is protected by a
require
statement and so is not reported. - The selfdestruct call is not protected by any access control condition using
msg.sender
andowner
and so is reported.
Parameters#
The detector does not accept any additional parameters.