Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface IOptimismPortalInterop {
error UnexpectedString();
error Unproven();
error LegacyGame();
error MessageTargetSharedLockbox();

event DisputeGameBlacklisted(IDisputeGame indexed disputeGame);
event Initialized(uint8 version);
Expand Down
67 changes: 0 additions & 67 deletions packages/contracts-bedrock/interfaces/L1/ISystemConfigInterop.sol

This file was deleted.

21 changes: 0 additions & 21 deletions packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol";

// Scripts
import { DeployConfig } from "scripts/deploy/DeployConfig.s.sol";
import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol";
import { DeployUtils } from "scripts/libraries/DeployUtils.sol";

// Libraries
Expand Down Expand Up @@ -126,26 +125,6 @@ library ChainAssertions {
}
}

/// @notice Asserts that the SystemConfigInterop is setup correctly
function checkSystemConfigInterop(
Types.ContractSet memory _contracts,
DeployConfig _cfg,
bool _isProxy
)
internal
view
{
ISystemConfigInterop config = ISystemConfigInterop(_contracts.SystemConfig);

console.log(
"Running chain assertions on the SystemConfigInterop %s at %s",
_isProxy ? "proxy" : "implementation",
address(config)
);

checkSystemConfig(_contracts, _cfg, _isProxy);
}

/// @notice Asserts that the L1CrossDomainMessenger is setup correctly
function checkL1CrossDomainMessenger(Types.ContractSet memory _contracts, Vm _vm, bool _isProxy) internal view {
IL1CrossDomainMessenger messenger = IL1CrossDomainMessenger(_contracts.L1CrossDomainMessenger);
Expand Down
6 changes: 1 addition & 5 deletions packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,7 @@ contract Deploy is Deployer {
_opcm: OPContractsManager(address(dio.opcm())),
_mips: IMIPS(address(dio.mipsSingleton()))
});
if (_isInterop) {
ChainAssertions.checkSystemConfigInterop({ _contracts: contracts, _cfg: cfg, _isProxy: false });
} else {
ChainAssertions.checkSystemConfig({ _contracts: contracts, _cfg: cfg, _isProxy: false });
}
ChainAssertions.checkSystemConfig({ _contracts: contracts, _cfg: cfg, _isProxy: false });
}

/// @notice Deploy all of the OP Chain specific contracts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol";
import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol";
import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol";
import { IOptimismPortalInterop } from "interfaces/L1/IOptimismPortalInterop.sol";
import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol";

import { DeployUtils } from "scripts/libraries/DeployUtils.sol";
import { Solarray } from "scripts/libraries/Solarray.sol";
Expand Down Expand Up @@ -749,17 +748,13 @@ contract DeployImplementations is Script {
// interop as an example, they've made the following changes to L1 contracts:
// - `OptimismPortalInterop is OptimismPortal`: A different portal implementation is used, and
// it's ABI is the same.
// - `SystemConfigInterop is SystemConfig`: A different system config implementation is used, and
// it's constructor has a different signature. This signature is different because there is a
// new input parameter, the `superchainConfig`.
// - Because of the different system config constructor, there is a new input parameter (superchainConfig).
//
// Similar to how inheritance was used to develop the new portal and system config contracts, we use
// inheritance to modify up to all of the deployer contracts. For this interop example, what this
// means is we need:
// - A `DeployImplementationsInterop is DeployImplementations` that:
// - Deploys OptimismPortalInterop instead of OptimismPortal.
// - Deploys SystemConfigInterop instead of SystemConfig.
//
// Most of the complexity in the above flow comes from the the new input for the updated SystemConfig
// initializer. If all function signatures were the same, all we'd have to change is the contract
Expand Down Expand Up @@ -792,17 +787,4 @@ contract DeployImplementationsInterop is DeployImplementations {
vm.label(address(impl), "OptimismPortalImpl");
_dio.set(_dio.optimismPortalImpl.selector, address(impl));
}

function deploySystemConfigImpl(DeployImplementationsOutput _dio) public override {
vm.broadcast(msg.sender);
ISystemConfigInterop impl = ISystemConfigInterop(
DeployUtils.createDeterministic({
_name: "SystemConfigInterop",
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISystemConfigInterop.__constructor__, ())),
_salt: _salt
})
);
vm.label(address(impl), "SystemConfigImpl");
_dio.set(_dio.systemConfigImpl.selector, address(impl));
}
}
10 changes: 6 additions & 4 deletions packages/contracts-bedrock/scripts/deploy/DeploySuperchain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,10 @@ contract DeploySuperchainInterop is DeploySuperchain {
function deploySharedLockboxImplementation(DeploySuperchainOutput _dso) public virtual {
vm.broadcast(msg.sender);
ISharedLockbox sharedLockboxImpl = ISharedLockbox(
DeployUtils.create1({
DeployUtils.createDeterministic({
_name: "SharedLockbox",
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISharedLockbox.__constructor__, ()))
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISharedLockbox.__constructor__, ())),
_salt: _salt
})
);

Expand Down Expand Up @@ -656,9 +657,10 @@ contract DeploySuperchainInterop is DeploySuperchain {
function deploySuperchainConfigImplementation(DeploySuperchainOutput _dso) public override {
vm.broadcast(msg.sender);
ISuperchainConfigInterop superchainConfigImpl = ISuperchainConfigInterop(
DeployUtils.create1({
DeployUtils.createDeterministic({
_name: "SuperchainConfigInterop",
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISuperchainConfigInterop.__constructor__, ()))
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISuperchainConfigInterop.__constructor__, ())),
_salt: _salt
})
);

Expand Down
43 changes: 17 additions & 26 deletions packages/contracts-bedrock/scripts/deploy/ManageDependencies.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ pragma solidity ^0.8.0;

import { Script } from "forge-std/Script.sol";
import { BaseDeployIO } from "scripts/deploy/BaseDeployIO.sol";
import { ISystemConfigInterop } from "interfaces/L1/ISystemConfigInterop.sol";
import { ISuperchainConfigInterop } from "interfaces/L1/ISuperchainConfigInterop.sol";
import { ISystemConfig } from "interfaces/L1/ISystemConfig.sol";

contract ManageDependenciesInput is BaseDeployIO {
uint256 internal _chainId;
ISystemConfigInterop _systemConfig;
bool internal _remove;
ISystemConfig _systemConfig;
ISuperchainConfigInterop _superchainConfig;

// Setter for uint256 type
function set(bytes4 _sel, uint256 _value) public {
Expand All @@ -20,13 +21,8 @@ contract ManageDependenciesInput is BaseDeployIO {
function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "ManageDependenciesInput: cannot set zero address");

if (_sel == this.systemConfig.selector) _systemConfig = ISystemConfigInterop(_addr);
else revert("ManageDependenciesInput: unknown selector");
}

// Setter for bool type
function set(bytes4 _sel, bool _value) public {
if (_sel == this.remove.selector) _remove = _value;
if (_sel == this.superchainConfig.selector) _superchainConfig = ISuperchainConfigInterop(_addr);
else if (_sel == this.systemConfig.selector) _systemConfig = ISystemConfig(_addr);
else revert("ManageDependenciesInput: unknown selector");
}

Expand All @@ -36,29 +32,24 @@ contract ManageDependenciesInput is BaseDeployIO {
return _chainId;
}

function systemConfig() public view returns (ISystemConfigInterop) {
require(address(_systemConfig) != address(0), "ManageDependenciesInput: not set");
return _systemConfig;
function superchainConfig() public view returns (ISuperchainConfigInterop) {
require(address(_superchainConfig) != address(0), "ManageDependenciesInput: not set");
return _superchainConfig;
}

function remove() public view returns (bool) {
return _remove;
function systemConfig() public view returns (ISystemConfig) {
require(address(_systemConfig) != address(0), "ManageDependenciesInput: not set");
return _systemConfig;
}
}

contract ManageDependencies is Script {
// TODO: Fix dependency management since SystemConfig does not handle them anymore
function run(ManageDependenciesInput _input) public {
// bool remove = _input.remove();
// uint256 chainId = _input.chainId();
// ISystemConfigInterop systemConfig = _input.systemConfig();
uint256 chainId = _input.chainId();
ISuperchainConfigInterop superchainConfig = _input.superchainConfig();
ISystemConfig systemConfig = _input.systemConfig();

// // Call the appropriate function based on the remove flag
// vm.broadcast(msg.sender);
// if (remove) {
// systemConfig.removeDependency(chainId);
// } else {
// systemConfig.addDependency(chainId);
// }
vm.broadcast(msg.sender);
superchainConfig.addDependency(chainId, address(systemConfig));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,11 @@
"name": "LegacyGame",
"type": "error"
},
{
"inputs": [],
"name": "MessageTargetSharedLockbox",
"type": "error"
},
{
"inputs": [],
"name": "NonReentrant",
Expand Down
Loading