SmartEmbed is a web service tool for clone detection & bug detection for smart contracts.
We have published our tool through the following url :
There is a tutorial video introducing how to use SmartEmbed on Youtube:
Source data can be downloaded from :
https://drive.google.com/file/d/13iTTpt7gFd9wEW35C2fX4pVT7cVlHgxi/view?usp=sharing
This folder contains the code for the SmartEmbed web tool. There are a few important subfolders and files as follows.
- templates - contains the frontend html files
- static - contains the css files and js scripts
- app[dot]py - main flask file, see below for usage.
- similarity[dot]py and smart_embed[dot]py - Contains the backend codes for clone detection.
- bug[dot]py and smart_bug[dot]py - Contains the backend codes for bug detection.
- Install requirements.txt with
pip install -r requirements.txt
. - Please update the
FASTTEXT_MODEL
andCONTRACT_EMBEDDINGS_PATH
to the correspondingwork_space
directory in thesimilarity.py
lines10
and19
respectively. - Run the command
python app.py
. This will initialize the web tool atlocalhost:9700
, as illustrated below.
- Paste the smart contract on to the text area and hit Submit.
- Clone detection results will be displayed as follows.
- Bug detection results will be displayed as follows.
[email protected]
Discussions, suggestions and questions are welcome!