Coder Social home page Coder Social logo

messi-q / gpscvuldetector Goto Github PK

View Code? Open in Web Editor NEW
92.0 5.0 16.0 9 MB

Combining Graph Neural Networks with Expert Knowledge for Smart Contract Vulnerability Detection (TKDE Accepted)

Python 100.00%
smart-contracts vulnerability-detection graph-neural-networks expert-knowledge

gpscvuldetector's Introduction

GPSCVulDetector

This repo is a python implementation of combining graph neural network with expert knowledge for smart contract vulnerability detection.

Citation

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

@article{liu2023combining,
  title={Combining Graph Neural Networks With Expert Knowledge for Smart Contract Vulnerability Detection},
  author={Liu, Zhenguang and Qian, Peng and Wang, Xiaoyang and Zhuang, Yuan and Qiu, Lin and Wang, Xun},
  journal={IEEE Transactions on Knowledge \& Data Engineering},
  volume={35},
  number={02},
  pages={1296--1310},
  year={2023},
  publisher={IEEE Computer Society}
}

Requirements

Required Packages

  • python 3+
  • TensorFlow 2.0
  • numpy 1.18.2
  • sklearn 0.20.2

Run the following script to install the required packages.

pip install --upgrade pip
pip install tensorflow==2.0
pip install numpy==1.18.2
pip install scikit-learn==0.20.2

Graph extractor & Pattern extractor

  1. Graph: The contract graph and its feature are extracted by the automatic graph extractor in the graph_extractor_example directory (or refer to our previous methods).
  2. Pattern: The expert pattern and its feature are extracted by the automatic pattern extractor in the pattern_extractor_example directory.

Notably, you can also use the features extracted in AMEVulDetector.

If any question, please email to [email protected].

Running Project

  • To run program, please use this command: python3 GPSCVulDetector.py.
  • Also, you can set specific hyperparameters, and all the hyperparameters can be found in parser.py.

Examples:

python3 GPSCVulDetector.py
python3 GPSCVulDetector.py --model CGE --lr 0.002 --dropout 0.2 --epochs 100 --batch_size 32

References

  1. Smart Contract Vulnerability Detection Using Graph Neural Networks. IJCAI 2020. GNNSCVulDetector.
@inproceedings{ijcai2020-454,
  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 = {Proceedings of the Twenty-Ninth International Joint Conference on
               Artificial Intelligence, {IJCAI-20}},
  publisher = {International Joint Conferences on Artificial Intelligence Organization}, 
  pages     = {3283--3290},
  year      = {2020},
}

  1. Towards Automated Reentrancy Detection for Smart Contracts Based on Sequential Models. IEEE Access. ReChecker.
@article{qian2020towards,
  title={Towards Automated Reentrancy Detection for Smart Contracts Based on Sequential Models},
  author={Qian, Peng and Liu, Zhenguang and He, Qinming and Zimmermann, Roger and Wang, Xun},
  journal={IEEE Access},
  year={2020},
  publisher={IEEE}
}

gpscvuldetector's People

Contributors

cleanunicorn avatar messi-q avatar papercodebase avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gpscvuldetector's Issues

GPSCVulDetector.py file not found

In the README.md file its mentioned
To run program, please use this command: python3 GPSCVulDetector.py.

But there is no GPSCVulDetector.py file.
Is the CGEVulDetector.py file which is incorrectly renamed ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.