Commit b55f4d73 authored by Blaine Malone's avatar Blaine Malone Committed by GitHub

rename: OPStackManafer -> OPContractsManager (#12091)

parent da9bc723
...@@ -46,6 +46,6 @@ fuzz: ...@@ -46,6 +46,6 @@ fuzz:
sync-standard-version: sync-standard-version:
curl -Lo ./deployer/opsm/standard-versions.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions.toml curl -Lo ./deployer/opcm/standard-versions.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions.toml
.PHONY: test fuzz op-deployer sync-standard-version .PHONY: test fuzz op-deployer sync-standard-version
\ No newline at end of file
...@@ -151,7 +151,7 @@ func TestEndToEndApply(t *testing.T) { ...@@ -151,7 +151,7 @@ func TestEndToEndApply(t *testing.T) {
{"SuperchainConfigImpl", st.SuperchainDeployment.SuperchainConfigImplAddress}, {"SuperchainConfigImpl", st.SuperchainDeployment.SuperchainConfigImplAddress},
{"ProtocolVersionsProxy", st.SuperchainDeployment.ProtocolVersionsProxyAddress}, {"ProtocolVersionsProxy", st.SuperchainDeployment.ProtocolVersionsProxyAddress},
{"ProtocolVersionsImpl", st.SuperchainDeployment.ProtocolVersionsImplAddress}, {"ProtocolVersionsImpl", st.SuperchainDeployment.ProtocolVersionsImplAddress},
{"OpsmProxy", st.ImplementationsDeployment.OpsmProxyAddress}, {"OpcmProxy", st.ImplementationsDeployment.OpcmProxyAddress},
{"DelayedWETHImpl", st.ImplementationsDeployment.DelayedWETHImplAddress}, {"DelayedWETHImpl", st.ImplementationsDeployment.DelayedWETHImplAddress},
{"OptimismPortalImpl", st.ImplementationsDeployment.OptimismPortalImplAddress}, {"OptimismPortalImpl", st.ImplementationsDeployment.OptimismPortalImplAddress},
{"PreimageOracleSingleton", st.ImplementationsDeployment.PreimageOracleSingletonAddress}, {"PreimageOracleSingleton", st.ImplementationsDeployment.PreimageOracleSingletonAddress},
......
package opsm package opcm
import ( import (
"fmt" "fmt"
...@@ -16,7 +16,7 @@ type DeployImplementationsInput struct { ...@@ -16,7 +16,7 @@ type DeployImplementationsInput struct {
ChallengePeriodSeconds *big.Int ChallengePeriodSeconds *big.Int
ProofMaturityDelaySeconds *big.Int ProofMaturityDelaySeconds *big.Int
DisputeGameFinalityDelaySeconds *big.Int DisputeGameFinalityDelaySeconds *big.Int
// Release version to set OPSM implementations for, of the format `op-contracts/vX.Y.Z`. // Release version to set OPCM implementations for, of the format `op-contracts/vX.Y.Z`.
Release string Release string
SuperchainConfigProxy common.Address SuperchainConfigProxy common.Address
ProtocolVersionsProxy common.Address ProtocolVersionsProxy common.Address
...@@ -31,8 +31,8 @@ func (input *DeployImplementationsInput) InputSet() bool { ...@@ -31,8 +31,8 @@ func (input *DeployImplementationsInput) InputSet() bool {
} }
type DeployImplementationsOutput struct { type DeployImplementationsOutput struct {
OpsmProxy common.Address OpcmProxy common.Address
OpsmImpl common.Address OpcmImpl common.Address
DelayedWETHImpl common.Address DelayedWETHImpl common.Address
OptimismPortalImpl common.Address OptimismPortalImpl common.Address
PreimageOracleSingleton common.Address PreimageOracleSingleton common.Address
...@@ -84,12 +84,12 @@ func DeployImplementations( ...@@ -84,12 +84,12 @@ func DeployImplementations(
} }
defer cleanupDeploy() defer cleanupDeploy()
opsmContract := "OPStackManager" opcmContract := "OPContractsManager"
if input.UseInterop { if input.UseInterop {
opsmContract = "OPStackManagerInterop" opcmContract = "OPContractsManagerInterop"
} }
if err := host.RememberOnLabel("OPStackManager", opsmContract+".sol", opsmContract); err != nil { if err := host.RememberOnLabel("OPContractsManager", opcmContract+".sol", opcmContract); err != nil {
return output, fmt.Errorf("failed to link OPStackManager label: %w", err) return output, fmt.Errorf("failed to link OPContractsManager label: %w", err)
} }
// So we can see in detail where the SystemConfig interop initializer fails // So we can see in detail where the SystemConfig interop initializer fails
......
package opsm package opcm
import ( import (
"fmt" "fmt"
...@@ -26,7 +26,7 @@ type DeployOPChainInput struct { ...@@ -26,7 +26,7 @@ type DeployOPChainInput struct {
BasefeeScalar uint32 BasefeeScalar uint32
BlobBaseFeeScalar uint32 BlobBaseFeeScalar uint32
L2ChainId *big.Int L2ChainId *big.Int
OpsmProxy common.Address OpcmProxy common.Address
} }
func (input *DeployOPChainInput) InputSet() bool { func (input *DeployOPChainInput) InputSet() bool {
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry" "github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script" "github.com/ethereum-optimism/optimism/op-chain-ops/script"
...@@ -22,7 +22,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St ...@@ -22,7 +22,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
lgr.Info("deploying implementations") lgr.Info("deploying implementations")
var dump *foundry.ForgeAllocs var dump *foundry.ForgeAllocs
var dio opsm.DeployImplementationsOutput var dio opcm.DeployImplementationsOutput
var err error var err error
err = CallScriptBroadcast( err = CallScriptBroadcast(
ctx, ctx,
...@@ -37,9 +37,9 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St ...@@ -37,9 +37,9 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
Handler: func(host *script.Host) error { Handler: func(host *script.Host) error {
host.SetEnvVar("IMPL_SALT", st.Create2Salt.Hex()[2:]) host.SetEnvVar("IMPL_SALT", st.Create2Salt.Hex()[2:])
host.ImportState(st.SuperchainDeployment.StateDump) host.ImportState(st.SuperchainDeployment.StateDump)
dio, err = opsm.DeployImplementations( dio, err = opcm.DeployImplementations(
host, host,
opsm.DeployImplementationsInput{ opcm.DeployImplementationsInput{
Salt: st.Create2Salt, Salt: st.Create2Salt,
WithdrawalDelaySeconds: big.NewInt(604800), WithdrawalDelaySeconds: big.NewInt(604800),
MinProposalSizeBytes: big.NewInt(126000), MinProposalSizeBytes: big.NewInt(126000),
...@@ -50,7 +50,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St ...@@ -50,7 +50,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
SuperchainConfigProxy: st.SuperchainDeployment.SuperchainConfigProxyAddress, SuperchainConfigProxy: st.SuperchainDeployment.SuperchainConfigProxyAddress,
ProtocolVersionsProxy: st.SuperchainDeployment.ProtocolVersionsProxyAddress, ProtocolVersionsProxy: st.SuperchainDeployment.ProtocolVersionsProxyAddress,
SuperchainProxyAdmin: st.SuperchainDeployment.ProxyAdminAddress, SuperchainProxyAdmin: st.SuperchainDeployment.ProxyAdminAddress,
StandardVersionsToml: opsm.StandardVersionsData, StandardVersionsToml: opcm.StandardVersionsData,
UseInterop: false, UseInterop: false,
}, },
) )
...@@ -70,7 +70,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St ...@@ -70,7 +70,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
} }
st.ImplementationsDeployment = &state.ImplementationsDeployment{ st.ImplementationsDeployment = &state.ImplementationsDeployment{
OpsmProxyAddress: dio.OpsmProxy, OpcmProxyAddress: dio.OpcmProxy,
DelayedWETHImplAddress: dio.DelayedWETHImpl, DelayedWETHImplAddress: dio.DelayedWETHImpl,
OptimismPortalImplAddress: dio.OptimismPortalImpl, OptimismPortalImplAddress: dio.OptimismPortalImpl,
PreimageOracleSingletonAddress: dio.PreimageOracleSingleton, PreimageOracleSingletonAddress: dio.PreimageOracleSingleton,
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry" "github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script" "github.com/ethereum-optimism/optimism/op-chain-ops/script"
...@@ -47,8 +47,8 @@ func GenerateL2Genesis(ctx context.Context, env *Env, artifactsFS foundry.StatDi ...@@ -47,8 +47,8 @@ func GenerateL2Genesis(ctx context.Context, env *Env, artifactsFS foundry.StatDi
Client: env.L1Client, Client: env.L1Client,
Broadcaster: DiscardBroadcaster, Broadcaster: DiscardBroadcaster,
Handler: func(host *script.Host) error { Handler: func(host *script.Host) error {
err := opsm.L2Genesis(host, &opsm.L2GenesisInput{ err := opcm.L2Genesis(host, &opcm.L2GenesisInput{
L1Deployments: opsm.L1Deployments{ L1Deployments: opcm.L1Deployments{
L1CrossDomainMessengerProxy: thisChainState.L1CrossDomainMessengerProxyAddress, L1CrossDomainMessengerProxy: thisChainState.L1CrossDomainMessengerProxyAddress,
L1StandardBridgeProxy: thisChainState.L1StandardBridgeProxyAddress, L1StandardBridgeProxy: thisChainState.L1StandardBridgeProxyAddress,
L1ERC721BridgeProxy: thisChainState.L1ERC721BridgeProxyAddress, L1ERC721BridgeProxy: thisChainState.L1ERC721BridgeProxyAddress,
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry" "github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script" "github.com/ethereum-optimism/optimism/op-chain-ops/script"
...@@ -27,7 +27,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs, ...@@ -27,7 +27,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
return fmt.Errorf("failed to get chain intent: %w", err) return fmt.Errorf("failed to get chain intent: %w", err)
} }
var dco opsm.DeployOPChainOutput var dco opcm.DeployOPChainOutput
err = CallScriptBroadcast( err = CallScriptBroadcast(
ctx, ctx,
CallScriptBroadcastOpts{ CallScriptBroadcastOpts{
...@@ -40,9 +40,9 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs, ...@@ -40,9 +40,9 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
Broadcaster: KeyedBroadcaster, Broadcaster: KeyedBroadcaster,
Handler: func(host *script.Host) error { Handler: func(host *script.Host) error {
host.ImportState(st.ImplementationsDeployment.StateDump) host.ImportState(st.ImplementationsDeployment.StateDump)
dco, err = opsm.DeployOPChain( dco, err = opcm.DeployOPChain(
host, host,
opsm.DeployOPChainInput{ opcm.DeployOPChainInput{
OpChainProxyAdminOwner: thisIntent.Roles.ProxyAdminOwner, OpChainProxyAdminOwner: thisIntent.Roles.ProxyAdminOwner,
SystemConfigOwner: thisIntent.Roles.SystemConfigOwner, SystemConfigOwner: thisIntent.Roles.SystemConfigOwner,
Batcher: thisIntent.Roles.Batcher, Batcher: thisIntent.Roles.Batcher,
...@@ -52,7 +52,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs, ...@@ -52,7 +52,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
BasefeeScalar: 1368, BasefeeScalar: 1368,
BlobBaseFeeScalar: 801949, BlobBaseFeeScalar: 801949,
L2ChainId: chainID.Big(), L2ChainId: chainID.Big(),
OpsmProxy: st.ImplementationsDeployment.OpsmProxyAddress, OpcmProxy: st.ImplementationsDeployment.OpcmProxyAddress,
}, },
) )
return err return err
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"github.com/ethereum-optimism/optimism/op-chain-ops/script" "github.com/ethereum-optimism/optimism/op-chain-ops/script"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/state"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry" "github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -24,7 +24,7 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir ...@@ -24,7 +24,7 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
lgr.Info("deploying superchain") lgr.Info("deploying superchain")
var dump *foundry.ForgeAllocs var dump *foundry.ForgeAllocs
var dso opsm.DeploySuperchainOutput var dso opcm.DeploySuperchainOutput
var err error var err error
err = CallScriptBroadcast( err = CallScriptBroadcast(
ctx, ctx,
...@@ -37,9 +37,9 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir ...@@ -37,9 +37,9 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
Client: env.L1Client, Client: env.L1Client,
Broadcaster: KeyedBroadcaster, Broadcaster: KeyedBroadcaster,
Handler: func(host *script.Host) error { Handler: func(host *script.Host) error {
dso, err = opsm.DeploySuperchain( dso, err = opcm.DeploySuperchain(
host, host,
opsm.DeploySuperchainInput{ opcm.DeploySuperchainInput{
ProxyAdminOwner: intent.SuperchainRoles.ProxyAdminOwner, ProxyAdminOwner: intent.SuperchainRoles.ProxyAdminOwner,
ProtocolVersionsOwner: intent.SuperchainRoles.ProtocolVersionsOwner, ProtocolVersionsOwner: intent.SuperchainRoles.ProtocolVersionsOwner,
Guardian: intent.SuperchainRoles.Guardian, Guardian: intent.SuperchainRoles.Guardian,
......
...@@ -65,7 +65,7 @@ type SuperchainDeployment struct { ...@@ -65,7 +65,7 @@ type SuperchainDeployment struct {
} }
type ImplementationsDeployment struct { type ImplementationsDeployment struct {
OpsmProxyAddress common.Address `json:"opsmProxyAddress"` OpcmProxyAddress common.Address `json:"opcmProxyAddress"`
DelayedWETHImplAddress common.Address `json:"delayedWETHImplAddress"` DelayedWETHImplAddress common.Address `json:"delayedWETHImplAddress"`
OptimismPortalImplAddress common.Address `json:"optimismPortalImplAddress"` OptimismPortalImplAddress common.Address `json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress common.Address `json:"preimageOracleSingletonAddress"` PreimageOracleSingletonAddress common.Address `json:"preimageOracleSingletonAddress"`
......
...@@ -33,7 +33,7 @@ type SuperFaultProofConfig struct { ...@@ -33,7 +33,7 @@ type SuperFaultProofConfig struct {
DisputeGameFinalityDelaySeconds *big.Int DisputeGameFinalityDelaySeconds *big.Int
} }
type OPSMImplementationsConfig struct { type OPCMImplementationsConfig struct {
Release string Release string
FaultProof SuperFaultProofConfig FaultProof SuperFaultProofConfig
...@@ -51,7 +51,7 @@ type SuperchainConfig struct { ...@@ -51,7 +51,7 @@ type SuperchainConfig struct {
Paused bool Paused bool
Implementations OPSMImplementationsConfig Implementations OPCMImplementationsConfig
genesis.SuperchainL1DeployConfig genesis.SuperchainL1DeployConfig
} }
......
...@@ -5,13 +5,12 @@ import ( ...@@ -5,13 +5,12 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/foundry" "github.com/ethereum-optimism/optimism/op-chain-ops/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/beacondeposit" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis/beacondeposit"
...@@ -149,7 +148,7 @@ func prepareInitialL1(l1Host *script.Host, cfg *L1Config) (*L1Deployment, error) ...@@ -149,7 +148,7 @@ func prepareInitialL1(l1Host *script.Host, cfg *L1Config) (*L1Deployment, error)
func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*SuperchainDeployment, error) { func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*SuperchainDeployment, error) {
l1Host.SetTxOrigin(superCfg.Deployer) l1Host.SetTxOrigin(superCfg.Deployer)
superDeployment, err := opsm.DeploySuperchain(l1Host, opsm.DeploySuperchainInput{ superDeployment, err := opcm.DeploySuperchain(l1Host, opcm.DeploySuperchainInput{
ProxyAdminOwner: superCfg.ProxyAdminOwner, ProxyAdminOwner: superCfg.ProxyAdminOwner,
ProtocolVersionsOwner: superCfg.ProtocolVersionsOwner, ProtocolVersionsOwner: superCfg.ProtocolVersionsOwner,
Guardian: superCfg.SuperchainConfigGuardian, Guardian: superCfg.SuperchainConfigGuardian,
...@@ -161,7 +160,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup ...@@ -161,7 +160,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
return nil, fmt.Errorf("failed to deploy Superchain contracts: %w", err) return nil, fmt.Errorf("failed to deploy Superchain contracts: %w", err)
} }
implementationsDeployment, err := opsm.DeployImplementations(l1Host, opsm.DeployImplementationsInput{ implementationsDeployment, err := opcm.DeployImplementations(l1Host, opcm.DeployImplementationsInput{
WithdrawalDelaySeconds: superCfg.Implementations.FaultProof.WithdrawalDelaySeconds, WithdrawalDelaySeconds: superCfg.Implementations.FaultProof.WithdrawalDelaySeconds,
MinProposalSizeBytes: superCfg.Implementations.FaultProof.MinProposalSizeBytes, MinProposalSizeBytes: superCfg.Implementations.FaultProof.MinProposalSizeBytes,
ChallengePeriodSeconds: superCfg.Implementations.FaultProof.ChallengePeriodSeconds, ChallengePeriodSeconds: superCfg.Implementations.FaultProof.ChallengePeriodSeconds,
...@@ -172,7 +171,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup ...@@ -172,7 +171,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
ProtocolVersionsProxy: superDeployment.ProtocolVersionsProxy, ProtocolVersionsProxy: superDeployment.ProtocolVersionsProxy,
SuperchainProxyAdmin: superDeployment.SuperchainProxyAdmin, SuperchainProxyAdmin: superDeployment.SuperchainProxyAdmin,
UseInterop: superCfg.Implementations.UseInterop, UseInterop: superCfg.Implementations.UseInterop,
StandardVersionsToml: opsm.StandardVersionsData, StandardVersionsToml: opcm.StandardVersionsData,
}) })
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to deploy Implementations contracts: %w", err) return nil, fmt.Errorf("failed to deploy Implementations contracts: %w", err)
...@@ -197,7 +196,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme ...@@ -197,7 +196,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
l1Host.SetTxOrigin(cfg.Deployer) l1Host.SetTxOrigin(cfg.Deployer)
output, err := opsm.DeployOPChain(l1Host, opsm.DeployOPChainInput{ output, err := opcm.DeployOPChain(l1Host, opcm.DeployOPChainInput{
OpChainProxyAdminOwner: cfg.ProxyAdminOwner, OpChainProxyAdminOwner: cfg.ProxyAdminOwner,
SystemConfigOwner: cfg.SystemConfigOwner, SystemConfigOwner: cfg.SystemConfigOwner,
Batcher: cfg.BatchSenderAddress, Batcher: cfg.BatchSenderAddress,
...@@ -207,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme ...@@ -207,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar, BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar,
BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar, BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar,
L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID), L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID),
OpsmProxy: superDeployment.OpsmProxy, OpcmProxy: superDeployment.OpcmProxy,
}) })
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err) return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err)
...@@ -220,8 +219,8 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme ...@@ -220,8 +219,8 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
} }
func genesisL2(l2Host *script.Host, cfg *L2Config, deployment *L2Deployment) error { func genesisL2(l2Host *script.Host, cfg *L2Config, deployment *L2Deployment) error {
if err := opsm.L2Genesis(l2Host, &opsm.L2GenesisInput{ if err := opcm.L2Genesis(l2Host, &opcm.L2GenesisInput{
L1Deployments: opsm.L1Deployments{ L1Deployments: opcm.L1Deployments{
L1CrossDomainMessengerProxy: deployment.L1CrossDomainMessengerProxy, L1CrossDomainMessengerProxy: deployment.L1CrossDomainMessengerProxy,
L1StandardBridgeProxy: deployment.L1StandardBridgeProxy, L1StandardBridgeProxy: deployment.L1StandardBridgeProxy,
L1ERC721BridgeProxy: deployment.L1ERC721BridgeProxy, L1ERC721BridgeProxy: deployment.L1ERC721BridgeProxy,
......
...@@ -9,8 +9,8 @@ type L1Deployment struct { ...@@ -9,8 +9,8 @@ type L1Deployment struct {
} }
type Implementations struct { type Implementations struct {
OpsmProxy common.Address `json:"OPSMProxy"` OpcmProxy common.Address `json:"OPCMProxy"`
OpsmImpl common.Address `json:"OPSMImpl"` OpcmImpl common.Address `json:"OPCMImpl"`
DelayedWETHImpl common.Address `json:"DelayedWETHImpl"` DelayedWETHImpl common.Address `json:"DelayedWETHImpl"`
OptimismPortalImpl common.Address `json:"OptimismPortalImpl"` OptimismPortalImpl common.Address `json:"OptimismPortalImpl"`
PreimageOracleSingleton common.Address `json:"PreimageOracleSingleton"` PreimageOracleSingleton common.Address `json:"PreimageOracleSingleton"`
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm" "github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opcm"
"github.com/ethereum-optimism/optimism/op-chain-ops/devkeys" "github.com/ethereum-optimism/optimism/op-chain-ops/devkeys"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
) )
...@@ -67,7 +67,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error) ...@@ -67,7 +67,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
ProxyAdminOwner: superchainProxyAdmin, ProxyAdminOwner: superchainProxyAdmin,
ProtocolVersionsOwner: superchainProtocolVersionsOwner, ProtocolVersionsOwner: superchainProtocolVersionsOwner,
Deployer: superchainDeployer, Deployer: superchainDeployer,
Implementations: OPSMImplementationsConfig{ Implementations: OPCMImplementationsConfig{
Release: "dev", Release: "dev",
FaultProof: SuperFaultProofConfig{ FaultProof: SuperFaultProofConfig{
WithdrawalDelaySeconds: big.NewInt(604800), WithdrawalDelaySeconds: big.NewInt(604800),
...@@ -77,7 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error) ...@@ -77,7 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
DisputeGameFinalityDelaySeconds: big.NewInt(6), DisputeGameFinalityDelaySeconds: big.NewInt(6),
}, },
UseInterop: true, UseInterop: true,
StandardVersionsToml: opsm.StandardVersionsData, StandardVersionsToml: opcm.StandardVersionsData,
}, },
SuperchainL1DeployConfig: genesis.SuperchainL1DeployConfig{ SuperchainL1DeployConfig: genesis.SuperchainL1DeployConfig{
RequiredProtocolVersion: params.OPStackSupport, RequiredProtocolVersion: params.OPStackSupport,
......
...@@ -28,7 +28,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol ...@@ -28,7 +28,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.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 { OPStackManager } from "src/L1/OPStackManager.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";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...@@ -36,7 +36,7 @@ import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol"; ...@@ -36,7 +36,7 @@ import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol";
import { L1StandardBridge } from "src/L1/L1StandardBridge.sol"; import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol"; import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
import { OPStackManagerInterop } from "src/L1/OPStackManagerInterop.sol"; import { OPContractsManagerInterop } from "src/L1/OPContractsManagerInterop.sol";
import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol"; import { OptimismPortalInterop } from "src/L1/OptimismPortalInterop.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol"; import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
...@@ -55,7 +55,7 @@ contract DeployImplementationsInput is BaseDeployIO { ...@@ -55,7 +55,7 @@ contract DeployImplementationsInput is BaseDeployIO {
uint256 internal _proofMaturityDelaySeconds; uint256 internal _proofMaturityDelaySeconds;
uint256 internal _disputeGameFinalityDelaySeconds; uint256 internal _disputeGameFinalityDelaySeconds;
// The release version to set OPSM implementations for, of the format `op-contracts/vX.Y.Z`. // The release version to set OPCM implementations for, of the format `op-contracts/vX.Y.Z`.
string internal _release; string internal _release;
// Outputs from DeploySuperchain.s.sol. // Outputs from DeploySuperchain.s.sol.
...@@ -166,8 +166,8 @@ contract DeployImplementationsInput is BaseDeployIO { ...@@ -166,8 +166,8 @@ contract DeployImplementationsInput is BaseDeployIO {
} }
contract DeployImplementationsOutput is BaseDeployIO { contract DeployImplementationsOutput is BaseDeployIO {
OPStackManager internal _opsmProxy; OPContractsManager internal _opcmProxy;
OPStackManager internal _opsmImpl; OPContractsManager internal _opcmImpl;
DelayedWETH internal _delayedWETHImpl; DelayedWETH internal _delayedWETHImpl;
OptimismPortal2 internal _optimismPortalImpl; OptimismPortal2 internal _optimismPortalImpl;
PreimageOracle internal _preimageOracleSingleton; PreimageOracle internal _preimageOracleSingleton;
...@@ -183,8 +183,8 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -183,8 +183,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address"); require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address");
// forgefmt: disable-start // forgefmt: disable-start
if (sel == this.opsmProxy.selector) _opsmProxy = OPStackManager(payable(_addr)); if (sel == this.opcmProxy.selector) _opcmProxy = OPContractsManager(payable(_addr));
else if (sel == this.opsmImpl.selector) _opsmImpl = OPStackManager(payable(_addr)); else if (sel == this.opcmImpl.selector) _opcmImpl = OPContractsManager(payable(_addr));
else if (sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr)); else if (sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr));
else if (sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr)); else if (sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr));
else if (sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr); else if (sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr);
...@@ -203,8 +203,8 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -203,8 +203,8 @@ contract DeployImplementationsOutput is BaseDeployIO {
// With 12 addresses, we'd get a stack too deep error if we tried to do this inline as a // With 12 addresses, we'd get a stack too deep error if we tried to do this inline as a
// single call to `Solarray.addresses`. So we split it into two calls. // single call to `Solarray.addresses`. So we split it into two calls.
address[] memory addrs1 = Solarray.addresses( address[] memory addrs1 = Solarray.addresses(
address(this.opsmProxy()), address(this.opcmProxy()),
address(this.opsmImpl()), address(this.opcmImpl()),
address(this.optimismPortalImpl()), address(this.optimismPortalImpl()),
address(this.delayedWETHImpl()), address(this.delayedWETHImpl()),
address(this.preimageOracleSingleton()), address(this.preimageOracleSingleton()),
...@@ -225,15 +225,15 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -225,15 +225,15 @@ contract DeployImplementationsOutput is BaseDeployIO {
assertValidDeploy(_dii); assertValidDeploy(_dii);
} }
function opsmProxy() public returns (OPStackManager) { function opcmProxy() public returns (OPContractsManager) {
DeployUtils.assertValidContractAddress(address(_opsmProxy)); DeployUtils.assertValidContractAddress(address(_opcmProxy));
DeployUtils.assertImplementationSet(address(_opsmProxy)); DeployUtils.assertImplementationSet(address(_opcmProxy));
return _opsmProxy; return _opcmProxy;
} }
function opsmImpl() public view returns (OPStackManager) { function opcmImpl() public view returns (OPContractsManager) {
DeployUtils.assertValidContractAddress(address(_opsmImpl)); DeployUtils.assertValidContractAddress(address(_opcmImpl));
return _opsmImpl; return _opcmImpl;
} }
function optimismPortalImpl() public view returns (OptimismPortal2) { function optimismPortalImpl() public view returns (OptimismPortal2) {
...@@ -294,35 +294,35 @@ contract DeployImplementationsOutput is BaseDeployIO { ...@@ -294,35 +294,35 @@ contract DeployImplementationsOutput is BaseDeployIO {
assertValidL1ERC721BridgeImpl(_dii); assertValidL1ERC721BridgeImpl(_dii);
assertValidL1StandardBridgeImpl(_dii); assertValidL1StandardBridgeImpl(_dii);
assertValidMipsSingleton(_dii); assertValidMipsSingleton(_dii);
assertValidOpsmProxy(_dii); assertValidOpcmProxy(_dii);
assertValidOpsmImpl(_dii); assertValidOpcmImpl(_dii);
assertValidOptimismMintableERC20FactoryImpl(_dii); assertValidOptimismMintableERC20FactoryImpl(_dii);
assertValidOptimismPortalImpl(_dii); assertValidOptimismPortalImpl(_dii);
assertValidPreimageOracleSingleton(_dii); assertValidPreimageOracleSingleton(_dii);
assertValidSystemConfigImpl(_dii); assertValidSystemConfigImpl(_dii);
} }
function assertValidOpsmProxy(DeployImplementationsInput _dii) internal { function assertValidOpcmProxy(DeployImplementationsInput _dii) internal {
// First we check the proxy as itself. // First we check the proxy as itself.
Proxy proxy = Proxy(payable(address(opsmProxy()))); Proxy proxy = Proxy(payable(address(opcmProxy())));
vm.prank(address(0)); vm.prank(address(0));
address admin = proxy.admin(); address admin = proxy.admin();
require(admin == address(_dii.superchainProxyAdmin()), "OPSMP-10"); require(admin == address(_dii.superchainProxyAdmin()), "OPCMP-10");
// Then we check the proxy as OPSM. // Then we check the proxy as OPCM.
DeployUtils.assertInitialized({ _contractAddress: address(opsmProxy()), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(opcmProxy()), _slot: 0, _offset: 0 });
require(address(opsmProxy().superchainConfig()) == address(_dii.superchainConfigProxy()), "OPSMP-20"); require(address(opcmProxy().superchainConfig()) == address(_dii.superchainConfigProxy()), "OPCMP-20");
require(address(opsmProxy().protocolVersions()) == address(_dii.protocolVersionsProxy()), "OPSMP-30"); require(address(opcmProxy().protocolVersions()) == address(_dii.protocolVersionsProxy()), "OPCMP-30");
require(LibString.eq(opsmProxy().latestRelease(), _dii.release()), "OPSMP-50"); // Initial release is latest. require(LibString.eq(opcmProxy().latestRelease(), _dii.release()), "OPCMP-50"); // Initial release is latest.
} }
function assertValidOpsmImpl(DeployImplementationsInput _dii) internal { function assertValidOpcmImpl(DeployImplementationsInput _dii) internal {
Proxy proxy = Proxy(payable(address(opsmProxy()))); Proxy proxy = Proxy(payable(address(opcmProxy())));
vm.prank(address(0)); vm.prank(address(0));
OPStackManager impl = OPStackManager(proxy.implementation()); OPContractsManager impl = OPContractsManager(proxy.implementation());
DeployUtils.assertInitialized({ _contractAddress: address(impl), _slot: 0, _offset: 0 }); DeployUtils.assertInitialized({ _contractAddress: address(impl), _slot: 0, _offset: 0 });
require(address(impl.superchainConfig()) == address(_dii.superchainConfigProxy()), "OPSMI-10"); require(address(impl.superchainConfig()) == address(_dii.superchainConfigProxy()), "OPCMI-10");
require(address(impl.protocolVersions()) == address(_dii.protocolVersionsProxy()), "OPSMI-20"); require(address(impl.protocolVersions()) == address(_dii.protocolVersionsProxy()), "OPCMI-20");
} }
function assertValidOptimismPortalImpl(DeployImplementationsInput) internal view { function assertValidOptimismPortalImpl(DeployImplementationsInput) internal view {
...@@ -468,42 +468,42 @@ contract DeployImplementations is Script { ...@@ -468,42 +468,42 @@ contract DeployImplementations is Script {
deployMipsSingleton(_dii, _dio); deployMipsSingleton(_dii, _dio);
deployDisputeGameFactoryImpl(_dii, _dio); deployDisputeGameFactoryImpl(_dii, _dio);
// Deploy the OP Stack Manager with the new implementations set. // Deploy the OP Contracts Manager with the new implementations set.
deployOPStackManager(_dii, _dio); deployOPContractsManager(_dii, _dio);
_dio.checkOutput(_dii); _dio.checkOutput(_dii);
} }
// -------- Deployment Steps -------- // -------- Deployment Steps --------
// --- OP Stack Manager --- // --- OP Contracts Manager ---
function opsmSystemConfigSetter( function opcmSystemConfigSetter(
DeployImplementationsInput, DeployImplementationsInput,
DeployImplementationsOutput _dio DeployImplementationsOutput _dio
) )
internal internal
view view
virtual virtual
returns (OPStackManager.ImplementationSetter memory) returns (OPContractsManager.ImplementationSetter memory)
{ {
return OPStackManager.ImplementationSetter({ return OPContractsManager.ImplementationSetter({
name: "SystemConfig", name: "SystemConfig",
info: OPStackManager.Implementation(address(_dio.systemConfigImpl()), SystemConfig.initialize.selector) info: OPContractsManager.Implementation(address(_dio.systemConfigImpl()), SystemConfig.initialize.selector)
}); });
} }
// Deploy and initialize a proxied OPStackManager. // Deploy and initialize a proxied OPContractsManager.
function createOPSMContract( function createOPCMContract(
DeployImplementationsInput _dii, DeployImplementationsInput _dii,
DeployImplementationsOutput _dio, DeployImplementationsOutput _dio,
OPStackManager.Blueprints memory _blueprints, OPContractsManager.Blueprints memory _blueprints,
string memory _release, string memory _release,
OPStackManager.ImplementationSetter[] memory _setters OPContractsManager.ImplementationSetter[] memory _setters
) )
internal internal
virtual virtual
returns (OPStackManager opsmProxy_) returns (OPContractsManager opcmProxy_)
{ {
ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin(); ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin();
...@@ -511,29 +511,35 @@ contract DeployImplementations is Script { ...@@ -511,29 +511,35 @@ contract DeployImplementations is Script {
Proxy proxy = new Proxy(address(msg.sender)); Proxy proxy = new Proxy(address(msg.sender));
deployOPContractsManagerImpl(_dii, _dio); deployOPContractsManagerImpl(_dii, _dio);
OPStackManager opsmImpl = _dio.opsmImpl(); OPContractsManager opcmImpl = _dio.opcmImpl();
OPStackManager.InitializerInputs memory initializerInputs = OPContractsManager.InitializerInputs memory initializerInputs =
OPStackManager.InitializerInputs(_blueprints, _setters, _release, true); OPContractsManager.InitializerInputs(_blueprints, _setters, _release, true);
vm.startBroadcast(msg.sender); vm.startBroadcast(msg.sender);
proxy.upgradeToAndCall( proxy.upgradeToAndCall(
address(opsmImpl), abi.encodeWithSelector(opsmImpl.initialize.selector, initializerInputs) address(opcmImpl), abi.encodeWithSelector(opcmImpl.initialize.selector, initializerInputs)
); );
proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract
vm.stopBroadcast(); vm.stopBroadcast();
opsmProxy_ = OPStackManager(address(proxy)); opcmProxy_ = OPContractsManager(address(proxy));
} }
function deployOPStackManager(DeployImplementationsInput _dii, DeployImplementationsOutput _dio) public virtual { function deployOPContractsManager(
DeployImplementationsInput _dii,
DeployImplementationsOutput _dio
)
public
virtual
{
string memory release = _dii.release(); string memory release = _dii.release();
// First we deploy the blueprints for the singletons deployed by OPSM. // First we deploy the blueprints for the singletons deployed by OPCM.
// forgefmt: disable-start // forgefmt: disable-start
bytes32 salt = _dii.salt(); bytes32 salt = _dii.salt();
OPStackManager.Blueprints memory blueprints; OPContractsManager.Blueprints memory blueprints;
vm.startBroadcast(msg.sender); vm.startBroadcast(msg.sender);
blueprints.addressManager = deployBytecode(Blueprint.blueprintDeployerBytecode(type(AddressManager).creationCode), salt); blueprints.addressManager = deployBytecode(Blueprint.blueprintDeployerBytecode(type(AddressManager).creationCode), salt);
...@@ -546,54 +552,56 @@ contract DeployImplementations is Script { ...@@ -546,54 +552,56 @@ contract DeployImplementations is Script {
vm.stopBroadcast(); vm.stopBroadcast();
// forgefmt: disable-end // forgefmt: disable-end
OPStackManager.ImplementationSetter[] memory setters = new OPStackManager.ImplementationSetter[](9); OPContractsManager.ImplementationSetter[] memory setters = new OPContractsManager.ImplementationSetter[](9);
setters[0] = OPStackManager.ImplementationSetter({ setters[0] = OPContractsManager.ImplementationSetter({
name: "L1ERC721Bridge", name: "L1ERC721Bridge",
info: OPStackManager.Implementation(address(_dio.l1ERC721BridgeImpl()), L1ERC721Bridge.initialize.selector) info: OPContractsManager.Implementation(address(_dio.l1ERC721BridgeImpl()), L1ERC721Bridge.initialize.selector)
}); });
setters[1] = OPStackManager.ImplementationSetter({ setters[1] = OPContractsManager.ImplementationSetter({
name: "OptimismPortal", name: "OptimismPortal",
info: OPStackManager.Implementation(address(_dio.optimismPortalImpl()), OptimismPortal2.initialize.selector) info: OPContractsManager.Implementation(address(_dio.optimismPortalImpl()), OptimismPortal2.initialize.selector)
}); });
setters[2] = opsmSystemConfigSetter(_dii, _dio); setters[2] = opcmSystemConfigSetter(_dii, _dio);
setters[3] = OPStackManager.ImplementationSetter({ setters[3] = OPContractsManager.ImplementationSetter({
name: "OptimismMintableERC20Factory", name: "OptimismMintableERC20Factory",
info: OPStackManager.Implementation( info: OPContractsManager.Implementation(
address(_dio.optimismMintableERC20FactoryImpl()), OptimismMintableERC20Factory.initialize.selector address(_dio.optimismMintableERC20FactoryImpl()), OptimismMintableERC20Factory.initialize.selector
) )
}); });
setters[4] = OPStackManager.ImplementationSetter({ setters[4] = OPContractsManager.ImplementationSetter({
name: "L1CrossDomainMessenger", name: "L1CrossDomainMessenger",
info: OPStackManager.Implementation( info: OPContractsManager.Implementation(
address(_dio.l1CrossDomainMessengerImpl()), L1CrossDomainMessenger.initialize.selector address(_dio.l1CrossDomainMessengerImpl()), L1CrossDomainMessenger.initialize.selector
) )
}); });
setters[5] = OPStackManager.ImplementationSetter({ setters[5] = OPContractsManager.ImplementationSetter({
name: "L1StandardBridge", name: "L1StandardBridge",
info: OPStackManager.Implementation(address(_dio.l1StandardBridgeImpl()), L1StandardBridge.initialize.selector) info: OPContractsManager.Implementation(
address(_dio.l1StandardBridgeImpl()), L1StandardBridge.initialize.selector
)
}); });
setters[6] = OPStackManager.ImplementationSetter({ setters[6] = OPContractsManager.ImplementationSetter({
name: "DisputeGameFactory", name: "DisputeGameFactory",
info: OPStackManager.Implementation( info: OPContractsManager.Implementation(
address(_dio.disputeGameFactoryImpl()), DisputeGameFactory.initialize.selector address(_dio.disputeGameFactoryImpl()), DisputeGameFactory.initialize.selector
) )
}); });
setters[7] = OPStackManager.ImplementationSetter({ setters[7] = OPContractsManager.ImplementationSetter({
name: "DelayedWETH", name: "DelayedWETH",
info: OPStackManager.Implementation(address(_dio.delayedWETHImpl()), DelayedWETH.initialize.selector) info: OPContractsManager.Implementation(address(_dio.delayedWETHImpl()), DelayedWETH.initialize.selector)
}); });
setters[8] = OPStackManager.ImplementationSetter({ setters[8] = OPContractsManager.ImplementationSetter({
name: "MIPS", name: "MIPS",
// MIPS is a singleton for all chains, so it doesn't need to be initialized, so the // MIPS is a singleton for all chains, so it doesn't need to be initialized, so the
// selector is just `bytes4(0)`. // selector is just `bytes4(0)`.
info: OPStackManager.Implementation(address(_dio.mipsSingleton()), bytes4(0)) info: OPContractsManager.Implementation(address(_dio.mipsSingleton()), bytes4(0))
}); });
// This call contains a broadcast to deploy OPSM which is proxied. // This call contains a broadcast to deploy OPCM which is proxied.
OPStackManager opsmProxy = createOPSMContract(_dii, _dio, blueprints, release, setters); OPContractsManager opcmProxy = createOPCMContract(_dii, _dio, blueprints, release, setters);
vm.label(address(opsmProxy), "OPStackManager"); vm.label(address(opcmProxy), "OPContractsManager");
_dio.set(_dio.opsmProxy.selector, address(opsmProxy)); _dio.set(_dio.opcmProxy.selector, address(opcmProxy));
} }
// --- Core Contracts --- // --- Core Contracts ---
...@@ -736,10 +744,10 @@ contract DeployImplementations is Script { ...@@ -736,10 +744,10 @@ contract DeployImplementations is Script {
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.
OPStackManager impl = new OPStackManager(superchainConfigProxy, protocolVersionsProxy); OPContractsManager impl = new OPContractsManager(superchainConfigProxy, protocolVersionsProxy);
vm.label(address(impl), "OPStackManagerImpl"); vm.label(address(impl), "OPContractsManagerImpl");
_dio.set(_dio.opsmImpl.selector, address(impl)); _dio.set(_dio.opcmImpl.selector, address(impl));
} }
// --- Fault Proofs Contracts --- // --- Fault Proofs Contracts ---
...@@ -968,7 +976,7 @@ contract DeployImplementations is Script { ...@@ -968,7 +976,7 @@ contract DeployImplementations is Script {
// architecture, this comment block documents how to update the deploy scripts to support new features. // architecture, this comment block documents how to update the deploy scripts to support new features.
// //
// Using the base scripts and contracts (DeploySuperchain, DeployImplementations, DeployOPChain, and // Using the base scripts and contracts (DeploySuperchain, DeployImplementations, DeployOPChain, and
// the corresponding OPStackManager) deploys a standard chain. For nonstandard and in-development // the corresponding OPContractsManager) deploys a standard chain. For nonstandard and in-development
// features we need to modify some or all of those contracts, and we do that via inheritance. Using // features we need to modify some or all of those contracts, and we do that via inheritance. Using
// interop as an example, they've made the following changes to L1 contracts: // interop as an example, they've made the following changes to L1 contracts:
// - `OptimismPortalInterop is OptimismPortal`: A different portal implementation is used, and // - `OptimismPortalInterop is OptimismPortal`: A different portal implementation is used, and
...@@ -981,32 +989,32 @@ contract DeployImplementations is Script { ...@@ -981,32 +989,32 @@ contract DeployImplementations is Script {
// Similar to how inheritance was used to develop the new portal and system config contracts, we use // 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 // inheritance to modify up to all of the deployer contracts. For this interop example, what this
// means is we need: // means is we need:
// - An `OPStackManagerInterop is OPStackManager` that knows how to encode the calldata for the // - An `OPContractsManagerInterop is OPContractsManager` that knows how to encode the calldata for the
// new system config initializer. // new system config initializer.
// - A `DeployImplementationsInterop is DeployImplementations` that: // - A `DeployImplementationsInterop is DeployImplementations` that:
// - Deploys OptimismPortalInterop instead of OptimismPortal. // - Deploys OptimismPortalInterop instead of OptimismPortal.
// - Deploys SystemConfigInterop instead of SystemConfig. // - Deploys SystemConfigInterop instead of SystemConfig.
// - Deploys OPStackManagerInterop instead of OPStackManager, which contains the updated logic // - Deploys OPContractsManagerInterop instead of OPContractsManager, which contains the updated logic
// for encoding the SystemConfig initializer. // for encoding the SystemConfig initializer.
// - Updates the OPSM release setter logic to use the updated initializer. // - Updates the OPCM release setter logic to use the updated initializer.
// - A `DeployOPChainInterop is DeployOPChain` that allows the updated input parameter to be passed. // - A `DeployOPChainInterop is DeployOPChain` that allows the updated input parameter to be passed.
// //
// Most of the complexity in the above flow comes from the the new input for the updated 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 // initializer. If all function signatures were the same, all we'd have to change is the contract
// implementations that are deployed then set in the OPSM. For now, to simplify things until we // implementations that are deployed then set in the OPCM. For now, to simplify things until we
// resolve https://github.com/ethereum-optimism/optimism/issues/11783, we just assume this new role // resolve https://github.com/ethereum-optimism/optimism/issues/11783, we just assume this new role
// is the same as the proxy admin owner. // is the same as the proxy admin owner.
contract DeployImplementationsInterop is DeployImplementations { contract DeployImplementationsInterop is DeployImplementations {
function createOPSMContract( function createOPCMContract(
DeployImplementationsInput _dii, DeployImplementationsInput _dii,
DeployImplementationsOutput _dio, DeployImplementationsOutput _dio,
OPStackManager.Blueprints memory _blueprints, OPContractsManager.Blueprints memory _blueprints,
string memory _release, string memory _release,
OPStackManager.ImplementationSetter[] memory _setters OPContractsManager.ImplementationSetter[] memory _setters
) )
internal internal
override override
returns (OPStackManager opsmProxy_) returns (OPContractsManager opcmProxy_)
{ {
ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin(); ProxyAdmin proxyAdmin = _dii.superchainProxyAdmin();
...@@ -1014,20 +1022,20 @@ contract DeployImplementationsInterop is DeployImplementations { ...@@ -1014,20 +1022,20 @@ contract DeployImplementationsInterop is DeployImplementations {
Proxy proxy = new Proxy(address(msg.sender)); Proxy proxy = new Proxy(address(msg.sender));
deployOPContractsManagerImpl(_dii, _dio); // overriding function deployOPContractsManagerImpl(_dii, _dio); // overriding function
OPStackManager opsmImpl = _dio.opsmImpl(); OPContractsManager opcmImpl = _dio.opcmImpl();
OPStackManager.InitializerInputs memory initializerInputs = OPContractsManager.InitializerInputs memory initializerInputs =
OPStackManager.InitializerInputs(_blueprints, _setters, _release, true); OPContractsManager.InitializerInputs(_blueprints, _setters, _release, true);
vm.startBroadcast(msg.sender); vm.startBroadcast(msg.sender);
proxy.upgradeToAndCall( proxy.upgradeToAndCall(
address(opsmImpl), abi.encodeWithSelector(opsmImpl.initialize.selector, initializerInputs) address(opcmImpl), abi.encodeWithSelector(opcmImpl.initialize.selector, initializerInputs)
); );
proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract proxy.changeAdmin(address(proxyAdmin)); // transfer ownership of Proxy contract to the ProxyAdmin contract
vm.stopBroadcast(); vm.stopBroadcast();
opsmProxy_ = OPStackManagerInterop(address(proxy)); opcmProxy_ = OPContractsManagerInterop(address(proxy));
} }
function deployOptimismPortalImpl( function deployOptimismPortalImpl(
...@@ -1097,24 +1105,26 @@ contract DeployImplementationsInterop is DeployImplementations { ...@@ -1097,24 +1105,26 @@ contract DeployImplementationsInterop is DeployImplementations {
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.
OPStackManager impl = new OPStackManagerInterop(superchainConfigProxy, protocolVersionsProxy); OPContractsManager impl = new OPContractsManagerInterop(superchainConfigProxy, protocolVersionsProxy);
vm.label(address(impl), "OPStackManagerImpl"); vm.label(address(impl), "OPContractsManagerImpl");
_dio.set(_dio.opsmImpl.selector, address(impl)); _dio.set(_dio.opcmImpl.selector, address(impl));
} }
function opsmSystemConfigSetter( function opcmSystemConfigSetter(
DeployImplementationsInput, DeployImplementationsInput,
DeployImplementationsOutput _dio DeployImplementationsOutput _dio
) )
internal internal
view view
override override
returns (OPStackManager.ImplementationSetter memory) returns (OPContractsManager.ImplementationSetter memory)
{ {
return OPStackManager.ImplementationSetter({ return OPContractsManager.ImplementationSetter({
name: "SystemConfig", name: "SystemConfig",
info: OPStackManager.Implementation(address(_dio.systemConfigImpl()), SystemConfigInterop.initialize.selector) info: OPContractsManager.Implementation(
address(_dio.systemConfigImpl()), SystemConfigInterop.initialize.selector
)
}); });
} }
} }
...@@ -26,7 +26,7 @@ import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol"; ...@@ -26,7 +26,7 @@ import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol"; import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol";
import { Claim, GameType, GameTypes, Hash, OutputRoot } from "src/dispute/lib/Types.sol"; import { Claim, GameType, GameTypes, Hash, OutputRoot } from "src/dispute/lib/Types.sol";
import { OPStackManager } from "src/L1/OPStackManager.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";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...@@ -46,7 +46,7 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -46,7 +46,7 @@ contract DeployOPChainInput is BaseDeployIO {
uint32 internal _basefeeScalar; uint32 internal _basefeeScalar;
uint32 internal _blobBaseFeeScalar; uint32 internal _blobBaseFeeScalar;
uint256 internal _l2ChainId; uint256 internal _l2ChainId;
OPStackManager internal _opsmProxy; OPContractsManager internal _opcmProxy;
function set(bytes4 _sel, address _addr) public { function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployOPChainInput: cannot set zero address"); require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
...@@ -56,7 +56,7 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -56,7 +56,7 @@ contract DeployOPChainInput is BaseDeployIO {
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr; else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.proposer.selector) _proposer = _addr; else if (_sel == this.proposer.selector) _proposer = _addr;
else if (_sel == this.challenger.selector) _challenger = _addr; else if (_sel == this.challenger.selector) _challenger = _addr;
else if (_sel == this.opsmProxy.selector) _opsmProxy = OPStackManager(_addr); else if (_sel == this.opcmProxy.selector) _opcmProxy = OPContractsManager(_addr);
else revert("DeployOPChainInput: unknown selector"); else revert("DeployOPChainInput: unknown selector");
} }
...@@ -129,7 +129,7 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -129,7 +129,7 @@ contract DeployOPChainInput is BaseDeployIO {
// anchor root and deploy a new permissioned dispute game contract anyway. // anchor root and deploy a new permissioned dispute game contract anyway.
// //
// You can `console.logBytes(abi.encode(defaultStartingAnchorRoots))` to get the bytes that // You can `console.logBytes(abi.encode(defaultStartingAnchorRoots))` to get the bytes that
// are hardcoded into `op-chain-ops/deployer/opsm/opchain.go` // are hardcoded into `op-chain-ops/deployer/opcm/opchain.go`
AnchorStateRegistry.StartingAnchorRoot[] memory defaultStartingAnchorRoots = AnchorStateRegistry.StartingAnchorRoot[] memory defaultStartingAnchorRoots =
new AnchorStateRegistry.StartingAnchorRoot[](1); new AnchorStateRegistry.StartingAnchorRoot[](1);
defaultStartingAnchorRoots[0] = AnchorStateRegistry.StartingAnchorRoot({ defaultStartingAnchorRoots[0] = AnchorStateRegistry.StartingAnchorRoot({
...@@ -139,10 +139,10 @@ contract DeployOPChainInput is BaseDeployIO { ...@@ -139,10 +139,10 @@ contract DeployOPChainInput is BaseDeployIO {
return abi.encode(defaultStartingAnchorRoots); return abi.encode(defaultStartingAnchorRoots);
} }
// TODO: Check that opsm is proxied and it has an implementation. // TODO: Check that opcm is proxied and it has an implementation.
function opsmProxy() public view returns (OPStackManager) { function opcmProxy() public view returns (OPContractsManager) {
require(address(_opsmProxy) != address(0), "DeployOPChainInput: not set"); require(address(_opcmProxy) != address(0), "DeployOPChainInput: not set");
return _opsmProxy; return _opcmProxy;
} }
} }
...@@ -309,8 +309,8 @@ contract DeployOPChainOutput is BaseDeployIO { ...@@ -309,8 +309,8 @@ contract DeployOPChainOutput is BaseDeployIO {
require(GameType.unwrap(game.gameType()) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON), "DPG-10"); require(GameType.unwrap(game.gameType()) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON), "DPG-10");
require(Claim.unwrap(game.absolutePrestate()) == bytes32(hex"dead"), "DPG-20"); require(Claim.unwrap(game.absolutePrestate()) == bytes32(hex"dead"), "DPG-20");
OPStackManager opsm = _doi.opsmProxy(); OPContractsManager opcm = _doi.opcmProxy();
(address mips,) = opsm.implementations(opsm.latestRelease(), "MIPS"); (address mips,) = opcm.implementations(opcm.latestRelease(), "MIPS");
require(game.vm() == IBigStepper(mips), "DPG-30"); require(game.vm() == IBigStepper(mips), "DPG-30");
require(address(game.weth()) == address(delayedWETHPermissionedGameProxy()), "DPG-40"); require(address(game.weth()) == address(delayedWETHPermissionedGameProxy()), "DPG-40");
...@@ -368,7 +368,7 @@ contract DeployOPChainOutput is BaseDeployIO { ...@@ -368,7 +368,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(systemConfig.startBlock() == block.number, "SYSCON-140"); require(systemConfig.startBlock() == block.number, "SYSCON-140");
require( require(
systemConfig.batchInbox() == _doi.opsmProxy().chainIdToBatchInboxAddress(_doi.l2ChainId()), "SYSCON-150" systemConfig.batchInbox() == _doi.opcmProxy().chainIdToBatchInboxAddress(_doi.l2ChainId()), "SYSCON-150"
); );
require(systemConfig.l1CrossDomainMessenger() == address(l1CrossDomainMessengerProxy()), "SYSCON-160"); require(systemConfig.l1CrossDomainMessenger() == address(l1CrossDomainMessengerProxy()), "SYSCON-160");
...@@ -393,7 +393,7 @@ contract DeployOPChainOutput is BaseDeployIO { ...@@ -393,7 +393,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30"); require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30");
require(address(messenger.portal()) == address(optimismPortalProxy()), "L1xDM-40"); require(address(messenger.portal()) == address(optimismPortalProxy()), "L1xDM-40");
require(address(messenger.superchainConfig()) == address(_doi.opsmProxy().superchainConfig()), "L1xDM-50"); require(address(messenger.superchainConfig()) == address(_doi.opcmProxy().superchainConfig()), "L1xDM-50");
bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204))); bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60"); require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
...@@ -409,7 +409,7 @@ contract DeployOPChainOutput is BaseDeployIO { ...@@ -409,7 +409,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.messenger()) == address(messenger), "L1SB-20"); require(address(bridge.messenger()) == address(messenger), "L1SB-20");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30"); require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30");
require(address(bridge.otherBridge()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-40"); require(address(bridge.otherBridge()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-40");
require(address(bridge.superchainConfig()) == address(_doi.opsmProxy().superchainConfig()), "L1SB-50"); require(address(bridge.superchainConfig()) == address(_doi.opcmProxy().superchainConfig()), "L1SB-50");
} }
function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal view { function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal view {
...@@ -431,12 +431,12 @@ contract DeployOPChainOutput is BaseDeployIO { ...@@ -431,12 +431,12 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "L721B-30"); require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "L721B-30");
require(address(bridge.messenger()) == address(l1CrossDomainMessengerProxy()), "L721B-40"); require(address(bridge.messenger()) == address(l1CrossDomainMessengerProxy()), "L721B-40");
require(address(bridge.superchainConfig()) == address(_doi.opsmProxy().superchainConfig()), "L721B-50"); require(address(bridge.superchainConfig()) == address(_doi.opcmProxy().superchainConfig()), "L721B-50");
} }
function assertValidOptimismPortal(DeployOPChainInput _doi) internal view { function assertValidOptimismPortal(DeployOPChainInput _doi) internal view {
OptimismPortal2 portal = optimismPortalProxy(); OptimismPortal2 portal = optimismPortalProxy();
ISuperchainConfig superchainConfig = ISuperchainConfig(address(_doi.opsmProxy().superchainConfig())); ISuperchainConfig superchainConfig = ISuperchainConfig(address(_doi.opcmProxy().superchainConfig()));
require(address(portal.disputeGameFactory()) == address(disputeGameFactoryProxy()), "PORTAL-10"); require(address(portal.disputeGameFactory()) == address(disputeGameFactoryProxy()), "PORTAL-10");
require(address(portal.systemConfig()) == address(systemConfigProxy()), "PORTAL-20"); require(address(portal.systemConfig()) == address(systemConfigProxy()), "PORTAL-20");
...@@ -470,9 +470,9 @@ contract DeployOPChain is Script { ...@@ -470,9 +470,9 @@ contract DeployOPChain is Script {
// -------- Core Deployment Methods -------- // -------- Core Deployment Methods --------
function run(DeployOPChainInput _doi, DeployOPChainOutput _doo) public { function run(DeployOPChainInput _doi, DeployOPChainOutput _doo) public {
OPStackManager opsmProxy = _doi.opsmProxy(); OPContractsManager opcmProxy = _doi.opcmProxy();
OPStackManager.Roles memory roles = OPStackManager.Roles({ OPContractsManager.Roles memory roles = OPContractsManager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(), opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _doi.systemConfigOwner(), systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(), batcher: _doi.batcher(),
...@@ -480,7 +480,7 @@ contract DeployOPChain is Script { ...@@ -480,7 +480,7 @@ contract DeployOPChain is Script {
proposer: _doi.proposer(), proposer: _doi.proposer(),
challenger: _doi.challenger() challenger: _doi.challenger()
}); });
OPStackManager.DeployInput memory deployInput = OPStackManager.DeployInput({ OPContractsManager.DeployInput memory deployInput = OPContractsManager.DeployInput({
roles: roles, roles: roles,
basefeeScalar: _doi.basefeeScalar(), basefeeScalar: _doi.basefeeScalar(),
blobBasefeeScalar: _doi.blobBaseFeeScalar(), blobBasefeeScalar: _doi.blobBaseFeeScalar(),
...@@ -489,7 +489,7 @@ contract DeployOPChain is Script { ...@@ -489,7 +489,7 @@ contract DeployOPChain is Script {
}); });
vm.broadcast(msg.sender); vm.broadcast(msg.sender);
OPStackManager.DeployOutput memory deployOutput = opsmProxy.deploy(deployInput); OPContractsManager.DeployOutput memory deployOutput = opcmProxy.deploy(deployInput);
vm.label(address(deployOutput.opChainProxyAdmin), "opChainProxyAdmin"); vm.label(address(deployOutput.opChainProxyAdmin), "opChainProxyAdmin");
vm.label(address(deployOutput.addressManager), "addressManager"); vm.label(address(deployOutput.addressManager), "addressManager");
......
...@@ -15,7 +15,7 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol"; ...@@ -15,7 +15,7 @@ import { BaseDeployIO } from "scripts/utils/BaseDeployIO.sol";
// This comment block defines the requirements and rationale for the architecture used in this forge // This comment block defines the requirements and rationale for the architecture used in this forge
// script, along with other scripts that are being written as new Superchain-first deploy scripts to // script, along with other scripts that are being written as new Superchain-first deploy scripts to
// complement the OP Stack Manager. The script architecture is a bit different than a standard forge // complement the OP Contracts Manager. The script architecture is a bit different than a standard forge
// deployment script. // deployment script.
// //
// There are three categories of users that are expected to interact with the scripts: // There are three categories of users that are expected to interact with the scripts:
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
"initCodeHash": "0x433fac9de52d8ce8fc3471b78ef6cc9cff1019f480c9ad91b6e09ab8738a8edb", "initCodeHash": "0x433fac9de52d8ce8fc3471b78ef6cc9cff1019f480c9ad91b6e09ab8738a8edb",
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649" "sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
}, },
"src/L1/OPStackManager.sol": { "src/L1/OPContractsManager.sol": {
"initCodeHash": "0x92c72b75206e756742df25d67d295e4479e65db1473948b8f53cb4ca642025d5", "initCodeHash": "0x92c72b75206e756742df25d67d295e4479e65db1473948b8f53cb4ca642025d5",
"sourceCodeHash": "0x3cbd30c68cad0dd18d49165bd21d94422b7403174f91a733e2398539dadf8656" "sourceCodeHash": "0x5e04124ee67298d2f1245139baf7de79dee421d2c031c6e5abe0cd3b1bdbdb32"
}, },
"src/L1/OptimismPortal.sol": { "src/L1/OptimismPortal.sol": {
"initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190", "initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190",
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPContractsManager.Blueprints",
"name": "", "name": "",
"type": "tuple" "type": "tuple"
} }
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.Roles", "internalType": "struct OPContractsManager.Roles",
"name": "roles", "name": "roles",
"type": "tuple" "type": "tuple"
}, },
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
"type": "bytes" "type": "bytes"
} }
], ],
"internalType": "struct OPStackManager.DeployInput", "internalType": "struct OPContractsManager.DeployInput",
"name": "_input", "name": "_input",
"type": "tuple" "type": "tuple"
} }
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.DeployOutput", "internalType": "struct OPContractsManager.DeployOutput",
"name": "", "name": "",
"type": "tuple" "type": "tuple"
} }
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPContractsManager.Blueprints",
"name": "blueprints", "name": "blueprints",
"type": "tuple" "type": "tuple"
}, },
...@@ -344,12 +344,12 @@ ...@@ -344,12 +344,12 @@
"type": "bytes4" "type": "bytes4"
} }
], ],
"internalType": "struct OPStackManager.Implementation", "internalType": "struct OPContractsManager.Implementation",
"name": "info", "name": "info",
"type": "tuple" "type": "tuple"
} }
], ],
"internalType": "struct OPStackManager.ImplementationSetter[]", "internalType": "struct OPContractsManager.ImplementationSetter[]",
"name": "setters", "name": "setters",
"type": "tuple[]" "type": "tuple[]"
}, },
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
"type": "bool" "type": "bool"
} }
], ],
"internalType": "struct OPStackManager.InitializerInputs", "internalType": "struct OPContractsManager.InitializerInputs",
"name": "_initializerInputs", "name": "_initializerInputs",
"type": "tuple" "type": "tuple"
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPContractsManager.Blueprints",
"name": "", "name": "",
"type": "tuple" "type": "tuple"
} }
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.Roles", "internalType": "struct OPContractsManager.Roles",
"name": "roles", "name": "roles",
"type": "tuple" "type": "tuple"
}, },
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
"type": "bytes" "type": "bytes"
} }
], ],
"internalType": "struct OPStackManager.DeployInput", "internalType": "struct OPContractsManager.DeployInput",
"name": "_input", "name": "_input",
"type": "tuple" "type": "tuple"
} }
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.DeployOutput", "internalType": "struct OPContractsManager.DeployOutput",
"name": "", "name": "",
"type": "tuple" "type": "tuple"
} }
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
"type": "address" "type": "address"
} }
], ],
"internalType": "struct OPStackManager.Blueprints", "internalType": "struct OPContractsManager.Blueprints",
"name": "blueprints", "name": "blueprints",
"type": "tuple" "type": "tuple"
}, },
...@@ -344,12 +344,12 @@ ...@@ -344,12 +344,12 @@
"type": "bytes4" "type": "bytes4"
} }
], ],
"internalType": "struct OPStackManager.Implementation", "internalType": "struct OPContractsManager.Implementation",
"name": "info", "name": "info",
"type": "tuple" "type": "tuple"
} }
], ],
"internalType": "struct OPStackManager.ImplementationSetter[]", "internalType": "struct OPContractsManager.ImplementationSetter[]",
"name": "setters", "name": "setters",
"type": "tuple[]" "type": "tuple[]"
}, },
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
"type": "bool" "type": "bool"
} }
], ],
"internalType": "struct OPStackManager.InitializerInputs", "internalType": "struct OPContractsManager.InitializerInputs",
"name": "_initializerInputs", "name": "_initializerInputs",
"type": "tuple" "type": "tuple"
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"label": "implementations", "label": "implementations",
"offset": 0, "offset": 0,
"slot": "2", "slot": "2",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))" "type": "mapping(string => mapping(string => struct OPContractsManager.Implementation))"
}, },
{ {
"bytes": "32", "bytes": "32",
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"label": "blueprint", "label": "blueprint",
"offset": 0, "offset": 0,
"slot": "4", "slot": "4",
"type": "struct OPStackManager.Blueprints" "type": "struct OPContractsManager.Blueprints"
}, },
{ {
"bytes": "1600", "bytes": "1600",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"label": "implementations", "label": "implementations",
"offset": 0, "offset": 0,
"slot": "2", "slot": "2",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))" "type": "mapping(string => mapping(string => struct OPContractsManager.Implementation))"
}, },
{ {
"bytes": "32", "bytes": "32",
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"label": "blueprint", "label": "blueprint",
"offset": 0, "offset": 0,
"slot": "4", "slot": "4",
"type": "struct OPStackManager.Blueprints" "type": "struct OPContractsManager.Blueprints"
}, },
{ {
"bytes": "1600", "bytes": "1600",
......
...@@ -40,7 +40,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol"; ...@@ -40,7 +40,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol"; import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
/// @custom:proxied true /// @custom:proxied true
contract OPStackManager is ISemver, Initializable { contract OPContractsManager is ISemver, Initializable {
// -------- Structs -------- // -------- Structs --------
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain. /// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
...@@ -113,7 +113,7 @@ contract OPStackManager is ISemver, Initializable { ...@@ -113,7 +113,7 @@ contract OPStackManager is ISemver, Initializable {
address permissionedDisputeGame2; address permissionedDisputeGame2;
} }
/// @notice Inputs required when initializing the OPStackManager. To avoid 'StackTooDeep' errors, /// @notice Inputs required when initializing the OPContractsManager. To avoid 'StackTooDeep' errors,
/// all necessary inputs (excluding immutables) for initialization are bundled together in this struct. /// all necessary inputs (excluding immutables) for initialization are bundled together in this struct.
struct InitializerInputs { struct InitializerInputs {
Blueprints blueprints; Blueprints blueprints;
...@@ -133,7 +133,7 @@ contract OPStackManager is ISemver, Initializable { ...@@ -133,7 +133,7 @@ contract OPStackManager is ISemver, Initializable {
/// @notice Address of the ProtocolVersions contract shared by all chains. /// @notice Address of the ProtocolVersions contract shared by all chains.
ProtocolVersions public immutable protocolVersions; ProtocolVersions public immutable protocolVersions;
/// @notice The latest release of the OP Stack 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;
/// @notice Maps a release version to a contract name to it's implementation data. /// @notice Maps a release version to a contract name to it's implementation data.
...@@ -181,7 +181,7 @@ contract OPStackManager is ISemver, Initializable { ...@@ -181,7 +181,7 @@ contract OPStackManager is ISemver, Initializable {
// -------- Methods -------- // -------- Methods --------
/// @notice OPSM 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(SuperchainConfig _superchainConfig, ProtocolVersions _protocolVersions) {
assertValidContractAddress(address(_superchainConfig)); assertValidContractAddress(address(_superchainConfig));
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.15; pragma solidity 0.8.15;
import { OPStackManager } from "src/L1/OPStackManager.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 { ResourceMetering } from "src/L1/ResourceMetering.sol"; import { ResourceMetering } from "src/L1/ResourceMetering.sol";
...@@ -9,12 +9,12 @@ import { SystemConfig } from "src/L1/SystemConfig.sol"; ...@@ -9,12 +9,12 @@ import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol"; import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
/// @custom:proxied true /// @custom:proxied true
contract OPStackManagerInterop is OPStackManager { contract OPContractsManagerInterop is OPContractsManager {
constructor( constructor(
SuperchainConfig _superchainConfig, SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions ProtocolVersions _protocolVersions
) )
OPStackManager(_superchainConfig, _protocolVersions) OPContractsManager(_superchainConfig, _protocolVersions)
{ } { }
// The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument // The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument
......
...@@ -10,7 +10,7 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol"; ...@@ -10,7 +10,7 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.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 { OPStackManager } from "src/L1/OPStackManager.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";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...@@ -106,11 +106,11 @@ contract DeployImplementationsOutput_Test is Test { ...@@ -106,11 +106,11 @@ contract DeployImplementationsOutput_Test is Test {
function test_set_succeeds() public { function test_set_succeeds() public {
Proxy proxy = new Proxy(address(0)); Proxy proxy = new Proxy(address(0));
address opsmImpl = address(makeAddr("opsmImpl")); address opcmImpl = address(makeAddr("opcmImpl"));
vm.prank(address(0)); vm.prank(address(0));
proxy.upgradeTo(opsmImpl); proxy.upgradeTo(opcmImpl);
OPStackManager opsmProxy = OPStackManager(address(proxy)); OPContractsManager opcmProxy = OPContractsManager(address(proxy));
OptimismPortal2 optimismPortalImpl = OptimismPortal2(payable(makeAddr("optimismPortalImpl"))); OptimismPortal2 optimismPortalImpl = OptimismPortal2(payable(makeAddr("optimismPortalImpl")));
DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl"))); DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl")));
PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton")); PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton"));
...@@ -124,8 +124,8 @@ contract DeployImplementationsOutput_Test is Test { ...@@ -124,8 +124,8 @@ contract DeployImplementationsOutput_Test is Test {
OptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryImpl")); OptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryImpl"));
DisputeGameFactory disputeGameFactoryImpl = DisputeGameFactory(makeAddr("disputeGameFactoryImpl")); DisputeGameFactory disputeGameFactoryImpl = DisputeGameFactory(makeAddr("disputeGameFactoryImpl"));
vm.etch(address(opsmProxy), address(opsmProxy).code); vm.etch(address(opcmProxy), address(opcmProxy).code);
vm.etch(address(opsmImpl), hex"01"); vm.etch(address(opcmImpl), hex"01");
vm.etch(address(optimismPortalImpl), hex"01"); vm.etch(address(optimismPortalImpl), hex"01");
vm.etch(address(delayedWETHImpl), hex"01"); vm.etch(address(delayedWETHImpl), hex"01");
vm.etch(address(preimageOracleSingleton), hex"01"); vm.etch(address(preimageOracleSingleton), hex"01");
...@@ -136,7 +136,7 @@ contract DeployImplementationsOutput_Test is Test { ...@@ -136,7 +136,7 @@ contract DeployImplementationsOutput_Test is Test {
vm.etch(address(l1StandardBridgeImpl), hex"01"); vm.etch(address(l1StandardBridgeImpl), hex"01");
vm.etch(address(optimismMintableERC20FactoryImpl), hex"01"); vm.etch(address(optimismMintableERC20FactoryImpl), hex"01");
vm.etch(address(disputeGameFactoryImpl), hex"01"); vm.etch(address(disputeGameFactoryImpl), hex"01");
dio.set(dio.opsmProxy.selector, address(opsmProxy)); dio.set(dio.opcmProxy.selector, address(opcmProxy));
dio.set(dio.optimismPortalImpl.selector, address(optimismPortalImpl)); dio.set(dio.optimismPortalImpl.selector, address(optimismPortalImpl));
dio.set(dio.delayedWETHImpl.selector, address(delayedWETHImpl)); dio.set(dio.delayedWETHImpl.selector, address(delayedWETHImpl));
dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton)); dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton));
...@@ -148,7 +148,7 @@ contract DeployImplementationsOutput_Test is Test { ...@@ -148,7 +148,7 @@ contract DeployImplementationsOutput_Test is Test {
dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl)); dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl));
dio.set(dio.disputeGameFactoryImpl.selector, address(disputeGameFactoryImpl)); dio.set(dio.disputeGameFactoryImpl.selector, address(disputeGameFactoryImpl));
assertEq(address(opsmProxy), address(dio.opsmProxy()), "50"); assertEq(address(opcmProxy), address(dio.opcmProxy()), "50");
assertEq(address(optimismPortalImpl), address(dio.optimismPortalImpl()), "100"); assertEq(address(optimismPortalImpl), address(dio.optimismPortalImpl()), "100");
assertEq(address(delayedWETHImpl), address(dio.delayedWETHImpl()), "200"); assertEq(address(delayedWETHImpl), address(dio.delayedWETHImpl()), "200");
assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300"); assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300");
...@@ -413,7 +413,7 @@ contract DeployImplementations_Test is Test { ...@@ -413,7 +413,7 @@ contract DeployImplementations_Test is Test {
string memory release = string(bytes.concat(hash(_seed, 5))); string memory release = string(bytes.concat(hash(_seed, 5)));
protocolVersionsProxy = ProtocolVersions(address(uint160(uint256(hash(_seed, 7))))); protocolVersionsProxy = ProtocolVersions(address(uint160(uint256(hash(_seed, 7)))));
// Must configure the ProxyAdmin contract which is used to upgrade the OPSM's proxy contract. // Must configure the ProxyAdmin contract which is used to upgrade the OPCM's proxy contract.
ProxyAdmin superchainProxyAdmin = new ProxyAdmin(msg.sender); ProxyAdmin superchainProxyAdmin = new ProxyAdmin(msg.sender);
superchainConfigProxy = SuperchainConfig(address(new Proxy(payable(address(superchainProxyAdmin))))); superchainConfigProxy = SuperchainConfig(address(new Proxy(payable(address(superchainProxyAdmin)))));
......
...@@ -23,7 +23,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol ...@@ -23,7 +23,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol
import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { SuperchainConfig } from "src/L1/SuperchainConfig.sol";
import { ProtocolVersions, ProtocolVersion } from "src/L1/ProtocolVersions.sol"; import { ProtocolVersions, ProtocolVersion } from "src/L1/ProtocolVersions.sol";
import { OPStackManager } from "src/L1/OPStackManager.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";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
...@@ -46,7 +46,7 @@ contract DeployOPChainInput_Test is Test { ...@@ -46,7 +46,7 @@ contract DeployOPChainInput_Test is Test {
uint32 basefeeScalar = 100; uint32 basefeeScalar = 100;
uint32 blobBaseFeeScalar = 200; uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300; uint256 l2ChainId = 300;
OPStackManager opsm = OPStackManager(makeAddr("opsm")); OPContractsManager opcm = OPContractsManager(makeAddr("opcm"));
function setUp() public { function setUp() public {
doi = new DeployOPChainInput(); doi = new DeployOPChainInput();
...@@ -62,7 +62,7 @@ contract DeployOPChainInput_Test is Test { ...@@ -62,7 +62,7 @@ contract DeployOPChainInput_Test is Test {
doi.set(doi.basefeeScalar.selector, basefeeScalar); doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar); doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId); doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.opsmProxy.selector, address(opsm)); doi.set(doi.opcmProxy.selector, address(opcm));
// Compare the default inputs to the getter methods. // Compare the default inputs to the getter methods.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200"); assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200");
assertEq(systemConfigOwner, doi.systemConfigOwner(), "300"); assertEq(systemConfigOwner, doi.systemConfigOwner(), "300");
...@@ -73,7 +73,7 @@ contract DeployOPChainInput_Test is Test { ...@@ -73,7 +73,7 @@ contract DeployOPChainInput_Test is Test {
assertEq(basefeeScalar, doi.basefeeScalar(), "800"); assertEq(basefeeScalar, doi.basefeeScalar(), "800");
assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900"); assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900");
assertEq(l2ChainId, doi.l2ChainId(), "1000"); assertEq(l2ChainId, doi.l2ChainId(), "1000");
assertEq(address(opsm), address(doi.opsmProxy()), "1100"); assertEq(address(opcm), address(doi.opcmProxy()), "1100");
} }
function test_getters_whenNotSet_revert() public { function test_getters_whenNotSet_revert() public {
...@@ -328,7 +328,7 @@ contract DeployOPChain_TestBase is Test { ...@@ -328,7 +328,7 @@ contract DeployOPChain_TestBase is Test {
ProtocolVersions protocolVersionsProxy; ProtocolVersions protocolVersionsProxy;
// Define default inputs for DeployOPChain. // Define default inputs for DeployOPChain.
// `opsm` is set during `setUp` since it is an output of the previous step. // `opcm` is set during `setUp` since it is an output of the previous step.
address opChainProxyAdminOwner = makeAddr("defaultOPChainProxyAdminOwner"); address opChainProxyAdminOwner = makeAddr("defaultOPChainProxyAdminOwner");
address systemConfigOwner = makeAddr("defaultSystemConfigOwner"); address systemConfigOwner = makeAddr("defaultSystemConfigOwner");
address batcher = makeAddr("defaultBatcher"); address batcher = makeAddr("defaultBatcher");
...@@ -339,7 +339,7 @@ contract DeployOPChain_TestBase is Test { ...@@ -339,7 +339,7 @@ contract DeployOPChain_TestBase is Test {
uint32 blobBaseFeeScalar = 200; uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300; uint256 l2ChainId = 300;
AnchorStateRegistry.StartingAnchorRoot[] startingAnchorRoots; AnchorStateRegistry.StartingAnchorRoot[] startingAnchorRoots;
OPStackManager opsm = OPStackManager(address(0)); OPContractsManager opcm = OPContractsManager(address(0));
function setUp() public virtual { function setUp() public virtual {
// Set defaults for reference types // Set defaults for reference types
...@@ -401,8 +401,8 @@ contract DeployOPChain_TestBase is Test { ...@@ -401,8 +401,8 @@ contract DeployOPChain_TestBase is Test {
deployOPChain = new DeployOPChain(); deployOPChain = new DeployOPChain();
(doi, doo) = deployOPChain.etchIOContracts(); (doi, doo) = deployOPChain.etchIOContracts();
// Set the OPStackManager address as input to DeployOPChain. // Set the OPContractsManager input for DeployOPChain.
opsm = dio.opsmProxy(); opcm = dio.opcmProxy();
} }
// See the function of the same name in the `DeployImplementations_Test` contract of // See the function of the same name in the `DeployImplementations_Test` contract of
...@@ -456,11 +456,11 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { ...@@ -456,11 +456,11 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar); doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar); doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId); doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.opsmProxy.selector, address(opsm)); // Not fuzzed since it must be an actual instance. doi.set(doi.opcmProxy.selector, address(opcm)); // Not fuzzed since it must be an actual instance.
deployOPChain.run(doi, doo); deployOPChain.run(doi, doo);
// TODO Add fault proof contract assertions below once OPSM fully supports them. // TODO Add fault proof contract assertions below once OPCM fully supports them.
// Assert that individual input fields were properly set based on the inputs. // Assert that individual input fields were properly set based on the inputs.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "100"); assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "100");
...@@ -486,7 +486,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase { ...@@ -486,7 +486,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
// assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700"); // assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700");
// assertEq(address(doo.faultDisputeGame().challenger()), challenger, "2800"); // assertEq(address(doo.faultDisputeGame().challenger()), challenger, "2800");
// Most architecture assertions are handled within the OP Stack Manager itself and therefore // Most architecture assertions are handled within the OP Contracts Manager itself and therefore
// we only assert on the things that are not visible onchain. // we only assert on the things that are not visible onchain.
// TODO add these assertions: AddressManager, Proxy, ProxyAdmin, etc. // TODO add these assertions: AddressManager, Proxy, ProxyAdmin, etc.
} }
......
...@@ -6,18 +6,18 @@ import { Test, stdStorage, StdStorage } from "forge-std/Test.sol"; ...@@ -6,18 +6,18 @@ import { Test, stdStorage, StdStorage } from "forge-std/Test.sol";
import { DeployOPChainInput } from "scripts/DeployOPChain.s.sol"; import { DeployOPChainInput } from "scripts/DeployOPChain.s.sol";
import { DeployOPChain_TestBase } from "test/DeployOPChain.t.sol"; import { DeployOPChain_TestBase } from "test/DeployOPChain.t.sol";
import { OPStackManager } from "src/L1/OPStackManager.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 { SystemConfig } from "src/L1/SystemConfig.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol";
// Exposes internal functions for testing. // Exposes internal functions for testing.
contract OPStackManager_Harness is OPStackManager { contract OPContractsManager_Harness is OPContractsManager {
constructor( constructor(
SuperchainConfig _superchainConfig, SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions ProtocolVersions _protocolVersions
) )
OPStackManager(_superchainConfig, _protocolVersions) OPContractsManager(_superchainConfig, _protocolVersions)
{ } { }
function chainIdToBatchInboxAddress_exposed(uint256 l2ChainId) public pure returns (address) { function chainIdToBatchInboxAddress_exposed(uint256 l2ChainId) public pure returns (address) {
...@@ -26,12 +26,12 @@ contract OPStackManager_Harness is OPStackManager { ...@@ -26,12 +26,12 @@ contract OPStackManager_Harness is OPStackManager {
} }
// Unlike other test suites, we intentionally do not inherit from CommonTest or Setup. This is // Unlike other test suites, we intentionally do not inherit from CommonTest or Setup. This is
// because OPStackManager acts as a deploy script, so we start from a clean slate here and // because OPContractsManager acts as a deploy script, so we start from a clean slate here and
// work OPStackManager's deployment into the existing test setup, instead of using the existing // work OPContractsManager's deployment into the existing test setup, instead of using the existing
// test setup to deploy OPStackManager. We do however inherit from DeployOPChain_TestBase so // test setup to deploy OPContractsManager. We do however inherit from DeployOPChain_TestBase so
// we can use its setup to deploy the implementations similarly to how a real deployment would // we can use its setup to deploy the implementations similarly to how a real deployment would
// happen. // happen.
contract OPStackManager_Deploy_Test is DeployOPChain_TestBase { contract OPContractsManager_Deploy_Test is DeployOPChain_TestBase {
using stdStorage for StdStorage; using stdStorage for StdStorage;
event Deployed(uint256 indexed l2ChainId, SystemConfig indexed systemConfig); event Deployed(uint256 indexed l2ChainId, SystemConfig indexed systemConfig);
...@@ -48,14 +48,14 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase { ...@@ -48,14 +48,14 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar); doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar); doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId); doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.opsmProxy.selector, address(opsm)); doi.set(doi.opcmProxy.selector, address(opcm));
} }
// This helper function is used to convert the input struct type defined in DeployOPChain.s.sol // This helper function is used to convert the input struct type defined in DeployOPChain.s.sol
// to the input struct type defined in OPStackManager.sol. // to the input struct type defined in OPContractsManager.sol.
function toOPSMDeployInput(DeployOPChainInput _doi) internal view returns (OPStackManager.DeployInput memory) { function toOPCMDeployInput(DeployOPChainInput _doi) internal view returns (OPContractsManager.DeployInput memory) {
return OPStackManager.DeployInput({ return OPContractsManager.DeployInput({
roles: OPStackManager.Roles({ roles: OPContractsManager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(), opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _doi.systemConfigOwner(), systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(), batcher: _doi.batcher(),
...@@ -71,30 +71,30 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase { ...@@ -71,30 +71,30 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
} }
function test_deploy_l2ChainIdEqualsZero_reverts() public { function test_deploy_l2ChainIdEqualsZero_reverts() public {
OPStackManager.DeployInput memory deployInput = toOPSMDeployInput(doi); OPContractsManager.DeployInput memory deployInput = toOPCMDeployInput(doi);
deployInput.l2ChainId = 0; deployInput.l2ChainId = 0;
vm.expectRevert(OPStackManager.InvalidChainId.selector); vm.expectRevert(OPContractsManager.InvalidChainId.selector);
opsm.deploy(deployInput); opcm.deploy(deployInput);
} }
function test_deploy_l2ChainIdEqualsCurrentChainId_reverts() public { function test_deploy_l2ChainIdEqualsCurrentChainId_reverts() public {
OPStackManager.DeployInput memory deployInput = toOPSMDeployInput(doi); OPContractsManager.DeployInput memory deployInput = toOPCMDeployInput(doi);
deployInput.l2ChainId = block.chainid; deployInput.l2ChainId = block.chainid;
vm.expectRevert(OPStackManager.InvalidChainId.selector); vm.expectRevert(OPContractsManager.InvalidChainId.selector);
opsm.deploy(deployInput); opcm.deploy(deployInput);
} }
function test_deploy_succeeds() public { function test_deploy_succeeds() public {
vm.expectEmit(true, false, true, true); // TODO precompute the system config address. vm.expectEmit(true, false, true, true); // TODO precompute the system config address.
emit Deployed(doi.l2ChainId(), SystemConfig(address(1))); emit Deployed(doi.l2ChainId(), SystemConfig(address(1)));
opsm.deploy(toOPSMDeployInput(doi)); opcm.deploy(toOPCMDeployInput(doi));
} }
} }
// These tests use the harness which exposes internal functions for testing. // These tests use the harness which exposes internal functions for testing.
contract OPStackManager_InternalMethods_Test is Test { contract OPContractsManager_InternalMethods_Test is Test {
OPStackManager_Harness opsmHarness; OPContractsManager_Harness opcmHarness;
function setUp() public { function setUp() public {
SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig")); SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig"));
...@@ -102,7 +102,7 @@ contract OPStackManager_InternalMethods_Test is Test { ...@@ -102,7 +102,7 @@ contract OPStackManager_InternalMethods_Test is Test {
vm.etch(address(superchainConfigProxy), hex"01"); vm.etch(address(superchainConfigProxy), hex"01");
vm.etch(address(protocolVersionsProxy), hex"01"); vm.etch(address(protocolVersionsProxy), hex"01");
opsmHarness = new OPStackManager_Harness({ opcmHarness = new OPContractsManager_Harness({
_superchainConfig: superchainConfigProxy, _superchainConfig: superchainConfigProxy,
_protocolVersions: protocolVersionsProxy _protocolVersions: protocolVersionsProxy
}); });
...@@ -114,12 +114,12 @@ contract OPStackManager_InternalMethods_Test is Test { ...@@ -114,12 +114,12 @@ contract OPStackManager_InternalMethods_Test is Test {
// 2. Hash it and manually take the first 19 bytes, and prefixed it with 0x00. // 2. Hash it and manually take the first 19 bytes, and prefixed it with 0x00.
uint256 chainId = 1234; uint256 chainId = 1234;
address expected = 0x0017FA14b0d73Aa6A26D6b8720c1c84b50984f5C; address expected = 0x0017FA14b0d73Aa6A26D6b8720c1c84b50984f5C;
address actual = opsmHarness.chainIdToBatchInboxAddress_exposed(chainId); address actual = opcmHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual); vm.assertEq(expected, actual);
chainId = type(uint256).max; chainId = type(uint256).max;
expected = 0x00a9C584056064687E149968cBaB758a3376D22A; expected = 0x00a9C584056064687E149968cBaB758a3376D22A;
actual = opsmHarness.chainIdToBatchInboxAddress_exposed(chainId); actual = opcmHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual); vm.assertEq(expected, actual);
} }
} }
...@@ -10,7 +10,7 @@ import { Executables } from "scripts/libraries/Executables.sol"; ...@@ -10,7 +10,7 @@ import { Executables } from "scripts/libraries/Executables.sol";
import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol"; import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol";
// Contracts // Contracts
import { OPStackManager } from "src/L1/OPStackManager.sol"; import { OPContractsManager } from "src/L1/OPContractsManager.sol";
// Interfaces // Interfaces
import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol"; import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
...@@ -836,29 +836,29 @@ contract Specification_Test is CommonTest { ...@@ -836,29 +836,29 @@ contract Specification_Test is CommonTest {
_addSpec({ _name: "WETH98", _sel: _getSel("transferFrom(address,address,uint256)") }); _addSpec({ _name: "WETH98", _sel: _getSel("transferFrom(address,address,uint256)") });
_addSpec({ _name: "WETH98", _sel: _getSel("withdraw(uint256)") }); _addSpec({ _name: "WETH98", _sel: _getSel("withdraw(uint256)") });
// OPStackManager // OPContractsManager
_addSpec({ _name: "OPStackManager", _sel: _getSel("version()") }); _addSpec({ _name: "OPContractsManager", _sel: _getSel("version()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("superchainConfig()") }); _addSpec({ _name: "OPContractsManager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("protocolVersions()") }); _addSpec({ _name: "OPContractsManager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("latestRelease()") }); _addSpec({ _name: "OPContractsManager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("implementations(string,string)") }); _addSpec({ _name: "OPContractsManager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("systemConfigs(uint256)") }); _addSpec({ _name: "OPContractsManager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.initialize.selector }); _addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.initialize.selector });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.deploy.selector }); _addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.deploy.selector });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.blueprints.selector }); _addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.blueprints.selector });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.chainIdToBatchInboxAddress.selector }); _addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.chainIdToBatchInboxAddress.selector });
// OPStackManagerInterop // OPContractsManagerInterop
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("version()") }); _addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("superchainConfig()") }); _addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("protocolVersions()") }); _addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("latestRelease()") }); _addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("implementations(string,string)") }); _addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("systemConfigs(uint256)") }); _addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.initialize.selector }); _addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.initialize.selector });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.deploy.selector }); _addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.deploy.selector });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.blueprints.selector }); _addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.blueprints.selector });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.chainIdToBatchInboxAddress.selector }); _addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.chainIdToBatchInboxAddress.selector });
// DeputyGuardianModule // DeputyGuardianModule
_addSpec({ _addSpec({
......
...@@ -411,8 +411,8 @@ contract Initializer_Test is Bridge_Initializer { ...@@ -411,8 +411,8 @@ contract Initializer_Test is Bridge_Initializer {
excludes[4] = "src/dispute/FaultDisputeGame.sol"; excludes[4] = "src/dispute/FaultDisputeGame.sol";
excludes[5] = "src/dispute/PermissionedDisputeGame.sol"; excludes[5] = "src/dispute/PermissionedDisputeGame.sol";
// TODO: Eventually remove this exclusion. Same reason as above dispute contracts. // TODO: Eventually remove this exclusion. Same reason as above dispute contracts.
excludes[6] = "src/L1/OPStackManager.sol"; excludes[6] = "src/L1/OPContractsManager.sol";
excludes[7] = "src/L1/OPStackManagerInterop.sol"; excludes[7] = "src/L1/OPContractsManagerInterop.sol";
// Get all contract names in the src directory, minus the excluded contracts. // Get all contract names in the src directory, minus the excluded contracts.
string[] memory contractNames = ForgeArtifacts.getContractNames("src/*", excludes); string[] memory contractNames = ForgeArtifacts.getContractNames("src/*", excludes);
......
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