Skip to content

Edison-Watch/hackbot-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,684 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRODUCTION BRANCH DO NOT INTERACT DIRECTLY

Archimedes Hackbot

Archimedes Hackbot

Input a foundry project, the Hackbot will find ways to hack the code and steal money. (Legally)

Key FeaturesInstallationRequirementsEnvironment VariablesHow and What to Run

Installation

  1. Git clone this repo
  2. Initialize submodules:
    git submodule update --init --recursive

Requirements

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-dev
  • default-jre (or other java runtime provider)
  • clang (in particular clang++ frontend)
  • npm
  • docker (in particular dockerd running)

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 or npm install -g n sudo n stable)

Once rye is installed, you can set up the project dependencies by running:

make update_python_deps

Environment Variables

We make use of the following environment variables:

  • OPENAI_API_KEY
  • GH_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.

How and what to run

(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.

Tests

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.

Relevant parts of the repo

  • utils/
  • tests/
  • main.py

Misc: Relevant foundry-based Code4Rena repos

See this csv listing them.

Example Targets

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

Build and deployment

See hackbot_devops/Makefile for build and deployment instructions, but it's basically gcloud auth login and then make build_and_deploy

About

♨️ GatlingX Hackbot for hacking Foundry-based github repos

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages