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
75b6b12a
Commit
75b6b12a
authored
Jan 06, 2021
by
Mark Tyneway
Committed by
GitHub
Jan 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deploy: fix relayer address config (#167)
parent
0cb732b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
deploy.js
packages/contracts/bin/deploy.js
+16
-5
No files found.
packages/contracts/bin/deploy.js
View file @
75b6b12a
...
@@ -25,13 +25,14 @@ const HD_PATH = env.HD_PATH || utils.defaultPath;
...
@@ -25,13 +25,14 @@ const HD_PATH = env.HD_PATH || utils.defaultPath;
const
BLOCK_TIME_SECONDS
=
env
.
BLOCK_TIME_SECONDS
||
15
;
const
BLOCK_TIME_SECONDS
=
env
.
BLOCK_TIME_SECONDS
||
15
;
const
L2_CROSS_DOMAIN_MESSENGER_ADDRESS
=
const
L2_CROSS_DOMAIN_MESSENGER_ADDRESS
=
env
.
L2_CROSS_DOMAIN_MESSENGER_ADDRESS
||
'
0x4200000000000000000000000000000000000007
'
;
env
.
L2_CROSS_DOMAIN_MESSENGER_ADDRESS
||
'
0x4200000000000000000000000000000000000007
'
;
let
RELAYER_ADDRESS
=
env
.
RELAYER_ADDRESS
||
'
0x0000000000000000000000000000000000000000
'
;
const
RELAYER_PRIVATE_KEY
=
env
.
RELAYER_PRIVATE_KEY
;
(
async
()
=>
{
(
async
()
=>
{
const
provider
=
new
JsonRpcProvider
(
web3Url
);
const
provider
=
new
JsonRpcProvider
(
web3Url
);
let
signer
;
let
signer
;
// Use the ledger for the deployer
if
(
USE_LEDGER
)
{
if
(
USE_LEDGER
)
{
signer
=
new
LedgerSigner
(
provider
,
'
default
'
,
HD_PATH
);
signer
=
new
LedgerSigner
(
provider
,
'
default
'
,
HD_PATH
);
}
else
{
}
else
{
...
@@ -42,17 +43,27 @@ const L2_CROSS_DOMAIN_MESSENGER_ADDRESS =
...
@@ -42,17 +43,27 @@ const L2_CROSS_DOMAIN_MESSENGER_ADDRESS =
if
(
SEQUENCER_ADDRESS
)
{
if
(
SEQUENCER_ADDRESS
)
{
if
(
!
utils
.
isAddress
(
SEQUENCER_ADDRESS
))
if
(
!
utils
.
isAddress
(
SEQUENCER_ADDRESS
))
throw
new
Error
(
`Invalid Sequencer Address:
${
SEQUENCER_ADDRESS
}
`
)
throw
new
Error
(
`Invalid Sequencer Address:
${
SEQUENCER_ADDRESS
}
`
)
;
}
else
{
}
else
{
if
(
!
sequencerKey
)
if
(
!
sequencerKey
)
throw
new
Error
(
'
Must pass sequencer key as SEQUENCER_PRIVATE_KEY
'
);
throw
new
Error
(
'
Must pass sequencer key as SEQUENCER_PRIVATE_KEY
'
);
const
sequencer
=
new
Wallet
(
sequencerKey
,
provider
);
const
sequencer
=
new
Wallet
(
sequencerKey
,
provider
);
SEQUENCER_ADDRESS
=
await
sequencer
.
getAddress
()
SEQUENCER_ADDRESS
=
await
sequencer
.
getAddress
()
;
}
}
if
(
typeof
WHITELIST_OWNER
===
'
undefined
'
)
if
(
typeof
WHITELIST_OWNER
===
'
undefined
'
)
WHITELIST_OWNER
=
signer
;
WHITELIST_OWNER
=
signer
;
// Use the address derived from RELAYER_PRIVATE_KEY if a private key
// is passed. Using the zero address as the relayer address will mean
// there is no relayer authentication.
if
(
RELAYER_PRIVATE_KEY
)
{
if
(
!
utils
.
isAddress
(
RELAYER_ADDRESS
))
throw
new
Error
(
`Invalid Relayer Address:
${
RELAYER_ADDRESS
}
`
);
const
relayer
=
new
Wallet
(
RELAYER_PRIVATE_KEY
,
provider
);
RELAYER_ADDRESS
=
await
relayer
.
getAddress
();
}
const
result
=
await
contracts
.
deploy
({
const
result
=
await
contracts
.
deploy
({
deploymentSigner
:
signer
,
deploymentSigner
:
signer
,
transactionChainConfig
:
{
transactionChainConfig
:
{
...
@@ -69,7 +80,7 @@ const L2_CROSS_DOMAIN_MESSENGER_ADDRESS =
...
@@ -69,7 +80,7 @@ const L2_CROSS_DOMAIN_MESSENGER_ADDRESS =
L2CrossDomainMessengerAddress
:
L2_CROSS_DOMAIN_MESSENGER_ADDRESS
L2CrossDomainMessengerAddress
:
L2_CROSS_DOMAIN_MESSENGER_ADDRESS
},
},
l1CrossDomainMessengerConfig
:
{
l1CrossDomainMessengerConfig
:
{
relayerAddress
:
SEQUENC
ER_ADDRESS
,
relayerAddress
:
RELAY
ER_ADDRESS
,
},
},
ovmGasMeteringConfig
:
{
ovmGasMeteringConfig
:
{
minTransactionGasLimit
:
MIN_TRANSACTION_GAS_LIMIT
,
minTransactionGasLimit
:
MIN_TRANSACTION_GAS_LIMIT
,
...
...
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