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
98f3aa42
Unverified
Commit
98f3aa42
authored
Oct 21, 2021
by
ben-chain
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(contracts): fix set-addresses script wait condition, support local owners
parent
124dbd6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
110-AddressSetter.deploy.ts
packages/contracts/deploy/110-AddressSetter.deploy.ts
+2
-2
111-set-addresses.ts
packages/contracts/deploy/111-set-addresses.ts
+30
-4
No files found.
packages/contracts/deploy/110-AddressSetter.deploy.ts
View file @
98f3aa42
...
@@ -21,8 +21,8 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -21,8 +21,8 @@ const deployFn: DeployFunction = async (hre) => {
'
StateCommitmentChain
'
,
'
StateCommitmentChain
'
,
'
BondManager
'
,
'
BondManager
'
,
'
OVM_L1CrossDomainMessenger
'
,
'
OVM_L1CrossDomainMessenger
'
,
'
Proxy__L1CrossDomainMessenger
'
,
'
Proxy__
OVM_
L1CrossDomainMessenger
'
,
'
Proxy__L1StandardBridge
'
,
'
Proxy__
OVM_
L1StandardBridge
'
,
]
]
const
addresses
=
await
Promise
.
all
(
const
addresses
=
await
Promise
.
all
(
...
...
packages/contracts/deploy/111-set-addresses.ts
View file @
98f3aa42
/* Imports: External */
/* Imports: External */
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
import
{
hexStringEquals
}
from
'
@eth-optimism/core-utils
'
import
{
ethers
}
from
'
hardhat
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
/* Imports: Internal */
/* Imports: Internal */
import
{
getLiveContract
,
waitUntilTrue
}
from
'
../src/hardhat-deploy-ethers
'
import
{
getLiveContract
,
waitUntilTrue
}
from
'
../src/hardhat-deploy-ethers
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
addressSetter
=
await
getLiveContract
(
hre
,
'
AddressSetter
'
)
const
{
deployer
}
=
await
hre
.
getNamedAccounts
()
const
addressSetter
=
await
getLiveContract
(
hre
,
'
AddressSetter
'
,
{
signerOrProvider
:
deployer
,
})
const
libAddressManager
=
await
getLiveContract
(
hre
,
'
Lib_AddressManager
'
)
const
libAddressManager
=
await
getLiveContract
(
hre
,
'
Lib_AddressManager
'
)
const
names
=
await
addressSetter
.
getNames
()
const
names
=
await
addressSetter
.
getNames
()
const
addresses
=
await
addressSetter
.
getAddresses
()
const
addresses
=
await
addressSetter
.
getAddresses
()
const
finalOwner
=
await
addressSetter
.
finalOwner
()
const
finalOwner
=
await
addressSetter
.
finalOwner
()
let
currentOwner
let
currentOwner
=
await
libAddressManager
.
owner
()
console
.
log
(
console
.
log
(
'
\n
'
,
'
\n
'
,
...
@@ -29,10 +33,29 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -29,10 +33,29 @@ const deployFn: DeployFunction = async (hre) => {
)
)
console
.
log
(
` to the Address Setter contract at
${
addressSetter
.
address
}
.`
)
console
.
log
(
` to the Address Setter contract at
${
addressSetter
.
address
}
.`
)
const
hreSigners
=
await
hre
.
ethers
.
getSigners
()
const
hreSignerAddresses
=
hreSigners
.
map
((
signer
)
=>
{
return
signer
.
address
})
if
(
hreSignerAddresses
.
some
((
addr
)
=>
{
return
hexStringEquals
(
addr
,
currentOwner
)
})
)
{
console
.
log
(
'
Deploy script owns the address manager, this must be CI. Setting addresses...
'
)
const
owner
=
await
hre
.
ethers
.
getSigner
(
currentOwner
)
await
libAddressManager
.
connect
(
owner
)
.
transferOwnership
(
addressSetter
.
address
)
}
await
waitUntilTrue
(
await
waitUntilTrue
(
async
()
=>
{
async
()
=>
{
currentOwner
=
await
libAddressManager
.
owner
()
console
.
log
(
'
Checking ownership of Lib_AddressManager...
'
)
console
.
log
(
'
Checking ownership of Lib_AddressManager...
'
)
currentOwner
=
await
libAddressManager
.
owner
()
console
.
log
(
'
Lib_AddressManager owner is now set to AddressSetter.
'
)
return
hexStringEquals
(
currentOwner
,
addressSetter
.
address
)
return
hexStringEquals
(
currentOwner
,
addressSetter
.
address
)
},
},
{
{
...
@@ -43,14 +66,17 @@ const deployFn: DeployFunction = async (hre) => {
...
@@ -43,14 +66,17 @@ const deployFn: DeployFunction = async (hre) => {
)
)
// Set the addresses!
// Set the addresses!
console
.
log
(
'
Ownership successfully transferred. Invoking setAddresses...
'
)
await
addressSetter
.
setAddresses
()
await
addressSetter
.
setAddresses
()
currentOwner
=
await
libAddressManager
.
owner
()
currentOwner
=
await
libAddressManager
.
owner
()
console
.
log
(
'
Verifying final ownership of Lib_AddressManager
'
)
console
.
log
(
'
Verifying final ownership of Lib_AddressManager
'
)
if
(
!
hexStringEquals
(
finalOwner
,
currentOwner
))
{
if
(
!
hexStringEquals
(
finalOwner
,
currentOwner
))
{
console
.
log
(
throw
new
Error
(
`The current address manager owner
${
currentOwner
}
, \nis not equal to the expected owner:
${
finalOwner
}
`
`The current address manager owner
${
currentOwner
}
, \nis not equal to the expected owner:
${
finalOwner
}
`
)
)
}
else
{
console
.
log
(
`Address Manager ownership was returned to
${
finalOwner
}
.`
)
}
}
}
}
...
...
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