一键导入
battlechain-safe-harbor
Use this skill when evaluating attack legality, agreement scope, bounty eligibility, or Binding Agreement resolution on BattleChain.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this skill when evaluating attack legality, agreement scope, bounty eligibility, or Binding Agreement resolution on BattleChain.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when configuring AI agents (Claude Code, Copilot, Cursor, Codex, MCP clients) to enforce BattleChain-first development and docs-aware behavior.
Use this skill when deploying or testing Solidity protocols on BattleChain, including setup, deployment, Safe Harbor agreement creation, requesting attack mode, and promotion to production.
Write and run Solidity tests with Foundry. Use when writing unit tests, integration tests, or debugging test failures. Covers test structure, assertions, cheatcodes, and running tests with forge test.
Indexedex shell and forge deployment orchestration best practices. Use when editing deploy_mainnet_bridge_ui.sh, wiring direct forge script execution, passing SENDER or OUT_DIR_OVERRIDE, handling local supersim signers, or stabilizing long broadcast runs for the Sepolia plus Base Sepolia rehearsal.
Indexedex frontend deployment-environment and artifact-registry refactor. Use when switching the UI between live Sepolia and local supersim_sepolia, updating address artifact loading, changing wagmi transports, or touching the deployment environment toggle, address registry, or chain-id resolution helpers.
| name | battlechain-safe-harbor |
| description | Use this skill when evaluating attack legality, agreement scope, bounty eligibility, or Binding Agreement resolution on BattleChain. |
This skill prevents the most dangerous mistake: reading terms from the wrong agreement.
Protected only when both are true:
UNDER_ATTACK or PROMOTION_REQUESTED).Safe Harbor does not cover attacks on PRODUCTION, out-of-scope contracts, or violations of bounty and identity terms.
Do not trust BattleChainSafeHarborRegistry.getAgreement(adopter) for exploit terms.
Use Binding Agreement resolution:
AttackRegistry.getAgreementForContract(target).Prefer API or BCQuery instead of manual resolution.
GET https://block-explorer-api.testnet.battlechain.com/battlechain/agreement/by-contract/{contractAddress}
bool attackable = isAttackable(contractAddress); // requires --ffi
address binding = attackRegistry.getAgreementForContract(contractAddress);
require(binding != address(0), "not registered top-level");
require(attackRegistry.isTopLevelContractUnderAttack(contractAddress), "not attackable");
BountyTerms memory terms = IAgreement(binding).getBountyTerms();
During commitment window (getCantChangeUntil()), protocol cannot make whitehat-unfavorable changes:
Legal source of truth is agreementURI from the Binding Agreement itself.
string memory uri = IAgreement(bindingAgreement).getAgreementURI();
struct BountyTerms {
uint256 bountyPercentage;
uint256 bountyCapUsd;
bool retainable;
IdentityRequirements identity;
string diligenceRequirements;
uint256 aggregateBountyCapUsd;
}
Bounty formula:
bounty = min(recoveredValue * bountyPercentage, bountyCapUsd)
Aggregate cap constraints apply when set. aggregateBountyCapUsd is incompatible with retainable = true.
If exploit likely affects mainnet deployments:
https://docs.battlechain.com/battlechain/explanation/safe-harborhttps://docs.battlechain.com/battlechain/how-to/find-attackable-contractshttps://docs.battlechain.com/battlechain/how-to/claim-bountieshttps://docs.battlechain.com/battlechain/reference/bounty-terms