Commit 73e4bf88 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #4869 from ethereum-optimism/sc/ctb-rekey-cleanup

maint(ctb): revamp the rekey task
parents 405cb9b6 b71442c1
...@@ -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, ' '))
} }
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment