Attack Synthesis for DeFi Apps
We use DeFiHackLabs as the benchmark records.
Install python 3.11.
brew install python@3.11
Install dependencies.
pip3 install -q --upgrade pip && pip3 install -q -r ./requirements.txt && \
solc-select install 0.8.21 && solc-select use 0.8.21 && npm install --quiet --save-dev
Install Foundry 0.2.0.
curl -L https://foundry.paradigm.xyz | bash
This command will evaluate all sketches of a benchmark.
python3 ./main.py -e -i ./benchmarks/Discover
Ablation study
python3 ./main.py -e --fixed -i ./benchmarks/Discover
This test is for testing whether the ground truth works or not.
forge test -vvv --match-path ./benchmarks/Discover/Discover.t.sol
This command will evaluate all sketches of a benchmark.
python3 ./main.py -ha -i ./benchmarks/Discover
(It works with cached results and if you don't want to cache, run rm ./benchmarks/Discover/result/*.json
)
anvil --no-mining --timestamp 0 --base-fee 0 --gas-price 0
This work is accepted by ACM CCS '24. Link
Halmos will use the same cache directory as foundry.toml
.
Supported cheating codes: Check this file
python3 ./main.py -p -i ./benchmarks/Discover
python3 ./main.py -p -i all
rm ./benchmarks/**/result/eurus_*.json
rm ./benchmarks/**/result/record.json