@@ -13,7 +13,7 @@ import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
1313import { IPreimageOracle } from "interfaces/cannon/IPreimageOracle.sol " ;
1414import { IMIPS } from "interfaces/cannon/IMIPS.sol " ;
1515import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol " ;
16-
16+ import { IAnchorStateRegistry } from " interfaces/dispute/IAnchorStateRegistry.sol " ;
1717import { OPContractsManager } from "src/L1/OPContractsManager.sol " ;
1818import { IOptimismPortal2 } from "interfaces/L1/IOptimismPortal2.sol " ;
1919import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol " ;
@@ -142,6 +142,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
142142 IL1StandardBridge internal _l1StandardBridgeImpl;
143143 IOptimismMintableERC20Factory internal _optimismMintableERC20FactoryImpl;
144144 IDisputeGameFactory internal _disputeGameFactoryImpl;
145+ IAnchorStateRegistry internal _anchorStateRegistryImpl;
145146
146147 function set (bytes4 _sel , address _addr ) public {
147148 require (_addr != address (0 ), "DeployImplementationsOutput: cannot set zero address " );
@@ -158,6 +159,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
158159 else if (_sel == this .l1StandardBridgeImpl.selector ) _l1StandardBridgeImpl = IL1StandardBridge (payable (_addr));
159160 else if (_sel == this .optimismMintableERC20FactoryImpl.selector ) _optimismMintableERC20FactoryImpl = IOptimismMintableERC20Factory (_addr);
160161 else if (_sel == this .disputeGameFactoryImpl.selector ) _disputeGameFactoryImpl = IDisputeGameFactory (_addr);
162+ else if (_sel == this .anchorStateRegistryImpl.selector ) _anchorStateRegistryImpl = IAnchorStateRegistry (_addr);
161163 else revert ("DeployImplementationsOutput: unknown selector " );
162164 // forgefmt: disable-end
163165 }
@@ -179,7 +181,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
179181 address (this .l1ERC721BridgeImpl ()),
180182 address (this .l1StandardBridgeImpl ()),
181183 address (this .optimismMintableERC20FactoryImpl ()),
182- address (this .disputeGameFactoryImpl ())
184+ address (this .disputeGameFactoryImpl ()),
185+ address (this .anchorStateRegistryImpl ())
183186 );
184187
185188 DeployUtils.assertValidContractAddresses (Solarray.extend (addrs1, addrs2));
@@ -242,10 +245,16 @@ contract DeployImplementationsOutput is BaseDeployIO {
242245 return _disputeGameFactoryImpl;
243246 }
244247
248+ function anchorStateRegistryImpl () public view returns (IAnchorStateRegistry) {
249+ DeployUtils.assertValidContractAddress (address (_anchorStateRegistryImpl));
250+ return _anchorStateRegistryImpl;
251+ }
252+
245253 // -------- Deployment Assertions --------
246254 function assertValidDeploy (DeployImplementationsInput _dii ) public view {
247255 assertValidDelayedWETHImpl (_dii);
248256 assertValidDisputeGameFactoryImpl (_dii);
257+ assertValidAnchorStateRegistryImpl (_dii);
249258 assertValidL1CrossDomainMessengerImpl (_dii);
250259 assertValidL1ERC721BridgeImpl (_dii);
251260 assertValidL1StandardBridgeImpl (_dii);
@@ -387,6 +396,12 @@ contract DeployImplementationsOutput is BaseDeployIO {
387396
388397 require (address (factory.owner ()) == address (0 ), "DG-10 " );
389398 }
399+
400+ function assertValidAnchorStateRegistryImpl (DeployImplementationsInput) internal view {
401+ IAnchorStateRegistry registry = anchorStateRegistryImpl ();
402+
403+ DeployUtils.assertInitialized ({ _contractAddress: address (registry), _isProxy: false , _slot: 0 , _offset: 0 });
404+ }
390405}
391406
392407contract DeployImplementations is Script {
@@ -406,6 +421,7 @@ contract DeployImplementations is Script {
406421 deployPreimageOracleSingleton (_dii, _dio);
407422 deployMipsSingleton (_dii, _dio);
408423 deployDisputeGameFactoryImpl (_dio);
424+ deployAnchorStateRegistryImpl (_dio);
409425
410426 // Deploy the OP Contracts Manager with the new implementations set.
411427 deployOPContractsManager (_dii, _dio);
@@ -438,6 +454,7 @@ contract DeployImplementations is Script {
438454 l1CrossDomainMessengerImpl: address (_dio.l1CrossDomainMessengerImpl ()),
439455 l1StandardBridgeImpl: address (_dio.l1StandardBridgeImpl ()),
440456 disputeGameFactoryImpl: address (_dio.disputeGameFactoryImpl ()),
457+ anchorStateRegistryImpl: address (_dio.anchorStateRegistryImpl ()),
441458 delayedWETHImpl: address (_dio.delayedWETHImpl ()),
442459 mipsImpl: address (_dio.mipsSingleton ())
443460 });
@@ -569,7 +586,7 @@ contract DeployImplementations is Script {
569586 // | Contract | Proxied | Deployment | MCP Ready |
570587 // |-------------------------|---------|-----------------------------------|------------|
571588 // | DisputeGameFactory | Yes | Bespoke | Yes |
572- // | AnchorStateRegistry | Yes | Bespoke | No |
589+ // | AnchorStateRegistry | Yes | Bespoke | Yes |
573590 // | FaultDisputeGame | No | Bespoke | No | Not yet supported by OPCM
574591 // | PermissionedDisputeGame | No | Bespoke | No |
575592 // | DelayedWETH | Yes | Two bespoke (one per DisputeGame) | Yes *️⃣ |
@@ -586,6 +603,7 @@ contract DeployImplementations is Script {
586603 // here we deploy:
587604 //
588605 // - DisputeGameFactory (implementation)
606+ // - AnchorStateRegistry (implementation)
589607 // - OptimismPortal2 (implementation)
590608 // - DelayedWETH (implementation)
591609 // - PreimageOracle (singleton)
@@ -594,7 +612,6 @@ contract DeployImplementations is Script {
594612 // For contracts which are not MCP ready neither the Proxy nor the implementation can be shared, therefore they
595613 // are deployed by `DeployOpChain.s.sol`.
596614 // These are:
597- // - AnchorStateRegistry (proxy and implementation)
598615 // - FaultDisputeGame (not proxied)
599616 // - PermissionedDisputeGame (not proxied)
600617 // - DelayedWeth (proxies only)
@@ -690,6 +707,19 @@ contract DeployImplementations is Script {
690707 _dio.set (_dio.disputeGameFactoryImpl.selector , address (impl));
691708 }
692709
710+ function deployAnchorStateRegistryImpl (DeployImplementationsOutput _dio ) public virtual {
711+ vm.broadcast (msg .sender );
712+ IAnchorStateRegistry impl = IAnchorStateRegistry (
713+ DeployUtils.createDeterministic ({
714+ _name: "AnchorStateRegistry " ,
715+ _args: DeployUtils.encodeConstructor (abi.encodeCall (IAnchorStateRegistry.__constructor__, ())),
716+ _salt: _salt
717+ })
718+ );
719+ vm.label (address (impl), "AnchorStateRegistryImpl " );
720+ _dio.set (_dio.anchorStateRegistryImpl.selector , address (impl));
721+ }
722+
693723 // -------- Utilities --------
694724
695725 function etchIOContracts () public returns (DeployImplementationsInput dii_ , DeployImplementationsOutput dio_ ) {
@@ -769,6 +799,7 @@ contract DeployImplementationsInterop is DeployImplementations {
769799 l1CrossDomainMessengerImpl: address (_dio.l1CrossDomainMessengerImpl ()),
770800 l1StandardBridgeImpl: address (_dio.l1StandardBridgeImpl ()),
771801 disputeGameFactoryImpl: address (_dio.disputeGameFactoryImpl ()),
802+ anchorStateRegistryImpl: address (_dio.anchorStateRegistryImpl ()),
772803 delayedWETHImpl: address (_dio.delayedWETHImpl ()),
773804 mipsImpl: address (_dio.mipsSingleton ())
774805 });
0 commit comments