Skip to content

Commit 6e786a2

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # Readme.md
2 parents afc6264 + 722f5eb commit 6e786a2

File tree

6 files changed

+40
-36
lines changed

6 files changed

+40
-36
lines changed

.idea/GraphDeeSmartContract.iml

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

.idea/encodings.xml

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

.idea/misc.xml

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

.idea/modules.xml

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

.idea/vcs.xml

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

Readme.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 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)
2+
3+
This repo is a python implementation of smart contract vulnerability detection of our DR-GCN network.
4+
5+
### Running project
6+
* To run program, use this command: python SmConVulDetector.py.
7+
* In addition, you can use specific hyper-parameters to train the model. All the hyper-parameters can be found in `parser.py`.
8+
9+
Examples:
10+
```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
13+
```
14+
15+
Using script:
16+
Repeating 10 times for different seeds with `train.sh`.
17+
```shell
18+
for i in $(seq 1 10);
19+
do seed=$(( ( RANDOM % 10000 ) + 1 ));
20+
python SmConVulDetector.py --model gcn_modify --seed $seed | tee logs/smartcheck_"$i".log;
21+
done
22+
```
23+
Then, you can find the training results in the `logs/`.
24+
25+
26+
### Dataset
27+
Original smart contract source code:
28+
29+
Ethereum smart contracts: [Etherscan_contract](https://drive.google.com/open?id=1h9aFFSsL7mK4NmVJd4So7IJlFj9u0HRv)
30+
31+
Vntchain smart contacts: [Vntchain_contract](https://drive.google.com/open?id=1FTb__ERCOGNGM9dTeHLwAxBLw7X5Td4v)
32+
33+
The train data after normalization:
34+
35+
`training_data/LOOP_CORENODES_1317`, `LOOP_FULLNODES_1317`, `REENTRANCY_CORENODES_1671`, `REENTRANCY_FULLNODES_1671`
36+
37+
38+
### Reference
39+
1. The code borrows from [graph_unet](https://github.com/bknyaz/graph_nn)
40+
2. Thomas N. Kipf, Max Welling, Semi-Supervised Classification with Graph Convolutional Networks, ICLR 2017

0 commit comments

Comments
 (0)