[论文解读] A Comprehensive Survey of Upgradeable Smart Contract Patterns
本文对以太坊上使用代理架构的可升级智能合约模式进行了全面调查,通过分析64,000份已验证合约,识别并分类了可升级模式。通过在Slither基础上构建自定义检测框架,对静态分析进行增强,作者将误报率从70%降低至接近零,提出了一种稳健且可扩展的方法,用于在生产环境中识别安全且可升级的智能合约。
In this work, we provide a comprehensive survey of smart contract upgradability patterns using proxies. A primary characteristic of smart contracts on the Ethereum blockchain is that they are immutable once implemented, no changes can be made. Taking human error into account, as well as technology improvements and newly discovered vulnerabilities, there has been a need to upgrade these smart contracts, which may hold enormous amounts of Ether and hence become the target of attacks. Several such attacks have caused tremendous losses in the past, as well as millions of dollars in Ether which has been locked away in broken contracts. Thus far we have collected many upgradable proxy patterns and studied their features to build a comprehensive catalog of patterns. We present a summary of these upgradable proxy patterns which we collected and studied. We scraped the source code for approximately 100000 verified contracts from Etherscan.io, the most popular block explorer for Ethereum, out of which we extracted around 64k unique files - most containing multiple contracts. We have begun to automate the analysis of these contracts using the popular static analysis tool Slither, while at the same time implementing much more robust detection of upgradable proxies using this framework. Comparing the results of the original implementation to our own, we have found that approximately 70 percent of the contracts which were initially flagged as upgradeable proxies are false positives which we have eliminated.
研究动机与目标
- 为应对由于人为错误、需求演变以及新出现的漏洞所导致的智能合约可升级性安全与可靠性方面的关键需求。
- 分析并整理现实世界中以太坊智能合约所使用的基于代理的可升级性模式。
- 通过减少误报,提高静态分析工具在识别真实可升级智能合约方面的准确性。
- 开发并验证一个可扩展的框架,用于在大规模已验证合约集合中检测可升级代理模式。
- 为未来在安全智能合约演化与形式化验证方面的研究和工具开发提供基础。
提出的方法
- 作者从以太坊区块浏览器抓取并分析了64,000个唯一的智能合约文件,重点关注已验证合约。
- 应用静态分析工具Slither,检测所收集合约中潜在的可升级代理模式。
- 实现了一个自定义检测框架,以超越原始Slither实现的准确性。
- 通过将框架结果与同一数据集上原始Slither输出进行对比,对框架进行了验证。
- 通过代理模式的语义和结构分析,系统性地识别并过滤掉误报。
- 最终的可升级模式目录源自经过清洗、高置信度的检测合约集合。
实验结果
研究问题
- RQ1以太坊上可升级智能合约中占主导地位的模式是什么?
- RQ2现有静态分析在识别真实可升级代理合约方面的准确性如何?
- RQ3当前检测方法在可升级智能合约检测中的误报率是多少?
- RQ4自定义检测框架能否显著降低可升级合约识别中的误报?
- RQ5哪些结构和语义特征能够将真实可升级代理与误报区分开来?
主要发现
- 在约100,000份已验证合约中,提取并分析了64,000个唯一的合约文件以评估其可升级性。
- 基于原始Slither的检测方法将约70%的结果标记为可升级代理,但这些结果大多为误报。
- 作者增强后的检测框架成功消除了大部分误报,显著提升了可靠性。
- 研究揭示了现实世界以太坊合约中基于代理的可升级性普遍存在,但也暴露出当前自动化检测方法的重大缺陷。
- 最终的可升级模式目录基于经过清洗、高置信度的数据集,可为未来更精确的分析和工具开发提供支持。
- 结果表明,可升级合约的自动化检测需要超越语法模式匹配的语义和结构智能。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。