Access Control
All Strike contracts that use role-based access control inherit OpenZeppelin's AccessControl, except PythResolver which uses a simpler custom ownership model.
Roles Overview
DEFAULT_ADMIN_ROLE
All AccessControl contracts
Deployer EOA
Can grant/revoke any role
OPERATOR_ROLE
OrderBook
BatchAuction, MarketFactory
Manage markets and settle orders
PROTOCOL_ROLE
Vault
OrderBook, BatchAuction, Redemption
Lock/unlock/transfer collateral
MINTER_ROLE
OutcomeToken
BatchAuction, Redemption
Mint and burn outcome tokens
ESCROW_ROLE
OutcomeToken
BatchAuction
Burn escrowed sell-order tokens on fill via burnEscrow()
ADMIN_ROLE
MarketFactory
PythResolver
Manage market state transitions
Role Definitions
DEFAULT_ADMIN_ROLE (all contracts)
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;Held by the deployer EOA. Can call grantRole and revokeRole on any role. This is the OpenZeppelin default admin role that governs all other roles.
OPERATOR_ROLE (OrderBook)
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");Grants access to:
registerMarket(minLots, batchInterval, expiryTime)-- create a new trading markethaltMarket(marketId)/resumeMarket(marketId)-- pause/resume tradingdeactivateMarket(marketId)-- permanently close a marketreduceOrderLots(orderId, lotsToReduce)-- remove filled lots from an orderupdateTreeVolume(marketId, side, tick, delta)-- adjust segment tree after fillsadvanceBatch(marketId)-- increment the batch counter
Granted to BatchAuction (settlement operations) and MarketFactory (market lifecycle).
PROTOCOL_ROLE (Vault)
Grants access to:
lock(user, amount)-- lock collateral for open ordersunlock(user, amount)-- unlock collateral on cancel/prunetransferCollateral(from, to, amount)-- move locked funds between accountssettleFill(user, marketId, toPool, feeCollector, protocolFee, unlockAmount)-- combined settlementaddToMarketPool(user, marketId, amount)-- move funds into redemption poolredeemFromPool(marketId, to, amount)-- pay out from redemption pool
Granted to OrderBook (lock/unlock on order placement/cancel), BatchAuction (settlement), and Redemption (payout from pool).
MINTER_ROLE (OutcomeToken)
Grants access to:
mintPair(to, marketId, amount)-- mint YES + NO token pairmintSingle(to, marketId, amount, isYes)-- mint a single outcome tokenburnPair(from, marketId, amount)-- burn YES + NO token pairredeem(from, marketId, amount, winningOutcome)-- burn winning tokens
Granted to BatchAuction (mints tokens during atomic settlement in clearBatch) and Redemption (burns winning tokens during redemption).
ESCROW_ROLE (OutcomeToken)
Grants access to:
burnEscrow(from, marketId, amount, isYes)-- burn escrowed outcome tokens held by OrderBook when sell orders (SellYes/SellNo) are filled during batch settlement
Granted to BatchAuction. When a SellYes or SellNo order is filled, the tokens were custodied by OrderBook on placement. BatchAuction calls burnEscrow() to burn those tokens as part of the settlement flow.
ADMIN_ROLE (MarketFactory)
Grants access to:
setResolving(factoryMarketId)-- transition market to Resolving statesetResolved(factoryMarketId, outcomeYes, settlementPrice)-- finalize resolutionpayResolverBounty(factoryMarketId, resolver)-- pay creation bond to resolverpauseFactory(paused)-- pause/unpause market creationsetDefaultParams(batchInterval, minLots)-- update default market paramssetCreationBond(bond)-- update creation bond amountsetFeeCollector(collector)-- update fee collector
Granted to PythResolver (resolution state transitions) and the deployer (admin controls). Note: the deployer also receives ADMIN_ROLE in the MarketFactory constructor.
PythResolver Admin (custom ownership)
PythResolver does not use OpenZeppelin AccessControl. It has a simple admin address set to msg.sender in the constructor. Transfer uses a two-step pattern:
The admin can call:
setConfThreshold(newBps)-- update confidence interval threshold
Role Graph (ASCII)
Detailed flow diagram:
Wiring Commands
Run these after deployment (the deployer must hold DEFAULT_ADMIN_ROLE on each contract):
Security Notes
The deployer holds
DEFAULT_ADMIN_ROLEon all contracts. This should be transferred to a multisig or timelock for production deployments.PythResolver admin should also be transferred to a multisig via
setPendingAdmin/acceptAdmin.Role grants are additive --
grantRoledoes not revoke existing holders.Missing role grants will cause
AccessControl: account ... is missing role ...reverts at runtime.
Last updated