Back to Trending
RepositoryPythonCNChina
Messi-Q

Messi-Q/GraphDeeSmartContract

Smart contract vulnerability detection using graph neural network (DR-GCN).

155stars
26forks
7issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: gcn

#1 Repository of the month

1
TINIX TRENDING·Topic: graph-neural-network

#1 Repository of the month

1
TINIX TRENDING·Topic: graph2vec

#1 Repository of the month

GraphDeeSmartContract GitHub stars GitHub forks

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

Requirements

Required Packages

  • python 3+ (python 3.7 used in our project)
  • PyTorch 1.0.0
  • numpy 1.18.2
  • sklearn 0.20.2

Run the following script to install the required packages.

pip install --upgrade pip
pip install torch==1.0.0
pip install numpy==1.18.2
pip install scikit-learn==0.20.2

Citation

Please use this citation in your paper if you refer to our paper or code.

@inproceedings{zhuang2020smart,
  title={Smart Contract Vulnerability Detection using Graph Neural Network.},
  author={Zhuang, Yuan and Liu, Zhenguang and Qian, Peng and Liu, Qi and Wang, Xiang and He, Qinming},
  booktitle={IJCAI},
  pages={3283--3290},
  year={2020}
}

Running project

  • To run program, please use this command: python3 SMVulDetector.py.
  • In addition, you can set specific hyper-parameters, and all the hyper-parameters can be found in parser.py.

Examples:

python3 SMVulDetector.py --dataset training_data/REENTRANCY_CORENODES_1671
python3 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 

Using script: Repeating 10 times for different seeds with train.sh.

for i in $(seq 1 10);
do seed=$(( ( RANDOM % 10000 )  + 1 ));
python3 SMVulDetector.py --model gcn_modify --seed $seed | tee logs/smartcheck_"$i".log;
done

Then, you can find the training results in the logs/.

Dataset

For original dataset, please turn to the dataset repo.

The normalized train data can be found in training_data/REENTRANCY_CORENODES_1671, REENTRANCY_FULLNODES_1671

Note that the instruction of constructing the dataset can be found in the GraphLearning, and the XXX_node_attributes can be obtained using our designed tools.

Reference

  1. A fraction of the code reuses the code of graph_unet.
  2. Thomas N. Kipf, Max Welling, Semi-Supervised Classification with Graph Convolutional Networks, ICLR 2017.

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
benedekrozemberczki/PDN

The official PyTorch implementation of "Pathfinder Discovery Networks for Neural Message Passing" (WebConf '21)

58
Dec 28, 2025
RepositoryPython
PeiJieSun/diffnet

Graph Neural Network based Social Recommendation Model. SIGIR2019.

186
Jun 2, 2024
RepositoryPython
shuowang-ai/GeniePath-pytorch

This is a PyTorch implementation of the GeniePath model in <GeniePath: Graph Neural Networks with Adaptive Receptive Paths> (https://arxiv.org/abs/1802.00910)

104
Jul 25, 2024
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryPython
Graphify-Labs/graphify

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

156.2k
Dec 2, 2026
RepositoryC++
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

201.9k
Dec 1, 2026
Modelimage-text-to-text
Qwen/Qwen3.8-27B

Qwen3.8-27B !Note This repository contains model weights and configuration files for the post-trained model in the Hugging Face Transformers format. These artifacts are compatible with Hugging Face Transformers, vLLM, SGLang, TokenSpeed, etc. !Tip F...

♥0
4.8M
Nov 7, 2026
RepositoryTypeScript
Egonex-AI/Understand-Anything

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

95.2k
Nov 25, 2026
RepositoryPython
benedekrozemberczki/awesome-graph-classification

A collection of important graph embedding, classification and representation learning papers with implementations.

4.8k
Mar 18, 2023