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

rename: OPStackManafer -> OPContractsManager (#12091)

parent da9bc723
......@@ -46,6 +46,6 @@ fuzz:
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
\ No newline at end of file
......@@ -151,7 +151,7 @@ func TestEndToEndApply(t *testing.T) {
{"SuperchainConfigImpl", st.SuperchainDeployment.SuperchainConfigImplAddress},
{"ProtocolVersionsProxy", st.SuperchainDeployment.ProtocolVersionsProxyAddress},
{"ProtocolVersionsImpl", st.SuperchainDeployment.ProtocolVersionsImplAddress},
{"OpsmProxy", st.ImplementationsDeployment.OpsmProxyAddress},
{"OpcmProxy", st.ImplementationsDeployment.OpcmProxyAddress},
{"DelayedWETHImpl", st.ImplementationsDeployment.DelayedWETHImplAddress},
{"OptimismPortalImpl", st.ImplementationsDeployment.OptimismPortalImplAddress},
{"PreimageOracleSingleton", st.ImplementationsDeployment.PreimageOracleSingletonAddress},
......
package opsm
package opcm
import (
"fmt"
......@@ -16,7 +16,7 @@ type DeployImplementationsInput struct {
ChallengePeriodSeconds *big.Int
ProofMaturityDelaySeconds *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
SuperchainConfigProxy common.Address
ProtocolVersionsProxy common.Address
......@@ -31,8 +31,8 @@ func (input *DeployImplementationsInput) InputSet() bool {
}
type DeployImplementationsOutput struct {
OpsmProxy common.Address
OpsmImpl common.Address
OpcmProxy common.Address
OpcmImpl common.Address
DelayedWETHImpl common.Address
OptimismPortalImpl common.Address
PreimageOracleSingleton common.Address
......@@ -84,12 +84,12 @@ func DeployImplementations(
}
defer cleanupDeploy()
opsmContract := "OPStackManager"
opcmContract := "OPContractsManager"
if input.UseInterop {
opsmContract = "OPStackManagerInterop"
opcmContract = "OPContractsManagerInterop"
}
if err := host.RememberOnLabel("OPStackManager", opsmContract+".sol", opsmContract); err != nil {
return output, fmt.Errorf("failed to link OPStackManager label: %w", err)
if err := host.RememberOnLabel("OPContractsManager", opcmContract+".sol", opcmContract); err != nil {
return output, fmt.Errorf("failed to link OPContractsManager label: %w", err)
}
// So we can see in detail where the SystemConfig interop initializer fails
......
package opsm
package opcm
import (
"fmt"
......@@ -26,7 +26,7 @@ type DeployOPChainInput struct {
BasefeeScalar uint32
BlobBaseFeeScalar uint32
L2ChainId *big.Int
OpsmProxy common.Address
OpcmProxy common.Address
}
func (input *DeployOPChainInput) InputSet() bool {
......
......@@ -5,7 +5,7 @@ import (
"fmt"
"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/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
......@@ -22,7 +22,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
lgr.Info("deploying implementations")
var dump *foundry.ForgeAllocs
var dio opsm.DeployImplementationsOutput
var dio opcm.DeployImplementationsOutput
var err error
err = CallScriptBroadcast(
ctx,
......@@ -37,9 +37,9 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
Handler: func(host *script.Host) error {
host.SetEnvVar("IMPL_SALT", st.Create2Salt.Hex()[2:])
host.ImportState(st.SuperchainDeployment.StateDump)
dio, err = opsm.DeployImplementations(
dio, err = opcm.DeployImplementations(
host,
opsm.DeployImplementationsInput{
opcm.DeployImplementationsInput{
Salt: st.Create2Salt,
WithdrawalDelaySeconds: big.NewInt(604800),
MinProposalSizeBytes: big.NewInt(126000),
......@@ -50,7 +50,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
SuperchainConfigProxy: st.SuperchainDeployment.SuperchainConfigProxyAddress,
ProtocolVersionsProxy: st.SuperchainDeployment.ProtocolVersionsProxyAddress,
SuperchainProxyAdmin: st.SuperchainDeployment.ProxyAdminAddress,
StandardVersionsToml: opsm.StandardVersionsData,
StandardVersionsToml: opcm.StandardVersionsData,
UseInterop: false,
},
)
......@@ -70,7 +70,7 @@ func DeployImplementations(ctx context.Context, env *Env, artifactsFS foundry.St
}
st.ImplementationsDeployment = &state.ImplementationsDeployment{
OpsmProxyAddress: dio.OpsmProxy,
OpcmProxyAddress: dio.OpcmProxy,
DelayedWETHImplAddress: dio.DelayedWETHImpl,
OptimismPortalImplAddress: dio.OptimismPortalImpl,
PreimageOracleSingletonAddress: dio.PreimageOracleSingleton,
......
......@@ -8,7 +8,7 @@ import (
"fmt"
"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/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
......@@ -47,8 +47,8 @@ func GenerateL2Genesis(ctx context.Context, env *Env, artifactsFS foundry.StatDi
Client: env.L1Client,
Broadcaster: DiscardBroadcaster,
Handler: func(host *script.Host) error {
err := opsm.L2Genesis(host, &opsm.L2GenesisInput{
L1Deployments: opsm.L1Deployments{
err := opcm.L2Genesis(host, &opcm.L2GenesisInput{
L1Deployments: opcm.L1Deployments{
L1CrossDomainMessengerProxy: thisChainState.L1CrossDomainMessengerProxyAddress,
L1StandardBridgeProxy: thisChainState.L1StandardBridgeProxyAddress,
L1ERC721BridgeProxy: thisChainState.L1ERC721BridgeProxyAddress,
......
......@@ -5,7 +5,7 @@ import (
"fmt"
"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/foundry"
"github.com/ethereum-optimism/optimism/op-chain-ops/script"
......@@ -27,7 +27,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
return fmt.Errorf("failed to get chain intent: %w", err)
}
var dco opsm.DeployOPChainOutput
var dco opcm.DeployOPChainOutput
err = CallScriptBroadcast(
ctx,
CallScriptBroadcastOpts{
......@@ -40,9 +40,9 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
Broadcaster: KeyedBroadcaster,
Handler: func(host *script.Host) error {
host.ImportState(st.ImplementationsDeployment.StateDump)
dco, err = opsm.DeployOPChain(
dco, err = opcm.DeployOPChain(
host,
opsm.DeployOPChainInput{
opcm.DeployOPChainInput{
OpChainProxyAdminOwner: thisIntent.Roles.ProxyAdminOwner,
SystemConfigOwner: thisIntent.Roles.SystemConfigOwner,
Batcher: thisIntent.Roles.Batcher,
......@@ -52,7 +52,7 @@ func DeployOPChain(ctx context.Context, env *Env, artifactsFS foundry.StatDirFs,
BasefeeScalar: 1368,
BlobBaseFeeScalar: 801949,
L2ChainId: chainID.Big(),
OpsmProxy: st.ImplementationsDeployment.OpsmProxyAddress,
OpcmProxy: st.ImplementationsDeployment.OpcmProxyAddress,
},
)
return err
......
......@@ -7,7 +7,7 @@ import (
"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/foundry"
"github.com/ethereum-optimism/optimism/op-node/rollup"
......@@ -24,7 +24,7 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
lgr.Info("deploying superchain")
var dump *foundry.ForgeAllocs
var dso opsm.DeploySuperchainOutput
var dso opcm.DeploySuperchainOutput
var err error
err = CallScriptBroadcast(
ctx,
......@@ -37,9 +37,9 @@ func DeploySuperchain(ctx context.Context, env *Env, artifactsFS foundry.StatDir
Client: env.L1Client,
Broadcaster: KeyedBroadcaster,
Handler: func(host *script.Host) error {
dso, err = opsm.DeploySuperchain(
dso, err = opcm.DeploySuperchain(
host,
opsm.DeploySuperchainInput{
opcm.DeploySuperchainInput{
ProxyAdminOwner: intent.SuperchainRoles.ProxyAdminOwner,
ProtocolVersionsOwner: intent.SuperchainRoles.ProtocolVersionsOwner,
Guardian: intent.SuperchainRoles.Guardian,
......
......@@ -65,7 +65,7 @@ type SuperchainDeployment struct {
}
type ImplementationsDeployment struct {
OpsmProxyAddress common.Address `json:"opsmProxyAddress"`
OpcmProxyAddress common.Address `json:"opcmProxyAddress"`
DelayedWETHImplAddress common.Address `json:"delayedWETHImplAddress"`
OptimismPortalImplAddress common.Address `json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress common.Address `json:"preimageOracleSingletonAddress"`
......
......@@ -33,7 +33,7 @@ type SuperFaultProofConfig struct {
DisputeGameFinalityDelaySeconds *big.Int
}
type OPSMImplementationsConfig struct {
type OPCMImplementationsConfig struct {
Release string
FaultProof SuperFaultProofConfig
......@@ -51,7 +51,7 @@ type SuperchainConfig struct {
Paused bool
Implementations OPSMImplementationsConfig
Implementations OPCMImplementationsConfig
genesis.SuperchainL1DeployConfig
}
......
......@@ -5,13 +5,12 @@ import (
"fmt"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/deployer/opsm"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"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/genesis"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis/beacondeposit"
......@@ -149,7 +148,7 @@ func prepareInitialL1(l1Host *script.Host, cfg *L1Config) (*L1Deployment, error)
func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*SuperchainDeployment, error) {
l1Host.SetTxOrigin(superCfg.Deployer)
superDeployment, err := opsm.DeploySuperchain(l1Host, opsm.DeploySuperchainInput{
superDeployment, err := opcm.DeploySuperchain(l1Host, opcm.DeploySuperchainInput{
ProxyAdminOwner: superCfg.ProxyAdminOwner,
ProtocolVersionsOwner: superCfg.ProtocolVersionsOwner,
Guardian: superCfg.SuperchainConfigGuardian,
......@@ -161,7 +160,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
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,
MinProposalSizeBytes: superCfg.Implementations.FaultProof.MinProposalSizeBytes,
ChallengePeriodSeconds: superCfg.Implementations.FaultProof.ChallengePeriodSeconds,
......@@ -172,7 +171,7 @@ func deploySuperchainToL1(l1Host *script.Host, superCfg *SuperchainConfig) (*Sup
ProtocolVersionsProxy: superDeployment.ProtocolVersionsProxy,
SuperchainProxyAdmin: superDeployment.SuperchainProxyAdmin,
UseInterop: superCfg.Implementations.UseInterop,
StandardVersionsToml: opsm.StandardVersionsData,
StandardVersionsToml: opcm.StandardVersionsData,
})
if err != nil {
return nil, fmt.Errorf("failed to deploy Implementations contracts: %w", err)
......@@ -197,7 +196,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
l1Host.SetTxOrigin(cfg.Deployer)
output, err := opsm.DeployOPChain(l1Host, opsm.DeployOPChainInput{
output, err := opcm.DeployOPChain(l1Host, opcm.DeployOPChainInput{
OpChainProxyAdminOwner: cfg.ProxyAdminOwner,
SystemConfigOwner: cfg.SystemConfigOwner,
Batcher: cfg.BatchSenderAddress,
......@@ -207,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar,
BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar,
L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID),
OpsmProxy: superDeployment.OpsmProxy,
OpcmProxy: superDeployment.OpcmProxy,
})
if err != nil {
return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err)
......@@ -220,8 +219,8 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
}
func genesisL2(l2Host *script.Host, cfg *L2Config, deployment *L2Deployment) error {
if err := opsm.L2Genesis(l2Host, &opsm.L2GenesisInput{
L1Deployments: opsm.L1Deployments{
if err := opcm.L2Genesis(l2Host, &opcm.L2GenesisInput{
L1Deployments: opcm.L1Deployments{
L1CrossDomainMessengerProxy: deployment.L1CrossDomainMessengerProxy,
L1StandardBridgeProxy: deployment.L1StandardBridgeProxy,
L1ERC721BridgeProxy: deployment.L1ERC721BridgeProxy,
......
......@@ -9,8 +9,8 @@ type L1Deployment struct {
}
type Implementations struct {
OpsmProxy common.Address `json:"OPSMProxy"`
OpsmImpl common.Address `json:"OPSMImpl"`
OpcmProxy common.Address `json:"OPCMProxy"`
OpcmImpl common.Address `json:"OPCMImpl"`
DelayedWETHImpl common.Address `json:"DelayedWETHImpl"`
OptimismPortalImpl common.Address `json:"OptimismPortalImpl"`
PreimageOracleSingleton common.Address `json:"PreimageOracleSingleton"`
......
......@@ -8,7 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"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/genesis"
)
......@@ -67,7 +67,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
ProxyAdminOwner: superchainProxyAdmin,
ProtocolVersionsOwner: superchainProtocolVersionsOwner,
Deployer: superchainDeployer,
Implementations: OPSMImplementationsConfig{
Implementations: OPCMImplementationsConfig{
Release: "dev",
FaultProof: SuperFaultProofConfig{
WithdrawalDelaySeconds: big.NewInt(604800),
......@@ -77,7 +77,7 @@ func (r *InteropDevRecipe) Build(addrs devkeys.Addresses) (*WorldConfig, error)
DisputeGameFinalityDelaySeconds: big.NewInt(6),
},
UseInterop: true,
StandardVersionsToml: opsm.StandardVersionsData,
StandardVersionsToml: opcm.StandardVersionsData,
},
SuperchainL1DeployConfig: genesis.SuperchainL1DeployConfig{
RequiredProtocolVersion: params.OPStackSupport,
......
......@@ -26,7 +26,7 @@ import { FaultDisputeGame } from "src/dispute/FaultDisputeGame.sol";
import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.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 { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
......@@ -46,7 +46,7 @@ contract DeployOPChainInput is BaseDeployIO {
uint32 internal _basefeeScalar;
uint32 internal _blobBaseFeeScalar;
uint256 internal _l2ChainId;
OPStackManager internal _opsmProxy;
OPContractsManager internal _opcmProxy;
function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
......@@ -56,7 +56,7 @@ contract DeployOPChainInput is BaseDeployIO {
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.proposer.selector) _proposer = _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");
}
......@@ -129,7 +129,7 @@ contract DeployOPChainInput is BaseDeployIO {
// anchor root and deploy a new permissioned dispute game contract anyway.
//
// 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 =
new AnchorStateRegistry.StartingAnchorRoot[](1);
defaultStartingAnchorRoots[0] = AnchorStateRegistry.StartingAnchorRoot({
......@@ -139,10 +139,10 @@ contract DeployOPChainInput is BaseDeployIO {
return abi.encode(defaultStartingAnchorRoots);
}
// TODO: Check that opsm is proxied and it has an implementation.
function opsmProxy() public view returns (OPStackManager) {
require(address(_opsmProxy) != address(0), "DeployOPChainInput: not set");
return _opsmProxy;
// TODO: Check that opcm is proxied and it has an implementation.
function opcmProxy() public view returns (OPContractsManager) {
require(address(_opcmProxy) != address(0), "DeployOPChainInput: not set");
return _opcmProxy;
}
}
......@@ -309,8 +309,8 @@ contract DeployOPChainOutput is BaseDeployIO {
require(GameType.unwrap(game.gameType()) == GameType.unwrap(GameTypes.PERMISSIONED_CANNON), "DPG-10");
require(Claim.unwrap(game.absolutePrestate()) == bytes32(hex"dead"), "DPG-20");
OPStackManager opsm = _doi.opsmProxy();
(address mips,) = opsm.implementations(opsm.latestRelease(), "MIPS");
OPContractsManager opcm = _doi.opcmProxy();
(address mips,) = opcm.implementations(opcm.latestRelease(), "MIPS");
require(game.vm() == IBigStepper(mips), "DPG-30");
require(address(game.weth()) == address(delayedWETHPermissionedGameProxy()), "DPG-40");
......@@ -368,7 +368,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(systemConfig.startBlock() == block.number, "SYSCON-140");
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");
......@@ -393,7 +393,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30");
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)));
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
......@@ -409,7 +409,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.messenger()) == address(messenger), "L1SB-20");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30");
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 {
......@@ -431,12 +431,12 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "L721B-30");
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 {
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.systemConfig()) == address(systemConfigProxy()), "PORTAL-20");
......@@ -470,9 +470,9 @@ contract DeployOPChain is Script {
// -------- Core Deployment Methods --------
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(),
systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(),
......@@ -480,7 +480,7 @@ contract DeployOPChain is Script {
proposer: _doi.proposer(),
challenger: _doi.challenger()
});
OPStackManager.DeployInput memory deployInput = OPStackManager.DeployInput({
OPContractsManager.DeployInput memory deployInput = OPContractsManager.DeployInput({
roles: roles,
basefeeScalar: _doi.basefeeScalar(),
blobBasefeeScalar: _doi.blobBaseFeeScalar(),
......@@ -489,7 +489,7 @@ contract DeployOPChain is Script {
});
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.addressManager), "addressManager");
......
......@@ -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
// 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.
//
// There are three categories of users that are expected to interact with the scripts:
......
......@@ -31,9 +31,9 @@
"initCodeHash": "0x433fac9de52d8ce8fc3471b78ef6cc9cff1019f480c9ad91b6e09ab8738a8edb",
"sourceCodeHash": "0xde4df0f9633dc0cdb1c9f634003ea5b0f7c5c1aebc407bc1b2f44c0ecf938649"
},
"src/L1/OPStackManager.sol": {
"src/L1/OPContractsManager.sol": {
"initCodeHash": "0x92c72b75206e756742df25d67d295e4479e65db1473948b8f53cb4ca642025d5",
"sourceCodeHash": "0x3cbd30c68cad0dd18d49165bd21d94422b7403174f91a733e2398539dadf8656"
"sourceCodeHash": "0x5e04124ee67298d2f1245139baf7de79dee421d2c031c6e5abe0cd3b1bdbdb32"
},
"src/L1/OptimismPortal.sol": {
"initCodeHash": "0xbe2c0c81b3459014f287d8c89cdc0d27dde5d1f44e5d024fa1e4773ddc47c190",
......
......@@ -62,7 +62,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
"internalType": "struct OPContractsManager.Blueprints",
"name": "",
"type": "tuple"
}
......@@ -126,7 +126,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.Roles",
"internalType": "struct OPContractsManager.Roles",
"name": "roles",
"type": "tuple"
},
......@@ -151,7 +151,7 @@
"type": "bytes"
}
],
"internalType": "struct OPStackManager.DeployInput",
"internalType": "struct OPContractsManager.DeployInput",
"name": "_input",
"type": "tuple"
}
......@@ -236,7 +236,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.DeployOutput",
"internalType": "struct OPContractsManager.DeployOutput",
"name": "",
"type": "tuple"
}
......@@ -320,7 +320,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
"internalType": "struct OPContractsManager.Blueprints",
"name": "blueprints",
"type": "tuple"
},
......@@ -344,12 +344,12 @@
"type": "bytes4"
}
],
"internalType": "struct OPStackManager.Implementation",
"internalType": "struct OPContractsManager.Implementation",
"name": "info",
"type": "tuple"
}
],
"internalType": "struct OPStackManager.ImplementationSetter[]",
"internalType": "struct OPContractsManager.ImplementationSetter[]",
"name": "setters",
"type": "tuple[]"
},
......@@ -364,7 +364,7 @@
"type": "bool"
}
],
"internalType": "struct OPStackManager.InitializerInputs",
"internalType": "struct OPContractsManager.InitializerInputs",
"name": "_initializerInputs",
"type": "tuple"
}
......
......@@ -62,7 +62,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
"internalType": "struct OPContractsManager.Blueprints",
"name": "",
"type": "tuple"
}
......@@ -126,7 +126,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.Roles",
"internalType": "struct OPContractsManager.Roles",
"name": "roles",
"type": "tuple"
},
......@@ -151,7 +151,7 @@
"type": "bytes"
}
],
"internalType": "struct OPStackManager.DeployInput",
"internalType": "struct OPContractsManager.DeployInput",
"name": "_input",
"type": "tuple"
}
......@@ -236,7 +236,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.DeployOutput",
"internalType": "struct OPContractsManager.DeployOutput",
"name": "",
"type": "tuple"
}
......@@ -320,7 +320,7 @@
"type": "address"
}
],
"internalType": "struct OPStackManager.Blueprints",
"internalType": "struct OPContractsManager.Blueprints",
"name": "blueprints",
"type": "tuple"
},
......@@ -344,12 +344,12 @@
"type": "bytes4"
}
],
"internalType": "struct OPStackManager.Implementation",
"internalType": "struct OPContractsManager.Implementation",
"name": "info",
"type": "tuple"
}
],
"internalType": "struct OPStackManager.ImplementationSetter[]",
"internalType": "struct OPContractsManager.ImplementationSetter[]",
"name": "setters",
"type": "tuple[]"
},
......@@ -364,7 +364,7 @@
"type": "bool"
}
],
"internalType": "struct OPStackManager.InitializerInputs",
"internalType": "struct OPContractsManager.InitializerInputs",
"name": "_initializerInputs",
"type": "tuple"
}
......
......@@ -25,7 +25,7 @@
"label": "implementations",
"offset": 0,
"slot": "2",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))"
"type": "mapping(string => mapping(string => struct OPContractsManager.Implementation))"
},
{
"bytes": "32",
......@@ -39,7 +39,7 @@
"label": "blueprint",
"offset": 0,
"slot": "4",
"type": "struct OPStackManager.Blueprints"
"type": "struct OPContractsManager.Blueprints"
},
{
"bytes": "1600",
......
......@@ -25,7 +25,7 @@
"label": "implementations",
"offset": 0,
"slot": "2",
"type": "mapping(string => mapping(string => struct OPStackManager.Implementation))"
"type": "mapping(string => mapping(string => struct OPContractsManager.Implementation))"
},
{
"bytes": "32",
......@@ -39,7 +39,7 @@
"label": "blueprint",
"offset": 0,
"slot": "4",
"type": "struct OPStackManager.Blueprints"
"type": "struct OPContractsManager.Blueprints"
},
{
"bytes": "1600",
......
......@@ -40,7 +40,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol";
import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol";
/// @custom:proxied true
contract OPStackManager is ISemver, Initializable {
contract OPContractsManager is ISemver, Initializable {
// -------- Structs --------
/// @notice Represents the roles that can be set when deploying a standard OP Stack chain.
......@@ -113,7 +113,7 @@ contract OPStackManager is ISemver, Initializable {
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.
struct InitializerInputs {
Blueprints blueprints;
......@@ -133,7 +133,7 @@ contract OPStackManager is ISemver, Initializable {
/// @notice Address of the ProtocolVersions contract shared by all chains.
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;
/// @notice Maps a release version to a contract name to it's implementation data.
......@@ -181,7 +181,7 @@ contract OPStackManager is ISemver, Initializable {
// -------- 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) {
assertValidContractAddress(address(_superchainConfig));
......
// SPDX-License-Identifier: MIT
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 { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
......@@ -9,12 +9,12 @@ import { SystemConfig } from "src/L1/SystemConfig.sol";
import { SystemConfigInterop } from "src/L1/SystemConfigInterop.sol";
/// @custom:proxied true
contract OPStackManagerInterop is OPStackManager {
contract OPContractsManagerInterop is OPContractsManager {
constructor(
SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions
)
OPStackManager(_superchainConfig, _protocolVersions)
OPContractsManager(_superchainConfig, _protocolVersions)
{ }
// The `SystemConfigInterop` contract has an extra `address _dependencyManager` argument
......
......@@ -10,7 +10,7 @@ import { DisputeGameFactory } from "src/dispute/DisputeGameFactory.sol";
import { SuperchainConfig } from "src/L1/SuperchainConfig.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 { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
......@@ -106,11 +106,11 @@ contract DeployImplementationsOutput_Test is Test {
function test_set_succeeds() public {
Proxy proxy = new Proxy(address(0));
address opsmImpl = address(makeAddr("opsmImpl"));
address opcmImpl = address(makeAddr("opcmImpl"));
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")));
DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl")));
PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton"));
......@@ -124,8 +124,8 @@ contract DeployImplementationsOutput_Test is Test {
OptimismMintableERC20Factory(makeAddr("optimismMintableERC20FactoryImpl"));
DisputeGameFactory disputeGameFactoryImpl = DisputeGameFactory(makeAddr("disputeGameFactoryImpl"));
vm.etch(address(opsmProxy), address(opsmProxy).code);
vm.etch(address(opsmImpl), hex"01");
vm.etch(address(opcmProxy), address(opcmProxy).code);
vm.etch(address(opcmImpl), hex"01");
vm.etch(address(optimismPortalImpl), hex"01");
vm.etch(address(delayedWETHImpl), hex"01");
vm.etch(address(preimageOracleSingleton), hex"01");
......@@ -136,7 +136,7 @@ contract DeployImplementationsOutput_Test is Test {
vm.etch(address(l1StandardBridgeImpl), hex"01");
vm.etch(address(optimismMintableERC20FactoryImpl), 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.delayedWETHImpl.selector, address(delayedWETHImpl));
dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton));
......@@ -148,7 +148,7 @@ contract DeployImplementationsOutput_Test is Test {
dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl));
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(delayedWETHImpl), address(dio.delayedWETHImpl()), "200");
assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300");
......@@ -413,7 +413,7 @@ contract DeployImplementations_Test is Test {
string memory release = string(bytes.concat(hash(_seed, 5)));
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);
superchainConfigProxy = SuperchainConfig(address(new Proxy(payable(address(superchainProxyAdmin)))));
......
......@@ -23,7 +23,7 @@ import { PermissionedDisputeGame } from "src/dispute/PermissionedDisputeGame.sol
import { SuperchainConfig } from "src/L1/SuperchainConfig.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 { SystemConfig } from "src/L1/SystemConfig.sol";
import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol";
......@@ -46,7 +46,7 @@ contract DeployOPChainInput_Test is Test {
uint32 basefeeScalar = 100;
uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300;
OPStackManager opsm = OPStackManager(makeAddr("opsm"));
OPContractsManager opcm = OPContractsManager(makeAddr("opcm"));
function setUp() public {
doi = new DeployOPChainInput();
......@@ -62,7 +62,7 @@ contract DeployOPChainInput_Test is Test {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
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.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200");
assertEq(systemConfigOwner, doi.systemConfigOwner(), "300");
......@@ -73,7 +73,7 @@ contract DeployOPChainInput_Test is Test {
assertEq(basefeeScalar, doi.basefeeScalar(), "800");
assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900");
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 {
......@@ -328,7 +328,7 @@ contract DeployOPChain_TestBase is Test {
ProtocolVersions protocolVersionsProxy;
// 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 systemConfigOwner = makeAddr("defaultSystemConfigOwner");
address batcher = makeAddr("defaultBatcher");
......@@ -339,7 +339,7 @@ contract DeployOPChain_TestBase is Test {
uint32 blobBaseFeeScalar = 200;
uint256 l2ChainId = 300;
AnchorStateRegistry.StartingAnchorRoot[] startingAnchorRoots;
OPStackManager opsm = OPStackManager(address(0));
OPContractsManager opcm = OPContractsManager(address(0));
function setUp() public virtual {
// Set defaults for reference types
......@@ -401,8 +401,8 @@ contract DeployOPChain_TestBase is Test {
deployOPChain = new DeployOPChain();
(doi, doo) = deployOPChain.etchIOContracts();
// Set the OPStackManager address as input to DeployOPChain.
opsm = dio.opsmProxy();
// Set the OPContractsManager input for DeployOPChain.
opcm = dio.opcmProxy();
}
// See the function of the same name in the `DeployImplementations_Test` contract of
......@@ -456,11 +456,11 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
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);
// 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.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "100");
......@@ -486,7 +486,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
// assertEq(address(doo.faultDisputeGame().proposer()), proposer, "2700");
// 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.
// TODO add these assertions: AddressManager, Proxy, ProxyAdmin, etc.
}
......
......@@ -6,18 +6,18 @@ import { Test, stdStorage, StdStorage } from "forge-std/Test.sol";
import { DeployOPChainInput } from "scripts/DeployOPChain.s.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 { ProtocolVersions } from "src/L1/ProtocolVersions.sol";
import { SystemConfig } from "src/L1/SystemConfig.sol";
// Exposes internal functions for testing.
contract OPStackManager_Harness is OPStackManager {
contract OPContractsManager_Harness is OPContractsManager {
constructor(
SuperchainConfig _superchainConfig,
ProtocolVersions _protocolVersions
)
OPStackManager(_superchainConfig, _protocolVersions)
OPContractsManager(_superchainConfig, _protocolVersions)
{ }
function chainIdToBatchInboxAddress_exposed(uint256 l2ChainId) public pure returns (address) {
......@@ -26,12 +26,12 @@ contract OPStackManager_Harness is OPStackManager {
}
// 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
// work OPStackManager'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
// because OPContractsManager acts as a deploy script, so we start from a clean slate here and
// work OPContractsManager's deployment into the existing test setup, instead of using the existing
// 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
// happen.
contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
contract OPContractsManager_Deploy_Test is DeployOPChain_TestBase {
using stdStorage for StdStorage;
event Deployed(uint256 indexed l2ChainId, SystemConfig indexed systemConfig);
......@@ -48,14 +48,14 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
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
// to the input struct type defined in OPStackManager.sol.
function toOPSMDeployInput(DeployOPChainInput _doi) internal view returns (OPStackManager.DeployInput memory) {
return OPStackManager.DeployInput({
roles: OPStackManager.Roles({
// to the input struct type defined in OPContractsManager.sol.
function toOPCMDeployInput(DeployOPChainInput _doi) internal view returns (OPContractsManager.DeployInput memory) {
return OPContractsManager.DeployInput({
roles: OPContractsManager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
systemConfigOwner: _doi.systemConfigOwner(),
batcher: _doi.batcher(),
......@@ -71,30 +71,30 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
}
function test_deploy_l2ChainIdEqualsZero_reverts() public {
OPStackManager.DeployInput memory deployInput = toOPSMDeployInput(doi);
OPContractsManager.DeployInput memory deployInput = toOPCMDeployInput(doi);
deployInput.l2ChainId = 0;
vm.expectRevert(OPStackManager.InvalidChainId.selector);
opsm.deploy(deployInput);
vm.expectRevert(OPContractsManager.InvalidChainId.selector);
opcm.deploy(deployInput);
}
function test_deploy_l2ChainIdEqualsCurrentChainId_reverts() public {
OPStackManager.DeployInput memory deployInput = toOPSMDeployInput(doi);
OPContractsManager.DeployInput memory deployInput = toOPCMDeployInput(doi);
deployInput.l2ChainId = block.chainid;
vm.expectRevert(OPStackManager.InvalidChainId.selector);
opsm.deploy(deployInput);
vm.expectRevert(OPContractsManager.InvalidChainId.selector);
opcm.deploy(deployInput);
}
function test_deploy_succeeds() public {
vm.expectEmit(true, false, true, true); // TODO precompute the system config address.
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.
contract OPStackManager_InternalMethods_Test is Test {
OPStackManager_Harness opsmHarness;
contract OPContractsManager_InternalMethods_Test is Test {
OPContractsManager_Harness opcmHarness;
function setUp() public {
SuperchainConfig superchainConfigProxy = SuperchainConfig(makeAddr("superchainConfig"));
......@@ -102,7 +102,7 @@ contract OPStackManager_InternalMethods_Test is Test {
vm.etch(address(superchainConfigProxy), hex"01");
vm.etch(address(protocolVersionsProxy), hex"01");
opsmHarness = new OPStackManager_Harness({
opcmHarness = new OPContractsManager_Harness({
_superchainConfig: superchainConfigProxy,
_protocolVersions: protocolVersionsProxy
});
......@@ -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.
uint256 chainId = 1234;
address expected = 0x0017FA14b0d73Aa6A26D6b8720c1c84b50984f5C;
address actual = opsmHarness.chainIdToBatchInboxAddress_exposed(chainId);
address actual = opcmHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual);
chainId = type(uint256).max;
expected = 0x00a9C584056064687E149968cBaB758a3376D22A;
actual = opsmHarness.chainIdToBatchInboxAddress_exposed(chainId);
actual = opcmHarness.chainIdToBatchInboxAddress_exposed(chainId);
vm.assertEq(expected, actual);
}
}
......@@ -10,7 +10,7 @@ import { Executables } from "scripts/libraries/Executables.sol";
import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol";
// Contracts
import { OPStackManager } from "src/L1/OPStackManager.sol";
import { OPContractsManager } from "src/L1/OPContractsManager.sol";
// Interfaces
import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
......@@ -836,29 +836,29 @@ contract Specification_Test is CommonTest {
_addSpec({ _name: "WETH98", _sel: _getSel("transferFrom(address,address,uint256)") });
_addSpec({ _name: "WETH98", _sel: _getSel("withdraw(uint256)") });
// OPStackManager
_addSpec({ _name: "OPStackManager", _sel: _getSel("version()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OPStackManager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.initialize.selector });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.deploy.selector });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.blueprints.selector });
_addSpec({ _name: "OPStackManager", _sel: OPStackManager.chainIdToBatchInboxAddress.selector });
// OPStackManagerInterop
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OPStackManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.initialize.selector });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.deploy.selector });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.blueprints.selector });
_addSpec({ _name: "OPStackManagerInterop", _sel: OPStackManager.chainIdToBatchInboxAddress.selector });
// OPContractsManager
_addSpec({ _name: "OPContractsManager", _sel: _getSel("version()") });
_addSpec({ _name: "OPContractsManager", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OPContractsManager", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OPContractsManager", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OPContractsManager", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OPContractsManager", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.initialize.selector });
_addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.deploy.selector });
_addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.blueprints.selector });
_addSpec({ _name: "OPContractsManager", _sel: OPContractsManager.chainIdToBatchInboxAddress.selector });
// OPContractsManagerInterop
_addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("version()") });
_addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("superchainConfig()") });
_addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("protocolVersions()") });
_addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("latestRelease()") });
_addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("implementations(string,string)") });
_addSpec({ _name: "OPContractsManagerInterop", _sel: _getSel("systemConfigs(uint256)") });
_addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.initialize.selector });
_addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.deploy.selector });
_addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.blueprints.selector });
_addSpec({ _name: "OPContractsManagerInterop", _sel: OPContractsManager.chainIdToBatchInboxAddress.selector });
// DeputyGuardianModule
_addSpec({
......
......@@ -411,8 +411,8 @@ contract Initializer_Test is Bridge_Initializer {
excludes[4] = "src/dispute/FaultDisputeGame.sol";
excludes[5] = "src/dispute/PermissionedDisputeGame.sol";
// TODO: Eventually remove this exclusion. Same reason as above dispute contracts.
excludes[6] = "src/L1/OPStackManager.sol";
excludes[7] = "src/L1/OPStackManagerInterop.sol";
excludes[6] = "src/L1/OPContractsManager.sol";
excludes[7] = "src/L1/OPContractsManagerInterop.sol";
// Get all contract names in the src directory, minus the excluded contracts.
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