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
cb8fbc4c
Unverified
Commit
cb8fbc4c
authored
Apr 05, 2023
by
Maurelian
Committed by
GitHub
Apr 05, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5354 from ethereum-optimism/jm/streamline-migration/doProxyTransfer
parents
653ca9d6
79706a9a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
85 deletions
+86
-85
020-SystemDictatorSteps-1.ts
...ges/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
+53
-85
deploy-utils.ts
packages/contracts-bedrock/src/deploy-utils.ts
+33
-0
No files found.
packages/contracts-bedrock/deploy/020-SystemDictatorSteps-1.ts
View file @
cb8fbc4c
...
...
@@ -11,10 +11,8 @@ import {
assertContractVariable
,
getContractsFromArtifacts
,
getDeploymentAddress
,
doOwnershipTransfer
,
doPhase
,
printJsonTransaction
,
printTenderlySimulationLink
,
printCastCommand
,
}
from
'
../src/deploy-utils
'
const
uint128Max
=
ethers
.
BigNumber
.
from
(
'
0xffffffffffffffffffffffffffffffff
'
)
...
...
@@ -73,10 +71,13 @@ const deployFn: DeployFunction = async (hre) => {
// Transfer ownership of the ProxyAdmin to the SystemDictator.
if
((
await
ProxyAdmin
.
owner
())
!==
SystemDictator
.
address
)
{
console
.
log
(
`Setting ProxyAdmin owner to MSD`
)
await
ProxyAdmin
.
transferOwnership
(
SystemDictator
.
address
)
}
else
{
console
.
log
(
`Proxy admin already owned by MSD`
)
await
doOwnershipTransfer
({
isLiveDeployer
,
proxy
:
ProxyAdmin
,
name
:
'
ProxyAdmin
'
,
transferFunc
:
'
transferOwnership
'
,
dictator
:
SystemDictator
,
})
}
// We don't need to transfer proxy addresses if we're already beyond the proxy transfer step.
...
...
@@ -89,30 +90,13 @@ const deployFn: DeployFunction = async (hre) => {
needsProxyTransfer
&&
(
await
AddressManager
.
owner
())
!==
SystemDictator
.
address
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Setting AddressManager owner to MSD`
)
await
AddressManager
.
transferOwnership
(
SystemDictator
.
address
)
}
else
{
const
tx
=
await
AddressManager
.
populateTransaction
.
transferOwnership
(
SystemDictator
.
address
)
console
.
log
(
`Please transfer AddressManager owner to MSD`
)
console
.
log
(
`AddressManager address:
${
AddressManager
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
// Wait for the ownership transfer to complete.
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
AddressManager
.
owner
()
return
owner
===
SystemDictator
.
address
},
5000
,
1000
)
await
doOwnershipTransfer
({
isLiveDeployer
,
proxy
:
AddressManager
,
name
:
'
AddressManager
'
,
transferFunc
:
'
transferOwnership
'
,
dictator
:
SystemDictator
,
})
}
else
{
console
.
log
(
`AddressManager already owned by the SystemDictator`
)
}
...
...
@@ -124,34 +108,13 @@ const deployFn: DeployFunction = async (hre) => {
from
:
ethers
.
constants
.
AddressZero
,
}))
!==
SystemDictator
.
address
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Setting L1StandardBridge owner to MSD`
)
await
L1StandardBridgeProxyWithSigner
.
setOwner
(
SystemDictator
.
address
)
}
else
{
const
tx
=
await
L1StandardBridgeProxy
.
populateTransaction
.
setOwner
(
SystemDictator
.
address
)
console
.
log
(
`Please transfer L1StandardBridge (proxy) owner to MSD`
)
console
.
log
(
`L1StandardBridgeProxy address:
${
L1StandardBridgeProxy
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
}
// Wait for the ownership transfer to complete.
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
L1StandardBridgeProxy
.
callStatic
.
getOwner
({
from
:
ethers
.
constants
.
AddressZero
,
await
doOwnershipTransfer
({
isLiveDeployer
,
proxy
:
L1StandardBridgeProxyWithSigner
,
name
:
'
L1StandardBridgeProxy
'
,
transferFunc
:
'
setOwner
'
,
dictator
:
SystemDictator
,
})
return
owner
===
SystemDictator
.
address
},
5000
,
1000
)
}
else
{
console
.
log
(
`L1StandardBridge already owned by MSD`
)
}
...
...
@@ -163,35 +126,40 @@ const deployFn: DeployFunction = async (hre) => {
from
:
ethers
.
constants
.
AddressZero
,
}))
!==
SystemDictator
.
address
)
{
if
(
isLiveDeployer
)
{
console
.
log
(
`Setting L1ERC721Bridge owner to MSD`
)
await
L1ERC721BridgeProxyWithSigner
.
changeAdmin
(
SystemDictator
.
address
)
await
doOwnershipTransfer
({
isLiveDeployer
,
proxy
:
L1ERC721BridgeProxyWithSigner
,
name
:
'
L1ERC721BridgeProxy
'
,
transferFunc
:
'
changeAdmin
'
,
dictator
:
SystemDictator
,
})
}
else
{
const
tx
=
await
L1ERC721BridgeProxy
.
populateTransaction
.
changeAdmin
(
SystemDictator
.
address
)
console
.
log
(
`Please transfer L1ERC721Bridge (proxy) owner to MSD`
)
console
.
log
(
`L1ERC721BridgeProxy address:
${
L1ERC721BridgeProxy
.
address
}
`
)
console
.
log
(
`MSD address:
${
SystemDictator
.
address
}
`
)
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
SystemDictator
.
provider
,
tx
)
console
.
log
(
`L1ERC721Bridge already owned by MSD`
)
}
// Wait for the ownership transfer to complete
.
// Wait for the ownership transfers to complete before continuing
.
await
awaitCondition
(
async
()
=>
{
const
owner
=
await
L1ERC721BridgeProxy
.
callStatic
.
admin
({
async
():
Promise
<
boolean
>
=>
{
const
proxyAdminOwner
=
await
ProxyAdmin
.
owner
()
const
addressManagerOwner
=
await
AddressManager
.
owner
()
const
l1StandardBridgeOwner
=
await
L1StandardBridgeProxy
.
callStatic
.
getOwner
({
from
:
ethers
.
constants
.
AddressZero
,
})
return
owner
===
SystemDictator
.
address
const
l1Erc721BridgeOwner
=
await
L1ERC721BridgeProxy
.
callStatic
.
admin
({
from
:
ethers
.
constants
.
AddressZero
,
})
return
(
proxyAdminOwner
===
SystemDictator
.
address
&&
addressManagerOwner
===
SystemDictator
.
address
&&
l1StandardBridgeOwner
===
SystemDictator
.
address
&&
l1Erc721BridgeOwner
===
SystemDictator
.
address
)
},
5000
,
1000
)
}
else
{
console
.
log
(
`L1ERC721Bridge already owned by MSD`
)
}
await
doPhase
({
isLiveDeployer
,
...
...
packages/contracts-bedrock/src/deploy-utils.ts
View file @
cb8fbc4c
...
...
@@ -322,6 +322,39 @@ export const printJsonTransaction = (tx: ethers.PopulatedTransaction): void => {
)
}
/**
* Mini helper for transferring a Proxy to the MSD
*
* @param opts Options for executing the step.
* @param opts.isLiveDeployer True if the deployer is live.
* @param opts.proxy proxy contract.
* @param opts.dictator dictator contract.
*/
export
const
doOwnershipTransfer
=
async
(
opts
:
{
isLiveDeployer
?:
boolean
proxy
:
ethers
.
Contract
name
:
string
transferFunc
:
string
dictator
:
ethers
.
Contract
}):
Promise
<
void
>
=>
{
if
(
opts
.
isLiveDeployer
)
{
console
.
log
(
`Setting
${
opts
.
name
}
owner to MSD`
)
await
opts
.
proxy
[
opts
.
transferFunc
](
opts
.
dictator
.
address
)
}
else
{
const
tx
=
await
opts
.
proxy
.
populateTransaction
[
opts
.
transferFunc
](
opts
.
dictator
.
address
)
console
.
log
(
`
Please transfer
${
opts
.
name
}
(proxy) owner to MSD
-
${
opts
.
name
}
address:
${
opts
.
proxy
.
address
}
- MSD address:
${
opts
.
dictator
.
address
}
`
)
printJsonTransaction
(
tx
)
printCastCommand
(
tx
)
await
printTenderlySimulationLink
(
opts
.
dictator
.
provider
,
tx
)
}
}
/**
* Mini helper for checking if the current step is a target step.
*
...
...
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