Skip to content

Commit

Permalink
Merge pull request #5572 from ethereum-optimism/jm/streamline-migrati…
Browse files Browse the repository at this point in the history
…on/phase2-finalize

feat(ctb): Add the finalize function to MSD.phase2()
  • Loading branch information
OptimismBot committed May 1, 2023
2 parents 5d711a0 + c0298e3 commit 2985bd8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,19 @@ contract SystemDictator is OwnableUpgradeable {
}

/**
* @notice Calls the remaining steps of the migration process.
* @notice Calls the remaining steps of the migration process, and finalizes.
*/
function phase2() external onlyOwner {
step3();
step4();
step5();
finalize();
}

/**
* @notice Tranfers admin ownership to the final owner.
*/
function finalize() external onlyOwner {
function finalize() public onlyOwner {
// Transfer ownership of the ProxyAdmin to the final owner.
config.globalConfig.proxyAdmin.transferOwnership(config.globalConfig.finalOwner);

Expand Down
34 changes: 10 additions & 24 deletions packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ const deployFn: DeployFunction = async (hre) => {
Step 5 will initialize all Bedrock contracts. After this step is executed, the OptimismPortal
will be open for deposits but withdrawals will be paused if deploying a production network.
The Proposer will also be able to submit L2 outputs to the L2OutputOracle.
Lastly the finalize step will be executed. This will transfer ownership of the ProxyAdmin to
the final system owner as specified in the deployment configuration.
`,
checks: async () => {
// Step 3 checks
Expand Down Expand Up @@ -300,6 +303,13 @@ const deployFn: DeployFunction = async (hre) => {
'messenger',
L1CrossDomainMessenger.address
)

// finalize checks
await assertContractVariable(
ProxyAdmin,
'owner',
hre.deployConfig.finalSystemOwner
)
},
})

Expand Down Expand Up @@ -335,37 +345,13 @@ const deployFn: DeployFunction = async (hre) => {

await assertContractVariable(OptimismPortal, 'paused', false)

console.log(`
You must now finalize the upgrade by calling finalize() on the SystemDictator. This will
transfer ownership of the ProxyAdmin to the final system owner as specified in the deployment
configuration.
`)

if (isLiveDeployer) {
console.log(`Finalizing deployment...`)
await SystemDictator.finalize()
} else {
const tx = await SystemDictator.populateTransaction.finalize()
console.log(`Please finalize deployment...`)
console.log(`MSD address: ${SystemDictator.address}`)
printJsonTransaction(tx)
printCastCommand(tx)
await printTenderlySimulationLink(SystemDictator.provider, tx)
}

await awaitCondition(
async () => {
return SystemDictator.finalized()
},
5000,
1000
)

await assertContractVariable(
ProxyAdmin,
'owner',
hre.deployConfig.finalSystemOwner
)
}
}

Expand Down

0 comments on commit 2985bd8

Please sign in to comment.