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
4 changes: 4 additions & 0 deletions op-chain-ops/interopgen/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ type L1Deployment struct {

type Implementations struct {
Opcm common.Address `json:"OPCM"`
OpcmContractsContainer common.Address `json:"OPCMContractsContainer"`
OpcmGameTypeAdder common.Address `json:"OPCMGameTypeAdder"`
OpcmDeployer common.Address `json:"OPCMDeployer"`
OpcmUpgrader common.Address `json:"OPCMUpgrader"`
DelayedWETHImpl common.Address `json:"DelayedWETHImpl"`
OptimismPortalImpl common.Address `json:"OptimismPortalImpl"`
PreimageOracleSingleton common.Address `json:"PreimageOracleSingleton"`
Expand Down
9 changes: 5 additions & 4 deletions op-deployer/pkg/deployer/opcm/implementations.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func (input *DeployImplementationsInput) InputSet() bool {

type DeployImplementationsOutput struct {
Opcm common.Address
OpcmContractsContainer common.Address
OpcmGameTypeAdder common.Address
OpcmDeployer common.Address
OpcmUpgrader common.Address
DelayedWETHImpl common.Address
OptimismPortalImpl common.Address
PreimageOracleSingleton common.Address
Expand Down Expand Up @@ -86,10 +90,7 @@ func DeployImplementations(
defer cleanupDeploy()

opcmContract := "OPContractsManager"
if input.UseInterop {
opcmContract = "OPContractsManagerInterop"
}
if err := host.RememberOnLabel("OPContractsManager", opcmContract+".sol", opcmContract); err != nil {
if err := host.RememberOnLabel("OPContractsManager", "OPContractsManager.sol", opcmContract); err != nil {
return output, fmt.Errorf("failed to link OPContractsManager label: %w", err)
}

Expand Down
3 changes: 3 additions & 0 deletions op-deployer/pkg/deployer/pipeline/implementations.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func DeployImplementations(env *Env, intent *state.Intent, st *state.State) erro

st.ImplementationsDeployment = &state.ImplementationsDeployment{
OpcmAddress: dio.Opcm,
OpcmGameTypeAdderAddress: dio.OpcmGameTypeAdder,
OpcmDeployerAddress: dio.OpcmDeployer,
OpcmUpgraderAddress: dio.OpcmUpgrader,
DelayedWETHImplAddress: dio.DelayedWETHImpl,
OptimismPortalImplAddress: dio.OptimismPortalImpl,
PreimageOracleSingletonAddress: dio.PreimageOracleSingleton,
Expand Down
3 changes: 3 additions & 0 deletions op-deployer/pkg/deployer/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ type SuperchainDeployment struct {

type ImplementationsDeployment struct {
OpcmAddress common.Address `json:"opcmAddress"`
OpcmGameTypeAdderAddress common.Address `json:"opcmGameTypeAdderAddress"`
OpcmDeployerAddress common.Address `json:"opcmDeployerAddress"`
OpcmUpgraderAddress common.Address `json:"opcmUpgraderAddress"`
DelayedWETHImplAddress common.Address `json:"delayedWETHImplAddress"`
OptimismPortalImplAddress common.Address `json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress common.Address `json:"preimageOracleSingletonAddress"`
Expand Down
105 changes: 74 additions & 31 deletions packages/contracts-bedrock/interfaces/L1/IOPContractsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { IDelayedWETH } from "interfaces/dispute/IDelayedWETH.sol";
import { IAnchorStateRegistry } from "interfaces/dispute/IAnchorStateRegistry.sol";
import { IAddressManager } from "interfaces/legacy/IAddressManager.sol";
import { IProxyAdmin } from "interfaces/universal/IProxyAdmin.sol";
import { IDisputeGame } from "interfaces/dispute/IDisputeGame.sol";
import { IDisputeGameFactory } from "interfaces/dispute/IDisputeGameFactory.sol";
import { IFaultDisputeGame } from "interfaces/dispute/IFaultDisputeGame.sol";
import { IPermissionedDisputeGame } from "interfaces/dispute/IPermissionedDisputeGame.sol";
Expand All @@ -23,6 +22,65 @@ import { IL1ERC721Bridge } from "interfaces/L1/IL1ERC721Bridge.sol";
import { IL1StandardBridge } from "interfaces/L1/IL1StandardBridge.sol";
import { IOptimismMintableERC20Factory } from "interfaces/universal/IOptimismMintableERC20Factory.sol";

interface IOPContractsManagerContractsContainer {
function __constructor__(
IOPContractsManager.Blueprints memory _blueprints,
IOPContractsManager.Implementations memory _implementations
)
external;

function blueprints() external view returns (IOPContractsManager.Blueprints memory);
function implementations() external view returns (IOPContractsManager.Implementations memory);
}

interface IOPContractsManagerGameTypeAdder {
event GameTypeAdded(
uint256 indexed l2ChainId, GameType indexed gameType, address newDisputeGame, address oldDisputeGame
);

function __constructor__(
IOPContractsManagerContractsContainer _contractsContainer
)
external;

function addGameType(IOPContractsManager.AddGameInput[] memory _gameConfigs, address _superchainConfig)
external
returns (IOPContractsManager.AddGameOutput[] memory);

function updatePrestate(IOPContractsManager.OpChainConfig[] memory _prestateUpdateInputs, address _superchainConfig) external;

function contractsContainer() external view returns (IOPContractsManagerContractsContainer);
}

interface IOPContractsManagerDeployer {
event Deployed(uint256 indexed l2ChainId, address indexed deployer, bytes deployOutput);

function __constructor__(
IOPContractsManagerContractsContainer _contractsContainer
)
external;

function deploy(IOPContractsManager.DeployInput memory _input, address _superchainConfig, address _deployer)
external
returns (IOPContractsManager.DeployOutput memory);

function contractsContainer() external view returns (IOPContractsManagerContractsContainer);
}

interface IOPContractsManagerUpgrader {
event Upgraded(uint256 indexed l2ChainId, address indexed systemConfig, address indexed upgrader);

function __constructor__(
IOPContractsManagerContractsContainer _contractsContainer
)
external;

function upgrade(IOPContractsManager.OpChainConfig[] memory _opChainConfigs) external;

function contractsContainer() external view returns (IOPContractsManagerContractsContainer);
}


interface IOPContractsManager {
// -------- Structs --------

Expand Down Expand Up @@ -153,36 +211,8 @@ interface IOPContractsManager {
/// version of the L1 smart contracts is deployed. It takes the format of `op-contracts/vX.Y.Z`.
function l1ContractsRelease() external view returns (string memory);

// -------- Events --------

/// @notice Emitted when a new OP Stack chain is deployed.
/// @param l2ChainId Chain ID of the new chain.
/// @param deployer Address that deployed the chain.
/// @param deployOutput ABI-encoded output of the deployment.
event Deployed(uint256 indexed l2ChainId, address indexed deployer, bytes deployOutput);

/// @notice Emitted when a chain is upgraded
/// @param systemConfig Address of the chain's SystemConfig contract
/// @param upgrader Address that initiated the upgrade
event Upgraded(uint256 indexed l2ChainId, ISystemConfig indexed systemConfig, address indexed upgrader);

/// @notice Emitted when a new game type is added to a chain
/// @param l2ChainId Chain ID of the chain
/// @param gameType Type of the game being added
/// @param newDisputeGame Address of the deployed dispute game
/// @param oldDisputeGame Address of the old dispute game
event GameTypeAdded(uint256 indexed l2ChainId, GameType indexed gameType, IDisputeGame newDisputeGame, IDisputeGame oldDisputeGame);

// -------- Errors --------

error BytesArrayTooLong();
error DeploymentFailed();
error EmptyInitcode();
error IdentityPrecompileCallFailed();
error NotABlueprint();
error ReservedBitsSet();
error UnexpectedPreambleData(bytes data);
error UnsupportedERCVersion(uint8 version);
error OnlyUpgradeController();

/// @notice Thrown when an address is the zero address.
Expand Down Expand Up @@ -219,15 +249,18 @@ interface IOPContractsManager {

error PrestateNotSet();

error PrestateRequired();

// -------- Methods --------

function __constructor__(
IOPContractsManagerGameTypeAdder _opcmGameTypeAdder,
IOPContractsManagerDeployer _opcmDeployer,
IOPContractsManagerUpgrader _opcmUpgrader,
ISuperchainConfig _superchainConfig,
IProtocolVersions _protocolVersions,
IProxyAdmin _superchainProxyAdmin,
string memory _l1ContractsRelease,
Blueprints memory _blueprints,
Implementations memory _implementations,
address _upgradeController
)
external;
Expand All @@ -242,6 +275,10 @@ interface IOPContractsManager {
/// must be added in ascending GameType order.
function addGameType(AddGameInput[] memory _gameConfigs) external returns (AddGameOutput[] memory);

/// @notice Updates the prestate hash for a new game type while keeping all other parameters the same
/// @param _prestateUpdateInputs The new prestate hash to use
function updatePrestate(OpChainConfig[] memory _prestateUpdateInputs) external;

/// @notice Maps an L2 chain ID to an L1 batch inbox address as defined by the standard
/// configuration's convention. This convention is `versionByte || keccak256(bytes32(chainId))[:19]`,
/// where || denotes concatenation`, versionByte is 0x00, and chainId is a uint256.
Expand All @@ -251,6 +288,12 @@ interface IOPContractsManager {
/// @notice Returns the blueprint contract addresses.
function blueprints() external view returns (Blueprints memory);

function opcmDeployer() external view returns (IOPContractsManagerDeployer);

function opcmUpgrader() external view returns (IOPContractsManagerUpgrader);

function opcmGameTypeAdder() external view returns (IOPContractsManagerGameTypeAdder);

/// @notice Returns the implementation contract addresses.
function implementations() external view returns (Implementations memory);

Expand Down

This file was deleted.

Loading