This repository contains official implementation of our paper "Unlocking Underexplored States: LLM-Enhanced Smart Contract Fuzzing with Retrieval-Augmented Generation".
If you want to use a locally deployed LLM to run our framework, see LLM/README.md for details.
For information about our tool's dependencies, how to install them, and how to install, initialize and use our framework, you can see fuzzer/README.md
Our framework is implemented based on previous work IR-Fuzz, so we will install it first.
git clone https://github.com/Messi-Q/IR-Fuzz.gitthen, please install the dependencies:
sudo apt update
sudo apt install -y cmake golang-go libleveldb-dev libcrypto++-dev software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereumsudo apt update
sudo apt install -y build-essential git libssl-dev libgmp-dev libboost-all-dev ethereum libjsoncpp-dev
pip3 install -r requirements.txtNext, we install the Solidity compiler solc. If it is already installed, you can ignore it. We use the integrated tool solc-select to achieve this.
pip3 install numpy solc-select
solc-select use 0.4.26 --always-installSometimes, the default Go module proxy server may experience network issues. In this case, you may need to switch to a more stable proxy, such as GOPROXY. Set the GOPROXY environment variable to https://goproxy.io or https://proxy.golang.org
or you can exec:
export GOPROXY=https://goproxy.iocmake --version
go version
geth version
solc --versioncd bran
go mod init
cd ..you can initial LARA by following script: (in dir fuzzer)
sh initial_LARA.shYou can run LARA by executable file run_lara.sh
./run_lara.sh $DURATION $ROUND $MODEL_NAME- Use LLM: (We have integrated DeepBrick's API call method.)
export DB_API_KEY=[your_deepbricks_api_key]- If you want to use LARA in local system with
ollama, you can seeLLM/README.md.