@@ -23,6 +23,7 @@ import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol";
2323import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol " ;
2424import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol " ;
2525import { IETHLockbox } from "interfaces/L1/IETHLockbox.sol " ;
26+ import { IResourceMetering } from "interfaces/L1/IResourceMetering.sol " ;
2627import { IOPContractsManagerStandardValidator } from "interfaces/L1/IOPContractsManagerStandardValidator.sol " ;
2728
2829interface IOPContractsManagerContractsContainer {
@@ -126,6 +127,117 @@ interface IOPContractsManagerInteropMigrator {
126127 function migrate (MigrateInput calldata _input ) external ;
127128}
128129
130+ interface IOPContractsManagerV2 {
131+ /// @notice Dispute game configuration for a specific game type.
132+ struct DisputeGameConfig {
133+ bool enabled;
134+ uint256 initBond;
135+ GameType gameType;
136+ bytes gameArgs;
137+ }
138+
139+ /// @notice Addresses of the deployed and wired contracts for an OP Chain.
140+ struct ChainContracts {
141+ ISystemConfig systemConfig;
142+ IProxyAdmin proxyAdmin;
143+ IAddressManager addressManager;
144+ IL1CrossDomainMessenger l1CrossDomainMessenger;
145+ IL1ERC721Bridge l1ERC721Bridge;
146+ IL1StandardBridge l1StandardBridge;
147+ IOptimismPortal2 optimismPortal;
148+ IETHLockbox ethLockbox;
149+ IOptimismMintableERC20Factory optimismMintableERC20Factory;
150+ IDisputeGameFactory disputeGameFactory;
151+ IAnchorStateRegistry anchorStateRegistry;
152+ IDelayedWETH delayedWETH;
153+ }
154+
155+ /// @notice Full configuration for deploying a new OP Chain.
156+ struct FullConfig {
157+ string saltMixer;
158+ ISuperchainConfig superchainConfig;
159+ address proxyAdminOwner;
160+ address systemConfigOwner;
161+ address unsafeBlockSigner;
162+ address batcher;
163+ Proposal startingAnchorRoot;
164+ GameType startingRespectedGameType;
165+ uint32 basefeeScalar;
166+ uint32 blobBasefeeScalar;
167+ uint64 gasLimit;
168+ uint256 l2ChainId;
169+ IResourceMetering.ResourceConfig resourceConfig;
170+ uint256 disputeMaxGameDepth;
171+ uint256 disputeSplitDepth;
172+ Duration disputeClockExtension;
173+ Duration disputeMaxClockDuration;
174+ DisputeGameConfig[] disputeGameConfigs;
175+ }
176+
177+ /// @notice Input for upgrading an existing OP Chain.
178+ struct UpgradeInput {
179+ ISystemConfig systemConfig;
180+ DisputeGameConfig[] disputeGameConfigs;
181+ }
182+
183+ /// @notice Emitted when a proxy is created.
184+ event ProxyCreation (string name , address proxy );
185+
186+ /// @notice Errors surfaced by OPContractsManagerV2.
187+ error AddressHasNoCode (address who );
188+ error BytesArrayTooLong ();
189+ error DeploymentFailed ();
190+ error EmptyInitcode ();
191+ error IdentityPrecompileCallFailed ();
192+ error NotABlueprint ();
193+ error OPContractsManagerV2_InvalidGameConfigs ();
194+ error OPContractsManagerV2_ProxyLoadBadError ();
195+ error OPContractsManagerV2_ProxyLoadBadReturn ();
196+ error OPContractsManagerV2_ProxyLoadNeedsGas ();
197+ error OPContractsManagerV2_ProxyLogOnlySelf ();
198+ error OPContractsManagerV2_ProxyMustLoad ();
199+ error OPContractsManagerV2_SuperchainConfigNeedsUpgrade ();
200+ error OPContractsManagerV2_UnsupportedGameType ();
201+ error OPContractsManager_InvalidGameType ();
202+ error ReservedBitsSet ();
203+ error SemverComp_InvalidSemverParts ();
204+ error UnexpectedPreambleData (bytes data );
205+ error UnsupportedERCVersion (uint8 version );
206+
207+ /// @notice Pseudo-constructor for CREATE2 deployment via an external deployer.
208+ function __constructor__ (IOPContractsManagerContractsContainer _container ) external ;
209+
210+ /// @notice Deploys and wires a complete OP Chain per the provided configuration.
211+ function deploy (FullConfig memory _cfg ) external returns (ChainContracts memory );
212+
213+ /// @notice Upgrades contracts on an existing OP Chain per the provided input.
214+ function upgrade (UpgradeInput memory _inp ) external returns (ChainContracts memory );
215+
216+ /// @notice Returns the contracts container used by this manager.
217+ function contractsContainer () external view returns (IOPContractsManagerContractsContainer);
218+
219+ /// @notice Returns the blueprint contract addresses used for deployment.
220+ function blueprints () external view returns (IOPContractsManager.Blueprints memory );
221+
222+ /// @notice Returns the implementation contract addresses used for wiring proxies.
223+ function implementations () external view returns (IOPContractsManager.Implementations memory );
224+
225+ /// @notice Retrieves the development feature bitmap stored in this contract.
226+ function devFeatureBitmap () external view returns (bytes32 );
227+
228+ /// @notice Returns whether a development feature is enabled.
229+ function isDevFeatureEnabled (bytes32 _feature ) external view returns (bool );
230+
231+ /// @notice Computes the L1 batch inbox address for an L2 chain ID.
232+ function chainIdToBatchInboxAddress (uint256 _l2ChainId ) external pure returns (address );
233+
234+ /// @notice Asserts an address is a deployed contract address.
235+ function assertValidContractAddress (address _who ) external view ;
236+
237+ /// @notice Emits a ProxyCreation event for a new proxy (internal tooling hook).
238+ function logProxyCreation (string calldata _name , address _proxy ) external ;
239+ }
240+
129241interface IOPContractsManager {
130242 // -------- Structs --------
131243
@@ -216,6 +328,7 @@ interface IOPContractsManager {
216328 address permissionedDisputeGameV2Impl;
217329 address superFaultDisputeGameImpl;
218330 address superPermissionedDisputeGameImpl;
331+ address storageSetterImpl;
219332 }
220333
221334 /// @notice The input required to identify a chain for upgrading.
@@ -302,6 +415,10 @@ interface IOPContractsManager {
302415
303416 error InvalidDevFeatureAccess (bytes32 devFeature );
304417
418+ error MissingPermissionedDisputeGame ();
419+
420+ event Deployed (uint256 indexed l2ChainId , address indexed deployer , bytes deployOutput );
421+
305422 // -------- Methods --------
306423
307424 function __constructor__ (
@@ -310,6 +427,7 @@ interface IOPContractsManager {
310427 IOPContractsManagerUpgrader _opcmUpgrader ,
311428 IOPContractsManagerInteropMigrator _opcmInteropMigrator ,
312429 IOPContractsManagerStandardValidator _opcmStandardValidator ,
430+ IOPContractsManagerV2 _opcmV2 ,
313431 ISuperchainConfig _superchainConfig ,
314432 IProtocolVersions _protocolVersions
315433 )
@@ -391,6 +509,8 @@ interface IOPContractsManager {
391509
392510 function opcmStandardValidator () external view returns (IOPContractsManagerStandardValidator);
393511
512+ function opcmV2 () external view returns (IOPContractsManagerV2);
513+
394514 /// @notice Retrieves the development feature bitmap stored in this OPCM contract
395515 /// @return The development feature bitmap.
396516 function devFeatureBitmap () external view returns (bytes32 );
0 commit comments