Commit 536178b0 authored by Maurelian's avatar Maurelian

feat(ctb): Add the finalize function to MSD.phase2()

parent a70e0c9a
...@@ -419,18 +419,19 @@ contract SystemDictator is OwnableUpgradeable { ...@@ -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 { function phase2() external onlyOwner {
step3(); step3();
step4(); step4();
step5(); step5();
finalize();
} }
/** /**
* @notice Tranfers admin ownership to the final owner. * @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. // Transfer ownership of the ProxyAdmin to the final owner.
config.globalConfig.proxyAdmin.transferOwnership(config.globalConfig.finalOwner); config.globalConfig.proxyAdmin.transferOwnership(config.globalConfig.finalOwner);
......
...@@ -190,6 +190,9 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -190,6 +190,9 @@ const deployFn: DeployFunction = async (hre) => {
Step 5 will initialize all Bedrock contracts. After this step is executed, the OptimismPortal 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. 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. 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 () => { checks: async () => {
// Step 3 checks // Step 3 checks
...@@ -300,6 +303,13 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -300,6 +303,13 @@ const deployFn: DeployFunction = async (hre) => {
'messenger', 'messenger',
L1CrossDomainMessenger.address L1CrossDomainMessenger.address
) )
// finalize checks
await assertContractVariable(
ProxyAdmin,
'owner',
hre.deployConfig.finalSystemOwner
)
}, },
}) })
...@@ -335,24 +345,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -335,24 +345,6 @@ const deployFn: DeployFunction = async (hre) => {
await assertContractVariable(OptimismPortal, 'paused', false) 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( await awaitCondition(
async () => { async () => {
return SystemDictator.finalized() return SystemDictator.finalized()
...@@ -360,12 +352,6 @@ const deployFn: DeployFunction = async (hre) => { ...@@ -360,12 +352,6 @@ const deployFn: DeployFunction = async (hre) => {
5000, 5000,
1000 1000
) )
await assertContractVariable(
ProxyAdmin,
'owner',
hre.deployConfig.finalSystemOwner
)
} }
} }
......
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