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
29a33b96
Unverified
Commit
29a33b96
authored
Nov 02, 2021
by
Maurelian
Committed by
Kelvin Fichter
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(contracts): Use chainId to detect hh environments
parent
c3db334f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
19 deletions
+11
-19
011-set-addresses.ts
packages/contracts/deploy/011-set-addresses.ts
+6
-9
014-OVM_L1StandardBridge.deploy.ts
packages/contracts/deploy/014-OVM_L1StandardBridge.deploy.ts
+5
-10
No files found.
packages/contracts/deploy/011-set-addresses.ts
View file @
29a33b96
/* Imports: External */
import
{
hexStringEquals
,
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
defaultHardhatNetworkParams
}
from
'
hardhat/internal/core/config/default-config
'
/* Imports: Internal */
import
{
getContractFromArtifact
}
from
'
../src/hardhat-deploy-ethers
'
...
...
@@ -71,15 +72,11 @@ const deployFn: DeployFunction = async (hre) => {
(4) Wait for the deploy process to continue.
`
)
// Check if the hardhat runtime environment has the owner of the AddressManager. This will only
// happen in CI. If this is the case, we can skip directly to transferring ownership over to the
// AddressDictator contract.
const
hreSigners
=
await
hre
.
ethers
.
getSigners
()
const
hreHasOwner
=
hreSigners
.
some
((
signer
)
=>
{
return
hexStringEquals
(
signer
.
address
,
currentOwner
)
})
if
(
hreHasOwner
)
{
// Hardhat has the owner loaded into it, we can skip directly to transferOwnership.
// Only execute this step if we're on the hardhat chain ID. This will only happen in CI. If this
// is the case, we can skip directly to transferring ownership over to the AddressDictator
// contract.
const
{
chainId
}
=
await
hre
.
ethers
.
provider
.
getNetwork
()
if
(
chainId
===
defaultHardhatNetworkParams
.
chainId
)
{
const
owner
=
await
hre
.
ethers
.
getSigner
(
currentOwner
)
await
Lib_AddressManager
.
connect
(
owner
).
transferOwnership
(
AddressDictator
.
address
...
...
packages/contracts/deploy/014-OVM_L1StandardBridge.deploy.ts
View file @
29a33b96
...
...
@@ -2,6 +2,7 @@
import
{
DeployFunction
}
from
'
hardhat-deploy/dist/types
'
import
{
ethers
}
from
'
ethers
'
import
{
hexStringEquals
,
awaitCondition
}
from
'
@eth-optimism/core-utils
'
import
{
defaultHardhatNetworkParams
}
from
'
hardhat/internal/core/config/default-config
'
/* Imports: Internal */
import
{
getContractDefinition
}
from
'
../src/contract-defs
'
...
...
@@ -82,16 +83,10 @@ const deployFn: DeployFunction = async (hre) => {
(4) Wait for the deploy process to continue.
`
)
// Check if the hardhat runtime environment has the owner of the proxy. This will only
// happen in CI. If this is the case, we can skip directly to transferring ownership over to the
// ChugSplashDictator contract.
const
hreSigners
=
await
hre
.
ethers
.
getSigners
()
const
hreHasOwner
=
hreSigners
.
some
((
signer
)
=>
{
return
hexStringEquals
(
signer
.
address
,
currentOwner
)
})
if
(
hreHasOwner
)
{
// Hardhat has the owner loaded into it, we can skip directly to transferOwnership.
// Check if if we're on the hardhat chain ID. This will only happen in CI. If this is the case, we
// can skip directly to transferring ownership over to the ChugSplashDictator contract.
const
{
chainId
}
=
await
hre
.
ethers
.
provider
.
getNetwork
()
if
(
chainId
===
defaultHardhatNetworkParams
.
chainId
)
{
const
owner
=
await
hre
.
ethers
.
getSigner
(
currentOwner
)
await
Proxy__OVM_L1StandardBridge
.
connect
(
owner
).
setOwner
(
ChugSplashDictator
.
address
...
...
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