Commit 6ba2ac0d authored by Maurelian's avatar Maurelian Committed by GitHub

Interfaces in OPCM and OPCMInterop (#12188)

* Updates to OPCM and OPCMInterop

* Update DeployImpls and OPCM Tests

* remove some unused imports

* Undo mapping type change

* Undo DeployOutput type change

* Semver and snapshots
parent 5eaac1de
...@@ -7,6 +7,7 @@ import { LibString } from "@solady/utils/LibString.sol"; ...@@ -7,6 +7,7 @@ import { LibString } from "@solady/utils/LibString.sol";
import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol"; import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol";
import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { IProtocolVersions } from "src/L1/interfaces/IProtocolVersions.sol";
import { ISystemConfigV160 } from "src/L1/interfaces/ISystemConfigV160.sol"; import { ISystemConfigV160 } from "src/L1/interfaces/ISystemConfigV160.sol";
import { IL1CrossDomainMessengerV160 } from "src/L1/interfaces/IL1CrossDomainMessengerV160.sol"; import { IL1CrossDomainMessengerV160 } from "src/L1/interfaces/IL1CrossDomainMessengerV160.sol";
import { IL1StandardBridgeV160 } from "src/L1/interfaces/IL1StandardBridgeV160.sol"; import { IL1StandardBridgeV160 } from "src/L1/interfaces/IL1StandardBridgeV160.sol";
...@@ -29,8 +30,6 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol"; ...@@ -29,8 +30,6 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { AnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol"; import { AnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol"; import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { OPContractsManager } from "src/L1/OPContractsManager.sol"; import { OPContractsManager } from "src/L1/OPContractsManager.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol";
...@@ -62,8 +61,8 @@ contract DeployImplementationsInput is BaseDeployIO { ...@@ -62,8 +61,8 @@ contract DeployImplementationsInput is BaseDeployIO {
string internal _release; string internal _release;
// Outputs from DeploySuperchain.s.sol. // Outputs from DeploySuperchain.s.sol.
SuperchainConfig internal _superchainConfigProxy; ISuperchainConfig internal _superchainConfigProxy;
ProtocolVersions internal _protocolVersionsProxy; IProtocolVersions internal _protocolVersionsProxy;
string internal _standardVersionsToml; string internal _standardVersionsToml;
...@@ -97,8 +96,8 @@ contract DeployImplementationsInput is BaseDeployIO { ...@@ -97,8 +96,8 @@ contract DeployImplementationsInput is BaseDeployIO {
function set(bytes4 _sel, address _addr) public { function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployImplementationsInput: cannot set zero address"); require(_addr != address(0), "DeployImplementationsInput: cannot set zero address");
if (_sel == this.superchainConfigProxy.selector) _superchainConfigProxy = SuperchainConfig(_addr); if (_sel == this.superchainConfigProxy.selector) _superchainConfigProxy = ISuperchainConfig(_addr);
else if (_sel == this.protocolVersionsProxy.selector) _protocolVersionsProxy = ProtocolVersions(_addr); else if (_sel == this.protocolVersionsProxy.selector) _protocolVersionsProxy = IProtocolVersions(_addr);
else if (_sel == this.opcmProxyOwner.selector) _opcmProxyOwner = _addr; else if (_sel == this.opcmProxyOwner.selector) _opcmProxyOwner = _addr;
else revert("DeployImplementationsInput: unknown selector"); else revert("DeployImplementationsInput: unknown selector");
} }
...@@ -151,12 +150,12 @@ contract DeployImplementationsInput is BaseDeployIO { ...@@ -151,12 +150,12 @@ contract DeployImplementationsInput is BaseDeployIO {
return _standardVersionsToml; return _standardVersionsToml;
} }
function superchainConfigProxy() public view returns (SuperchainConfig) { function superchainConfigProxy() public view returns (ISuperchainConfig) {
require(address(_superchainConfigProxy) != address(0), "DeployImplementationsInput: not set"); require(address(_superchainConfigProxy) != address(0), "DeployImplementationsInput: not set");
return _superchainConfigProxy; return _superchainConfigProxy;
} }
function protocolVersionsProxy() public view returns (ProtocolVersions) { function protocolVersionsProxy() public view returns (IProtocolVersions) {
require(address(_protocolVersionsProxy) != address(0), "DeployImplementationsInput: not set"); require(address(_protocolVersionsProxy) != address(0), "DeployImplementationsInput: not set");
return _protocolVersionsProxy; return _protocolVersionsProxy;
} }
...@@ -777,8 +776,8 @@ contract DeployImplementations is Script { ...@@ -777,8 +776,8 @@ contract DeployImplementations is Script {
public public
virtual virtual
{ {
SuperchainConfig superchainConfigProxy = _dii.superchainConfigProxy(); ISuperchainConfig superchainConfigProxy = _dii.superchainConfigProxy();
ProtocolVersions protocolVersionsProxy = _dii.protocolVersionsProxy(); IProtocolVersions protocolVersionsProxy = _dii.protocolVersionsProxy();
vm.broadcast(msg.sender); vm.broadcast(msg.sender);
// TODO: Eventually we will want to select the correct implementation based on the release. // TODO: Eventually we will want to select the correct implementation based on the release.
...@@ -1147,8 +1146,8 @@ contract DeployImplementationsInterop is DeployImplementations { ...@@ -1147,8 +1146,8 @@ contract DeployImplementationsInterop is DeployImplementations {
public public
override override
{ {
SuperchainConfig superchainConfigProxy = _dii.superchainConfigProxy(); ISuperchainConfig superchainConfigProxy = _dii.superchainConfigProxy();
ProtocolVersions protocolVersionsProxy = _dii.protocolVersionsProxy(); IProtocolVersions protocolVersionsProxy = _dii.protocolVersionsProxy();
vm.broadcast(msg.sender); vm.broadcast(msg.sender);
// TODO: Eventually we will want to select the correct implementation based on the release. // TODO: Eventually we will want to select the correct implementation based on the release.
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649" "sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
}, },
"src/L1/OPContractsManager.sol": { "src/L1/OPContractsManager.sol": {
"initCodeHash": "0xf64b41f5ec9a94ddbac484f2bdcb5792bf71e66ed6197d172cfd4592311f9b85", "initCodeHash": "0xa0c1139a01cef2445266c71175eff2d36e4b3a7584b198835ed8cba4f7143704",
"sourceCodeHash": "0x0ac3668c5f1ccbd49713a4e079f0dafb5cc45eca8de33e0faf0f01b1b989da89" "sourceCodeHash": "0x67f9846a215d0817a75b4beee50925861d14da2cab1b699bb4e8ae89fa12d01b"
}, },
"src/L1/OptimismPortal.sol": { "src/L1/OptimismPortal.sol": {
"initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190", "initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190",
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "contract SuperchainConfig", "internalType": "contract ISuperchainConfig",
"name": "_superchainConfig", "name": "_superchainConfig",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract ProtocolVersions", "internalType": "contract IProtocolVersions",
"name": "_protocolVersions", "name": "_protocolVersions",
"type": "address" "type": "address"
} }
...@@ -184,17 +184,17 @@ ...@@ -184,17 +184,17 @@
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract AddressManager", "internalType": "contract IAddressManager",
"name": "addressManager", "name": "addressManager",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract L1ERC721Bridge", "internalType": "contract IL1ERC721Bridge",
"name": "l1ERC721BridgeProxy", "name": "l1ERC721BridgeProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract SystemConfig", "internalType": "contract ISystemConfig",
"name": "systemConfigProxy", "name": "systemConfigProxy",
"type": "address" "type": "address"
}, },
...@@ -204,52 +204,52 @@ ...@@ -204,52 +204,52 @@
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract L1StandardBridge", "internalType": "contract IL1StandardBridge",
"name": "l1StandardBridgeProxy", "name": "l1StandardBridgeProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract L1CrossDomainMessenger", "internalType": "contract IL1CrossDomainMessenger",
"name": "l1CrossDomainMessengerProxy", "name": "l1CrossDomainMessengerProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract OptimismPortal2", "internalType": "contract IOptimismPortal2",
"name": "optimismPortalProxy", "name": "optimismPortalProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract DisputeGameFactory", "internalType": "contract IDisputeGameFactory",
"name": "disputeGameFactoryProxy", "name": "disputeGameFactoryProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract AnchorStateRegistry", "internalType": "contract IAnchorStateRegistry",
"name": "anchorStateRegistryProxy", "name": "anchorStateRegistryProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract AnchorStateRegistry", "internalType": "contract IAnchorStateRegistry",
"name": "anchorStateRegistryImpl", "name": "anchorStateRegistryImpl",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract FaultDisputeGame", "internalType": "contract IFaultDisputeGame",
"name": "faultDisputeGame", "name": "faultDisputeGame",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract PermissionedDisputeGame", "internalType": "contract IPermissionedDisputeGame",
"name": "permissionedDisputeGame", "name": "permissionedDisputeGame",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract DelayedWETH", "internalType": "contract IDelayedWETH",
"name": "delayedWETHPermissionedGameProxy", "name": "delayedWETHPermissionedGameProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract DelayedWETH", "internalType": "contract IDelayedWETH",
"name": "delayedWETHPermissionlessGameProxy", "name": "delayedWETHPermissionlessGameProxy",
"type": "address" "type": "address"
} }
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
"name": "protocolVersions", "name": "protocolVersions",
"outputs": [ "outputs": [
{ {
"internalType": "contract ProtocolVersions", "internalType": "contract IProtocolVersions",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
"name": "superchainConfig", "name": "superchainConfig",
"outputs": [ "outputs": [
{ {
"internalType": "contract SuperchainConfig", "internalType": "contract ISuperchainConfig",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -442,7 +442,7 @@ ...@@ -442,7 +442,7 @@
"name": "systemConfigs", "name": "systemConfigs",
"outputs": [ "outputs": [
{ {
"internalType": "contract SystemConfig", "internalType": "contract ISystemConfig",
"name": "", "name": "",
"type": "address" "type": "address"
} }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
{ {
"inputs": [ "inputs": [
{ {
"internalType": "contract SuperchainConfig", "internalType": "contract ISuperchainConfig",
"name": "_superchainConfig", "name": "_superchainConfig",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract ProtocolVersions", "internalType": "contract IProtocolVersions",
"name": "_protocolVersions", "name": "_protocolVersions",
"type": "address" "type": "address"
} }
...@@ -184,17 +184,17 @@ ...@@ -184,17 +184,17 @@
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract AddressManager", "internalType": "contract IAddressManager",
"name": "addressManager", "name": "addressManager",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract L1ERC721Bridge", "internalType": "contract IL1ERC721Bridge",
"name": "l1ERC721BridgeProxy", "name": "l1ERC721BridgeProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract SystemConfig", "internalType": "contract ISystemConfig",
"name": "systemConfigProxy", "name": "systemConfigProxy",
"type": "address" "type": "address"
}, },
...@@ -204,52 +204,52 @@ ...@@ -204,52 +204,52 @@
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract L1StandardBridge", "internalType": "contract IL1StandardBridge",
"name": "l1StandardBridgeProxy", "name": "l1StandardBridgeProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract L1CrossDomainMessenger", "internalType": "contract IL1CrossDomainMessenger",
"name": "l1CrossDomainMessengerProxy", "name": "l1CrossDomainMessengerProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract OptimismPortal2", "internalType": "contract IOptimismPortal2",
"name": "optimismPortalProxy", "name": "optimismPortalProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract DisputeGameFactory", "internalType": "contract IDisputeGameFactory",
"name": "disputeGameFactoryProxy", "name": "disputeGameFactoryProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract AnchorStateRegistry", "internalType": "contract IAnchorStateRegistry",
"name": "anchorStateRegistryProxy", "name": "anchorStateRegistryProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract AnchorStateRegistry", "internalType": "contract IAnchorStateRegistry",
"name": "anchorStateRegistryImpl", "name": "anchorStateRegistryImpl",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract FaultDisputeGame", "internalType": "contract IFaultDisputeGame",
"name": "faultDisputeGame", "name": "faultDisputeGame",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract PermissionedDisputeGame", "internalType": "contract IPermissionedDisputeGame",
"name": "permissionedDisputeGame", "name": "permissionedDisputeGame",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract DelayedWETH", "internalType": "contract IDelayedWETH",
"name": "delayedWETHPermissionedGameProxy", "name": "delayedWETHPermissionedGameProxy",
"type": "address" "type": "address"
}, },
{ {
"internalType": "contract DelayedWETH", "internalType": "contract IDelayedWETH",
"name": "delayedWETHPermissionlessGameProxy", "name": "delayedWETHPermissionlessGameProxy",
"type": "address" "type": "address"
} }
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
"name": "protocolVersions", "name": "protocolVersions",
"outputs": [ "outputs": [
{ {
"internalType": "contract ProtocolVersions", "internalType": "contract IProtocolVersions",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
"name": "superchainConfig", "name": "superchainConfig",
"outputs": [ "outputs": [
{ {
"internalType": "contract SuperchainConfig", "internalType": "contract ISuperchainConfig",
"name": "", "name": "",
"type": "address" "type": "address"
} }
...@@ -442,7 +442,7 @@ ...@@ -442,7 +442,7 @@
"name": "systemConfigs", "name": "systemConfigs",
"outputs": [ "outputs": [
{ {
"internalType": "contract SystemConfig", "internalType": "contract ISystemConfig",
"name": "", "name": "",
"type": "address" "type": "address"
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"label": "systemConfigs", "label": "systemConfigs",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "mapping(uint256 => contract SystemConfig)" "type": "mapping(uint256 => contract ISystemConfig)"
}, },
{ {
"bytes": "256", "bytes": "256",
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"label": "systemConfigs", "label": "systemConfigs",
"offset": 0, "offset": 0,
"slot": "3", "slot": "3",
"type": "mapping(uint256 => contract SystemConfig)" "type": "mapping(uint256 => contract ISystemConfig)"
}, },
{ {
"bytes": "256", "bytes": "256",
......
...@@ -15,30 +15,26 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol"; ...@@ -15,30 +15,26 @@ import { IDisputeGame } from "src/dispute/interfaces/IDisputeGame.sol";
import { ISystemConfigV160 } from "src/L1/interfaces/ISystemConfigV160.sol"; import { ISystemConfigV160 } from "src/L1/interfaces/ISystemConfigV160.sol";
import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol"; import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol";
import { Proxy } from "src/universal/Proxy.sol";
import { ProxyAdmin } from "src/universal/ProxyAdmin.sol"; import { ProxyAdmin } from "src/universal/ProxyAdmin.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { L1ChugSplashProxy } from "src/legacy/L1ChugSplashProxy.sol"; import { L1ChugSplashProxy } from "src/legacy/L1ChugSplashProxy.sol";
import { ResolvedDelegateProxy } from "src/legacy/ResolvedDelegateProxy.sol"; import { ResolvedDelegateProxy } from "src/legacy/ResolvedDelegateProxy.sol";
import { AddressManager } from "src/legacy/AddressManager.sol";
import { DelayedWETH } from "src/dispute/DelayedWETH.sol"; import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol";
import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol"; import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol";
import { AnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol"; import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol";
import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol"; import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol"; import { IPermissionedDisputeGame } from "src/dispute/interfaces/IPermissionedDisputeGame.sol";
import { Claim, Duration, GameType, GameTypes } from "src/dispute/lib/Types.sol"; import { Claim, Duration, GameType, GameTypes } from "src/dispute/lib/Types.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { IProtocolVersions } from "src/L1/interfaces/IProtocolVersions.sol";
import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; import { IOptimismPortal2 } from "src/L1/interfaces/IOptimismPortal2.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol"; import { ISystemConfigV160 } from "src/L1/interfaces/ISystemConfigV160.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { IL1CrossDomainMessenger } from "src/L1/interfaces/IL1CrossDomainMessenger.sol";
import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol"; import { IL1ERC721Bridge } from "src/L1/interfaces/IL1ERC721Bridge.sol";
import { L1StandardBridge } from "src/L1/L1StandardBridge.sol"; import { IL1StandardBridge } from "src/L1/interfaces/IL1StandardBridge.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol"; import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
/// @custom:proxied true /// @custom:proxied true
...@@ -71,21 +67,21 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -71,21 +67,21 @@ contract OPContractsManager is ISemver, Initializable {
/// @notice The full set of outputs from deploying a new OP Stack chain. /// @notice The full set of outputs from deploying a new OP Stack chain.
struct DeployOutput { struct DeployOutput {
ProxyAdmin opChainProxyAdmin; ProxyAdmin opChainProxyAdmin;
AddressManager addressManager; IAddressManager addressManager;
L1ERC721Bridge l1ERC721BridgeProxy; IL1ERC721Bridge l1ERC721BridgeProxy;
SystemConfig systemConfigProxy; ISystemConfig systemConfigProxy;
OptimismMintableERC20Factory optimismMintableERC20FactoryProxy; OptimismMintableERC20Factory optimismMintableERC20FactoryProxy;
L1StandardBridge l1StandardBridgeProxy; IL1StandardBridge l1StandardBridgeProxy;
L1CrossDomainMessenger l1CrossDomainMessengerProxy; IL1CrossDomainMessenger l1CrossDomainMessengerProxy;
// Fault proof contracts below. // Fault proof contracts below.
OptimismPortal2 optimismPortalProxy; IOptimismPortal2 optimismPortalProxy;
DisputeGameFactory disputeGameFactoryProxy; IDisputeGameFactory disputeGameFactoryProxy;
AnchorStateRegistry anchorStateRegistryProxy; IAnchorStateRegistry anchorStateRegistryProxy;
AnchorStateRegistry anchorStateRegistryImpl; IAnchorStateRegistry anchorStateRegistryImpl;
FaultDisputeGame faultDisputeGame; IFaultDisputeGame faultDisputeGame;
PermissionedDisputeGame permissionedDisputeGame; IPermissionedDisputeGame permissionedDisputeGame;
DelayedWETH delayedWETHPermissionedGameProxy; IDelayedWETH delayedWETHPermissionedGameProxy;
DelayedWETH delayedWETHPermissionlessGameProxy; IDelayedWETH delayedWETHPermissionlessGameProxy;
} }
/// @notice The logic address and initializer selector for an implementation contract. /// @notice The logic address and initializer selector for an implementation contract.
...@@ -128,18 +124,18 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -128,18 +124,18 @@ contract OPContractsManager is ISemver, Initializable {
// -------- Constants and Variables -------- // -------- Constants and Variables --------
/// @custom:semver 1.0.0-beta.16 /// @custom:semver 1.0.0-beta.17
string public constant version = "1.0.0-beta.16"; string public constant version = "1.0.0-beta.17";
/// @notice Represents the interface version so consumers know how to decode the DeployOutput struct /// @notice Represents the interface version so consumers know how to decode the DeployOutput struct
/// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used. /// that's emitted in the `Deployed` event. Whenever that struct changes, a new version should be used.
uint256 public constant OUTPUT_VERSION = 0; uint256 public constant OUTPUT_VERSION = 0;
/// @notice Address of the SuperchainConfig contract shared by all chains. /// @notice Address of the SuperchainConfig contract shared by all chains.
SuperchainConfig public immutable superchainConfig; ISuperchainConfig public immutable superchainConfig;
/// @notice Address of the ProtocolVersions contract shared by all chains. /// @notice Address of the ProtocolVersions contract shared by all chains.
ProtocolVersions public immutable protocolVersions; IProtocolVersions public immutable protocolVersions;
/// @notice The latest release of the OP Contracts Manager, as a string of the format `op-contracts/vX.Y.Z`. /// @notice The latest release of the OP Contracts Manager, as a string of the format `op-contracts/vX.Y.Z`.
string public latestRelease; string public latestRelease;
...@@ -148,7 +144,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -148,7 +144,7 @@ contract OPContractsManager is ISemver, Initializable {
mapping(string => mapping(string => Implementation)) public implementations; mapping(string => mapping(string => Implementation)) public implementations;
/// @notice Maps an L2 Chain ID to the SystemConfig for that chain. /// @notice Maps an L2 Chain ID to the SystemConfig for that chain.
mapping(uint256 => SystemConfig) public systemConfigs; mapping(uint256 => ISystemConfig) public systemConfigs;
/// @notice Addresses of the Blueprint contracts. /// @notice Addresses of the Blueprint contracts.
/// This is internal because if public the autogenerated getter method would return a tuple of /// This is internal because if public the autogenerated getter method would return a tuple of
...@@ -198,7 +194,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -198,7 +194,7 @@ contract OPContractsManager is ISemver, Initializable {
/// @notice OPCM is proxied. Therefore the `initialize` function replaces most constructor logic for this contract. /// @notice OPCM is proxied. Therefore the `initialize` function replaces most constructor logic for this contract.
constructor(SuperchainConfig _superchainConfig, ProtocolVersions _protocolVersions) { constructor(ISuperchainConfig _superchainConfig, IProtocolVersions _protocolVersions) {
assertValidContractAddress(address(_superchainConfig)); assertValidContractAddress(address(_superchainConfig));
assertValidContractAddress(address(_protocolVersions)); assertValidContractAddress(address(_protocolVersions));
superchainConfig = _superchainConfig; superchainConfig = _superchainConfig;
...@@ -238,36 +234,36 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -238,36 +234,36 @@ contract OPContractsManager is ISemver, Initializable {
// this contract, and then transfer ownership to the specified owner at the end of deployment. // this contract, and then transfer ownership to the specified owner at the end of deployment.
// The AddressManager is used to store the implementation for the L1CrossDomainMessenger // The AddressManager is used to store the implementation for the L1CrossDomainMessenger
// due to it's usage of the legacy ResolvedDelegateProxy. // due to it's usage of the legacy ResolvedDelegateProxy.
output.addressManager = AddressManager(Blueprint.deployFrom(blueprint.addressManager, salt)); output.addressManager = IAddressManager(Blueprint.deployFrom(blueprint.addressManager, salt));
output.opChainProxyAdmin = output.opChainProxyAdmin =
ProxyAdmin(Blueprint.deployFrom(blueprint.proxyAdmin, salt, abi.encode(address(this)))); ProxyAdmin(Blueprint.deployFrom(blueprint.proxyAdmin, salt, abi.encode(address(this))));
output.opChainProxyAdmin.setAddressManager(IAddressManager(address(output.addressManager))); output.opChainProxyAdmin.setAddressManager(output.addressManager);
// -------- Deploy Proxy Contracts -------- // -------- Deploy Proxy Contracts --------
// Deploy ERC-1967 proxied contracts. // Deploy ERC-1967 proxied contracts.
output.l1ERC721BridgeProxy = output.l1ERC721BridgeProxy =
L1ERC721Bridge(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "L1ERC721Bridge")); IL1ERC721Bridge(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "L1ERC721Bridge"));
output.optimismPortalProxy = output.optimismPortalProxy =
OptimismPortal2(payable(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismPortal"))); IOptimismPortal2(payable(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismPortal")));
output.systemConfigProxy = output.systemConfigProxy =
SystemConfig(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "SystemConfig")); ISystemConfig(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "SystemConfig"));
output.optimismMintableERC20FactoryProxy = OptimismMintableERC20Factory( output.optimismMintableERC20FactoryProxy = OptimismMintableERC20Factory(
deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismMintableERC20Factory") deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "OptimismMintableERC20Factory")
); );
output.disputeGameFactoryProxy = output.disputeGameFactoryProxy =
DisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DisputeGameFactory")); IDisputeGameFactory(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DisputeGameFactory"));
output.anchorStateRegistryProxy = output.anchorStateRegistryProxy =
AnchorStateRegistry(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "AnchorStateRegistry")); IAnchorStateRegistry(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "AnchorStateRegistry"));
// Deploy legacy proxied contracts. // Deploy legacy proxied contracts.
output.l1StandardBridgeProxy = L1StandardBridge( output.l1StandardBridgeProxy = IL1StandardBridge(
payable(Blueprint.deployFrom(blueprint.l1ChugSplashProxy, salt, abi.encode(output.opChainProxyAdmin))) payable(Blueprint.deployFrom(blueprint.l1ChugSplashProxy, salt, abi.encode(output.opChainProxyAdmin)))
); );
output.opChainProxyAdmin.setProxyType(address(output.l1StandardBridgeProxy), ProxyAdmin.ProxyType.CHUGSPLASH); output.opChainProxyAdmin.setProxyType(address(output.l1StandardBridgeProxy), ProxyAdmin.ProxyType.CHUGSPLASH);
string memory contractName = "OVM_L1CrossDomainMessenger"; string memory contractName = "OVM_L1CrossDomainMessenger";
output.l1CrossDomainMessengerProxy = L1CrossDomainMessenger( output.l1CrossDomainMessengerProxy = IL1CrossDomainMessenger(
Blueprint.deployFrom(blueprint.resolvedDelegateProxy, salt, abi.encode(output.addressManager, contractName)) Blueprint.deployFrom(blueprint.resolvedDelegateProxy, salt, abi.encode(output.addressManager, contractName))
); );
output.opChainProxyAdmin.setProxyType( output.opChainProxyAdmin.setProxyType(
...@@ -280,17 +276,17 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -280,17 +276,17 @@ contract OPContractsManager is ISemver, Initializable {
// The AnchorStateRegistry Implementation is not MCP Ready, and therefore requires an implementation per chain. // The AnchorStateRegistry Implementation is not MCP Ready, and therefore requires an implementation per chain.
// It must be deployed after the DisputeGameFactoryProxy so that it can be provided as a constructor argument. // It must be deployed after the DisputeGameFactoryProxy so that it can be provided as a constructor argument.
output.anchorStateRegistryImpl = AnchorStateRegistry( output.anchorStateRegistryImpl = IAnchorStateRegistry(
Blueprint.deployFrom(blueprint.anchorStateRegistry, salt, abi.encode(output.disputeGameFactoryProxy)) Blueprint.deployFrom(blueprint.anchorStateRegistry, salt, abi.encode(output.disputeGameFactoryProxy))
); );
// Eventually we will switch from DelayedWETHPermissionedGameProxy to DelayedWETHPermissionlessGameProxy. // Eventually we will switch from DelayedWETHPermissionedGameProxy to DelayedWETHPermissionlessGameProxy.
output.delayedWETHPermissionedGameProxy = DelayedWETH( output.delayedWETHPermissionedGameProxy = IDelayedWETH(
payable(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DelayedWETHPermissionedGame")) payable(deployProxy(l2ChainId, output.opChainProxyAdmin, saltMixer, "DelayedWETHPermissionedGame"))
); );
// While not a proxy, we deploy the PermissionedDisputeGame here as well because it's bespoke per chain. // While not a proxy, we deploy the PermissionedDisputeGame here as well because it's bespoke per chain.
output.permissionedDisputeGame = PermissionedDisputeGame( output.permissionedDisputeGame = IPermissionedDisputeGame(
Blueprint.deployFrom( Blueprint.deployFrom(
blueprint.permissionedDisputeGame1, blueprint.permissionedDisputeGame1,
blueprint.permissionedDisputeGame2, blueprint.permissionedDisputeGame2,
...@@ -345,7 +341,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -345,7 +341,7 @@ contract OPContractsManager is ISemver, Initializable {
output.disputeGameFactoryProxy.transferOwnership(address(_input.roles.opChainProxyAdminOwner)); output.disputeGameFactoryProxy.transferOwnership(address(_input.roles.opChainProxyAdminOwner));
impl.logic = address(output.anchorStateRegistryImpl); impl.logic = address(output.anchorStateRegistryImpl);
impl.initializer = AnchorStateRegistry.initialize.selector; impl.initializer = IAnchorStateRegistry.initialize.selector;
data = encodeAnchorStateRegistryInitializer(impl.initializer, _input); data = encodeAnchorStateRegistryInitializer(impl.initializer, _input);
upgradeAndCall(output.opChainProxyAdmin, address(output.anchorStateRegistryProxy), impl.logic, data); upgradeAndCall(output.opChainProxyAdmin, address(output.anchorStateRegistryProxy), impl.logic, data);
...@@ -461,7 +457,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -461,7 +457,7 @@ contract OPContractsManager is ISemver, Initializable {
if (keccak256(abi.encode(semver)) == keccak256(abi.encode(string("2.2.0")))) { if (keccak256(abi.encode(semver)) == keccak256(abi.encode(string("2.2.0")))) {
// We are using the op-contracts/v1.6.0 SystemConfig contract. // We are using the op-contracts/v1.6.0 SystemConfig contract.
( (
ResourceMetering.ResourceConfig memory referenceResourceConfig, IResourceMetering.ResourceConfig memory referenceResourceConfig,
ISystemConfigV160.Addresses memory opChainAddrs ISystemConfigV160.Addresses memory opChainAddrs
) = defaultSystemConfigV160Params(_selector, _input, _output); ) = defaultSystemConfigV160Params(_selector, _input, _output);
...@@ -479,8 +475,10 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -479,8 +475,10 @@ contract OPContractsManager is ISemver, Initializable {
); );
} else { } else {
// We are using the latest SystemConfig contract from the repo. // We are using the latest SystemConfig contract from the repo.
(ResourceMetering.ResourceConfig memory referenceResourceConfig, SystemConfig.Addresses memory opChainAddrs) (
= defaultSystemConfigParams(_selector, _input, _output); IResourceMetering.ResourceConfig memory referenceResourceConfig,
ISystemConfig.Addresses memory opChainAddrs
) = defaultSystemConfigParams(_selector, _input, _output);
return abi.encodeWithSelector( return abi.encodeWithSelector(
_selector, _selector,
...@@ -563,8 +561,8 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -563,8 +561,8 @@ contract OPContractsManager is ISemver, Initializable {
returns (bytes memory) returns (bytes memory)
{ {
// this line fails in the op-deployer tests because it is not passing in any data // this line fails in the op-deployer tests because it is not passing in any data
AnchorStateRegistry.StartingAnchorRoot[] memory startingAnchorRoots = IAnchorStateRegistry.StartingAnchorRoot[] memory startingAnchorRoots =
abi.decode(_input.startingAnchorRoots, (AnchorStateRegistry.StartingAnchorRoot[])); abi.decode(_input.startingAnchorRoots, (IAnchorStateRegistry.StartingAnchorRoot[]));
return abi.encodeWithSelector(_selector, startingAnchorRoots, superchainConfig); return abi.encodeWithSelector(_selector, startingAnchorRoots, superchainConfig);
} }
...@@ -615,7 +613,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -615,7 +613,7 @@ contract OPContractsManager is ISemver, Initializable {
internal internal
view view
virtual virtual
returns (ResourceMetering.ResourceConfig memory resourceConfig_, SystemConfig.Addresses memory opChainAddrs_) returns (IResourceMetering.ResourceConfig memory resourceConfig_, ISystemConfig.Addresses memory opChainAddrs_)
{ {
// We use assembly to easily convert from IResourceMetering.ResourceConfig to ResourceMetering.ResourceConfig. // We use assembly to easily convert from IResourceMetering.ResourceConfig to ResourceMetering.ResourceConfig.
// This is required because we have not yet fully migrated the codebase to be interface-based. // This is required because we have not yet fully migrated the codebase to be interface-based.
...@@ -624,7 +622,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -624,7 +622,7 @@ contract OPContractsManager is ISemver, Initializable {
resourceConfig_ := resourceConfig resourceConfig_ := resourceConfig
} }
opChainAddrs_ = SystemConfig.Addresses({ opChainAddrs_ = ISystemConfig.Addresses({
l1CrossDomainMessenger: address(_output.l1CrossDomainMessengerProxy), l1CrossDomainMessenger: address(_output.l1CrossDomainMessengerProxy),
l1ERC721Bridge: address(_output.l1ERC721BridgeProxy), l1ERC721Bridge: address(_output.l1ERC721BridgeProxy),
l1StandardBridge: address(_output.l1StandardBridgeProxy), l1StandardBridge: address(_output.l1StandardBridgeProxy),
...@@ -653,7 +651,7 @@ contract OPContractsManager is ISemver, Initializable { ...@@ -653,7 +651,7 @@ contract OPContractsManager is ISemver, Initializable {
view view
virtual virtual
returns ( returns (
ResourceMetering.ResourceConfig memory resourceConfig_, IResourceMetering.ResourceConfig memory resourceConfig_,
ISystemConfigV160.Addresses memory opChainAddrs_ ISystemConfigV160.Addresses memory opChainAddrs_
) )
{ {
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
pragma solidity 0.8.15; pragma solidity 0.8.15;
import { OPContractsManager } from "src/L1/OPContractsManager.sol"; import { OPContractsManager } from "src/L1/OPContractsManager.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { IProtocolVersions } from "src/L1/interfaces/IProtocolVersions.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol"; import { IResourceMetering } from "src/L1/interfaces/IResourceMetering.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol"; import { ISystemConfigInterop } from "src/L1/interfaces/ISystemConfigInterop.sol";
/// @custom:proxied true /// @custom:proxied true
contract OPContractsManagerInterop is OPContractsManager { contract OPContractsManagerInterop is OPContractsManager {
constructor( constructor(
SuperchainConfig _superchainConfig, ISuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions IProtocolVersions _protocolVersions
) )
OPContractsManager(_superchainConfig, _protocolVersions) OPContractsManager(_superchainConfig, _protocolVersions)
{ } { }
...@@ -30,7 +30,7 @@ contract OPContractsManagerInterop is OPContractsManager { ...@@ -30,7 +30,7 @@ contract OPContractsManagerInterop is OPContractsManager {
override override
returns (bytes memory) returns (bytes memory)
{ {
(ResourceMetering.ResourceConfig memory referenceResourceConfig, SystemConfig.Addresses memory opChainAddrs) = (IResourceMetering.ResourceConfig memory referenceResourceConfig, ISystemConfig.Addresses memory opChainAddrs) =
defaultSystemConfigParams(_selector, _input, _output); defaultSystemConfigParams(_selector, _input, _output);
// TODO For now we assume that the dependency manager is the same as the proxy admin owner. // TODO For now we assume that the dependency manager is the same as the proxy admin owner.
......
...@@ -9,13 +9,15 @@ import { DeployOPChain_TestBase } from "test/opcm/DeployOPChain.t.sol"; ...@@ -9,13 +9,15 @@ import { DeployOPChain_TestBase } from "test/opcm/DeployOPChain.t.sol";
import { OPContractsManager } from "src/L1/OPContractsManager.sol"; import { OPContractsManager } from "src/L1/OPContractsManager.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
import { IProtocolVersions } from "src/L1/interfaces/IProtocolVersions.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol";
// Exposes internal functions for testing. // Exposes internal functions for testing.
contract OPContractsManager_Harness is OPContractsManager { contract OPContractsManager_Harness is OPContractsManager {
constructor( constructor(
SuperchainConfig _superchainConfig, ISuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions IProtocolVersions _protocolVersions
) )
OPContractsManager(_superchainConfig, _protocolVersions) OPContractsManager(_superchainConfig, _protocolVersions)
{ } { }
...@@ -100,8 +102,8 @@ contract OPContractsManager_InternalMethods_Test is Test { ...@@ -100,8 +102,8 @@ contract OPContractsManager_InternalMethods_Test is Test {
OPContractsManager_Harness opcmHarness; OPContractsManager_Harness opcmHarness;
function setUp() public { function setUp() public {
SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig")); ISuperchainConfig superchainConfigProxy = ISuperchainConfig(makeAddr("superchainConfig"));
ProtocolVersions protocolVersionsProxy = ProtocolVersions(makeAddr("protocolVersions")); IProtocolVersions protocolVersionsProxy = IProtocolVersions(makeAddr("protocolVersions"));
vm.etch(address(superchainConfigProxy), hex"01"); vm.etch(address(superchainConfigProxy), hex"01");
vm.etch(address(protocolVersionsProxy), hex"01"); vm.etch(address(protocolVersionsProxy), hex"01");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment