Studying differentiated code to support smart contract update

Xiangping Chen,Peiyong Liao,Queping Kong,Yuan Huang,Xiaocong Zhou
DOI: https://doi.org/10.1007/s10664-023-10359-y
IF: 3.762
2023-09-14
Empirical Software Engineering
Abstract:Smart contracts have received a lot of attention. A smart contract is a program that runs on a blockchain. Some recent studies reveal that most of the smart contracts on the Ethereum blockchain are highly similar. An inexperienced smart contract developer can refer to some existing smart contracts that is similar to their own contracts to help their development by applying the differentiated code from the existing similar contracts. How to identify similar contracts and extract differentiated code to recommend to the developers as guidance is what we aim for in this work. Differentiated code is defined as the source code excluding the repeated part in two similar smart contracts, which usually illustrates how a software feature is implemented or a programming issue is solved. Thus, differentiated code might be used to guide the update of a smart contract. In this paper, we propose a differentiated code recommendation approach, SmartDiffrec, for supporting smart contract update. Specifically, we apply syntax and semantic similarities to discover the similar contracts for a given target contract, and then recommend the differentiated code to the target contract. Moreover, we investigate three research questions to analyze the effectiveness of our approach from the whole to the specific. The results show that the differentiated codes extracted found by our approach can effectively support smart contract update.
computer science, software engineering
What problem does this paper attempt to address?