Smart Contract Code Clone Detection Based on Pre-training Techniques
摘要
Smart contract has been utilized to realize cryptocurrencies and crowdfunding initiatives. Due to its characteristics of immutable once deployed, the security issues have been widely studied and paid much attention. In practise, reusing pieces of smart contract code from reputable sources has taken risks. Thus, in this paper, we study the code cloning in Ethereum with pre-training techniques. Specifically, we analyze the similarity of two smart contract codes by comparing the similarity of the word vectors. We use the cosine similarity comparison method to analyze and compare a collection of 3814 smart contracts containing timestamp vulnerabilities, then perform code quality analysis on these contracts to study the relationships between code reuse and vulnerabilities. Finally, we analyze the characteristics of these existential code cloning contracts. The results show that the performance of our experimental method is 1%–4% better than the current best detection method.