Skip to content

Commit 16d8627

Browse files
committed
update Readme.md.
1 parent 8936740 commit 16d8627

File tree

109 files changed

+49
-979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+49
-979
lines changed

Performance_evaluation.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

Readme.md

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,65 @@
11
# GraphDeeSmartContract ![GitHub stars](https://img.shields.io/github/stars/Messi-Q/GraphDeeSmartContract.svg?style=plastic) ![GitHub forks](https://img.shields.io/github/forks/Messi-Q/GraphDeeSmartContract.svg?color=blue&style=plastic) ![License](https://img.shields.io/github/license/Messi-Q/GraphDeeSmartContract.svg?color=blue&style=plastic)
22

3-
This repo is a python implementation of smart contract vulnerability detection of our DR-GCN network.
3+
This repo is a python implementation of smart contract vulnerability detection using graph neural networks (DR-GCN).
44

5-
### Running project
6-
* To run program, use this command: python SmConVulDetector.py.
5+
6+
## Requirements
7+
### Required Packages
8+
* **python**3 or above
9+
* **PyTorch**1.0.0
10+
* **numpy**1.18.2
11+
* **sklearn** for model evaluation
12+
13+
Run the following script to install the required packages.
14+
```
15+
pip install --upgrade pip
16+
pip install torch==1.0.0
17+
pip install numpy==1.18.2
18+
pip install scikit-learn
19+
```
20+
21+
22+
## Citation
23+
Please use this citation if you want to cite our [paper](https://www.ijcai.org/Proceedings/2020/0454.pdf) or codebase in your paper:
24+
```
25+
@inproceedings{ijcai2020-454,
26+
title = {Smart Contract Vulnerability Detection using Graph Neural Network},
27+
author = {Zhuang, Yuan and Liu, Zhenguang and Qian, Peng and Liu, Qi and Wang, Xiang and He, Qinming},
28+
booktitle = {Proceedings of the Twenty-Ninth International Joint Conference on
29+
Artificial Intelligence, {IJCAI-20}},
30+
publisher = {International Joint Conferences on Artificial Intelligence Organization},
31+
pages = {3283--3290},
32+
year = {2020},
33+
}
34+
35+
```
36+
37+
38+
## Running project
39+
* To run program, use this command: python SMVulDetector.py.
740
* In addition, you can use specific hyper-parameters to train the model. All the hyper-parameters can be found in `parser.py`.
841

942
Examples:
1043
```shell
11-
python SmConVulDetector.py --dataset training_data/REENTRANCY_CORENODES_1671
12-
python SmConVulDetector.py --dataset training_data/REENTRANCY_CORENODES_1671 --model gcn_modify --n_hidden 192 --lr 0.001 -f 64,64,64 --dropout 0.1 --vector_dim 100 --epochs 50 --lr_decay_steps 10,20
44+
python SMVulDetector.py --dataset training_data/REENTRANCY_CORENODES_1671
45+
python SMVulDetector.py --dataset training_data/REENTRANCY_CORENODES_1671 --model gcn_modify --n_hidden 192 --lr 0.001 -f 64,64,64 --dropout 0.1 --vector_dim 100 --epochs 50 --lr_decay_steps 10,20
1346
```
1447

1548
Using script:
1649
Repeating 10 times for different seeds with `train.sh`.
1750
```shell
1851
for i in $(seq 1 10);
1952
do seed=$(( ( RANDOM % 10000 ) + 1 ));
20-
python SmConVulDetector.py --model gcn_modify --seed $seed | tee logs/smartcheck_"$i".log;
53+
python SMVulDetector.py --model gcn_modify --seed $seed | tee logs/smartcheck_"$i".log;
2154
done
2255
```
2356
Then, you can find the training results in the `logs/`.
2457

2558

2659
### Dataset
27-
Original smart contract source code:
28-
29-
Ethereum smart contracts: [Etherscan_contract](https://drive.google.com/open?id=1h9aFFSsL7mK4NmVJd4So7IJlFj9u0HRv)
60+
ESC: [Ethereum Smart Contracts](https://drive.google.com/open?id=1h9aFFSsL7mK4NmVJd4So7IJlFj9u0HRv)
3061

31-
Vntchain smart contacts: [Vntchain_contract](https://drive.google.com/open?id=1FTb__ERCOGNGM9dTeHLwAxBLw7X5Td4v)
62+
VSC: [Vntchain Smart Contacts](https://drive.google.com/open?id=1FTb__ERCOGNGM9dTeHLwAxBLw7X5Td4v)
3263

3364
The train data after normalization:
3465

File renamed without changes.

comparison/reentrancy/ground_truth.txt

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)