Generated by DALL·E-3 | Image by Sihao Hu
GPTLens leverages Large Language Models (LLMs) like GPT-4 to improve the security analysis of smart contracts. It addresses the critical need for effective smart contract vulnerability detection, which has become increasingly important with the prevalence of blockchain technology. GPTLens introduces a two-stage framework: generation and discrimination. In the generation stage, LLMs act as auditors to identify a broad spectrum of potential vulnerabilities. The discrimination stage then evaluates these findings to minimize false positives, significantly enhancing the accuracy and reliability of vulnerability detection(shown in the figure below).
Some key features of GPTLens include:
- Dual-stage Analysis: Utilizes generation and discrimination stages to identify and verify smart contract vulnerabilities.
- LLM-driven Approach: Completely driven by LLMs, requiring no specialist knowledge in smart contracts for initial assessments.
- High Accuracy and Efficiency: Designed to reduce false positives and enhance the detection process without compromising on performance.
To see the detailed implementation, go to : https://github.com/git-disl/GPTLens. This demo app provides a scenario-based walkthrough of how GPTLens utilizes LLMs to examine smart contract code and detect vulnerabilities.
pip install -r requirements.txt
python src/gpt_lens_demo.py
This demo shows the GPT-lens workflow
Demo app Coverpage:
Demo app showing GPTLens architecture step-by-step:
Screen-Recording-2024-05-01-at-9.mp4
Demo app displaying data pipelining:
data_loading_page.mp4
This mini-project, GPTLens, was developed by Yining Yuan in collaboration with the GIT DiSL group under the supervision of Prof. Dr. Ling Liu and PhD student Sihao Hu.
For more detailed information on GPTLens, please refer to the following resources:
For any technical questions regarding this project, please consult with Sihao Hu.