Commit 300d9f33 authored by Maurelian's avatar Maurelian Committed by GitHub

feat(deploy): deploy implementations before proxies (#12114)

* feat(deploy): deploy implementations before proxies

This change prepares for the OPCM integration by deploying the implementations before the proxies.
`intializeImplementations()` was renamed to `initializeProxies()` which is more accurate.

Also the ASR's implementation was unnecessarily initialized with a proxy address for a constructor
argument.

* test(deploy): Move ASR impl deployment to deployProxies

It must be deployed per chain because it is not MCP ready.

* test(deploy): Rename deploy functions to correspond to OPCM
parent d42fc0b9
...@@ -398,9 +398,10 @@ contract Deploy is Deployer { ...@@ -398,9 +398,10 @@ contract Deploy is Deployer {
mustGetAddress("AddressManager"); mustGetAddress("AddressManager");
mustGetAddress("ProxyAdmin"); mustGetAddress("ProxyAdmin");
deployProxies();
deployImplementations(); deployImplementations();
initializeImplementations();
deployOpChain();
initializeOpChain();
setAlphabetFaultGameImplementation({ _allowUpgrade: false }); setAlphabetFaultGameImplementation({ _allowUpgrade: false });
setFastFaultGameImplementation({ _allowUpgrade: false }); setFastFaultGameImplementation({ _allowUpgrade: false });
...@@ -411,9 +412,9 @@ contract Deploy is Deployer { ...@@ -411,9 +412,9 @@ contract Deploy is Deployer {
transferDelayedWETHOwnership(); transferDelayedWETHOwnership();
} }
/// @notice Deploy all of the proxies /// @notice Deploy all of the OP Chain specific contracts
function deployProxies() public { function deployOpChain() public {
console.log("Deploying proxies"); console.log("Deploying OP Chain contracts");
deployERC1967Proxy("OptimismPortalProxy"); deployERC1967Proxy("OptimismPortalProxy");
deployERC1967Proxy("SystemConfigProxy"); deployERC1967Proxy("SystemConfigProxy");
...@@ -431,6 +432,8 @@ contract Deploy is Deployer { ...@@ -431,6 +432,8 @@ contract Deploy is Deployer {
deployERC1967Proxy("PermissionedDelayedWETHProxy"); deployERC1967Proxy("PermissionedDelayedWETHProxy");
deployERC1967Proxy("AnchorStateRegistryProxy"); deployERC1967Proxy("AnchorStateRegistryProxy");
deployAnchorStateRegistry();
transferAddressManagerOwnership(); // to the ProxyAdmin transferAddressManagerOwnership(); // to the ProxyAdmin
} }
...@@ -450,12 +453,12 @@ contract Deploy is Deployer { ...@@ -450,12 +453,12 @@ contract Deploy is Deployer {
deployDelayedWETH(); deployDelayedWETH();
deployPreimageOracle(); deployPreimageOracle();
deployMips(); deployMips();
deployAnchorStateRegistry();
} }
/// @notice Initialize all of the implementations /// @notice Initialize all of the proxies in an OP Chain by upgrading to the correct proxy and calling the
function initializeImplementations() public { /// initialize function
console.log("Initializing implementations"); function initializeOpChain() public {
console.log("Initializing Op Chain proxies");
// Selectively initialize either the original OptimismPortal or the new OptimismPortal2. Since this will upgrade // Selectively initialize either the original OptimismPortal or the new OptimismPortal2. Since this will upgrade
// the proxy, we cannot initialize both. // the proxy, we cannot initialize both.
if (cfg.useFaultProofs()) { if (cfg.useFaultProofs()) {
......
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