Skip to main content

Registry Moderator

The address that can approve/reject requests and instant promote.
// Get current moderator
address moderator = attackRegistry.getRegistryModerator();

// Change moderator (owner only)
attackRegistry.changeRegistryModerator(newModerator);

Valid Chains

CAIP-2 chain IDs that can be used in agreements.
// Check if chain is valid
bool valid = safeHarborRegistry.isChainValid("eip155:1");

// Set chains as valid (owner only)
safeHarborRegistry.setValidChains(chainIds);

// Set chains as invalid (owner only)
safeHarborRegistry.setInvalidChains(chainIds);

Common Chain IDs

ChainCAIP-2 ID
Ethereum Mainneteip155:1
Arbitrum Oneeip155:42161
Optimismeip155:10
Baseeip155:8453
BattleChain Testneteip155:325
BattleChain Mainneteip155:326

Time Constants

Set at deployment (require upgrade to change):
uint256 public constant PROMOTION_WINDOW = 14 days;
uint256 public constant PROMOTION_DELAY = 3 days;
uint256 public constant MIN_COMMITMENT = 7 days;
ConstantValueEffect
PROMOTION_WINDOW14 daysAuto-promote if DAO inactive
PROMOTION_DELAY3 daysDelay after promote()
MIN_COMMITMENT7 daysMinimum agreement commitment

Agreement Factory

Creates and validates agreements.
// Get factory
address factory = safeHarborRegistry.getAgreementFactory();

// Set factory (owner only)
safeHarborRegistry.setAgreementFactory(newFactory);

// Check if agreement is valid
bool valid = agreementFactory.isAgreementContract(agreementAddress);

Safe Harbor Registry

Links protocols to agreements.
// Get registry
address registry = attackRegistry.getSafeHarborRegistry();

// Set registry (owner only)
attackRegistry.setSafeHarborRegistry(newRegistry);

BattleChain Deployer

Registers new deployments.
// Get deployer
address deployer = attackRegistry.getBattleChainDeployer();

// Set deployer (owner only)
attackRegistry.setBattleChainDeployer(newDeployer);

Contract Upgrades

Both AttackRegistry and AgreementFactory use UUPS upgradeable pattern:
// Owner can authorize upgrades
function _authorizeUpgrade(address newImplementation) internal override onlyOwner;