Selfdestruct Removal Analysis 3

This follows from the first and second selfdestruct removal analysis reports.

As explained in previous reports, there are two use-cases which will be broken if SELFDESTRUCT is replaced with SENDALL using EIP-4758:

  • upgradable contracts created using CREATE2 which can be selfdestructed and a new contract deployed at the same address.
  • ephemeral contract creators: contracts which were intended to be created and selfdestructed in the same transaction now remain deployed after executing SENDALL.

This document gives an overview of contracts on mainnet that are confirmed/probable upgradable and creators of ephemeral contracts. A contract is considered upgradable if it has been created using CREATE2 and has a reachable SELFDESTRUCT opcode in its bytecode.

When determining whether a contract has a reachable SELFDESTRUCT, we want to detect solidity metadata appended to the contract bytecode. This can contain arbitrary bytes so any SELFDESTRUCT opcode in it must not be considered. The heuristic used here is to consider the metadata to be any bytes past two adjacent 0x00 and 0xa2 opcodes.

The dataset used can be reproduced using these instructions.

Note: a contract is considered recently-active if it has been the sender/receiver of an internal call or transaction since block 15900000.

Findings Summary

Potentially-Upgradable Addresses

Total of 2058022 existing selfdestructable contracts were created by 404 creators with only CREATE2 in their bytecode. 176110 were created by 304 creators with both CREATE2 and CREATE. 144735 have non-zero eth balances and 39204 were recently-active.

Creators by Balance

42 addresses with non-zero Eth balances. Top 10:

Address Project/Description Balance
0xb16c1342e617a5b6e4b631eb114483fdb289c0a4 sudoswap: Pair Factory 259.2
0x0000000000000eb4ec62758aae93400b3e5f7f18 MEV Bot 85.52
0xb233cb2f0dce57a56bf732767f45ffc8650186c5 17.32
0xdf024061cf701c02db0e2df32f160f12a660a396 3.5
0x0000000000a1c7212a1c129512d80eb30d14dc08 2.95
0xf9e8c18a855183246dbf19c8b249921fa64bd33c ItoVault: Deployer 2.427
0x35efabf6e2d970a3bc3fa1de991ec63987c127bc 2.38
0x94edc4a3065a7a42db6c57614e513992b2eb3ee4 2
0xbb7f0d85299d7068c741b3c7ed7800ff40599cc0 1.404
0x36ae49add923625ac7a30a49e3bdbbd07827a0a1 1.263
Creators by Recent Activity

57 addresses with recent activity. Top 10:

Address Project/Description Call Count
0x00000000003b3cc22af3ae1eac0440bcee416b40 MEV Bot 43428
0xb16c1342e617a5b6e4b631eb114483fdb289c0a4 sudoswap: Pair Factory 39916
0x0000000000004946c0e9f43f4dee607b0ef1fa1c 6187
0x03d37ad26961d79e52c3daea840c0095fb4729a7 2547
0xdf024061cf701c02db0e2df32f160f12a660a396 2328
0x7151b902537197fd79b920a33f42a765ee6504d5 1379
0x57e037f4d2c8bea011ad8a9a5af4aaeed508650f Loopring (?) 1114
0x6090a6e47849629b7245dfa1ca21d94cd15878ef ENS: Old Registrar 806
0x000000000000084e91743124a982076c59f10084 MEV Bot 424
0xd672f1e3411c23edbb49e8eb6c6b1564b2bf8e17 361

Previously-reinited Selfdestructable contract addresses with create2-containing creators

1992 selfdestructable contracts deployed by 89 creators.

Top Creators by Recent Activity

14 contracts were recently active. Top 10:

Address Project/Description Call Count
0x000000000000084e91743124a982076c59f10084 MEV Bot 424
0x813c2ccc69f68bb5080c1656504a423cedf609ac 40
0x00000000e82eb0431756271f0d00cfb143685e7b 20
0x4088123881a441b733ee4563f9bf141b0f07d46a 19
0x29c03561b5ef34b4290e2863ec495042ff70781f 16
0x61aad281762f173589e5fa007e28641e5724efb2 10
0x1530a652881c4435f7fbf7c00d0a05c22e80d6c3 8
0x683f4403f5ce87e3f53e352379e5ba62f00ae694 8
0x920a1b37e7983244e1b5e5e46f27b4da00d47347 8
0x1eab56260a4a11f758d0f1097a76c465e1ca1fca 4
Top Create2-containing Creators by Balance

9 contracts had non-zero balances:

Address Project/Description Balance
0x0000000000000eb4ec62758aae93400b3e5f7f18 MEV Bot 85.52
0xbb7f0d85299d7068c741b3c7ed7800ff40599cc0 1.404
0x545ab070078a05d0a6743f88a5ba2ad262daabc3 0.8100
0x000000000000cb53d776774284822b1298ade47f 0.000001590
0xdc3c2c78ef0e11952af23dccd8e24a0a64c9d20e ~0
0x0031867b9965761f730389d50dfbebd26527b8eb ~0
0x0000000000007673393729d5618dc555fd13f9aa ~0
0x00000000004c46cecbb6b3c67de2d24fbf4dd487 ~0
0x5eb332b005a40e0a63f0e0ed5232b1208aa7084a ~0
Top Created Contracts by Balance

35 contracts had non-zero balances. Top 10:

Address Project/Description Creator Eth Balance
0x0000000000007f150bd6f54c40a34d7c3d5e9f56 MEV Bot 0x55757942b19e543a7d4c909f952f5509b10b66b3 855.7
0x0000000000000eb4ec62758aae93400b3e5f7f18 MEV Bot 0xbad5531e175167cd89e8fdc099b3ec43d83c48b7 85.51
0x000000000035b5e5ad9019092c665357240f594e MEV Bot 0x5aaa33de85c9daea4f9e216be937409849f80ecd 43.43
0x0000000000a84d1a9b0063a910315c7ffa9cd248 MEV Bot 0x76dd8699c128bc795479191de364e99b38b6375e 55.08
0x000000000000660def84e69995117c0176ba446e MEV Bot 0x3dd1c15a0aeb7a772fa0c90f4817731c8622ff83 30.88
0x0000000099cb7fc48a935bceb9f05bbae54e8987 MEV Bot 0x5aaa33de85c9daea4f9e216be937409849f80ecd 11.62
0xf2d47e78dea8e0f96902c85902323d2a2012b0c0 0x62261ae38d40bcd5ab3e44989161b70a91e4d7da 3.378
0x00000007d259e6b322766529ac387b53a1584724 0x545ab070078a05d0a6743f88a5ba2ad262daabc3 0.2868
0x0eae044f00b0af300500f090ea00027097d03000 MEV Bot 0x1eab56260a4a11f758d0f1097a76c465e1ca1fca 0.1256
0x45503c34ee615c4ed5fe071fc6ccee06c049b1e3 0x2319c999808d589b5fb33349b182f000d281dc65 0.1
Top Created Contracts By Recent Activity

45 contracts with create2-containing creators were recently-active. Top 10:

Address Name/Description Creator Recent Call Count
0x0eae044f00b0af300500f090ea00027097d03000 MEV Bot 0x1eab56260a4a11f758d0f1097a76c465e1ca1fca 159511
0x007933790a4f00000099e9001629d9fe7775b800 0x879a58c3ca50c8c5f5647d310a5d0b3adeffdd59 96653
0x24902aa0cf0000a08c0ea0b003b0c0bf600000e0 0x4cfeb2473d7c64ac9a0e5442581883c9d88822df 95746
0xe8c060f8052e07423f71d445277c61ac5138a2e5 MEV Bot 0xc139f939ec6124da1c318a84662bc9791f80c461 95728
0x81153f0889ab398c4acb42cb58b565a5392bba95 MEV Bot 0x86ad374125c76826c35357813352df6d7be1fab7 93222
0x00000000a991c429ee2ec6df19d40fe0c80088b8 0x0be2ed3b069366b78d90e57c0dd1db756043919f 85383
0x000000000035b5e5ad9019092c665357240f594e MEV Bot 0x5aaa33de85c9daea4f9e216be937409849f80ecd 73261
0x0000000000007f150bd6f54c40a34d7c3d5e9f56 MEV Bot 0x55757942b19e543a7d4c909f952f5509b10b66b3 69964
0x0000000000a84d1a9b0063a910315c7ffa9cd248 MEV Bot 0x76dd8699c128bc795479191de364e99b38b6375e 64186
0xfd0000000100069ad1670066004306009b487ad7 0x2d055433247d668086ea4083be33b4a05a24ef50 49950

Ephemeral Contract Creators

Total of 9811 alive contracts that have previously created ephemeral contracts. 429 have non-zero Eth balances. 60 were recently active.

Top Contracts by Recent Activity
Contract Address Name/Description Internal/External Call Count
0xdef1c0ded9bec7f1a1670819833240f027b25eff https://www.0x.org/ 1350533
0xa5025faba6e70b84f74e9b1113e5f7f4e7f4859f https://poanetwork.github.io/multisender (broken link from etherscan contract source code) 60828
0x4f4495243837681061c4743b74b3eedf548d56a5 https://axelar.network/ 38334
0xc77ad0a71008d7094a62cfbd250a2eb2afdf2776 16928
0x2e1891de1e334407fafaab09ac545bb9e4099833 14763
0xb69d4de5991fa3ded39c27ed88934a106f0af19e 14763
0xcf0da9cea8403ff1e3ed6db93f3badc885c24522 14761
0xebe5cccc75b4ec5d6d8c7a3a8cee0d8c0e821584 14761
0x8b2550add3c5067ca7c03b84e1e37b14b35aa1e5 14159
0xd0c7a9d47704979273a527bcace42c9e01a69ec1 5448
Top Contracts By Balance
Contract Address Name/Description Ether Balance
0x66be1bc6c6af47900bbd4f3711801be6c2c6cb32 https://hakka.finance/ 1910
0xa5025faba6e70b84f74e9b1113e5f7f4e7f4859f https://poanetwork.github.io/multisender (broken link from etherscan contract source code) 245.7
0x36049d479a97cde1fc6e2a5d2cae30b666ebf92b https://pine.finance/ 8.9230
0xd412054cca18a61278ced6f674a526a6940ebd84 https://www.sorbet.finance/ 6.226
0xfc0f5114c9bd93b84598d836e4b0bdfb2eb2b1e1 4.924
0xbd2a43799b83d9d0ff56b85d4c140bce3d1d1c6c 3.445
0xdf024061cf701c02db0e2df32f160f12a660a396 3.488
0xbe4a176b0d18f1e158cc1a833383212f68327b51 2.909
0xb1a71b3526a3494857c4ef873f7702a11e2e3265 1.550
0x3f615ba21bc6cc5d4a6d798c5950cc5c42937fbd 1.50
Top Contracts Ranked by Number of Created Ephemeral Contracts
Contract Address Number of Ephemeral Contracts Created Since Genesis
0xe9428d4a341ac20e9f2e6b95b12c9ad52733fcd9 939699
0xa998cf7ac9c2063c95e6f81a0b8f220520d5e81a 294462
0x5a4e849325e9b87bdb918bbe1bbafdea819bbefe 270380
0x70872019d755762700951f70057eed26992455f3 268527
0xf331ff3d2eaf9a2009dc935816665c962fe82757 207984
0x2c204d6970eb394e73868b37ad0913b597c6a391 120640
0x9c5941b0e22fc11bc2901d78a5913a47fd9c87e0 94542
0xb6fb5ee1c5c9249b064f54f2ecbcfe3a66591fa7 80997
0x8b259620560c73f44adc2a5e0cd2f65c6e26c260 78267
0xa83063e117298993c3a2346224fdfd7f2f13aba5 78162

Etherscan gave no indication what these addresses were/are used for.

Interpretation

There are many selfdestructable contracts deployed on mainnet that could break with a blanket selfdestruct removal as proposed in EIP-4758. EIP-6046 is an alternative approach which provides backwards-compatible behavior for many on-chain contracts that would be broken by 4758. However, it has edge-cases that need consideration/investigation.

Looking at recent on-chain usage and Eth balance are good ways to prioritize potentially-affected contracts for manual analysis. However, we have to consider consider cases where disabling a low-value/rarely-used upgradeable contract could lock value in other contracts that depend on it.

Further automated analysis is needed to identify how potentially-affected contracts are related to other on-chain contracts: looking at history of interactions and doing static analysis to identify likely-addresses in code/storage, identify cases where these could be the address argument to a CALL* might provide useful insights.

Select a repo