一句话:首个以太坊代理合约大规模实证研究,提出字节码检测框架 PROXYEX,揭示使用模式与常见问题。
代理设计模式将智能合约的数据与代码分离,支持可升级、可扩展和代码复用,但其流行度、使用场景与开发陷阱缺乏系统研究。本文提出首个从字节码检测代理的框架 PROXYEX,准确率超过 99%,据此收集 2,031,422 个以太坊代理并开展首次大规模实证研究。研究分析代理数量与交易流量,归纳出可升级、可扩展、代码共享和代码隐藏四类使用模式,识别代理-逻辑存储冲突、逻辑-逻辑存储冲突和未初始化合约三类问题,并通过重放历史交易构建检查器。结果表明可升级并非 DApp 采用代理的唯一原因,许多代理存在存储冲突与未初始化合约等问题,为代理开发、质量保证和缺陷检测提供依据。
The proxy design pattern separates data and code in smart contracts into proxy and logic contracts. Data resides in proxy contracts, while code is sourced from logic contracts. This pattern allows for flexible smart contract development, enabling upgradeability, extensibility, and code reuse. Despite its popularity and importance, there is currently no systematic study to understand the prevalence, use scenarios, and development pitfalls of proxies. We present the first comprehensive study on Ethereum proxies. To gather a dataset of proxies, we introduce PROXYEX, the first framework to detect proxies from bytecode, achieving over 99% accuracy. Using PROXYEX, we collected a dataset of 2,031,422 Ethereum proxies and conducted the first large-scale empirical study. We analyzed proxy numbers and transaction traffic to understand their current status on Ethereum. We identified four proxy use patterns: upgradeability, extensibility, code-sharing, and code-hiding. We also pinpointed three common issues: proxy-logic storage collision, logic-logic storage collision, and uninitialized contracts, creating checkers for these by replaying historical transactions. Our study reveals that upgradeability isn't the sole reason for proxy adoption in DApps, and many proxies present issues like storage collisions and uninitialized contracts, which enhances the understanding of proxies and guide future smart contract research on the development, usage, quality assurance, and bug detection of proxies.
DOI 原文 ·
@inproceedings{paperbot8851,
title = {An Empirical Study of Proxy Contracts at the Ethereum Ecosystem Scale},
author = {Mengya Zhang and Preksha Shukla and Wuqi Zhang and Zhuo Zhang and Pranav Agrawal and Zhiqiang Lin and Xiangyu Zhang and Xiaokuan Zhang},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00083}
}