Web3 Security Series: Can funds mistakenly transferred to other blockchains be recovered? | Bee Network
An EOA (Externally Owned Account) is what we commonly refer to as a regular wallet address that is directly controlled by a private key or mnemonic phrase.
Prerequisites for asset recovery:
You have transferred your assets to an EOA address. You possess the private key or mnemonic phrase for this target EOA address. (This is usually another wallet address of your own, or a friend’s address that they are willing to cooperate). The target chain is an EVM-compatible chain.Methods to recover assets:
The holder of the private key to the receiving EOA address can directly withdraw funds on the target blockchain.
2. Scenario 2: The receiving address is the contract.This is one of the most desperate scenarios. Because the smart contract’s address is not generated by the private key, no one owns the smart contract’s private key and therefore cannot control the contract in the same way they control the EOA. Furthermore, if the contract does not have a pre-written rescue function to handle “accidentally transferred assets,” the mistakenly transferred funds may be permanently locked in the contract, and no one can retrieve them.
However, in some cases, there is indeed a glimmer of hope. Next, we will construct a scenario where ETH is locked on the Ethereum mainnet, and then explain how to rescue the funds.
2.1. Scene IntroductionIn summary, this scenario involves a user intending to invoke a contract on the Sepolia testnet to transfer ETH into the contract for token minting. However, during the transaction initiation, an incorrect connection was made to the mainnet, resulting in the ETH being locked in the mainnet contract. The specific scenario construction process is as follows:
1. On the Ethereum Sepolia testnet, the project team (EOA) deployed an implementation contract . Assume the main function of this contract is for users to deposit ETH to mint corresponding Aٹوکنs, with code similar to the “mintTokens” function. Assume the deployment address is A. Note that there is no function in A that allows direct ETH withdrawal.
2. On the Ethereum Sepolia testnet, the project team (EOA) deployed a factory contract . This contract’s function is to deploy a proxy contract pointing to the implementation contract (as shown in the function “deployProxyByImplementation”) using minimal proxy contracts (Clones) based on the provided implementation contract address and salt. Assume the deployment address is B. Here, we call the “deployProxyByImplementation” function, passing the implementation contract A address as `_implementation`, to deploy a proxy contract pointing to A at address C.
3. A user wants to mint ATokens on the Sepolia testnet by transferring ETH. The user initiates a call to the proxy contract C. Normally, proxy contract C would further call the “mintTokens” function, which implements contract A, to complete the user’s operation. However, during the call, the user incorrectly connects to the Ethereum mainnet. Consequently, the user directly transfers ETH to address C on the Ethereum mainnet. At this point, no contract is deployed on address C on the Ethereum mainnet, and no one owns the private key for address C. Therefore, the user’s funds are temporarily locked in address C on the mainnet.
2.2. Key Knowledge PointsBefore introducing the specific rescue plan, let’s first introduce some basic knowledge points needed for rescue.
2.2.1. create & create2
`create` and `create2` are two common ways to deploy contracts in Solidity.
When deploying a contract using the `create` function, the contract address is determined by the address of the transaction initiator and the account’s transaction count (nonce), and is unrelated to the contract’s content. When deploying a contract using create2, the calculation of the contract address no longer depends on the transaction initiator’s nonce, but is related to the following four parameters. 0xff The contract address for creating a new contract. The obfuscation value (salt) used as a parameter The creation bytecode (init_code) of the contract to be created.2.2.2. Minimal Agent Contracts (Clones)
https://docs.openzeppelin.com/contracts/4.x/api/proxy#clonesMinimal proxy contracts, also known as clone contracts, are based on the idea of deploying a proxy contract with extremely low cost (Gas) that points to a specified implementation contract. In a clone contract, the proxy contract can be deployed using either the `create` or `create2` method. For example, deploying a proxy contract using the `cloneDeterministic` function employs the `create2` method.
In the “cloneDeterministic” function, the bytecode of the created proxy contract is very short, in the format: “0x363d3d373d3d3d363d735af43d82803e903d91602b57fd5bf3″. The address of the implementation contract is directly hard-coded into the bytecode, and all calls to the proxy contract are delegated to the implementation contract.
As can be seen from the “cloneDeterministic” function, it uses the create2 method to create a proxy contract. The address of the created proxy contract is related to the address of the contract creator, the salt, the address of the implementing contract, and a fixed string of bytecode, but it is unrelated to the bytecode of the implementing contract.
2.3. Rescue PlanNext, we’ll explain how to rescue a user’s ETH held in the mainnet C address. The main idea is to deploy contract code on the Ethereum mainnet C address to take over the address and extract the ETH. The specific steps are as follows:
1. Deploy a factory contract on the mainnet with the same address B as on the testnet. The reason for needing the same factory contract address is that when subsequently calling “cloneDeterministic” to deploy the proxy contract, the address calculation of the proxy contract is related to the factory contract address. By examining the transaction deploying the factory contract on the Sepolia testnet, obtain the nonce of the deployer (project address) in this transaction. On the mainnet, advance the nonce of the project owner’s (EOA) address to the nonce before deploying the factory contract. Then deploy the factory contract on the mainnet. Since the deployer’s address and nonce are the same as the deployment transaction on the testnet, the factory contract address deployed on the mainnet will also be B.
2. Deploy the implementation contract on the mainnet at the same address A as on the testnet. As mentioned in the #Minimum Proxy Contract (Clones)# section, deploying a proxy contract using the “cloneDeterministic” function of the Clones contract calculates the proxy contract address. The calculated proxy contract address depends on the input parameter `salt` and the implementation contract address, but is independent of the implementation contract’s bytecode. Therefore, we only need to deploy one contract on address A; the specific content of the contract does not affect the calculation of the proxy contract address. We can then directly deploy a contract with ETH extraction functionality on address A, as shown in the code below.
On the testnet, implementation contract A is deployed by the project owner’s address (EOA). Therefore, the address of implementation contract A is only related to the transaction initiator and its nonce. Thus, by observing the transactions that deploy implementation contract A on the testnet, finding the relevant nonce, pushing the project owner’s address (EOA) on the mainnet to the specified nonce, and then deploying implementation contract A, you can proceed.
3. Deploy a proxy contract on the mainnet at the same address C as the testnet. Observe the transactions of the proxy contract C deployed on the testnet, obtain the salt information, and call the “deployProxyByImplementation” function of the factory contract B, passing the address of the implementation contract A and the salt as parameters. This will deploy the proxy contract at address C on the mainnet.
4. The mainnet proxy contract C is invoked to withdraw funds. The project address (EOA) calls the withdraw function of proxy contract C, specifies the recipient of funds, successfully withdraws the frozen ETH from proxy contract C, and then returns it to the relevant user.
2.4. SummaryAs can be seen from the above rescue plan, the funds can only be recovered if many conditions are met simultaneously, such as the contract deployer’s relevant nonce on the target chain not being used, the contract trapping the funds having a withdrawal function or being able to deploy a withdrawal function in various ways (the contract can be upgraded or a proxy such as Clones can be used, etc.).
Therefore, everyone must be extremely careful when trading, meticulously verifying each transaction before interacting with the contract. Before engaging with the contract, you can use ZAN’s AI SCAN vulnerability scanning tool to check its security. If your funds are accidentally locked, don’t panic; you can contact ZAN’s contract security audit team to try and help you recover your funds.
This article was written by Cara ( @Cara6289 ) ZAN ٹیم (X اکاؤنٹ @zan_team ) & AntChain OpenLabs (X account @AntChainOpenLab ).
یہ مضمون انٹرنیٹ سے لیا گیا ہے: Web3 Security Series: Can funds mistakenly transferred to other blockchains be recovered?Recommended Articles # تجزیہ# ایتھریم# ٹوکن# ٹول# web3© 版权声明صف 上一篇 Has Bitcoin's four-year cycle failed? 下一篇 Weekly Editor's Picks (November 15-21) 相关文章 Airdrop Weekly Report | Movement airdrop registration will end on December 2; Suilend airdrop check is online and tokens 6086cf14eb90bc67ca4fc62b 65,154 66 Sam Altmans latest article: AI Agents will reshape the world economy 6086cf14eb90bc67ca4fc62b 37,167 Fed Rate Cut Expectations: Why Employment Data Isn’t a Key Factor 6086cf14eb90bc67ca4fc62b 18,766 1 Must-watch next week | The GENIUS Act is expected to have a final vote in the Senate; May CPI data released (June 9-June 6086cf14eb90bc67ca4fc62b 29,066 4 When War Is Settled Before the News: How Prediction Markets “Priced” Maduro’s Arrest Operation 6 Days Early 6086cf14eb90bc67ca4fc62b 12,325 2 Re-examining different DAT strategies in the context of tightened Nasdaq regulation 6086cf14eb90bc67ca4fc62b 20,301 1 کوئی تبصرہ نہیں آپ کو ایک تبصرہ چھوڑنے کے لیے لاگ ان ہونا چاہیے! فوری طور پر لاگ ان کریں۔ کوئی تبصرہ نہیں... تازہ ترین مضامین Did Jane Street “Manipulate” BTC? Decoding the AP System, Understanding the Power Struggle Behind ETF Creation and Redemption Pricing 4 گھنٹے پہلے 197 Stop Comparing Bitcoin to Gold—It’s Now a High-Volatility Software Stock 4 گھنٹے پہلے 252 Matrixport Research: $25 Billion Gamma Unwinding Imminent, Liquidity Yet to Return Behind the Rebound 4 گھنٹے پہلے 223 ERC-5564: Ethereum’s Stealth Era Has Arrived, Receiving Addresses No Longer ‘Exposed’ 4 گھنٹے پہلے 252 Hong Kong Regulatory Green Light: Asseto Enables DL Holdings to Achieve Compliance for Two RWA Business Implementations 4 گھنٹے پہلے 255 مشہور ویب سائٹسTempoLighterGAIBگلائیڈرپلانکریلزبی سی پوکرووئی Bee.com دنیا کا سب سے بڑا Web3 پورٹل شراکت دار سکے کارپ بائننس CoinMarketCap سکے گیکو سکے لائیو آرمر Bee Network APP ڈاؤن لوڈ کریں اور web3 کا سفر شروع کریں۔ سفید کاغذ کردار عمومی سوالات © 2021–2026۔ جملہ حقوق محفوظ ہیں۔. رازداری کی پالیسی | سروس کی شرائط Bee Network APP ڈاؤن لوڈ کریں۔ اور ویب 3 کا سفر شروع کریں۔ دنیا کا سب سے بڑا Web3 پورٹل شراکت دار CoinCarp Binance CoinMarketCap CoinGecko Coinlive Armors سفید کاغذ کردار عمومی سوالات © 2021–2026۔ جملہ حقوق محفوظ ہیں۔. رازداری کی پالیسی | سروس کی شرائط تلاش کریں۔ تلاش کریں۔InSiteآنچینسماجیخبریں 热门推荐: ایئر ڈراپ ہنٹرز ڈیٹا تجزیہ کرپٹو مشہور شخصیات ٹریپ ڈیٹیکٹر اردو English 繁體中文 简体中文 日本語 Tiếng Việt العربية 한국어 Bahasa Indonesia हिन्दी Русский اردو智能索引记录
-
2026-03-02 12:14:12
综合导航
成功
标题:四年级作文300字
简介:在我们平凡的日常里,大家总少不了接触作文吧,作文可分为小学作文、中学作文、大学作文(论文)。那么你有了解过作文吗?以下是
-
2026-03-02 13:08:04
电商商城
成功
标题:百诺三角架怎么样 - 京东
简介:京东是专业的百诺三角架网上购物商城,为您提供百诺三角架价格图片信息、百诺三角架怎么样的用户评论、百诺三角架精选导购、更多
-
2026-03-02 13:00:32
教育培训
成功
标题:书是我的好朋友作文
简介:内容简介:书是我的好朋友,也是不会说话的老师,我喜欢读书。我喜欢读讲历史的书,像《史记故事》、《三国演义》,可 如果觉得
-
2026-03-02 13:05:56
教育培训
成功
标题:我找回了自信初中作文
简介:在学习、工作、生活中,大家总免不了要接触或使用书信吧,书信是一种向特定对象传递信息、交流思想感情的应用文书。你所见过的书
-
2026-03-02 13:07:52
图片素材
成功
标题:岁岁年年的作文2000字 描写岁岁年年的作文 关于岁岁年年的作文-作文网
简介:作文网精选关于岁岁年年的2000字作文,包含岁岁年年的作文素材,关于岁岁年年的作文题目,以岁岁年年为话题的2000字作文
-
2026-03-02 13:56:42
教育培训
成功
标题:【精选】文明作文400字6篇
简介:在日复一日的学习、工作或生活中,许多人都有过写作文的经历,对作文都不陌生吧,作文是人们把记忆中所存储的有关知识、经验和思
-
2026-03-02 13:57:42
教育培训
成功
标题:爱的力量小学作文
简介:在平日的学习、工作和生活里,大家都跟作文打过交道吧,作文是从内部言语向外部言语的过渡,即从经过压缩的简要的、自己能明白的
-
2026-03-02 13:56:51
教育培训
成功
标题:(热)小学二年级作文5篇
简介:在日常生活或是工作学习中,大家总少不了接触作文吧,作文是通过文字来表达一个主题意义的记叙方法。你写作文时总是无从下笔?以
-
2026-03-02 12:49:25
教育培训
成功
标题:2021年辽宁高考作文范文(精选5篇)
简介:在日常学习、工作抑或是生活中,大家对作文都再熟悉不过了吧,作文是人们把记忆中所存储的有关知识、经验和思想用书面形式表达出
-
2026-03-02 13:02:49
教育培训
成功
标题:精选泰国之旅作文400字4篇
简介:在学习、工作、生活中,大家对作文都不陌生吧,作文根据体裁的不同可以分为记叙文、说明文、应用文、议论文。为了让您在写作文时
-
2026-03-02 13:51:48
综合导航
成功
标题:Lookie what I got [Archive] - Toyota MR2 Message Board
简介:http://farm5.static.flickr.com/4034/4536107029_fd159ca907_o.
-
2026-03-02 13:01:08
图片素材
成功
标题:如何的作文700字 描写如何的作文 关于如何的作文-作文网
简介:作文网精选关于如何的700字作文,包含如何的作文素材,关于如何的作文题目,以如何为话题的700字作文大全,作文网原创名师
-
2026-03-02 13:52:07
综合导航
成功
标题:Good transmission shop around lawrenceville or atlanta? [Archive] - Toyota MR2 Message Board
简介:I
-
2026-03-02 13:46:58
综合导航
成功
标题:Galaxy Z6ã·ãªã¼ãºæ©ç¨®å¤æ´ããã¯å² çµäºãããã£ã³ãã¼ã³ã»å²å¼ç¹å
¸ä¸è¦§ au
简介:Galaxy Z6ã·ãªã¼ãºæ©ç¨®å¤æ´ããã¯å²ã®ç´¹ä»ãã¼
-
2026-03-02 13:07:20
教育培训
成功
标题:精选初中故事作文六篇
简介:在日常学习、工作和生活中,大家都经常接触到作文吧,借助作文可以提高我们的语言组织能力。你所见过的作文是什么样的呢?下面是
-
2026-03-02 13:02:31
综合导航
成功
标题:小常识作文400字
简介:无论是身处学校还是步入社会,许多人都有过写作文的经历,对作文都不陌生吧,作文是通过文字来表达一个主题意义的记叙方法。那么
-
2026-03-02 13:51:37
综合导航
成功
标题:Trump expands crypto business territory and plans to acquire crypto exchange Bakkt Bee Network
简介:Original author: BitpushNews As he prepares to take office
-
2026-03-02 12:52:50
综合导航
成功
标题:关于四年级学生作文合集八篇
简介:在我们平凡的日常里,大家或多或少都会接触过作文吧,作文是通过文字来表达一个主题意义的记叙方法。你知道作文怎样写才规范吗?
-
2026-03-02 13:56:25
教育培训
成功
标题:二年级作文300字【必备9篇】
简介:在平日的学习、工作和生活里,大家一定都接触过作文吧,借助作文人们可以实现文化交流的目的。写起作文来就毫无头绪?以下是小编
-
2026-03-02 13:02:26
教育培训
成功
标题:英语作文300字
简介:在生活、工作和学习中,大家最不陌生的就是作文了吧,作文是经过人的思想考虑和语言组织,通过文字来表达一个主题意义的记叙方法
-
2026-03-02 13:55:17
综合导航
成功
标题:24H Hot Coins and News Trump selects mainstream coins such as XRP, SOL and ADA to join the strategic reserve of crypto Bee Network
简介:1. Popular currencies on CEX CEX top 10 trading volume and
-
2026-03-02 13:06:39
综合导航
成功
标题:18luck新利官网利app-你玩乐的的好帮手
简介:18luck新利官网专注于为玩家打造无忧的游戏环境。其官方应用程序以简洁流畅的设计、便捷的操作体验和丰富的游戏内容,成为
-
2026-03-02 13:01:45
综合导航
成功
标题:第1章 还好他不爱_余生寂寥-笔趣阁
简介:余生寂寥最新章节第1章 还好他不爱全文免费阅读笔趣阁精选余生寂寥无错最新章节。
-
2026-03-02 13:00:10
教育培训
成功
标题:六年级作文300字(合集4篇)
简介:无论在学习、工作或是生活中,大家都尝试过写作文吧,根据写作命题的特点,作文可以分为命题作文和非命题作文。写起作文来就毫无
-
2026-03-02 12:33:01
综合导航
成功
标题:Body Colored or Black Trim? OPINIONS [Archive] - Toyota MR2 Message Board
简介:I
-
2026-03-02 13:55:22
综合导航
成功
标题:Alexandre Cabanel (1823-1889). The Reader's Biographical Encyclopaedia. 1922
简介:Alexandre Cabanel (1823-1889). The Reader
-
2026-03-02 12:11:27
图片素材
成功
标题:代代的作文450字 描写代代的作文 关于代代的作文-作文网
简介:作文网精选关于代代的450字作文,包含代代的作文素材,关于代代的作文题目,以代代为话题的450字作文大全,作文网原创名师
-
2026-03-02 12:24:56
综合导航
成功
标题:Careers General Atomics
简介:Browse available job openings at GENERAL ATOMICS
-
2026-03-02 12:20:07
综合导航
成功
标题:泉水的作文600字
简介:在平凡的学习、工作、生活中,大家都有写作文的经历,对作文很是熟悉吧,作文是一种言语活动,具有高度的综合性和创造性。那么问
-
2026-03-02 13:00:24
综合导航
成功
标题:Заявка на услугу «Доменный брокер» Рег.ру
简介:Отправить заявку на услугу «Доменный брокер».