Context: Smart contracts are computerized self-executing contracts that contain clauses, which are enforced once certain conditions are met. Smart contracts are immutable by design and cannot be modified once deployed, which ensures trustlessness. Despite smart contracts' immutability benefits, upgrading contract code is still necessary for bug fixes and potential feature improvements. In the past few years, the smart contract community introduced several practices for upgrading smart contracts. Upgradeable contracts are smart contracts that exhibit these practices and are designed with upgradeability in mind. During the upgrade process, a new smart contract version is deployed with the desired modification, and subsequent user requests will be forwarded to the latest version (upgraded contract). Nevertheless, little is known about the characteristics of the upgrading practices, how developers apply them, and how upgrading impacts contract usage. Objectives: This paper aims to characterize smart contract upgrading patterns and analyze their prevalence based on the deployed contracts that exhibit these patterns. Furthermore, we intend to investigate the reasons why developers upgrade contracts (e.g., introduce features, fix vulnerabilities) and how upgrades affect the adoption and life span of a contract in practice. Method: We collect deployed smart contracts metadata and source codes to identify contracts that exhibit certain upgrade patterns (upgradeable contracts) based on a set of policies. Then we trace smart contract versions for each upgradable contract and identify the changes in contract versions using similarity and vulnerabilities detection tools. Finally, we plan to analyze the impact of upgrading on contract usage based on the number of transactions received and the lifetime of the contract version.
翻译:背景:智能合约是计算机自动执行的合约,包含条款,一旦满足某些条件便会执行。智能合约本质上是不可变的,一旦部署,就不能修改,从而确保无需信任。尽管智能合约不可变的特性优势很多,但修改合约代码仍然是必要的,以进行错误修复和潜在功能改进。在过去的几年中,智能合约社区引入了几种升级智能合约的做法。可升级合约是指展现这些升级实践的智能合约,并以升级可行性为目标进行设计。在升级流程中,会部署一个新的智能合约版本,具有所需的修改,随后的用户请求将被转发到最新版本(升级合约)。然而,很少有人知道这些升级实践的特征,开发人员如何应用它们以及升级如何影响合约的使用情况。
目标:本文旨在描述智能合约升级模式的特征,并基于展示这些模式的部署合约分析其普遍性。此外,我们打算调查开发人员升级合约的原因(例如引入功能、修复漏洞)以及升级对合约在实践中的采用率和生命周期的影响。
方法:我们收集部署的智能合约元数据和源代码,根据一组策略标识展示某些升级模式(可升级合约)的合约。然后,我们跟踪每个可升级合约的智能合约版本,并使用相似度和漏洞检测工具标识合约版本中的更改。最后,我们计划根据接收的交易数和合约版本的生命周期分析升级对合约使用情况的影响。