How to Promote to Production
Move your contracts from attack mode to production after stress testing
Overview
After successful stress testing, promote your contracts to production mode. This removes Safe Harbor protection and treats contracts like mainnet deployments.
⚠️
Once promoted, there's no going back. Contracts cannot re-enter attack mode.
Request Promotion
// Only the attack moderator can promote
attackRegistry.promote(agreementAddress);
This starts a 3-day countdown. During this time:
- Contracts are still attackable
- Safe Harbor still applies
- You can cancel if issues are found
Cancel Promotion
If an issue is discovered during the 3-day wait:
attackRegistry.cancelPromotion(agreementAddress);
This returns the agreement to UNDER_ATTACK state.
Check Promotion Status
IAttackRegistry.AgreementInfo memory info = attackRegistry.getAgreementInfo(agreementAddress);
if (info.promotionRequestedTimestamp > 0) {
uint256 promotionTime = info.promotionRequestedTimestamp + 3 days;
if (block.timestamp >= promotionTime) {
// Now in PRODUCTION
} else {
// Still in PROMOTION_REQUESTED, can cancel
}
}
Mark as Corrupted
If a whitehat successfully exploits your contracts:
attackRegistry.markCorrupted(agreementAddress);
This sets state to CORRUPTED (terminal), signaling the contracts are compromised.
Transfer Attack Moderator
The attack moderator controls promotion. To transfer:
attackRegistry.transferAttackModerator(agreementAddress, newModerator);
After Promotion
- Deploy to mainnet: Your contracts are battle-tested
- Keep monitoring: Continue to watch your BattleChain deployment
- Mirror updates: Keep BattleChain and mainnet in sync
- Use for staging: Future updates can use BattleChain's attack mode
Best Practices
Learn best practices for using BattleChain