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
73e4bf88
Unverified
Commit
73e4bf88
authored
Feb 15, 2023
by
mergify[bot]
Committed by
GitHub
Feb 15, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4869 from ethereum-optimism/sc/ctb-rekey-cleanup
maint(ctb): revamp the rekey task
parents
405cb9b6
b71442c1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
rekey.ts
packages/contracts-bedrock/tasks/rekey.ts
+10
-16
No files found.
packages/contracts-bedrock/tasks/rekey.ts
View file @
73e4bf88
...
@@ -6,25 +6,19 @@ task('rekey', 'Generates a new set of keys for a test network').setAction(
...
@@ -6,25 +6,19 @@ task('rekey', 'Generates a new set of keys for a test network').setAction(
async
()
=>
{
async
()
=>
{
const
mnemonic
=
bip39
.
generateMnemonic
()
const
mnemonic
=
bip39
.
generateMnemonic
()
const
pathPrefix
=
"
m/44'/60'/0'/0
"
const
pathPrefix
=
"
m/44'/60'/0'/0
"
const
labels
=
[
const
labels
=
[
'
Admin
'
,
'
Proposer
'
,
'
Batcher
'
,
'
Sequencer
'
]
'
l2OutputOracleProposer
'
,
'
proxyAdminOwner
'
,
'
optimismBaseFeeRecipient
'
,
'
optimismL1FeeRecipient
'
,
'
p2pSequencerAddress
'
,
'
l2OutputOracleChallenger
'
,
'
batchSenderAddress
'
,
]
const
hdwallet
=
hdkey
.
fromMasterSeed
(
await
bip39
.
mnemonicToSeed
(
mnemonic
))
const
hdwallet
=
hdkey
.
fromMasterSeed
(
await
bip39
.
mnemonicToSeed
(
mnemonic
))
let
i
=
0
const
out
=
{}
console
.
log
(
`Mnemonic:
${
mnemonic
}
`
)
console
.
log
(
`Mnemonic:
${
mnemonic
}
`
)
for
(
const
label
of
labels
)
{
for
(
let
i
=
0
;
i
<
labels
.
length
;
i
++
)
{
const
label
=
labels
[
i
]
const
wallet
=
hdwallet
.
derivePath
(
`
${
pathPrefix
}
/
${
i
}
`
).
getWallet
()
const
wallet
=
hdwallet
.
derivePath
(
`
${
pathPrefix
}
/
${
i
}
`
).
getWallet
()
out
[
label
]
=
`0x
${
wallet
.
getAddress
().
toString
(
'
hex
'
)}
`
const
addr
=
'
0x
'
+
wallet
.
getAddress
().
toString
(
'
hex
'
)
i
++
const
pk
=
wallet
.
getPrivateKey
().
toString
(
'
hex
'
)
console
.
log
()
console
.
log
(
`
${
label
}
:
${
addr
}
`
)
console
.
log
(
`Private Key:
${
pk
}
`
)
}
}
console
.
log
(
JSON
.
stringify
(
out
,
null
,
'
'
))
}
}
)
)
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