{"eip":4760,"title":"SELFDESTRUCT bomb","description":"Deactivate SELFDESTRUCT by changing it to SENDALL and stage this via a stage of exponential gas cost increases.","authors":["Guillaume Ballet (@gballet)","Vitalik Buterin (@vbuterin)","Dankrad Feist (@dankrad)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2022-02-03","discussionsTo":"https://ethereum-magicians.org/t/eip-4760-selfdestruct-bomb/8713","repo":"EIPs","label":"EIP-4760","officialUrl":"https://eips.ethereum.org/EIPS/eip-4760","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4760.md","url":"https://eips.huatuo.xyz/eip-4760/","tldr":{"en":"A proposal to neutralise SELFDESTRUCT by doubling its gas cost every ~9 days as a warning, then turning it into SENDALL, which only moves ETH; it was not adopted.","ja":"警告として約 9 日ごとに SELFDESTRUCT のガスコストを倍にし、その後 ETH の移動のみを行う SENDALL に置き換えることで SELFDESTRUCT を無力化する提案。採用はされなかった。","ko":"경고 차원에서 약 9일마다 SELFDESTRUCT의 가스 비용을 두 배로 올린 뒤, ETH만 옮기는 SENDALL로 바꿔 SELFDESTRUCT를 무력화하자는 제안. 채택되지 않았다.","zh":"一项通过每约 9 天将 SELFDESTRUCT 的 gas 成本翻倍作为警告、之后将其变为仅转移 ETH 的 SENDALL，从而使 SELFDESTRUCT 失效的提案；该提案未被采纳。"},"tags":["evm","opcode","selfdestruct","core","verkle"],"explainers":{"en":{"lang":"en","tldr":"A proposal to neutralise SELFDESTRUCT by doubling its gas cost every ~9 days as a warning, then turning it into SENDALL, which only moves ETH; it was not adopted.","tags":["evm","opcode","selfdestruct","core","verkle"],"related":[6780,6049,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-4760/","markdown":"## What problem does it solve?\n\n`SELFDESTRUCT` deletes a contract's code and all of its storage and sends its ETH to a target. Wiping an unbounded amount of state in one opcode is awkward for clients today, and much harder in the planned Verkle tree layout, where an account's data is spread across many keys that are not obviously linked to the account root.\n\nSimply disabling the opcode could surprise developers who do not follow the EIP process. EIP-4760 tries to give them a loud, on-chain warning first: make `SELFDESTRUCT` steadily more expensive, so anyone whose contract relies on it notices before the behaviour changes.\n\n## How it works\n\nConstants from the spec:\n\n| Name | Value | Meaning |\n| --- | --- | --- |\n| `OLD_SELFDESTRUCT_COST` | 5000 | gas cost at the time |\n| `HARD_FORK_BLOCK` | TBD | activation point |\n| `DOUBLING_SLOTS` | `2**16` | about 9 days per doubling |\n| `DOUBLINGS_BEFORE_SENDALL` | 13 | about 4 months in total |\n\nTwo phases:\n\n1. **Bomb phase.** `SELFDESTRUCT` still works as before, but its gas cost is `5000 * 2 ** ((slot - HARD_FORK_BLOCK) // DOUBLING_SLOTS)`, doubling every period.\n2. **SENDALL phase.** After 13 doublings the cost returns to 5000 and the opcode is renamed `SENDALL`. It only moves all ETH in the account to the target. Code, storage and nonce are left untouched, and all `SELFDESTRUCT` refunds are removed.\n\nContracts that use `SELFDESTRUCT` only to sweep out ETH keep working. What breaks is the \"metamorphic contract\" pattern: destroy, then redeploy different code at the same address with `CREATE2`.\n\n## Sample code\n\nGas schedule during the bomb phase (pseudocode):\n\n```python\nOLD_SELFDESTRUCT_COST = 5000\nDOUBLING_SLOTS = 2**16\nDOUBLINGS_BEFORE_SENDALL = 13\n\ndef selfdestruct_gas(slot, fork_slot):\n    elapsed = slot - fork_slot\n    if elapsed \u003e= DOUBLING_SLOTS * DOUBLINGS_BEFORE_SENDALL:\n        return OLD_SELFDESTRUCT_COST          # now behaves as SENDALL\n    return OLD_SELFDESTRUCT_COST * 2 ** (elapsed // DOUBLING_SLOTS)\n\n# last bomb period: 5000 * 2**12 = 20,480,000 gas\n```\n\nWriting code that does not depend on destruction (works before and after any such change):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n// Instead of selfdestruct(payable(owner)) to \"close\" a contract:\ncontract Closable {\n    address public immutable owner = msg.sender;\n    bool public closed;\n\n    function close() external {\n        require(msg.sender == owner, \"not owner\");\n        closed = true;\n        (bool ok, ) = payable(owner).call{value: address(this).balance}(\"\");\n        require(ok, \"transfer failed\");\n    }\n}\n```\n\n## Things to know\n\n- Status is **Stagnant**; this EIP was never activated.\n- Ethereum took a different route. [EIP-6049](/eip-6049/) formally deprecated `SELFDESTRUCT`, and [EIP-6780](/eip-6780/) (Dencun, 2024) limited it so code and storage are only deleted when the contract is created and destroyed in the same transaction; otherwise it just sends ETH, similar to the `SENDALL` idea here.\n- [EIP-4758](/eip-4758/) is a sibling proposal that would have switched to `SENDALL` immediately, without the gas bomb.\n- The spec mixes \"block\" and \"slot\" when defining the activation point; it was never finalised.\n- Do not design new contracts around `SELFDESTRUCT` for upgrades; use proxy patterns instead.\n"},"ja":{"lang":"ja","tldr":"警告として約 9 日ごとに SELFDESTRUCT のガスコストを倍にし、その後 ETH の移動のみを行う SENDALL に置き換えることで SELFDESTRUCT を無力化する提案。採用はされなかった。","tags":["evm","opcode","selfdestruct","core","verkle"],"related":[6780,6049,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-4760/","markdown":"## 何を解決するのか\n\n`SELFDESTRUCT` はコントラクトのコードとすべてのストレージを削除し、その ETH をターゲットに送ります。1 つの opcode で際限のない量のステートを消去することは、現在のクライアントにとっても扱いにくく、計画されている Verkle ツリー構成ではさらに困難です。そこではアカウントのデータが、アカウントのルートと明確には結び付かない多数のキーに分散されるためです。\n\n単に opcode を無効化すると、EIP のプロセスを追っていない開発者を驚かせるおそれがあります。EIP-4760 は、まず目立つオンチェーンの警告を出すことを試みます。`SELFDESTRUCT` を着実に高価にしていくことで、コントラクトがそれに依存している人が、挙動が変わる前に気づけるようにします。\n\n## 仕組み\n\n仕様の定数:\n\n| 名前 | 値 | 意味 |\n| --- | --- | --- |\n| `OLD_SELFDESTRUCT_COST` | 5000 | 当時のガスコスト |\n| `HARD_FORK_BLOCK` | TBD | 有効化のタイミング |\n| `DOUBLING_SLOTS` | `2**16` | 倍になる周期は約 9 日 |\n| `DOUBLINGS_BEFORE_SENDALL` | 13 | 合計で約 4 か月 |\n\n2 つのフェーズがあります。\n\n1. **爆弾フェーズ。** `SELFDESTRUCT` はこれまでどおり動作しますが、ガスコストは `5000 * 2 ** ((slot - HARD_FORK_BLOCK) // DOUBLING_SLOTS)` となり、期間ごとに倍になります。\n2. **SENDALL フェーズ。** 13 回倍になった後、コストは 5000 に戻り、opcode は `SENDALL` に改名されます。これはアカウント内のすべての ETH をターゲットに移すだけです。コード、ストレージ、nonce には手を付けず、`SELFDESTRUCT` のリファンドはすべて廃止されます。\n\nETH を引き出すためだけに `SELFDESTRUCT` を使うコントラクトは、引き続き動作します。壊れるのは「メタモーフィックコントラクト」パターンです。つまり、破棄したうえで `CREATE2` により同じアドレスに別のコードを再デプロイする手法です。\n\n## サンプルコード\n\n爆弾フェーズ中のガススケジュール（擬似コード）:\n\n```python\nOLD_SELFDESTRUCT_COST = 5000\nDOUBLING_SLOTS = 2**16\nDOUBLINGS_BEFORE_SENDALL = 13\n\ndef selfdestruct_gas(slot, fork_slot):\n    elapsed = slot - fork_slot\n    if elapsed \u003e= DOUBLING_SLOTS * DOUBLINGS_BEFORE_SENDALL:\n        return OLD_SELFDESTRUCT_COST          # now behaves as SENDALL\n    return OLD_SELFDESTRUCT_COST * 2 ** (elapsed // DOUBLING_SLOTS)\n\n# last bomb period: 5000 * 2**12 = 20,480,000 gas\n```\n\n破棄に依存しないコードの書き方（このような変更の前後どちらでも動作します）:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n// Instead of selfdestruct(payable(owner)) to \"close\" a contract:\ncontract Closable {\n    address public immutable owner = msg.sender;\n    bool public closed;\n\n    function close() external {\n        require(msg.sender == owner, \"not owner\");\n        closed = true;\n        (bool ok, ) = payable(owner).call{value: address(this).balance}(\"\");\n        require(ok, \"transfer failed\");\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、この EIP が有効化されることはありませんでした。\n- Ethereum は別の道を選びました。[EIP-6049](/eip-6049/) は `SELFDESTRUCT` を正式に非推奨とし、[EIP-6780](/eip-6780/)（Dencun、2024 年）は、コントラクトが作成されたのと同じトランザクション内で破棄された場合にのみコードとストレージを削除するよう制限しました。それ以外では ETH を送るだけで、ここでの `SENDALL` の考え方に似ています。\n- [EIP-4758](/eip-4758/) は兄弟にあたる提案で、ガス爆弾なしですぐに `SENDALL` へ切り替えるものでした。\n- 仕様は有効化のタイミングを定義する際に「block」と「slot」を混在させており、確定することはありませんでした。\n- アップグレードのために `SELFDESTRUCT` を前提に新しいコントラクトを設計しないでください。代わりにプロキシパターンを使ってください。\n"},"ko":{"lang":"ko","tldr":"경고 차원에서 약 9일마다 SELFDESTRUCT의 가스 비용을 두 배로 올린 뒤, ETH만 옮기는 SENDALL로 바꿔 SELFDESTRUCT를 무력화하자는 제안. 채택되지 않았다.","tags":["evm","opcode","selfdestruct","core","verkle"],"related":[6780,6049,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-4760/","markdown":"## 어떤 문제를 해결하나요?\n\n`SELFDESTRUCT`는 컨트랙트의 코드와 모든 스토리지를 삭제하고 그 ETH를 대상에게 보냅니다. 하나의 opcode로 무제한의 상태를 지우는 것은 지금의 클라이언트에도 부담스럽고, 계획된 Verkle 트리 구조에서는 훨씬 어렵습니다. 거기서는 계정의 데이터가 계정 루트와 뚜렷하게 연결되지 않는 많은 키에 흩어져 저장되기 때문입니다.\n\nopcode를 그냥 비활성화하면 EIP 절차를 따라가지 않는 개발자들이 놀랄 수 있습니다. EIP-4760은 먼저 눈에 띄는 온체인 경고를 주려 합니다. `SELFDESTRUCT`를 꾸준히 더 비싸게 만들어서, 컨트랙트가 이에 의존하는 사람이 동작이 바뀌기 전에 알아차리게 하는 것입니다.\n\n## 어떻게 동작하나요?\n\n스펙의 상수:\n\n| 이름 | 값 | 의미 |\n| --- | --- | --- |\n| `OLD_SELFDESTRUCT_COST` | 5000 | 당시의 가스 비용 |\n| `HARD_FORK_BLOCK` | TBD | 활성화 시점 |\n| `DOUBLING_SLOTS` | `2**16` | 두 배가 되는 주기는 약 9일 |\n| `DOUBLINGS_BEFORE_SENDALL` | 13 | 합계 약 4개월 |\n\n두 단계가 있습니다.\n\n1. **폭탄 단계.** `SELFDESTRUCT`는 이전처럼 동작하지만 가스 비용이 `5000 * 2 ** ((slot - HARD_FORK_BLOCK) // DOUBLING_SLOTS)`이 되어 기간마다 두 배가 됩니다.\n2. **SENDALL 단계.** 13번 두 배가 된 뒤 비용은 5000으로 돌아가고 opcode 이름이 `SENDALL`로 바뀝니다. 계정의 모든 ETH를 대상에게 옮기기만 합니다. 코드, 스토리지, nonce는 그대로 두며 모든 `SELFDESTRUCT` 환급은 제거됩니다.\n\n`SELFDESTRUCT`를 ETH를 빼내는 용도로만 쓰는 컨트랙트는 계속 동작합니다. 깨지는 것은 \"메타모픽 컨트랙트\" 패턴, 즉 파괴한 뒤 `CREATE2`로 같은 주소에 다른 코드를 다시 배포하는 방식입니다.\n\n## 샘플 코드\n\n폭탄 단계의 가스 일정(의사 코드):\n\n```python\nOLD_SELFDESTRUCT_COST = 5000\nDOUBLING_SLOTS = 2**16\nDOUBLINGS_BEFORE_SENDALL = 13\n\ndef selfdestruct_gas(slot, fork_slot):\n    elapsed = slot - fork_slot\n    if elapsed \u003e= DOUBLING_SLOTS * DOUBLINGS_BEFORE_SENDALL:\n        return OLD_SELFDESTRUCT_COST          # now behaves as SENDALL\n    return OLD_SELFDESTRUCT_COST * 2 ** (elapsed // DOUBLING_SLOTS)\n\n# last bomb period: 5000 * 2**12 = 20,480,000 gas\n```\n\n파괴에 의존하지 않는 코드 작성하기(이런 변경 전후 어느 쪽에서든 동작합니다):\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n// Instead of selfdestruct(payable(owner)) to \"close\" a contract:\ncontract Closable {\n    address public immutable owner = msg.sender;\n    bool public closed;\n\n    function close() external {\n        require(msg.sender == owner, \"not owner\");\n        closed = true;\n        (bool ok, ) = payable(owner).call{value: address(this).balance}(\"\");\n        require(ok, \"transfer failed\");\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**이며, 이 EIP는 활성화된 적이 없습니다.\n- 이더리움은 다른 길을 택했습니다. [EIP-6049](/eip-6049/)는 `SELFDESTRUCT`를 공식적으로 사용 중단(deprecated)했고, [EIP-6780](/eip-6780/)(Dencun, 2024년)은 컨트랙트가 생성된 것과 같은 트랜잭션에서 파괴될 때만 코드와 스토리지를 삭제하도록 제한했습니다. 그 외에는 ETH만 보내며, 여기서의 `SENDALL` 아이디어와 비슷합니다.\n- [EIP-4758](/eip-4758/)은 가스 폭탄 없이 즉시 `SENDALL`로 전환하는 형제 제안이었습니다.\n- 스펙은 활성화 시점을 정의할 때 \"block\"과 \"slot\"을 섞어 쓰고 있으며, 확정된 적이 없습니다.\n- 업그레이드를 위해 `SELFDESTRUCT`에 의존하는 새 컨트랙트를 설계하지 마세요. 대신 프록시 패턴을 사용하세요.\n"},"zh":{"lang":"zh","tldr":"一项通过每约 9 天将 SELFDESTRUCT 的 gas 成本翻倍作为警告、之后将其变为仅转移 ETH 的 SENDALL，从而使 SELFDESTRUCT 失效的提案；该提案未被采纳。","tags":["evm","opcode","selfdestruct","core","verkle"],"related":[6780,6049,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-4760/","markdown":"## 它解决什么问题？\n\n`SELFDESTRUCT` 会删除合约的代码和全部存储，并把其 ETH 发送给目标地址。在一个操作码中清除数量不受限的状态，对如今的客户端来说就很棘手，而在计划中的 Verkle 树布局下会更加困难，因为账户的数据分散在许多键中，这些键与账户根之间并没有明显的联系。\n\n直接禁用该操作码可能会让不关注 EIP 流程的开发者感到意外。EIP-4760 试图先给他们一个醒目的链上警告：让 `SELFDESTRUCT` 持续变贵，使任何合约依赖它的人能在行为改变之前注意到。\n\n## 它如何运作\n\n规范中的常量：\n\n| 名称 | 值 | 含义 |\n| --- | --- | --- |\n| `OLD_SELFDESTRUCT_COST` | 5000 | 当时的 gas 成本 |\n| `HARD_FORK_BLOCK` | TBD | 激活点 |\n| `DOUBLING_SLOTS` | `2**16` | 每次翻倍约 9 天 |\n| `DOUBLINGS_BEFORE_SENDALL` | 13 | 总计约 4 个月 |\n\n分为两个阶段：\n\n1. **炸弹阶段。** `SELFDESTRUCT` 仍像以前一样工作，但其 gas 成本为 `5000 * 2 ** ((slot - HARD_FORK_BLOCK) // DOUBLING_SLOTS)`，每个周期翻倍。\n2. **SENDALL 阶段。** 经过 13 次翻倍后，成本回到 5000，操作码改名为 `SENDALL`。它只把账户中的全部 ETH 转移给目标地址。代码、存储和 nonce 保持不变，所有 `SELFDESTRUCT` 的退款都被取消。\n\n只用 `SELFDESTRUCT` 来取出 ETH 的合约仍可继续工作。会失效的是\"变形合约\"（metamorphic contract）模式：先销毁，再用 `CREATE2` 在同一地址重新部署不同的代码。\n\n## 示例代码\n\n炸弹阶段的 gas 计划（伪代码）：\n\n```python\nOLD_SELFDESTRUCT_COST = 5000\nDOUBLING_SLOTS = 2**16\nDOUBLINGS_BEFORE_SENDALL = 13\n\ndef selfdestruct_gas(slot, fork_slot):\n    elapsed = slot - fork_slot\n    if elapsed \u003e= DOUBLING_SLOTS * DOUBLINGS_BEFORE_SENDALL:\n        return OLD_SELFDESTRUCT_COST          # now behaves as SENDALL\n    return OLD_SELFDESTRUCT_COST * 2 ** (elapsed // DOUBLING_SLOTS)\n\n# last bomb period: 5000 * 2**12 = 20,480,000 gas\n```\n\n编写不依赖销毁的代码（在任何此类变更前后都能工作）：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n// Instead of selfdestruct(payable(owner)) to \"close\" a contract:\ncontract Closable {\n    address public immutable owner = msg.sender;\n    bool public closed;\n\n    function close() external {\n        require(msg.sender == owner, \"not owner\");\n        closed = true;\n        (bool ok, ) = payable(owner).call{value: address(this).balance}(\"\");\n        require(ok, \"transfer failed\");\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**；这项 EIP 从未被激活。\n- 以太坊选择了另一条路线。[EIP-6049](/eip-6049/) 正式弃用了 `SELFDESTRUCT`，[EIP-6780](/eip-6780/)（Dencun，2024 年）对其做了限制：只有在合约于同一笔交易中创建并销毁时才会删除代码和存储；否则它只发送 ETH，类似于这里的 `SENDALL` 思路。\n- [EIP-4758](/eip-4758/) 是一个姊妹提案，会不带 gas 炸弹，立即切换为 `SENDALL`。\n- 规范在定义激活点时混用了\"block\"和\"slot\"；它从未最终定稿。\n- 不要围绕 `SELFDESTRUCT` 来设计用于升级的新合约；请改用代理模式。\n"}}}
