Skip to main content
This tutorial walks you through deploying a contract to BattleChain and getting it ready for stress testing. By the end, you’ll have a contract in attack mode, open for whitehats to test.
Prerequisites: You should have an audited smart contract ready to deploy and some test funds for liquidity.

What You’ll Do

  1. Deploy your contract via BattleChainDeployer
  2. Create a Safe Harbor agreement
  3. Request attack mode
  4. Wait for DAO approval

Step 1: Deploy Your Contract

The recommended way to deploy is through BattleChainDeployer, which automatically registers your contract with the AttackRegistry.
Your contract is now deployed and registered. You (the deployer) are automatically authorized to request attack mode.
If your contract was deployed through other means, you can still request attack mode using requestUnderAttackByNonAuthorized. This function allows any contract to enter the attack flow, but requires DAO approval like normal.In Step 5, use this instead:

Step 2: Create a Safe Harbor Agreement

The agreement defines your bounty terms and which contracts are in scope.

Step 3: Extend Commitment Window

The agreement needs a commitment window of at least 7 days:

Step 4: Adopt the Agreement

Link your protocol to the agreement:

Step 5: Request Attack Mode

Now request attack mode for your contracts:
Your request is submitted! The agreement state is now ATTACK_REQUESTED.

Step 6: Wait for DAO Approval

The DAO will review your request. They check:
  • Is this a new contract (not a mainnet copy)?
  • Are the bounty terms reasonable?
  • Is the scope clearly defined?
You can check your status:

What’s Next?

Once approved, your contracts are in attack mode:
  • Monitor for attacks: Watch for unusual activity
  • Respond to issues: If a whitehat finds something, they’ll send funds to your recovery address
  • Promote when ready: After sufficient testing, promote to production

How to Promote to Production

Learn how to move your contracts to production mode