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.
翻译:在这项研究中,我们使用代理提供升级智能合约模式的全面调查。以太坊区块链上智能合约的主要特征是,一旦实施,它们就是不可变的,不能进行更改。考虑到人为错误、技术改进和新发现的漏洞,就出现了需要升级这些智能合约的需求,这些合约可能保存着大量的Ether,并因此成为攻击目标。以前发生过一些这样的攻击,导致巨额损失,以及数百万美元的Ether被锁定在损坏的合约中。迄今为止,我们已经收集了许多升级代理模式,并研究了它们的特点,以建立一个全面的模式目录。我们展示了这些升级代理模式的摘要,我们收集并研究了这些模式。我们从Etherscan.io上爬取了大约100000个验证合约的源代码,这是以太坊上最受欢迎的区块浏览器,在其中提取了大约64k个唯一文件,其中大多数包含多个合约。我们已经开始使用流行的静态分析工具Slither自动分析这些合约,同时使用这个框架实现了更加强大的检测升级代理。将原始实现的结果与我们自己的结果进行比较,我们发现最初被标记为可升级代理的合约约70%是假阳性,我们已经排除了这些情况。