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
21ea9dfa
Commit
21ea9dfa
authored
Apr 06, 2023
by
Maurelian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ctb): Add phase2 function to MSD
parent
11135c6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
32 deletions
+28
-32
SystemDictator.sol
...contracts-bedrock/contracts/deployment/SystemDictator.sol
+12
-3
021-SystemDictatorSteps-2.ts
...ges/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
+16
-29
No files found.
packages/contracts-bedrock/contracts/deployment/SystemDictator.sol
View file @
21ea9dfa
...
...
@@ -285,7 +285,7 @@ contract SystemDictator is OwnableUpgradeable {
/**
* @notice Removes deprecated addresses from the AddressManager.
*/
function step3()
external
onlyOwner step(EXIT_1_NO_RETURN_STEP) {
function step3()
public
onlyOwner step(EXIT_1_NO_RETURN_STEP) {
// Remove all deprecated addresses from the AddressManager
string[17] memory deprecated = [
"OVM_CanonicalTransactionChain",
...
...
@@ -315,7 +315,7 @@ contract SystemDictator is OwnableUpgradeable {
/**
* @notice Transfers system ownership to the ProxyAdmin.
*/
function step4()
external
onlyOwner step(PROXY_TRANSFER_STEP) {
function step4()
public
onlyOwner step(PROXY_TRANSFER_STEP) {
// Transfer ownership of the AddressManager to the ProxyAdmin.
config.globalConfig.addressManager.transferOwnership(
address(config.globalConfig.proxyAdmin)
...
...
@@ -335,7 +335,7 @@ contract SystemDictator is OwnableUpgradeable {
/**
* @notice Upgrades and initializes proxy contracts.
*/
function step5()
external
onlyOwner step(5) {
function step5()
public
onlyOwner step(5) {
// Dynamic config must be set before we can initialize the L2OutputOracle.
require(dynamicConfigSet, "SystemDictator: dynamic oracle config is not yet initialized");
...
...
@@ -418,6 +418,15 @@ contract SystemDictator is OwnableUpgradeable {
step2();
}
/**
* @notice Calls the next remaings steps of the migration process.
*/
function phase2() external onlyOwner {
step3();
step4();
step5();
}
/**
* @notice Tranfers admin ownership to the final owner.
*/
...
...
packages/contracts-bedrock/deploy/021-SystemDictatorSteps-2.ts
View file @
21ea9dfa
...
...
@@ -12,10 +12,11 @@ import {
getContractsFromArtifacts
,
printJsonTransaction
,
isStep
,
doStep
,
printTenderlySimulationLink
,
printCastCommand
,
liveDeployer
,
doPhase
,
isStartOfPhase
,
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
...
...
@@ -92,7 +93,7 @@ const deployFn: DeployFunction = async (hre) => {
// Make sure the dynamic system configuration has been set.
if
(
(
await
isSt
ep
(
SystemDictator
,
5
))
&&
(
await
isSt
artOfPhase
(
SystemDictator
,
2
))
&&
!
(
await
SystemDictator
.
dynamicConfigSet
())
)
{
console
.
log
(
`
...
...
@@ -169,17 +170,25 @@ const deployFn: DeployFunction = async (hre) => {
)
}
// Step 3 clears out some state from the AddressManager.
await
doStep
({
await
doPhase
({
isLiveDeployer
,
SystemDictator
,
step
:
3
,
phase
:
2
,
message
:
`
Phase 2 includes the following steps:
Step 3 will clear out some legacy state from the AddressManager. Once you execute this step,
you WILL NOT BE ABLE TO RESTART THE SYSTEM using exit1(). You should confirm that the L2
system is entirely operational before executing this step.
Step 4 will transfer ownership of the AddressManager and L1StandardBridge to the ProxyAdmin.
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.
`
,
checks
:
async
()
=>
{
// Step 3 checks
const
deads
=
[
'
OVM_CanonicalTransactionChain
'
,
'
OVM_L2CrossDomainMessenger
'
,
...
...
@@ -203,18 +212,8 @@ const deployFn: DeployFunction = async (hre) => {
const
addr
=
await
AddressManager
.
getAddress
(
dead
)
assert
(
addr
===
ethers
.
constants
.
AddressZero
)
}
},
})
// Step 4 transfers ownership of the AddressManager and L1StandardBridge to the ProxyAdmin.
await
doStep
({
isLiveDeployer
,
SystemDictator
,
step
:
4
,
message
:
`
Step 4 will transfer ownership of the AddressManager and L1StandardBridge to the ProxyAdmin.
`
,
checks
:
async
()
=>
{
// Step 4 checks
await
assertContractVariable
(
AddressManager
,
'
owner
'
,
ProxyAdmin
.
address
)
assert
(
...
...
@@ -222,20 +221,8 @@ const deployFn: DeployFunction = async (hre) => {
from
:
ethers
.
constants
.
AddressZero
,
}))
===
ProxyAdmin
.
address
)
},
})
// Step 5 initializes all contracts.
await
doStep
({
isLiveDeployer
,
SystemDictator
,
step
:
5
,
message
:
`
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.
`
,
checks
:
async
()
=>
{
// Step 5 checks
// Check L2OutputOracle was initialized properly.
await
assertContractVariable
(
L2OutputOracle
,
...
...
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