Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: delete FPACOPs and unused deploy functions #12261

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 1 addition & 247 deletions packages/contracts-bedrock/scripts/deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -603,27 +603,6 @@ contract Deploy is Deployer {
require(initialized != 0);
}

/// @notice Deploy the L1CrossDomainMessenger
function deployL1CrossDomainMessenger() public broadcast returns (address addr_) {
IL1CrossDomainMessenger messenger = IL1CrossDomainMessenger(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "L1CrossDomainMessenger",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IL1CrossDomainMessenger.__constructor__, ()))
})
);

// Override the `L1CrossDomainMessenger` contract to the deployed implementation. This is necessary
// to check the `L1CrossDomainMessenger` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L1CrossDomainMessenger = address(messenger);
ChainAssertions.checkL1CrossDomainMessenger({ _contracts: contracts, _vm: vm, _isProxy: false });

addr_ = address(messenger);
}

/// @notice Deploy the OptimismPortal
function deployOptimismPortal() public broadcast returns (address addr_) {
if (cfg.useInterop()) {
Expand All @@ -645,61 +624,6 @@ contract Deploy is Deployer {
ChainAssertions.checkOptimismPortal({ _contracts: contracts, _cfg: cfg, _isProxy: false });
}

/// @notice Deploy the OptimismPortal2
function deployOptimismPortal2() public broadcast returns (address addr_) {
// Could also verify this inside DeployConfig but doing it here is a bit more reliable.
require(
uint32(cfg.respectedGameType()) == cfg.respectedGameType(), "Deploy: respectedGameType must fit into uint32"
);

addr_ = DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "OptimismPortal2",
_args: DeployUtils.encodeConstructor(
abi.encodeCall(
IOptimismPortal2.__constructor__,
(cfg.proofMaturityDelaySeconds(), cfg.disputeGameFinalityDelaySeconds())
)
)
});

// Override the `OptimismPortal2` contract to the deployed implementation. This is necessary
// to check the `OptimismPortal2` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.OptimismPortal2 = addr_;
ChainAssertions.checkOptimismPortal2({ _contracts: contracts, _cfg: cfg, _isProxy: false });
}

/// @notice Deploy the OptimismPortalInterop contract
function deployOptimismPortalInterop() public broadcast returns (address addr_) {
// Could also verify this inside DeployConfig but doing it here is a bit more reliable.
require(
uint32(cfg.respectedGameType()) == cfg.respectedGameType(), "Deploy: respectedGameType must fit into uint32"
);

addr_ = DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "OptimismPortalInterop",
_args: DeployUtils.encodeConstructor(
abi.encodeCall(
IOptimismPortalInterop.__constructor__,
(cfg.proofMaturityDelaySeconds(), cfg.disputeGameFinalityDelaySeconds())
)
)
});
save("OptimismPortal2", addr_);

// Override the `OptimismPortal2` contract to the deployed implementation. This is necessary
// to check the `OptimismPortal2` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.OptimismPortal2 = addr_;
ChainAssertions.checkOptimismPortal2({ _contracts: contracts, _cfg: cfg, _isProxy: false });
}

/// @notice Deploy the L2OutputOracle
function deployL2OutputOracle() public broadcast returns (address addr_) {
IL2OutputOracle oracle = IL2OutputOracle(
Expand All @@ -726,106 +650,7 @@ contract Deploy is Deployer {
addr_ = address(oracle);
}

/// @notice Deploy the OptimismMintableERC20Factory
function deployOptimismMintableERC20Factory() public broadcast returns (address addr_) {
IOptimismMintableERC20Factory factory = IOptimismMintableERC20Factory(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "OptimismMintableERC20Factory",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IOptimismMintableERC20Factory.__constructor__, ()))
})
);

// Override the `OptimismMintableERC20Factory` contract to the deployed implementation. This is necessary
// to check the `OptimismMintableERC20Factory` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.OptimismMintableERC20Factory = address(factory);
ChainAssertions.checkOptimismMintableERC20Factory({ _contracts: contracts, _isProxy: false });

addr_ = address(factory);
}

/// @notice Deploy the DisputeGameFactory
function deployDisputeGameFactory() public broadcast returns (address addr_) {
IDisputeGameFactory factory = IDisputeGameFactory(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "DisputeGameFactory",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IDisputeGameFactory.__constructor__, ()))
})
);

// Override the `DisputeGameFactory` contract to the deployed implementation. This is necessary to check the
// `DisputeGameFactory` implementation alongside dependent contracts, which are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.DisputeGameFactory = address(factory);
ChainAssertions.checkDisputeGameFactory({ _contracts: contracts, _expectedOwner: address(0) });

addr_ = address(factory);
}

function deployDelayedWETH() public broadcast returns (address addr_) {
IDelayedWETH weth = IDelayedWETH(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "DelayedWETH",
_args: DeployUtils.encodeConstructor(
abi.encodeCall(IDelayedWETH.__constructor__, (cfg.faultGameWithdrawalDelay()))
)
})
);

// Override the `DelayedWETH` contract to the deployed implementation. This is necessary
// to check the `DelayedWETH` implementation alongside dependent contracts, which are
// always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.DelayedWETH = address(weth);
ChainAssertions.checkDelayedWETH({
_contracts: contracts,
_cfg: cfg,
_isProxy: false,
_expectedOwner: address(0)
});

addr_ = address(weth);
}

/// @notice Deploy the PreimageOracle
function deployPreimageOracle() public broadcast returns (address addr_) {
IPreimageOracle preimageOracle = IPreimageOracle(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "PreimageOracle",
_args: DeployUtils.encodeConstructor(
abi.encodeCall(
IPreimageOracle.__constructor__,
(cfg.preimageOracleMinProposalSize(), cfg.preimageOracleChallengePeriod())
)
)
})
);
addr_ = address(preimageOracle);
}

/// @notice Deploy Mips VM. Deploys either MIPS or MIPS2 depending on the environment
function deployMips() public broadcast returns (address addr_) {
addr_ = DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: Config.useMultithreadedCannon() ? "MIPS2" : "MIPS",
_args: DeployUtils.encodeConstructor(
abi.encodeCall(IMIPS2.__constructor__, (IPreimageOracle(mustGetAddress("PreimageOracle"))))
)
});
save("Mips", address(addr_));
}

/// @notice Deploy the AnchorStateRegistry
/// @notice Deploy the AnchorStateRegistry (Used in FPACOPS)
function deployAnchorStateRegistry() public broadcast returns (address addr_) {
IAnchorStateRegistry anchorStateRegistry = IAnchorStateRegistry(
DeployUtils.create2AndSave({
Expand All @@ -844,77 +669,6 @@ contract Deploy is Deployer {
addr_ = address(anchorStateRegistry);
}

/// @notice Deploy the SystemConfig
function deploySystemConfig() public broadcast returns (address addr_) {
addr_ = DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "SystemConfig",
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISystemConfig.__constructor__, ()))
});
}

/// @notice Deploy the SystemConfigInterop contract
function deploySystemConfigInterop() public broadcast returns (address addr_) {
addr_ = DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "SystemConfigInterop",
_args: DeployUtils.encodeConstructor(abi.encodeCall(ISystemConfigInterop.__constructor__, ()))
});
save("SystemConfig", addr_);

// Override the `SystemConfig` contract to the deployed implementation. This is necessary
// to check the `SystemConfig` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.SystemConfig = addr_;
ChainAssertions.checkSystemConfig({ _contracts: contracts, _cfg: cfg, _isProxy: false });
}

/// @notice Deploy the L1StandardBridge
function deployL1StandardBridge() public broadcast returns (address addr_) {
IL1StandardBridge bridge = IL1StandardBridge(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "L1StandardBridge",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IL1StandardBridge.__constructor__, ()))
})
);

// Override the `L1StandardBridge` contract to the deployed implementation. This is necessary
// to check the `L1StandardBridge` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L1StandardBridge = address(bridge);
ChainAssertions.checkL1StandardBridge({ _contracts: contracts, _isProxy: false });

addr_ = address(bridge);
}

/// @notice Deploy the L1ERC721Bridge
function deployL1ERC721Bridge() public broadcast returns (address addr_) {
IL1ERC721Bridge bridge = IL1ERC721Bridge(
DeployUtils.create2AndSave({
_save: this,
_salt: _implSalt(),
_name: "L1ERC721Bridge",
_args: DeployUtils.encodeConstructor(abi.encodeCall(IL1ERC721Bridge.__constructor__, ()))
})
);

// Override the `L1ERC721Bridge` contract to the deployed implementation. This is necessary
// to check the `L1ERC721Bridge` implementation alongside dependent contracts, which
// are always proxies.
Types.ContractSet memory contracts = _proxiesUnstrict();
contracts.L1ERC721Bridge = address(bridge);

ChainAssertions.checkL1ERC721Bridge({ _contracts: contracts, _isProxy: false });

addr_ = address(bridge);
}

/// @notice Transfer ownership of the address manager to the ProxyAdmin
function transferAddressManagerOwnership() public broadcast {
console.log("Transferring AddressManager ownership to IProxyAdmin");
Expand Down
Loading