Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
29cee901
Unverified
Commit
29cee901
authored
Nov 16, 2022
by
mergify[bot]
Committed by
GitHub
Nov 16, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4000 from ethereum-optimism/sc/ctb-msd-finalize
feat(ctb): allow owner to finalize MSD at any time
parents
1896b7c7
f19d11c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
14 deletions
+53
-14
MigrationSystemDictator.sol
...-bedrock/contracts/deployment/MigrationSystemDictator.sol
+27
-1
019-MigrationSystemDictatorSteps.ts
...tracts-bedrock/deploy/019-MigrationSystemDictatorSteps.ts
+26
-13
No files found.
packages/contracts-bedrock/contracts/deployment/MigrationSystemDictator.sol
View file @
29cee901
...
@@ -17,6 +17,16 @@ import { BaseSystemDictator } from "./BaseSystemDictator.sol";
...
@@ -17,6 +17,16 @@ import { BaseSystemDictator } from "./BaseSystemDictator.sol";
* proxies and implementations already be deployed before this contract is used.
* proxies and implementations already be deployed before this contract is used.
*/
*/
contract MigrationSystemDictator is BaseSystemDictator {
contract MigrationSystemDictator is BaseSystemDictator {
/**
* @notice Step where proxy ownership is transferred.
*/
uint8 constant PROXY_TRANSFER_STEP = 3;
/**
* @notice Whether or not the deployment is finalized.
*/
bool public finalized;
/**
/**
* @param _config System configuration.
* @param _config System configuration.
*/
*/
...
@@ -195,12 +205,28 @@ contract MigrationSystemDictator is BaseSystemDictator {
...
@@ -195,12 +205,28 @@ contract MigrationSystemDictator is BaseSystemDictator {
/**
/**
* @notice Tranfers admin ownership to the final owner.
* @notice Tranfers admin ownership to the final owner.
*/
*/
function
step7() external onlyOwner step(7)
{
function
finalize() external onlyOwner
{
// Transfer ownership of the L1CrossDomainMessenger to the final owner.
// Transfer ownership of the L1CrossDomainMessenger to the final owner.
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy)
L1CrossDomainMessenger(config.proxyAddressConfig.l1CrossDomainMessengerProxy)
.transferOwnership(config.globalConfig.finalOwner);
.transferOwnership(config.globalConfig.finalOwner);
// 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);
// Optionally also transfer AddressManager and L1StandardBridge if we still own it. Might
// happen if we're exiting early.
if (currentStep <= PROXY_TRANSFER_STEP) {
// Transfer ownership of the AddressManager to the final owner.
config.globalConfig.addressManager.transferOwnership(
address(config.globalConfig.finalOwner)
);
// Transfer ownership of the L1StandardBridge to the final owner.
L1ChugSplashProxy(payable(config.proxyAddressConfig.l1StandardBridgeProxy)).setOwner(
address(config.globalConfig.finalOwner)
);
}
finalized = true;
}
}
}
}
packages/contracts-bedrock/deploy/019-MigrationSystemDictatorSteps.ts
View file @
29cee901
...
@@ -326,21 +326,9 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -326,21 +326,9 @@ const deployFn: DeployFunction = async (hre) => {
6
:
async
()
=>
{
6
:
async
()
=>
{
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
false
)
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
paused
'
,
false
)
},
},
7
:
async
()
=>
{
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
await
assertContractVariable
(
ProxyAdmin
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
},
}
}
for
(
let
i
=
1
;
i
<=
7
;
i
++
)
{
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
if
((
await
MigrationSystemDictator
.
currentStep
())
===
i
)
{
if
((
await
MigrationSystemDictator
.
currentStep
())
===
i
)
{
if
(
isLiveDeployer
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Executing step
${
i
}
...`
)
console
.
log
(
`Executing step
${
i
}
...`
)
...
@@ -360,6 +348,31 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -360,6 +348,31 @@ const deployFn: DeployFunction = async (hre) => {
console
.
log
(
`Step
${
i
}
executed`
)
console
.
log
(
`Step
${
i
}
executed`
)
}
}
}
}
if
((
await
MigrationSystemDictator
.
currentStep
())
===
7
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Finalizing deployment...`
)
await
MigrationSystemDictator
.
finalize
()
}
else
{
console
.
log
(
`Please finalize deployment...`
)
}
await
awaitCondition
(
async
()
=>
{
return
MigrationSystemDictator
.
finalized
()
})
await
assertContractVariable
(
L1CrossDomainMessenger
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
await
assertContractVariable
(
ProxyAdmin
,
'
owner
'
,
hre
.
deployConfig
.
finalSystemOwner
)
}
}
}
deployFn
.
tags
=
[
'
MigrationSystemDictatorSteps
'
,
'
migration
'
]
deployFn
.
tags
=
[
'
MigrationSystemDictatorSteps
'
,
'
migration
'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment