[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to main content

Smart Contract Code Clone Detection Based on Pre-training Techniques

  • Conference paper
  • First Online:
Blockchain and Trustworthy Systems (BlockSys 2023)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1897))

Included in the following conference series:

  • 407 Accesses

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
£29.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
GBP 19.95
Price includes VAT (United Kingdom)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
GBP 51.99
Price includes VAT (United Kingdom)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
GBP 64.99
Price includes VAT (United Kingdom)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Bitcoin official website. https://bitcoin.org/en/

  2. Ethereum official website. https://www.ethereum.org/

  3. Wikipedia of ethereum. https://en.wikipedia.org/wiki/Ethereum/

  4. Solidity. https://en.wikipedia.org/wiki/Solidity/

  5. Official fomo3d website. https://exitscam.me/

  6. Davey, N., Barson, P., Field, S., Frank, R., Tansley, D.: The development of a software clone detector. IJAST, 1(3/4) (1995)

    Google Scholar 

  7. Bailey, J., Burd, E.: Evaluating clone detection tools for use during preventative maintenance. In: SCAM 2002 (2002)

    Google Scholar 

  8. Rieger, M.: Effective clone Detection Without Language Barriers. PhD thesis (2005)

    Google Scholar 

  9. Walenstein, A., Lakhotia, A.: The software similarity problem in malware analysis. In: Dagstuhl Seminar Proceedings (2007)

    Google Scholar 

  10. Baker, B.: On finding duplication and near-duplication in large software systems. In: WCRE 1995

    Google Scholar 

  11. Brixtel, R., Fontaine, M., Lesner, B., Bazin, C., Robbes, R.: Language-independent clone detection applied to plagiarism detection. In: SCAM 2010 (2010)

    Google Scholar 

  12. Jiang, L., Su, Z., Chiu, E.: Context-based detection of clone-related bugs. In: ESEC/FSE 2007

    Google Scholar 

  13. Lo, D., Jiang, L., Budi, A.: Active refinement of clone anomaly reports. In: ICSE 2012 (2012)

    Google Scholar 

  14. Wang, X., Dang, Y., Zhang, L., Zhang, D., Lan, E., Mei, H.: Can i clone this piece of code here? In: ASE 2012 (2012)

    Google Scholar 

  15. Dang, Y., Zhang, D., Ge, S., Chu, C., Qiu, Y., Xie, T.: Xiao: tuning code clones at hands of engineers inpractice. In: ACSAC 2012

    Google Scholar 

  16. Milea, N., Jiang, L., Khoo, S.: Scalable detection of missed cross-function refactorings. In: ISSTA 2014 (2014)

    Google Scholar 

  17. Milea, N., Jiang, L., Khoo, S.: Vector abstraction and concretization for scalable detection of refactorings. In: FSE 2014 (2014)

    Google Scholar 

  18. Roy, C., Cordy, J.: A survey on software clone detection research. Queen’s University, Technical report (2007)

    Google Scholar 

  19. Johnson, J.H.: Identifying redundancy in source code using fingerprints. In: CASCON 1993 (1993)

    Google Scholar 

  20. Johnson, J.H.: Visualizing textual redundancy in legacy source. In: CASCON 1994 (1994)

    Google Scholar 

  21. Baker, B.: A program for identifying duplicated code. In: Computer Science and Statistics (1992)

    Google Scholar 

  22. Baker, B." Parameterized pattern matching: algorithms and applications. JCSS, 52(1) (1996)

    Google Scholar 

  23. Tai, K.S., Socher, R., Manning, C.D.: Improved semantic rep-resentations from tree-structured long short-term memory networks

    Google Scholar 

  24. Zhang, P., Xiao, F., Luo, X.: A framework and dataset for bugs in ethereum smart contracts. In: 2020 IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 139–150. IEEE (2020)

    Google Scholar 

  25. Mikolov, T., Sutskever, I., Chen, K., Corrado, G.S., Dean, J.: Distributed representations of words and phrases and their compositionality. In: Proceedings of 26th International Conference Neural Information Processing System, pp. 3111–3119 (2013)

    Google Scholar 

  26. Zhou, W., Zhou, Y., Jiang, X., Ning, P.: Detecting repackaged smartphone applications in third-party android marketplaces. In: Proceedings of the second ACM Conference on Data and Application Security and Privacy, pp. 317–326. ACM (2012)

    Google Scholar 

  27. Chen, T., et al.: Understanding ethereum via graph analysis. In: IEEE INFOCOM 2018-IEEE Conference on Computer Communications, pp. 1484–1492. IEEE (2018)

    Google Scholar 

Download references

Acknowledgments

This work is partially supported by the National Key Research and Development Project of China (No. 2020YFB1711900).

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Zhuo Zhang or Xiaoguang Mao .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zhang, C. et al. (2024). Smart Contract Code Clone Detection Based on Pre-training Techniques. In: Chen, J., Wen, B., Chen, T. (eds) Blockchain and Trustworthy Systems. BlockSys 2023. Communications in Computer and Information Science, vol 1897. Springer, Singapore. https://doi.org/10.1007/978-981-99-8104-5_4

Download citation

  • DOI: https://doi.org/10.1007/978-981-99-8104-5_4

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-99-8103-8

  • Online ISBN: 978-981-99-8104-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics