From 8b0cf5a52ed3cf493c1272c82fe5a1483a877f93 Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 12:35:56 -0400 Subject: [PATCH 01/10] OPCM: AddressManager and ProxyAdmin assertions. --- .../scripts/DeployOPChain.s.sol | 23 +++++++++++++++++++ .../test/opcm/DeployOPChain.t.sol | 6 ++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol index af05e74b2e13..89a555b8ce2a 100644 --- a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol @@ -20,6 +20,7 @@ import { IProxyAdmin } from "src/universal/interfaces/IProxyAdmin.sol"; import { IProxy } from "src/universal/interfaces/IProxy.sol"; import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol"; +import { IL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol"; import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol"; import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol"; import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol"; @@ -366,6 +367,8 @@ contract DeployOPChainOutput is BaseDeployIO { assertValidOptimismPortal(_doi); assertValidPermissionedDisputeGame(_doi); assertValidSystemConfig(_doi); + assertValidAddressManager(_doi); + assertValidOPChainProxyAdmin(_doi); } function assertValidPermissionedDisputeGame(DeployOPChainInput _doi) internal { @@ -551,6 +554,26 @@ contract DeployOPChainOutput is BaseDeployIO { address admin = proxy.admin(); require(admin == address(opChainProxyAdmin()), "DWETH-20"); } + + function assertValidAddressManager(DeployOPChainInput) internal view { + require(addressManager().owner() == address(opChainProxyAdmin()), "AM-10"); + } + + function assertValidOPChainProxyAdmin(DeployOPChainInput _doi) internal { + IProxyAdmin admin = opChainProxyAdmin(); + require(admin.owner() == _doi.opChainProxyAdminOwner(), "OPCPA-10"); + require( + admin.getProxyImplementation(address(l1CrossDomainMessengerProxy())) + == addressManager().getAddress("OVM_L1CrossDomainMessenger"), + "OPCPA-20" + ); + require(address(admin.addressManager()) == address(addressManager()), "OPCPA-30"); + + address l1StandardBridge = address(l1StandardBridgeProxy()); + vm.prank(address(0)); + address l1StandardBridgeImpl = IL1ChugSplashProxy(payable(l1StandardBridge)).getImplementation(); + require(admin.getProxyImplementation(l1StandardBridge) == l1StandardBridgeImpl, "OPCPA-40"); + } } contract DeployOPChain is Script { diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index 3beee87b1ee3..8d2f6815798d 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -558,9 +558,9 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { assertEq(doo.permissionedDisputeGame().splitDepth(), 30, "3400"); assertEq(doo.permissionedDisputeGame().maxGameDepth(), 73, "3500"); - // Most architecture assertions are handled within the OP Contracts Manager itself and therefore - // we only assert on the things that are not visible onchain. - // TODO add these assertions: AddressManager, Proxy, ProxyAdmin, etc. + assertEq(address(doo.opChainProxyAdmin().addressManager().owner()), address(doo.opChainProxyAdmin()), "3600"); + assertEq(address(doo.opChainProxyAdmin().addressManager()), address(doo.addressManager()), "3700"); + assertEq(address(doo.opChainProxyAdmin().owner()), opChainProxyAdminOwner, "3800"); } } From f0d6e16ee5d20f275e347ce91d50e42e61dfa53e Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 13:44:28 -0400 Subject: [PATCH 02/10] fix: Added logic for proxy types to check implementations. --- .../scripts/DeployImplementations.s.sol | 2 +- .../scripts/DeployOPChain.s.sol | 75 ++++++++++++++++--- .../scripts/libraries/DeployUtils.sol | 23 +++++- 3 files changed, 85 insertions(+), 15 deletions(-) diff --git a/packages/contracts-bedrock/scripts/DeployImplementations.s.sol b/packages/contracts-bedrock/scripts/DeployImplementations.s.sol index 78331677af86..3179ea3d6426 100644 --- a/packages/contracts-bedrock/scripts/DeployImplementations.s.sol +++ b/packages/contracts-bedrock/scripts/DeployImplementations.s.sol @@ -229,7 +229,7 @@ contract DeployImplementationsOutput is BaseDeployIO { function opcmProxy() public returns (OPContractsManager) { DeployUtils.assertValidContractAddress(address(_opcmProxy)); - DeployUtils.assertImplementationSet(address(_opcmProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_opcmProxy)); return _opcmProxy; } diff --git a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol index 89a555b8ce2a..9f0b441e1c5f 100644 --- a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol @@ -172,7 +172,7 @@ contract DeployOPChainInput is BaseDeployIO { function opcmProxy() public returns (OPContractsManager) { require(address(_opcmProxy) != address(0), "DeployOPChainInput: not set"); DeployUtils.assertValidContractAddress(address(_opcmProxy)); - DeployUtils.assertImplementationSet(address(_opcmProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_opcmProxy)); return _opcmProxy; } @@ -287,43 +287,51 @@ contract DeployOPChainOutput is BaseDeployIO { return _addressManager; } - function l1ERC721BridgeProxy() public view returns (IL1ERC721Bridge) { + function l1ERC721BridgeProxy() public returns (IL1ERC721Bridge) { DeployUtils.assertValidContractAddress(address(_l1ERC721BridgeProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_l1ERC721BridgeProxy)); return _l1ERC721BridgeProxy; } - function systemConfigProxy() public view returns (ISystemConfig) { + function systemConfigProxy() public returns (ISystemConfig) { DeployUtils.assertValidContractAddress(address(_systemConfigProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_systemConfigProxy)); return _systemConfigProxy; } - function optimismMintableERC20FactoryProxy() public view returns (IOptimismMintableERC20Factory) { + function optimismMintableERC20FactoryProxy() public returns (IOptimismMintableERC20Factory) { DeployUtils.assertValidContractAddress(address(_optimismMintableERC20FactoryProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_optimismMintableERC20FactoryProxy)); return _optimismMintableERC20FactoryProxy; } - function l1StandardBridgeProxy() public view returns (IL1StandardBridge) { + function l1StandardBridgeProxy() public returns (IL1StandardBridge) { DeployUtils.assertValidContractAddress(address(_l1StandardBridgeProxy)); + DeployUtils.assertL1ChugSplashImplementationSet(address(_l1StandardBridgeProxy)); return _l1StandardBridgeProxy; } function l1CrossDomainMessengerProxy() public view returns (IL1CrossDomainMessenger) { DeployUtils.assertValidContractAddress(address(_l1CrossDomainMessengerProxy)); + DeployUtils.assertResolvedDelegateProxyImplementationSet("OVM_L1CrossDomainMessenger", addressManager()); return _l1CrossDomainMessengerProxy; } - function optimismPortalProxy() public view returns (IOptimismPortal2) { + function optimismPortalProxy() public returns (IOptimismPortal2) { DeployUtils.assertValidContractAddress(address(_optimismPortalProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_optimismPortalProxy)); return _optimismPortalProxy; } - function disputeGameFactoryProxy() public view returns (IDisputeGameFactory) { + function disputeGameFactoryProxy() public returns (IDisputeGameFactory) { DeployUtils.assertValidContractAddress(address(_disputeGameFactoryProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_disputeGameFactoryProxy)); return _disputeGameFactoryProxy; } - function anchorStateRegistryProxy() public view returns (IAnchorStateRegistry) { + function anchorStateRegistryProxy() public returns (IAnchorStateRegistry) { DeployUtils.assertValidContractAddress(address(_anchorStateRegistryProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_anchorStateRegistryProxy)); return _anchorStateRegistryProxy; } @@ -342,8 +350,9 @@ contract DeployOPChainOutput is BaseDeployIO { return _permissionedDisputeGame; } - function delayedWETHPermissionedGameProxy() public view returns (IDelayedWETH) { + function delayedWETHPermissionedGameProxy() public returns (IDelayedWETH) { DeployUtils.assertValidContractAddress(address(_delayedWETHPermissionedGameProxy)); + DeployUtils.assertERC1967ImplementationSet(address(_delayedWETHPermissionedGameProxy)); return _delayedWETHPermissionedGameProxy; } @@ -419,7 +428,7 @@ contract DeployOPChainOutput is BaseDeployIO { require(Hash.unwrap(actualRoot) == expectedRoot, "ANCHORP-40"); } - function assertValidAnchorStateRegistryImpl(DeployOPChainInput) internal view { + function assertValidAnchorStateRegistryImpl(DeployOPChainInput) internal { IAnchorStateRegistry registry = anchorStateRegistryImpl(); DeployUtils.assertInitialized({ _contractAddress: address(registry), _slot: 0, _offset: 0 }); @@ -495,7 +504,7 @@ contract DeployOPChainOutput is BaseDeployIO { require(address(bridge.superchainConfig()) == address(_doi.opcmProxy().superchainConfig()), "L1SB-50"); } - function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal view { + function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal { IOptimismMintableERC20Factory factory = optimismMintableERC20FactoryProxy(); DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 }); @@ -533,7 +542,7 @@ contract DeployOPChainOutput is BaseDeployIO { require(vm.load(address(portal), bytes32(uint256(61))) == bytes32(0)); } - function assertValidDisputeGameFactory(DeployOPChainInput _doi) internal view { + function assertValidDisputeGameFactory(DeployOPChainInput _doi) internal { IDisputeGameFactory factory = disputeGameFactoryProxy(); DeployUtils.assertInitialized({ _contractAddress: address(factory), _slot: 0, _offset: 0 }); @@ -573,6 +582,48 @@ contract DeployOPChainOutput is BaseDeployIO { vm.prank(address(0)); address l1StandardBridgeImpl = IL1ChugSplashProxy(payable(l1StandardBridge)).getImplementation(); require(admin.getProxyImplementation(l1StandardBridge) == l1StandardBridgeImpl, "OPCPA-40"); + + require( + admin.getProxyImplementation(address(l1ERC721BridgeProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(l1ERC721BridgeProxy())), + "OPCPA-50" + ); + + require( + admin.getProxyImplementation(address(optimismPortalProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(optimismPortalProxy())), + "OPCPA-60" + ); + + require( + admin.getProxyImplementation(address(systemConfigProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(systemConfigProxy())), + "OPCPA-70" + ); + + require( + admin.getProxyImplementation(address(optimismMintableERC20FactoryProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(optimismMintableERC20FactoryProxy())), + "OPCPA-80" + ); + + require( + admin.getProxyImplementation(address(disputeGameFactoryProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(disputeGameFactoryProxy())), + "OPCPA-90" + ); + + require( + admin.getProxyImplementation(address(delayedWETHPermissionedGameProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(delayedWETHPermissionedGameProxy())), + "OPCPA-100" + ); + + require( + admin.getProxyImplementation(address(anchorStateRegistryProxy())) + == DeployUtils.assertERC1967ImplementationSet(address(anchorStateRegistryProxy())), + "OPCPA-110" + ); } } diff --git a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol index 726c3d3686cd..79699abcac7b 100644 --- a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol +++ b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol @@ -12,6 +12,8 @@ import { Bytes } from "src/libraries/Bytes.sol"; // Interfaces import { IProxy } from "src/universal/interfaces/IProxy.sol"; +import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol"; +import { IStaticL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol"; library DeployUtils { Vm internal constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); @@ -217,11 +219,28 @@ library DeployUtils { /// @notice Asserts that the given proxy has an implementation set. /// @param _proxy Proxy to check. - function assertImplementationSet(address _proxy) internal { + function assertERC1967ImplementationSet(address _proxy) internal returns (address implementation) { // We prank as the zero address due to the Proxy's `proxyCallIfNotAdmin` modifier. // Pranking inside this function also means it can no longer be considered `view`. vm.prank(address(0)); - address implementation = IProxy(payable(_proxy)).implementation(); + implementation = IProxy(payable(_proxy)).implementation(); + assertValidContractAddress(implementation); + } + + function assertL1ChugSplashImplementationSet(address _proxy) internal returns (address implementation) { + vm.prank(address(0)); + implementation = IStaticL1ChugSplashProxy(_proxy).getImplementation(); + assertValidContractAddress(implementation); + } + + function assertResolvedDelegateProxyImplementationSet( + string memory _implementationName, + IAddressManager _addressManager + ) + internal + view + { + address implementation = _addressManager.getAddress(_implementationName); assertValidContractAddress(implementation); } From 2a3412d8c5296f018f57ac6f14e601a5f5bc7164 Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 13:57:07 -0400 Subject: [PATCH 03/10] fix: touch ups for RDP impl checking. --- .../scripts/DeployOPChain.s.sol | 19 ++++++------------- .../scripts/libraries/DeployUtils.sol | 17 +++++++++-------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol index 9f0b441e1c5f..2d56d408a029 100644 --- a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol @@ -573,52 +573,45 @@ contract DeployOPChainOutput is BaseDeployIO { require(admin.owner() == _doi.opChainProxyAdminOwner(), "OPCPA-10"); require( admin.getProxyImplementation(address(l1CrossDomainMessengerProxy())) - == addressManager().getAddress("OVM_L1CrossDomainMessenger"), + == DeployUtils.assertResolvedDelegateProxyImplementationSet("OVM_L1CrossDomainMessenger", addressManager()), "OPCPA-20" ); require(address(admin.addressManager()) == address(addressManager()), "OPCPA-30"); - - address l1StandardBridge = address(l1StandardBridgeProxy()); - vm.prank(address(0)); - address l1StandardBridgeImpl = IL1ChugSplashProxy(payable(l1StandardBridge)).getImplementation(); - require(admin.getProxyImplementation(l1StandardBridge) == l1StandardBridgeImpl, "OPCPA-40"); - + require( + admin.getProxyImplementation(address(l1StandardBridgeProxy())) + == DeployUtils.assertL1ChugSplashImplementationSet(address(l1StandardBridgeProxy())), + "OPCPA-40" + ); require( admin.getProxyImplementation(address(l1ERC721BridgeProxy())) == DeployUtils.assertERC1967ImplementationSet(address(l1ERC721BridgeProxy())), "OPCPA-50" ); - require( admin.getProxyImplementation(address(optimismPortalProxy())) == DeployUtils.assertERC1967ImplementationSet(address(optimismPortalProxy())), "OPCPA-60" ); - require( admin.getProxyImplementation(address(systemConfigProxy())) == DeployUtils.assertERC1967ImplementationSet(address(systemConfigProxy())), "OPCPA-70" ); - require( admin.getProxyImplementation(address(optimismMintableERC20FactoryProxy())) == DeployUtils.assertERC1967ImplementationSet(address(optimismMintableERC20FactoryProxy())), "OPCPA-80" ); - require( admin.getProxyImplementation(address(disputeGameFactoryProxy())) == DeployUtils.assertERC1967ImplementationSet(address(disputeGameFactoryProxy())), "OPCPA-90" ); - require( admin.getProxyImplementation(address(delayedWETHPermissionedGameProxy())) == DeployUtils.assertERC1967ImplementationSet(address(delayedWETHPermissionedGameProxy())), "OPCPA-100" ); - require( admin.getProxyImplementation(address(anchorStateRegistryProxy())) == DeployUtils.assertERC1967ImplementationSet(address(anchorStateRegistryProxy())), diff --git a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol index 79699abcac7b..fb7c053ed613 100644 --- a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol +++ b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol @@ -219,18 +219,18 @@ library DeployUtils { /// @notice Asserts that the given proxy has an implementation set. /// @param _proxy Proxy to check. - function assertERC1967ImplementationSet(address _proxy) internal returns (address implementation) { + function assertERC1967ImplementationSet(address _proxy) internal returns (address implementation_) { // We prank as the zero address due to the Proxy's `proxyCallIfNotAdmin` modifier. // Pranking inside this function also means it can no longer be considered `view`. vm.prank(address(0)); - implementation = IProxy(payable(_proxy)).implementation(); - assertValidContractAddress(implementation); + implementation_ = IProxy(payable(_proxy)).implementation(); + assertValidContractAddress(implementation_); } - function assertL1ChugSplashImplementationSet(address _proxy) internal returns (address implementation) { + function assertL1ChugSplashImplementationSet(address _proxy) internal returns (address implementation_) { vm.prank(address(0)); - implementation = IStaticL1ChugSplashProxy(_proxy).getImplementation(); - assertValidContractAddress(implementation); + implementation_ = IStaticL1ChugSplashProxy(_proxy).getImplementation(); + assertValidContractAddress(implementation_); } function assertResolvedDelegateProxyImplementationSet( @@ -239,9 +239,10 @@ library DeployUtils { ) internal view + returns (address implementation_) { - address implementation = _addressManager.getAddress(_implementationName); - assertValidContractAddress(implementation); + implementation_ = _addressManager.getAddress(_implementationName); + assertValidContractAddress(implementation_); } /// @notice Asserts that the given addresses are valid contract addresses. From 2f86c1a57c2275104e1d2439fbf3f4e84ac07bf0 Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:23:58 -0400 Subject: [PATCH 04/10] fix: fully fledged proxies added to tests because of new assertions. --- .../scripts/libraries/DeployUtils.sol | 64 ++++++++++++++++- .../test/opcm/DeployOPChain.t.sol | 68 ++++++++----------- 2 files changed, 93 insertions(+), 39 deletions(-) diff --git a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol index fb7c053ed613..641f4b5cbe86 100644 --- a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol +++ b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol @@ -5,15 +5,18 @@ pragma solidity 0.8.15; import { Vm } from "forge-std/Vm.sol"; import { console2 as console } from "forge-std/console2.sol"; import { Artifacts } from "scripts/Artifacts.s.sol"; +import { console2 } from "forge-std/console2.sol"; // Libraries import { LibString } from "@solady/utils/LibString.sol"; import { Bytes } from "src/libraries/Bytes.sol"; +import { Constants } from "src/libraries/Constants.sol"; // Interfaces import { IProxy } from "src/universal/interfaces/IProxy.sol"; import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol"; -import { IStaticL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol"; +import { IL1ChugSplashProxy, IStaticL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol"; +import { IResolvedDelegateProxy } from "src/legacy/interfaces/IResolvedDelegateProxy.sol"; library DeployUtils { Vm internal constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code"))))); @@ -245,6 +248,65 @@ library DeployUtils { assertValidContractAddress(implementation_); } + function buildERC1967ProxyWithImpl(string memory proxyImplName) public returns (IProxy genericProxy) { + genericProxy = IProxy( + create1({ + _name: "Proxy", + _args: DeployUtils.encodeConstructor(abi.encodeCall(IProxy.__constructor__, (address(0)))) + }) + ); + address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(proxyImplName))))); + vm.etch(address(implementation), hex"01"); + vm.prank(address(0)); + genericProxy.upgradeTo(address(implementation)); + vm.etch(address(genericProxy), address(genericProxy).code); + } + + function buildL1ChugSplashProxyWithImpl(string memory proxyImplName) + public + returns (IL1ChugSplashProxy proxy) + { + proxy = IL1ChugSplashProxy( + create1({ + _name: "L1ChugSplashProxy", + _args: DeployUtils.encodeConstructor(abi.encodeCall(IL1ChugSplashProxy.__constructor__, (address(0)))) + }) + ); + address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(proxyImplName))))); + vm.etch(address(implementation), hex"01"); + vm.prank(address(0)); + proxy.setStorage(Constants.PROXY_IMPLEMENTATION_ADDRESS, bytes32(uint256(uint160(implementation)))); + } + + function buildResolvedDelegateProxyWithImpl( + IAddressManager addressManager, + string memory proxyImplName + ) + public + returns (IResolvedDelegateProxy proxy) + { + proxy = IResolvedDelegateProxy( + create1({ + _name: "ResolvedDelegateProxy", + _args: DeployUtils.encodeConstructor( + abi.encodeCall(IResolvedDelegateProxy.__constructor__, (addressManager, proxyImplName)) + ) + }) + ); + address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(proxyImplName))))); + vm.etch(address(implementation), hex"01"); + addressManager.setAddress(proxyImplName, implementation); + } + + function buildAddressManager() public returns (IAddressManager addressManager) { + addressManager = IAddressManager( + create1({ + _name: "AddressManager", + _args: DeployUtils.encodeConstructor(abi.encodeCall(IAddressManager.__constructor__, ())) + }) + ); + } + /// @notice Asserts that the given addresses are valid contract addresses. /// @param _addrs Addresses to check. function assertValidContractAddresses(address[] memory _addrs) internal view { diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index 8d2f6815798d..f12196ddcb3d 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.15; import { Test } from "forge-std/Test.sol"; +import { console2 } from "forge-std/console2.sol"; import { DeploySuperchainInput, DeploySuperchain, DeploySuperchainOutput } from "scripts/DeploySuperchain.s.sol"; import { @@ -21,6 +22,8 @@ import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory. import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol"; import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol"; import { IPermissionedDisputeGame } from "src/dispute/interfaces/IPermissionedDisputeGame.sol"; +import { IL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol"; +import { IResolvedDelegateProxy } from "src/legacy/interfaces/IResolvedDelegateProxy.sol"; import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; import { IProtocolVersions, ProtocolVersion } from "src/L1/interfaces/IProtocolVersions.sol"; @@ -55,20 +58,6 @@ contract DeployOPChainInput_Test is Test { doi = new DeployOPChainInput(); } - function buildOpcmProxy() public returns (IProxy opcmProxy) { - opcmProxy = IProxy( - DeployUtils.create1({ - _name: "Proxy", - _args: DeployUtils.encodeConstructor(abi.encodeCall(IProxy.__constructor__, (address(0)))) - }) - ); - OPContractsManager opcmImpl = OPContractsManager(address(makeAddr("opcmImpl"))); - vm.prank(address(0)); - opcmProxy.upgradeTo(address(opcmImpl)); - vm.etch(address(opcmProxy), address(opcmProxy).code); - vm.etch(address(opcmImpl), hex"01"); - } - function test_set_succeeds() public { doi.set(doi.opChainProxyAdminOwner.selector, opChainProxyAdminOwner); doi.set(doi.systemConfigOwner.selector, systemConfigOwner); @@ -80,7 +69,7 @@ contract DeployOPChainInput_Test is Test { doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar); doi.set(doi.l2ChainId.selector, l2ChainId); - (IProxy opcmProxy) = buildOpcmProxy(); + (IProxy opcmProxy) = DeployUtils.buildERC1967ProxyWithImpl("opcmProxy"); doi.set(doi.opcmProxy.selector, address(opcmProxy)); // Compare the default inputs to the getter methods. @@ -133,22 +122,22 @@ contract DeployOPChainOutput_Test is Test { // Define default outputs to set. // We set these in storage because doing it locally in test_set_succeeds results in stack too deep. - IProxyAdmin opChainProxyAdmin = IProxyAdmin(makeAddr("optimismPortal2Impl")); - IAddressManager addressManager = IAddressManager(makeAddr("delayedWETHImpl")); - IL1ERC721Bridge l1ERC721BridgeProxy = IL1ERC721Bridge(makeAddr("l1ERC721BridgeProxy")); - ISystemConfig systemConfigProxy = ISystemConfig(makeAddr("systemConfigProxy")); - IOptimismMintableERC20Factory optimismMintableERC20FactoryProxy = - IOptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryProxy")); - IL1StandardBridge l1StandardBridgeProxy = IL1StandardBridge(payable(makeAddr("l1StandardBridgeProxy"))); - IL1CrossDomainMessenger l1CrossDomainMessengerProxy = - IL1CrossDomainMessenger(makeAddr("l1CrossDomainMessengerProxy")); - IOptimismPortal2 optimismPortalProxy = IOptimismPortal2(payable(makeAddr("optimismPortalProxy"))); - IDisputeGameFactory disputeGameFactoryProxy = IDisputeGameFactory(makeAddr("disputeGameFactoryProxy")); - IAnchorStateRegistry anchorStateRegistryProxy = IAnchorStateRegistry(makeAddr("anchorStateRegistryProxy")); + IProxyAdmin opChainProxyAdmin = IProxyAdmin(makeAddr("opChainProxyAdmin")); + // IL1ERC721Bridge l1ERC721BridgeProxy = IL1ERC721Bridge(makeAddr("l1ERC721BridgeProxy")); + // ISystemConfig systemConfigProxy = ISystemConfig(makeAddr("systemConfigProxy")); + // IOptimismMintableERC20Factory optimismMintableERC20FactoryProxy = + // IOptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryProxy")); + // IL1StandardBridge l1StandardBridgeProxy = IL1StandardBridge(payable(makeAddr("l1StandardBridgeProxy"))); + // IL1CrossDomainMessenger l1CrossDomainMessengerProxy = + // IL1CrossDomainMessenger(makeAddr("l1CrossDomainMessengerProxy")); + // IOptimismPortal2 optimismPortalProxy = IOptimismPortal2(payable(makeAddr("optimismPortalProxy"))); + // IDisputeGameFactory disputeGameFactoryProxy = IDisputeGameFactory(makeAddr("disputeGameFactoryProxy")); + // IAnchorStateRegistry anchorStateRegistryProxy = IAnchorStateRegistry(makeAddr("anchorStateRegistryProxy")); IAnchorStateRegistry anchorStateRegistryImpl = IAnchorStateRegistry(makeAddr("anchorStateRegistryImpl")); IFaultDisputeGame faultDisputeGame = IFaultDisputeGame(makeAddr("faultDisputeGame")); IPermissionedDisputeGame permissionedDisputeGame = IPermissionedDisputeGame(makeAddr("permissionedDisputeGame")); - IDelayedWETH delayedWETHPermissionedGameProxy = IDelayedWETH(payable(makeAddr("delayedWETHPermissionedGameProxy"))); + // IDelayedWETH delayedWETHPermissionedGameProxy = + // IDelayedWETH(payable(makeAddr("delayedWETHPermissionedGameProxy"))); // TODO: Eventually switch from Permissioned to Permissionless. // DelayedWETH delayedWETHPermissionlessGameProxy = // DelayedWETH(payable(makeAddr("delayedWETHPermissionlessGameProxy"))); @@ -159,19 +148,22 @@ contract DeployOPChainOutput_Test is Test { function test_set_succeeds() public { vm.etch(address(opChainProxyAdmin), hex"01"); - vm.etch(address(addressManager), hex"01"); - vm.etch(address(l1ERC721BridgeProxy), hex"01"); - vm.etch(address(systemConfigProxy), hex"01"); - vm.etch(address(optimismMintableERC20FactoryProxy), hex"01"); - vm.etch(address(l1StandardBridgeProxy), hex"01"); - vm.etch(address(l1CrossDomainMessengerProxy), hex"01"); - vm.etch(address(optimismPortalProxy), hex"01"); - vm.etch(address(disputeGameFactoryProxy), hex"01"); - vm.etch(address(anchorStateRegistryProxy), hex"01"); + IAddressManager addressManager = DeployUtils.buildAddressManager(); + (IProxy l1ERC721BridgeProxy) = DeployUtils.buildERC1967ProxyWithImpl("l1ERC721BridgeProxy"); + (IProxy systemConfigProxy) = DeployUtils.buildERC1967ProxyWithImpl("systemConfigProxy"); + (IProxy optimismMintableERC20FactoryProxy) = + DeployUtils.buildERC1967ProxyWithImpl("optimismMintableERC20FactoryProxy"); + (IL1ChugSplashProxy l1StandardBridgeProxy) = DeployUtils.buildL1ChugSplashProxyWithImpl("l1StandardBridgeProxy"); + (IResolvedDelegateProxy l1CrossDomainMessengerProxy) = + DeployUtils.buildResolvedDelegateProxyWithImpl(addressManager, "OVM_L1CrossDomainMessenger"); + (IProxy optimismPortalProxy) = DeployUtils.buildERC1967ProxyWithImpl("optimismPortalProxy"); + (IProxy disputeGameFactoryProxy) = DeployUtils.buildERC1967ProxyWithImpl("disputeGameFactoryProxy"); + (IProxy anchorStateRegistryProxy) = DeployUtils.buildERC1967ProxyWithImpl("anchorStateRegistryProxy"); vm.etch(address(anchorStateRegistryImpl), hex"01"); vm.etch(address(faultDisputeGame), hex"01"); vm.etch(address(permissionedDisputeGame), hex"01"); - vm.etch(address(delayedWETHPermissionedGameProxy), hex"01"); + (IProxy delayedWETHPermissionedGameProxy) = + DeployUtils.buildERC1967ProxyWithImpl("delayedWETHPermissionedGameProxy"); // TODO: Eventually switch from Permissioned to Permissionless. // vm.etch(address(delayedWETHPermissionlessGameProxy), hex"01"); From 60b6542bf10ac636b7b0c366fb2ddda4551b9aa4 Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:27:09 -0400 Subject: [PATCH 05/10] fix: removing console2 lib. --- packages/contracts-bedrock/scripts/libraries/DeployUtils.sol | 1 - packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol index 641f4b5cbe86..989fd529ab5f 100644 --- a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol +++ b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol @@ -5,7 +5,6 @@ pragma solidity 0.8.15; import { Vm } from "forge-std/Vm.sol"; import { console2 as console } from "forge-std/console2.sol"; import { Artifacts } from "scripts/Artifacts.s.sol"; -import { console2 } from "forge-std/console2.sol"; // Libraries import { LibString } from "@solady/utils/LibString.sol"; diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index f12196ddcb3d..01b976832179 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -2,7 +2,6 @@ pragma solidity 0.8.15; import { Test } from "forge-std/Test.sol"; -import { console2 } from "forge-std/console2.sol"; import { DeploySuperchainInput, DeploySuperchain, DeploySuperchainOutput } from "scripts/DeploySuperchain.s.sol"; import { From 0d813ff12f2887b409357d30ac17aa40b9380ecd Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:29:23 -0400 Subject: [PATCH 06/10] fix: semgrep complaining. --- .../scripts/libraries/DeployUtils.sol | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol index 989fd529ab5f..d507cbc1ae6d 100644 --- a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol +++ b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol @@ -247,58 +247,55 @@ library DeployUtils { assertValidContractAddress(implementation_); } - function buildERC1967ProxyWithImpl(string memory proxyImplName) public returns (IProxy genericProxy) { - genericProxy = IProxy( + function buildERC1967ProxyWithImpl(string memory _proxyImplName) public returns (IProxy genericProxy_) { + genericProxy_ = IProxy( create1({ _name: "Proxy", _args: DeployUtils.encodeConstructor(abi.encodeCall(IProxy.__constructor__, (address(0)))) }) ); - address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(proxyImplName))))); + address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(_proxyImplName))))); vm.etch(address(implementation), hex"01"); vm.prank(address(0)); - genericProxy.upgradeTo(address(implementation)); - vm.etch(address(genericProxy), address(genericProxy).code); + genericProxy_.upgradeTo(address(implementation)); + vm.etch(address(genericProxy_), address(genericProxy_).code); } - function buildL1ChugSplashProxyWithImpl(string memory proxyImplName) - public - returns (IL1ChugSplashProxy proxy) - { - proxy = IL1ChugSplashProxy( + function buildL1ChugSplashProxyWithImpl(string memory _proxyImplName) public returns (IL1ChugSplashProxy proxy_) { + proxy_ = IL1ChugSplashProxy( create1({ _name: "L1ChugSplashProxy", _args: DeployUtils.encodeConstructor(abi.encodeCall(IL1ChugSplashProxy.__constructor__, (address(0)))) }) ); - address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(proxyImplName))))); + address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(_proxyImplName))))); vm.etch(address(implementation), hex"01"); vm.prank(address(0)); - proxy.setStorage(Constants.PROXY_IMPLEMENTATION_ADDRESS, bytes32(uint256(uint160(implementation)))); + proxy_.setStorage(Constants.PROXY_IMPLEMENTATION_ADDRESS, bytes32(uint256(uint160(implementation)))); } function buildResolvedDelegateProxyWithImpl( - IAddressManager addressManager, - string memory proxyImplName + IAddressManager _addressManager, + string memory _proxyImplName ) public - returns (IResolvedDelegateProxy proxy) + returns (IResolvedDelegateProxy proxy_) { - proxy = IResolvedDelegateProxy( + proxy_ = IResolvedDelegateProxy( create1({ _name: "ResolvedDelegateProxy", _args: DeployUtils.encodeConstructor( - abi.encodeCall(IResolvedDelegateProxy.__constructor__, (addressManager, proxyImplName)) + abi.encodeCall(IResolvedDelegateProxy.__constructor__, (_addressManager, _proxyImplName)) ) }) ); - address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(proxyImplName))))); + address implementation = address(vm.addr(uint256(keccak256(abi.encodePacked(_proxyImplName))))); vm.etch(address(implementation), hex"01"); - addressManager.setAddress(proxyImplName, implementation); + _addressManager.setAddress(_proxyImplName, implementation); } - function buildAddressManager() public returns (IAddressManager addressManager) { - addressManager = IAddressManager( + function buildAddressManager() public returns (IAddressManager addressManager_) { + addressManager_ = IAddressManager( create1({ _name: "AddressManager", _args: DeployUtils.encodeConstructor(abi.encodeCall(IAddressManager.__constructor__, ())) From 3a5188434ad242351819b3f42f1a7c131330a4de Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:34:53 -0400 Subject: [PATCH 07/10] fix: comment cleanup and logical split to avoid stack too deep error. --- .../test/opcm/DeployOPChain.t.sol | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index 01b976832179..dec8fecb5657 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -119,27 +119,13 @@ contract DeployOPChainInput_Test is Test { contract DeployOPChainOutput_Test is Test { DeployOPChainOutput doo; - // Define default outputs to set. - // We set these in storage because doing it locally in test_set_succeeds results in stack too deep. + // We set the non proxy contracts in storage because doing it locally in 'test_set_succeeds' function results in + // stack too deep. + IAddressManager addressManager = DeployUtils.buildAddressManager(); IProxyAdmin opChainProxyAdmin = IProxyAdmin(makeAddr("opChainProxyAdmin")); - // IL1ERC721Bridge l1ERC721BridgeProxy = IL1ERC721Bridge(makeAddr("l1ERC721BridgeProxy")); - // ISystemConfig systemConfigProxy = ISystemConfig(makeAddr("systemConfigProxy")); - // IOptimismMintableERC20Factory optimismMintableERC20FactoryProxy = - // IOptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryProxy")); - // IL1StandardBridge l1StandardBridgeProxy = IL1StandardBridge(payable(makeAddr("l1StandardBridgeProxy"))); - // IL1CrossDomainMessenger l1CrossDomainMessengerProxy = - // IL1CrossDomainMessenger(makeAddr("l1CrossDomainMessengerProxy")); - // IOptimismPortal2 optimismPortalProxy = IOptimismPortal2(payable(makeAddr("optimismPortalProxy"))); - // IDisputeGameFactory disputeGameFactoryProxy = IDisputeGameFactory(makeAddr("disputeGameFactoryProxy")); - // IAnchorStateRegistry anchorStateRegistryProxy = IAnchorStateRegistry(makeAddr("anchorStateRegistryProxy")); IAnchorStateRegistry anchorStateRegistryImpl = IAnchorStateRegistry(makeAddr("anchorStateRegistryImpl")); IFaultDisputeGame faultDisputeGame = IFaultDisputeGame(makeAddr("faultDisputeGame")); IPermissionedDisputeGame permissionedDisputeGame = IPermissionedDisputeGame(makeAddr("permissionedDisputeGame")); - // IDelayedWETH delayedWETHPermissionedGameProxy = - // IDelayedWETH(payable(makeAddr("delayedWETHPermissionedGameProxy"))); - // TODO: Eventually switch from Permissioned to Permissionless. - // DelayedWETH delayedWETHPermissionlessGameProxy = - // DelayedWETH(payable(makeAddr("delayedWETHPermissionlessGameProxy"))); function setUp() public { doo = new DeployOPChainOutput(); @@ -147,7 +133,6 @@ contract DeployOPChainOutput_Test is Test { function test_set_succeeds() public { vm.etch(address(opChainProxyAdmin), hex"01"); - IAddressManager addressManager = DeployUtils.buildAddressManager(); (IProxy l1ERC721BridgeProxy) = DeployUtils.buildERC1967ProxyWithImpl("l1ERC721BridgeProxy"); (IProxy systemConfigProxy) = DeployUtils.buildERC1967ProxyWithImpl("systemConfigProxy"); (IProxy optimismMintableERC20FactoryProxy) = From 6dfc444d6f9cf0b79dec4af1b761e34100b4f1cb Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:37:50 -0400 Subject: [PATCH 08/10] fix: adding comment back in. --- packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index dec8fecb5657..478c5e40b98f 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -146,10 +146,11 @@ contract DeployOPChainOutput_Test is Test { vm.etch(address(anchorStateRegistryImpl), hex"01"); vm.etch(address(faultDisputeGame), hex"01"); vm.etch(address(permissionedDisputeGame), hex"01"); + // TODO: Eventually switch from Permissioned to Permissionless. + // (IProxy delayedWETHPermissionlessGameProxy) = + // DeployUtils.buildERC1967ProxyWithImpl("delayedWETHPermissionlessGameProxy"); (IProxy delayedWETHPermissionedGameProxy) = DeployUtils.buildERC1967ProxyWithImpl("delayedWETHPermissionedGameProxy"); - // TODO: Eventually switch from Permissioned to Permissionless. - // vm.etch(address(delayedWETHPermissionlessGameProxy), hex"01"); doo.set(doo.opChainProxyAdmin.selector, address(opChainProxyAdmin)); doo.set(doo.addressManager.selector, address(addressManager)); From c621036f57edeac224f39e80db9c0e09975fc933 Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:41:41 -0400 Subject: [PATCH 09/10] fix: added natspec comments for new DeployUtils functions. --- .../scripts/libraries/DeployUtils.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol index d507cbc1ae6d..669ebd0f65c7 100644 --- a/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol +++ b/packages/contracts-bedrock/scripts/libraries/DeployUtils.sol @@ -229,12 +229,17 @@ library DeployUtils { assertValidContractAddress(implementation_); } + /// @notice Asserts that the given L1ChugSplashProxy has an implementation set. + /// @param _proxy L1ChugSplashProxy to check. function assertL1ChugSplashImplementationSet(address _proxy) internal returns (address implementation_) { vm.prank(address(0)); implementation_ = IStaticL1ChugSplashProxy(_proxy).getImplementation(); assertValidContractAddress(implementation_); } + /// @notice Asserts that the given ResolvedDelegateProxy has an implementation set. + /// @param _implementationName Name of the implementation contract. + /// @param _addressManager AddressManager contract. function assertResolvedDelegateProxyImplementationSet( string memory _implementationName, IAddressManager _addressManager @@ -247,6 +252,8 @@ library DeployUtils { assertValidContractAddress(implementation_); } + /// @notice Builds an ERC1967 Proxy with a dummy implementation. + /// @param _proxyImplName Name of the implementation contract. function buildERC1967ProxyWithImpl(string memory _proxyImplName) public returns (IProxy genericProxy_) { genericProxy_ = IProxy( create1({ @@ -261,6 +268,8 @@ library DeployUtils { vm.etch(address(genericProxy_), address(genericProxy_).code); } + /// @notice Builds an L1ChugSplashProxy with a dummy implementation. + /// @param _proxyImplName Name of the implementation contract. function buildL1ChugSplashProxyWithImpl(string memory _proxyImplName) public returns (IL1ChugSplashProxy proxy_) { proxy_ = IL1ChugSplashProxy( create1({ @@ -274,6 +283,9 @@ library DeployUtils { proxy_.setStorage(Constants.PROXY_IMPLEMENTATION_ADDRESS, bytes32(uint256(uint160(implementation)))); } + /// @notice Builds a ResolvedDelegateProxy with a dummy implementation. + /// @param _addressManager AddressManager contract. + /// @param _proxyImplName Name of the implementation contract. function buildResolvedDelegateProxyWithImpl( IAddressManager _addressManager, string memory _proxyImplName @@ -294,6 +306,7 @@ library DeployUtils { _addressManager.setAddress(_proxyImplName, implementation); } + /// @notice Builds an AddressManager contract. function buildAddressManager() public returns (IAddressManager addressManager_) { addressManager_ = IAddressManager( create1({ From e6e644b412a530dc3df109db354fd7e12005346d Mon Sep 17 00:00:00 2001 From: Blaine Malone Date: Tue, 8 Oct 2024 15:52:40 -0400 Subject: [PATCH 10/10] fix: removed unused imports. --- packages/contracts-bedrock/scripts/DeployOPChain.s.sol | 1 - packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol | 8 -------- 2 files changed, 9 deletions(-) diff --git a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol index 2d56d408a029..f88469b7ead5 100644 --- a/packages/contracts-bedrock/scripts/DeployOPChain.s.sol +++ b/packages/contracts-bedrock/scripts/DeployOPChain.s.sol @@ -20,7 +20,6 @@ import { IProxyAdmin } from "src/universal/interfaces/IProxyAdmin.sol"; import { IProxy } from "src/universal/interfaces/IProxy.sol"; import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol"; -import { IL1ChugSplashProxy } from "src/legacy/interfaces/IL1ChugSplashProxy.sol"; import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol"; import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol"; import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol"; diff --git a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol index 478c5e40b98f..13460f35c632 100644 --- a/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol +++ b/packages/contracts-bedrock/test/opcm/DeployOPChain.t.sol @@ -16,8 +16,6 @@ import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; import { IProxyAdmin } from "src/universal/interfaces/IProxyAdmin.sol"; import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol"; -import { IDelayedWETH } from "src/dispute/interfaces/IDelayedWETH.sol"; -import { IDisputeGameFactory } from "src/dispute/interfaces/IDisputeGameFactory.sol"; import { IAnchorStateRegistry } from "src/dispute/interfaces/IAnchorStateRegistry.sol"; import { IFaultDisputeGame } from "src/dispute/interfaces/IFaultDisputeGame.sol"; import { IPermissionedDisputeGame } from "src/dispute/interfaces/IPermissionedDisputeGame.sol"; @@ -27,12 +25,6 @@ import { IResolvedDelegateProxy } from "src/legacy/interfaces/IResolvedDelegateP import { ISuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol"; import { IProtocolVersions, ProtocolVersion } from "src/L1/interfaces/IProtocolVersions.sol"; import { OPContractsManager } from "src/L1/OPContractsManager.sol"; -import { IOptimismPortal2 } from "src/L1/interfaces/IOptimismPortal2.sol"; -import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol"; -import { IL1CrossDomainMessenger } from "src/L1/interfaces/IL1CrossDomainMessenger.sol"; -import { IL1ERC721Bridge } from "src/L1/interfaces/IL1ERC721Bridge.sol"; -import { IL1StandardBridge } from "src/L1/interfaces/IL1StandardBridge.sol"; -import { IOptimismMintableERC20Factory } from "src/universal/interfaces/IOptimismMintableERC20Factory.sol"; import { IProxy } from "src/universal/interfaces/IProxy.sol"; import { Claim, Duration, GameType, GameTypes, Hash, OutputRoot } from "src/dispute/lib/Types.sol";