Smart Contract Similarity Detection

Fall 2022 - SE6387.001 Advanced Software Engineering Project

Project Goal

  1. Given two smart contracts, automatically calculate their similarity (using cosine similarity)
  2. Generate probability density function graphs to determine the threshold of the similarity score
  3. Detect the co-cloned pairs and the non-co-cloned pairs of contracts along with their similarity values using the computed threshold in step 2

Flowchart Diagram

Figure 1: Flowchart Diagram of the Project Goal

Description

This diagram represents the different components of our project and its structure. It shows the relationship between the directories in a hierarchical way for a much simpler visualization.

Overall Project Structure

Figure 2: Diagram of the Overall Project Structure

Internal Structure of the Program

This class diagram represents the internal classes that are defined and used in the program. It shows all of the main classes along with their attributes and defined methods.

Class Diagram

Figure 3: Class Diagram of the Internal Project Structure

Getting Started

Setup

  1. Create a /contracts directory under /src/
  2. Go to this github repository https://github.com/PrCatch/etherscan-0815-0914
  3. Download project as a ZIP file in another folder NOT in /src/
  4. Extract the project from the ZIP file
  5. From the etherscan folder, select the contracts you want to compare from the contracts folder
  6. Place those contracts into /src/contracts directory
    • The contracts should be placed following the format of /#/#/project
    • Example:
      Screenshot 2022-12-01 at 11 20 01 PM

Environment Prerequisites

Authors

Name Email
Junaid Hashmi jsh171030@utdallas.edu
Miao Miao mxm190091@utdallas.edu
Jeongwon Seo jxs170012@utdallas.edu

Version History

  • FinalCodeSubmission
    • Final Version of the Code

Acknowledgments

  • Dr. Wei Yang - Professor of SE6387.001
  • Simin Chen - Staff Advisor