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
a8b14a7d
Unverified
Commit
a8b14a7d
authored
Nov 12, 2021
by
Kelvin Fichter
Committed by
kf
Nov 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: transfer messenger ownership during deploy
parent
244d4e3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
3 deletions
+40
-3
sharp-ants-act.md
.changeset/sharp-ants-act.md
+5
-0
007-OVM_L1CrossDomainMessenger.deploy.ts
...contracts/deploy/007-OVM_L1CrossDomainMessenger.deploy.ts
+18
-1
012-initialize-Proxy__L1CrossDomainMessenger.ts
...ts/deploy/012-initialize-Proxy__L1CrossDomainMessenger.ts
+17
-2
No files found.
.changeset/sharp-ants-act.md
0 → 100644
View file @
a8b14a7d
---
'
@eth-optimism/contracts'
:
patch
---
Adds additional deploy step to transfer messenger ownership
packages/contracts/deploy/007-OVM_L1CrossDomainMessenger.deploy.ts
View file @
a8b14a7d
...
@@ -25,7 +25,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -25,7 +25,7 @@ const deployFn: DeployFunction = async (hre) => {
// a proxy. However, it's best practice to initialize it anyway just in case there's
// a proxy. However, it's best practice to initialize it anyway just in case there's
// some unknown security hole. It also prevents another user from appearing like an
// some unknown security hole. It also prevents another user from appearing like an
// official address because it managed to call the initialization function.
// official address because it managed to call the initialization function.
console
.
log
(
`Initializing L1CrossDomainMessenger...`
)
console
.
log
(
`Initializing L1CrossDomainMessenger
(implementation)
...`
)
await
contract
.
initialize
(
Lib_AddressManager
.
address
)
await
contract
.
initialize
(
Lib_AddressManager
.
address
)
console
.
log
(
`Checking that contract was correctly initialized...`
)
console
.
log
(
`Checking that contract was correctly initialized...`
)
...
@@ -39,6 +39,23 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -39,6 +39,23 @@ const deployFn: DeployFunction = async (hre) => {
5000
,
5000
,
100
100
)
)
// Same thing as above, we want to transfer ownership of this contract to the owner of the
// AddressManager. Not technically necessary but seems like the right thing to do.
console
.
log
(
`Transferring ownership of L1CrossDomainMessenger (implementation)...`
)
const
owner
=
(
hre
as
any
).
deployConfig
.
ovmAddressManagerOwner
await
contract
.
transferOwnership
(
owner
)
console
.
log
(
`Checking that contract owner was correctly set...`
)
await
awaitCondition
(
async
()
=>
{
return
hexStringEquals
(
await
contract
.
owner
(),
owner
)
},
5000
,
100
)
},
},
})
})
}
}
...
...
packages/contracts/deploy/012-initialize-Proxy__L1CrossDomainMessenger.ts
View file @
a8b14a7d
...
@@ -9,8 +9,6 @@ import { names } from '../src/address-names'
...
@@ -9,8 +9,6 @@ import { names } from '../src/address-names'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
console
.
log
(
`Initializing Proxy__L1CrossDomainMessenger...`
)
// There's a risk that we could get front-run during a fresh deployment, which would brick this
// There's a risk that we could get front-run during a fresh deployment, which would brick this
// contract and require that the proxy be re-deployed. We will not have this risk once we move
// contract and require that the proxy be re-deployed. We will not have this risk once we move
// entirely to chugsplash-style deployments. It's unlikely to happen and relatively easy to
// entirely to chugsplash-style deployments. It's unlikely to happen and relatively easy to
...
@@ -29,6 +27,7 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -29,6 +27,7 @@ const deployFn: DeployFunction = async (hre) => {
names
.
unmanaged
.
Lib_AddressManager
names
.
unmanaged
.
Lib_AddressManager
)
)
console
.
log
(
`Initializing Proxy__OVM_L1CrossDomainMessenger...`
)
await
Proxy__OVM_L1CrossDomainMessenger
.
initialize
(
Lib_AddressManager
.
address
)
await
Proxy__OVM_L1CrossDomainMessenger
.
initialize
(
Lib_AddressManager
.
address
)
console
.
log
(
`Checking that contract was correctly initialized...`
)
console
.
log
(
`Checking that contract was correctly initialized...`
)
...
@@ -42,6 +41,22 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -42,6 +41,22 @@ const deployFn: DeployFunction = async (hre) => {
5000
,
5000
,
100
100
)
)
console
.
log
(
`Setting Proxy__OVM_L1CrossDomainMessenger owner...`
)
const
owner
=
(
hre
as
any
).
deployConfig
.
ovmAddressManagerOwner
await
Proxy__OVM_L1CrossDomainMessenger
.
transferOwnership
(
owner
)
console
.
log
(
`Checking that the contract owner was correctly set...`
)
await
awaitCondition
(
async
()
=>
{
return
hexStringEquals
(
await
Proxy__OVM_L1CrossDomainMessenger
.
owner
(),
owner
)
},
5000
,
100
)
}
}
deployFn
.
tags
=
[
'
finalize
'
]
deployFn
.
tags
=
[
'
finalize
'
]
...
...
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