A starter repo for interacting with the Battlechain Safe Harbor protocol. Includes scripts for deploying a vulnerable vault, creating a Safe Harbor agreement, requesting attack mode, and executing a whitehat rescue.
- git
- You'll know you did it right if you can run
git --versionand you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --versionand you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z) - For browser wallet targets (
just *-browser), you need forge >=1.6.0-nightly(commitc1cdc6c1, 2026-03-10) or later
- You'll know you did it right if you can run
- just
- You'll know you did it right if you can run
just --versionand you see a response likejust 1.x.x
- You'll know you did it right if you can run
git clone <MY_REPO>
cd <MY_REPO>just build# Step 1: Deploy MockToken + VulnerableVault, seed the vault
just setup
# Step 2: Create Safe Harbor agreement (requires VAULT_ADDRESS in .env)
just create-agreement
# Step 3: Request attack mode (requires AGREEMENT_ADDRESS in .env)
just request-attack-mode# Step 4: Execute the attack (requires DAO approval first)
just attack# Check agreement state (2=ATTACK_REQUESTED, 3=UNDER_ATTACK)
just check-state
# Run tests
just test