Octane generally recommends against the use of selfdestruct() instruction or its now-deprecated alias suicide() as it can potentially allow malicious code to destroy a contract and steal any Ether held by the contract.Users interacting with the smart contract will find that transfer calls to the destroyed contract don’t revert, instead their tokens suddenly disappear as ether sent to the destroyed contract is lost forever.Octane will detect such unsafe use of self-destruct. This detection can be overridden if the call is carefully protected and can only be called by authorized users.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Octane Security","colors":{"primary":"#F0F0F0","light":"#4A76E9","dark":"#2D2B2A"},"favicon":"/favicon.png","logo":{"light":"https://mintcdn.com/octane/uHERqlzSYcucHEqv/logo/light.png?fit=max\u0026auto=format\u0026n=uHERqlzSYcucHEqv\u0026q=85\u0026s=dd0b3353c63343b1d38223e0a8b4917b","dark":"https://mintcdn.com/octane/uHERqlzSYcucHEqv/logo/dark.png?fit=max\u0026auto=format\u0026n=uHERqlzSYcucHEqv\u0026q=85\u0026s=db13a21df85eabaefb82df1b1d97aed5"},"navbar":{"primary":{"type":"button","label":"Schedule a demo","href":"https://octane.security/schedule-demo"}},"footer":{"socials":{"twitter":"https://twitter.com/octane_security"}},"navigation":{"global":{"anchors":[{"anchor":"Website","href":"https://octane.security","icon":"globe"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"octane","hasAudioNarration":false,"actualSubdomain":"octane","customDomains":["docs.octane.security"],"gitSource":{"type":"github","owner":"octane-security","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae91e058a031681d559c20a:success","clientVersion":"0.0.4160","searchFilterCounts":[{"language":"default","tag":"Vulnerability Detectors","count":41},{"language":"default","tag":"Standard","count":19},{"language":"default","tag":"Experimental","count":13},{"language":"default","tag":"Advanced","count":9},{"language":"default","tag":"Documentation","count":5},{"language":"default","tag":"Essentials","count":3},{"language":"default","tag":"Get Started","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"detectors/standard/self-destruct","slug":"/detectors/standard/self-destruct","pageMetadata":{"title":null,"description":null,"href":"/detectors/standard/self-destruct"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={p:`p`,..._provideComponents(),...props.components},{Heading}=_components;if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Unsafe Use of Self-Destruct`}),`\n`,_jsx(Heading,{level:`3`,id:``}),`\n`,_jsx(_components.p,{children:`Octane generally recommends against the use of selfdestruct() instruction or its now-deprecated alias suicide() as it can potentially allow malicious code to destroy a contract and steal any Ether held by the contract.`}),`\n`,_jsx(_components.p,{children:`Users interacting with the smart contract will find that transfer calls to the destroyed contract don’t revert, instead their tokens suddenly disappear as ether sent to the destroyed contract is lost forever.`}),`\n`,_jsx(_components.p,{children:`Octane will detect such unsafe use of self-destruct. This detection can be overridden if the call is carefully protected and can only be called by authorized users.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":null,"description":null,"href":"/detectors/standard/self-destruct"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"subdomain":"octane","siteName":"Octane Security","title":"Self destruct - Octane Security","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T00:41:33.706Z","originalFileLocation":"detectors/standard/self-destruct.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Octane Security\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Self destruct - Octane Security\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Octane Security\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.octane.security/detectors/standard/self-destruct\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://octane.mintlify.site/_mintlify/api/og/v2?division=Standard\u0026amp;title=Self+destruct\u0026amp;theme=45756722c71d5a8235fc0dc0\u0026amp;signature=f904963474a95ab4ebfb37a68670a3c35a0ac8b33ddec4ed369231eb5c0d3d20\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Self destruct - Octane Security\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://octane.mintlify.site/_mintlify/api/og/v2?division=Standard\u0026amp;title=Self+destruct\u0026amp;theme=45756722c71d5a8235fc0dc0\u0026amp;signature=f904963474a95ab4ebfb37a68670a3c35a0ac8b33ddec4ed369231eb5c0d3d20\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/octane/g-S2DBjC_IW703Pm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Octane Security\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#F0F0F0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.octane.security/detectors/standard/self-destruct\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/detectors/standard/self-destruct.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.octane.security/#organization\",\"name\":\"Octane Security\",\"url\":\"https://docs.octane.security\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/octane/uHERqlzSYcucHEqv/logo/light.png?fit=max\u0026auto=format\u0026n=uHERqlzSYcucHEqv\u0026q=85\u0026s=dd0b3353c63343b1d38223e0a8b4917b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.octane.security#website\",\"name\":\"Octane Security\",\"url\":\"https://docs.octane.security\",\"publisher\":{\"@id\":\"https://docs.octane.security/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.octane.security/detectors/standard/self-destruct#webpage\",\"url\":\"https://docs.octane.security/detectors/standard/self-destruct\",\"name\":\"Self destruct\",\"dateModified\":\"2026-01-07T00:41:33.706Z\",\"isPartOf\":{\"@id\":\"https://docs.octane.security#website\"},\"breadcrumb\":{\"@id\":\"https://docs.octane.security/detectors/standard/self-destruct#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.octane.security/detectors/standard/self-destruct#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Standard\",\"item\":\"https://docs.octane.security/detectors/standard/reentrancy\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Self destruct\",\"item\":\"https://docs.octane.security/detectors/standard/self-destruct\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.octane.security/detectors/standard/self-destruct#article\",\"headline\":\"Self destruct\",\"name\":\"Self destruct\",\"url\":\"https://docs.octane.security/detectors/standard/self-destruct\",\"mainEntityOfPage\":{\"@id\":\"https://docs.octane.security/detectors/standard/self-destruct#webpage\"},\"dateModified\":\"2026-01-07T00:41:33.706Z\",\"publisher\":{\"@id\":\"https://docs.octane.security/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.octane.security#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Octane Security\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Octane Security\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/detectors/standard/self-destruct.md","siteName":"Octane Security","nav":{"global":{"anchors":[{"anchor":"Website","href":"https://octane.security","icon":"globe"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"What is Octane?","icon":"globe","href":"/introduction"},{"title":"Quickstart","icon":"rocket","href":"/quickstart"}]},{"group":"Essentials","pages":[{"title":"When to use Octane","icon":"lightbulb","href":"/essentials/when-to-use"},{"title":"What Octane Detects","icon":"radar","href":"/essentials/what-octane-detects"},{"title":"Code Fix Engine","icon":"wrench","href":"/essentials/code-fix"}]}]},{"tab":"Vulnerability Detectors","groups":[{"group":"Advanced","pages":[{"title":"Rounding Errors","href":"/detectors/advanced/rounding"},{"title":"Denial of Service","href":"/detectors/advanced/dos"},{"title":"Attacker Balance Gain","href":"/detectors/advanced/balance-gain"},{"title":"Ether/Token Leaking","href":"/detectors/advanced/ether-token-leaking"},{"title":"Incorrect Calculation of Token Transfer","href":"/detectors/advanced/incorrect-token-calc"},{"title":"Bad Randomness","href":"/detectors/advanced/bad-randomness"},{"title":"Token Loss","href":"/detectors/advanced/token-loss"},{"title":"Typographical Errors","href":"/detectors/advanced/typographic"},{"title":"Unprotected External Calls","href":"/detectors/advanced/unprotected-ext-calls"}]},{"group":"Experimental","pages":[{"title":"Gas Limit Manipulation Possible (by 1/64 Rule)","href":"/detectors/experimental/gas-limit-manipulation-1-64-rule"},{"title":"Missing/Improper Check on the Admin Address","href":"/detectors/experimental/missing-or-improper-admin-address-check"},{"title":"Validation Check Does Not Fall Through","href":"/detectors/experimental/validation-check-does-not-fall-through"},{"title":"Incorrect Nonce Update (Signature Replay Attack)","href":"/detectors/experimental/incorrect-nonce-sig-replay-attack"},{"title":"Missing/Improper Check on Oracle Data","href":"/detectors/experimental/oracle-data-check"},{"title":"Token Oversupply by Repayment Without Burn","href":"/detectors/experimental/oversupply-by-repayment-without-burn"},{"title":"Erroneous Writing to Memory Instead of Storage","href":"/detectors/experimental/writing-to-memory-but-not-storage"},{"title":"Incorrectly Payable","href":"/detectors/experimental/incorrectly-payable"},{"title":"Improper Use of Oracle Heartbeats","href":"/detectors/experimental/oracle-heartbeat"},{"title":"Slippage Parameter Missing or Ineffective","href":"/detectors/experimental/slippage-param-missing-or-ineffective"},{"title":"Invalid State Manipulation","href":"/detectors/experimental/invalid-state-manipulation"},{"title":"Improper/Missing L2 Sequencer Check","href":"/detectors/experimental/oracle-l2-sequencer"},{"title":"Stale Price Risk","href":"/detectors/experimental/stale-price-risk"}]},{"group":"Standard","pages":[{"title":"Reentrancy","href":"/detectors/standard/reentrancy"},{"title":"Block Attributes Misuse","href":"/detectors/standard/block-attrs"},{"title":"Conflicting Inheritance","href":"/detectors/standard/conflicting-inheritance"},{"title":"Misuse of Create2 Opcode","href":"/detectors/standard/create2"},{"title":"Explicit Balance Checks","href":"/detectors/standard/explicit-bal-checks"},{"title":"Attacker-Controlled DelegateCall","href":"/detectors/standard/fuzz-delegatecall"},{"title":"Property Violation","href":"/detectors/standard/fuzz-property-violation"},{"title":"Attacker-Invokable Self-Destruct","href":"/detectors/standard/fuzz-selfdestruct"},{"title":"Hashing Consecutive Variable-Length Arguments","href":"/detectors/standard/hash-consecutive"},{"title":"Incorrect Function Visibility","href":"/detectors/standard/incorrect-fn-vis"},{"title":"Keccak Unequal Memory Lengths","href":"/detectors/standard/keccak"},{"title":"Use of Assembly","href":"/detectors/standard/assembly"},{"title":"Integer Overflow/Underflow","description":null,"href":"/detectors/standard/overflow-underflow"},{"title":null,"href":"/detectors/standard/self-destruct"},{"title":"Unsafe Use of Tx Origin","description":null,"href":"/detectors/standard/tx-origin"},{"title":"Unchecked Return Values","href":"/detectors/standard/unchecked-return"},{"title":"Unsafe Unicode Characters","href":"/detectors/standard/unicode"},{"title":"Uninitialized Storage Vulnerabilities","href":"/detectors/standard/uninit-storage"},{"title":"Unsafe DelegateCall","href":"/detectors/standard/unsafe-delegatecall"}]}]}]},"basePath":"","title":"Self destruct - Octane Security","buildId":"dpl_GRSyrvXT6FFTpZZTGz5iZPp3D2zE","deploymentId":"dpl_GRSyrvXT6FFTpZZTGz5iZPp3D2zE","dynamics":[],"chunks":[]}