Skip to main content
This tutorial walks you through finding an attackable contract, verifying its Safe Harbor terms, and executing a legal attack. By the end, you’ll understand the complete whitehat workflow.
Prerequisites: Familiarity with smart contract security and Solidity.

What You’ll Do

  1. Find an attackable contract
  2. Review the Safe Harbor agreement
  3. Execute an attack
  4. Handle recovered funds correctly

Step 1: Find an Attackable Contract

Query the AttackRegistry to check if a contract is attackable:
To find contracts to attack, monitor for AgreementStateChanged events:

Step 2: Get the Agreement Details

Once you find an attackable contract, get its agreement:
You now know the bounty terms. In this example: 10% bounty, $5M cap, retainable.

Step 3: Verify the Contract is in Scope

Double-check the contract is covered:

Step 4: Get the Recovery Address

Note where to send recovered funds:

Step 5: Execute Your Attack

Now execute your exploit. Here’s an example attacking a reentrancy vulnerability:

Step 6: Handle Funds Correctly

After a successful attack:
1

Calculate Your Bounty

2

Send Remainder to Recovery

Transfer RecoveredAmount - Bounty to the recovery address
3

Keep Your Bounty

The remaining amount is yours
You’ve completed your first attack! The protocol received their funds (minus your bounty), and you’re protected under Safe Harbor.

Step 7: Document Everything

Keep records of:
  • The contract you attacked
  • The vulnerability exploited
  • Transaction hashes
  • Your bounty calculation
  • Funds sent to recovery

What’s Next?

How to Claim Bounties

Learn more about bounty calculations and caps

Safe Harbor Protection

Understand your legal protections