After all contracts are deployed, grant the following roles. The deployer holds DEFAULT_ADMIN_ROLE on every AccessControl contract and can call grantRole.
OrderBook.OPERATOR_ROLE
BatchAuction needs OPERATOR_ROLE to call reduceOrderLots, updateTreeVolume, and advanceBatch. MarketFactory needs it to call registerMarket and deactivateMarket.
Vault.PROTOCOL_ROLE
OrderBook calls lock and unlock. BatchAuction calls settleFill and unlock. Redemption calls redeemFromPool.
PythResolver calls setResolving, setResolved, and payResolverBounty on MarketFactory.
PythResolver Admin
PythResolver uses simple ownership (not AccessControl). The admin is set to msg.sender in the constructor (the deployer). Transfer via two-step process:
Deploy Commands
Local Devnet (Anvil)
The Deploy.s.sol script deploys a MockPyth instance, wires all roles, and creates a test market automatically.
BSC Testnet
BSC Mainnet
The deploy script auto-detects chain ID 97 (testnet) vs 56 (mainnet) and uses the correct Pyth address.
Contract Verification
Deploy scripts pass --verify to auto-verify on BscScan. To verify a contract manually:
For contracts with complex constructor args, use cast abi-encode to produce the correct encoding.
Post-Deploy Validation Checklist
Contract verification -- all contracts verified on BscScan.
Test market creation -- call MarketFactory.createMarket(...) with a known Pyth price ID (requires MARKET_CREATOR_ROLE) and verify the market appears in activeMarkets.
Test place/cancel cycle -- approve Vault for USDT, call OrderBook.placeOrder(...) and verify USDT collateral is escrowed in Vault. Cancel the order and verify USDT is returned to wallet.
Keepers configured -- batch-keeper, market-keeper, and resolution-keeper (in strike-infra) pointing at correct contract addresses.
Indexer configured -- indexer (in strike-infra) pointing at correct RPC and contract addresses, listening for all relevant events.