PRODUCTION BRANCH DO NOT INTERACT DIRECTLY
Input a foundry project, the Hackbot will find ways to hack the code and steal money. (Legally)
Key Features • Installation • Requirements • Environment Variables • How and What to Run
- Git clone this repo
- Initialize submodules:
git submodule update --init --recursive
This project uses rye for dependency management. If you don't have rye installed, you can install it by following the official installation instructions.
You will need to install via package manager (or similar, below are the apt names):
libomp-devdefault-jre(or other java runtime provider)clang(in particular clang++ frontend)npmdocker(in particulardockerdrunning)
If you're on an M(digit) mac, you will need to install Rosetta 2 to do emulation
of x86_64 containers/executables. Install it with
softwareupdate --install-rosetta --agree-to-license
And you will need to make sure that versions of:
node >= 16.0(may be installed/bootstrapped from earlier npm via apt ornpm install -g nsudo n stable)
Once rye is installed, you can set up the project dependencies by running:
make update_python_deps
We make use of the following environment variables:
OPENAI_API_KEYGH_PERSONAL_ACCESS_TOKEN
Set these as KEY=VALUE in the top-level .env file, i.e.
tee -a .env <<< "OPENAI_API_KEY=sk-proj-..."
tee -a .env <<< "GH_PERSONAL_ACCESS_TOKEN=github_pat_..."See sample.env for a template, these are automatically loaded into the
environment when the global_config package is imported.
(OUTDATED Section)
To run the full hackbot application, you can run make all. Make sure you have
npm installed.
To run the hackbot application backend without running the UI, you can run
make debug.
There are deterministic tests that can be run with make test-deterministic,
which is used in CI.
To run individual tests, you can use rye run python -m test.module.name.here
(Slow) There are non-deterministic tests that can be run with
make test-non-deterministic which is not used in CI and is typically used to
test LLM functionality
(Slow) To run all tests, try rye test.
utils/tests/main.py
https://github.com/code-423n4/2023-08-dopex/blob/main/scope.txt https://github.com/code-423n4/2023-08-dopex-findings/blob/main/report.md
See hackbot_devops/Makefile for build and deployment instructions, but it's
basically gcloud auth login and then make build_and_deploy
