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
e1d468ba
Unverified
Commit
e1d468ba
authored
Nov 04, 2022
by
mergify[bot]
Committed by
GitHub
Nov 04, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3868 from ethereum-optimism/sc/ctb-msd-steps
feat(ctb): break out MSD steps
parents
776fac89
6efa7b62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
113 deletions
+163
-113
015-FreshSystemDictatorSteps.ts
.../contracts-bedrock/deploy/015-FreshSystemDictatorSteps.ts
+1
-1
016-MigrationSystemDictator.ts
...s/contracts-bedrock/deploy/016-MigrationSystemDictator.ts
+0
-112
017-MigrationSystemDictatorSteps.ts
...tracts-bedrock/deploy/017-MigrationSystemDictatorSteps.ts
+162
-0
No files found.
packages/contracts-bedrock/deploy/015-FreshSystemDictatorSteps.ts
View file @
e1d468ba
...
...
@@ -182,6 +182,6 @@ const deployFn: DeployFunction = async (hre) => {
}
}
deployFn
.
tags
=
[
'
FreshSystemDictator
'
,
'
fresh
'
]
deployFn
.
tags
=
[
'
FreshSystemDictator
Steps
'
,
'
fresh
'
]
export
default
deployFn
packages/contracts-bedrock/deploy/016-MigrationSystemDictator.ts
View file @
e1d468ba
import
{
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
{
ethers
}
from
'
ethers
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
'
@eth-optimism/hardhat-deploy-config
'
...
...
@@ -7,13 +6,11 @@ import 'hardhat-deploy'
import
{
getDeploymentAddress
,
deployAndVerifyAndThen
,
getContractFromArtifact
,
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
let
isLiveDeployer
=
false
let
controller
=
hre
.
deployConfig
.
controller
if
(
controller
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
...
...
@@ -25,7 +22,6 @@ const deployFn: DeployFunction = async (hre) => {
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
controller
=
deployer
isLiveDeployer
=
true
}
else
{
throw
new
Error
(
`controller address MUST NOT be the deployer on live networks`
...
...
@@ -116,114 +112,6 @@ const deployFn: DeployFunction = async (hre) => {
// TODO: Assert all the config was set correctly.
},
})
const
ProxyAdmin
=
await
getContractFromArtifact
(
hre
,
'
ProxyAdmin
'
,
{
signerOrProvider
:
deployer
,
})
const
MigrationSystemDictator
=
await
getContractFromArtifact
(
hre
,
'
MigrationSystemDictator
'
,
{
signerOrProvider
:
deployer
,
}
)
console
.
log
(
`Transferring ownership of ProxyAdmin to MigrationSystemDictator...`
)
await
ProxyAdmin
.
setOwner
(
MigrationSystemDictator
.
address
)
// Transfer ownership of the AddressManager to MigrationSystemDictator.
const
AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
,
{
signerOrProvider
:
deployer
,
}
)
if
(
isLiveDeployer
)
{
console
.
log
(
`Transferring ownership of AddressManager to the MigrationSystemDictator...`
)
await
AddressManager
.
transferOwnership
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Please transfer ownership of the AddressManager to the MigrationSystemDictator located at:
${
MigrationSystemDictator
.
address
}
`
)
}
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
AddressManager
.
owner
()
return
owner
===
MigrationSystemDictator
.
address
})
// Transfer ownership of the L1CrossDomainMessenger to MigrationSystemDictator.
const
L1CrossDomainMessenger
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1CrossDomainMessenger
'
,
{
iface
:
'
L1CrossDomainMessenger
'
,
signerOrProvider
:
deployer
,
}
)
if
(
isLiveDeployer
)
{
console
.
log
(
`Transferring ownership of L1CrossDomainMessenger to the MigrationSystemDictator...`
)
await
L1CrossDomainMessenger
.
transferOwnership
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Please transfer ownership of the L1CrossDomainMessenger to the MigrationSystemDictator located at:
${
MigrationSystemDictator
.
address
}
`
)
}
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
L1CrossDomainMessenger
.
owner
()
return
owner
===
MigrationSystemDictator
.
address
})
// Transfer ownership of the L1StandardBridge (proxy) to MigrationSystemDictator.
const
L1StandardBridge
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
,
{
signerOrProvider
:
deployer
,
}
)
if
(
isLiveDeployer
)
{
console
.
log
(
`Transferring ownership of L1StandardBridge to the MigrationSystemDictator...`
)
await
L1StandardBridge
.
setOwner
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Please transfer ownership of the L1StandardBridge (proxy) to the MigrationSystemDictator located at:
${
MigrationSystemDictator
.
address
}
`
)
}
const
noSigner
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
)
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
noSigner
.
callStatic
.
getOwner
({
from
:
ethers
.
constants
.
AddressZero
,
})
return
owner
===
MigrationSystemDictator
.
address
})
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Executing step
${
i
}
...`
)
await
MigrationSystemDictator
[
`step
${
i
}
`
]()
}
else
{
console
.
log
(
`Please execute step
${
i
}
...`
)
}
await
awaitCondition
(
async
()
=>
{
const
step
=
await
MigrationSystemDictator
.
currentStep
()
return
step
.
toNumber
()
===
i
+
1
})
}
}
deployFn
.
tags
=
[
'
MigrationSystemDictator
'
,
'
migration
'
]
...
...
packages/contracts-bedrock/deploy/017-MigrationSystemDictatorSteps.ts
0 → 100644
View file @
e1d468ba
import
{
ethers
}
from
'
ethers
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
'
@eth-optimism/hardhat-deploy-config
'
import
'
hardhat-deploy
'
import
{
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
{
getContractFromArtifact
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
let
isLiveDeployer
=
false
let
controller
=
hre
.
deployConfig
.
controller
if
(
controller
===
ethers
.
constants
.
AddressZero
)
{
if
(
hre
.
network
.
config
.
live
===
false
)
{
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!!`
)
console
.
log
(
`WARNING!!! A controller address was not provided.`
)
console
.
log
(
`WARNING!!! Make sure you are ONLY doing this on a test network.`
)
controller
=
deployer
isLiveDeployer
=
true
}
else
{
throw
new
Error
(
`controller address MUST NOT be the deployer on live networks`
)
}
}
const
MigrationSystemDictator
=
await
getContractFromArtifact
(
hre
,
'
MigrationSystemDictator
'
,
{
signerOrProvider
:
deployer
,
}
)
// Transfer ownership of the ProxyAdmin to the MigrationSystemDictator
const
ProxyAdmin
=
await
getContractFromArtifact
(
hre
,
'
ProxyAdmin
'
,
{
signerOrProvider
:
deployer
,
})
if
((
await
ProxyAdmin
.
owner
())
!==
MigrationSystemDictator
.
address
)
{
console
.
log
(
`Transferring proxy admin ownership to the MigrationSystemDictator`
)
await
ProxyAdmin
.
setOwner
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Proxy admin already owned by the MigrationSystemDictator`
)
}
// Transfer ownership of the AddressManager to MigrationSystemDictator.
const
AddressManager
=
await
getContractFromArtifact
(
hre
,
'
Lib_AddressManager
'
,
{
signerOrProvider
:
deployer
,
}
)
if
((
await
AddressManager
.
owner
())
!==
MigrationSystemDictator
.
address
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Transferring ownership of AddressManager to the MigrationSystemDictator...`
)
await
AddressManager
.
transferOwnership
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Please transfer ownership of the AddressManager to the MigrationSystemDictator located at:
${
MigrationSystemDictator
.
address
}
`
)
}
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
AddressManager
.
owner
()
return
owner
===
MigrationSystemDictator
.
address
})
}
else
{
console
.
log
(
`AddressManager already owned by the MigrationSystemDictator`
)
}
// Transfer ownership of the L1CrossDomainMessenger to MigrationSystemDictator.
const
L1CrossDomainMessenger
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1CrossDomainMessenger
'
,
{
iface
:
'
L1CrossDomainMessenger
'
,
signerOrProvider
:
deployer
,
}
)
if
(
(
await
L1CrossDomainMessenger
.
owner
())
!==
MigrationSystemDictator
.
address
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Transferring ownership of L1CrossDomainMessenger to the MigrationSystemDictator...`
)
await
L1CrossDomainMessenger
.
transferOwnership
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Please transfer ownership of the L1CrossDomainMessenger to the MigrationSystemDictator located at:
${
MigrationSystemDictator
.
address
}
`
)
}
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
L1CrossDomainMessenger
.
owner
()
return
owner
===
MigrationSystemDictator
.
address
})
}
else
{
console
.
log
(
`L1CrossDomainMessenger already owned by the MigrationSystemDictator`
)
}
// Transfer ownership of the L1StandardBridge (proxy) to MigrationSystemDictator.
const
L1StandardBridge
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
)
if
((
await
L1StandardBridge
.
owner
())
!==
MigrationSystemDictator
.
address
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Transferring ownership of L1StandardBridge to the MigrationSystemDictator...`
)
const
L1StandardBridgeWithSigner
=
await
getContractFromArtifact
(
hre
,
'
Proxy__OVM_L1StandardBridge
'
,
{
signerOrProvider
:
deployer
,
}
)
await
L1StandardBridgeWithSigner
.
setOwner
(
MigrationSystemDictator
.
address
)
}
else
{
console
.
log
(
`Please transfer ownership of the L1StandardBridge (proxy) to the MigrationSystemDictator located at:
${
MigrationSystemDictator
.
address
}
`
)
}
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
L1StandardBridge
.
callStatic
.
getOwner
()
return
owner
===
MigrationSystemDictator
.
address
})
}
else
{
console
.
log
(
`L1StandardBridge already owned by the MigrationSystemDictator`
)
}
for
(
let
i
=
1
;
i
<=
6
;
i
++
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Executing step
${
i
}
...`
)
await
MigrationSystemDictator
[
`step
${
i
}
`
]()
}
else
{
console
.
log
(
`Please execute step
${
i
}
...`
)
}
await
awaitCondition
(
async
()
=>
{
const
step
=
await
MigrationSystemDictator
.
currentStep
()
return
step
.
toNumber
()
===
i
+
1
})
}
}
deployFn
.
tags
=
[
'
MigrationSystemDictatorSteps
'
,
'
migration
'
]
export
default
deployFn
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