Skip to content

Commit 026578e

Browse files
authored
Merge branch 'develop' into refactor-machine-hash
2 parents 4661583 + 2e8eeb9 commit 026578e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

scripts/rollupCreation.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export async function createRollup(
7777
rollupCreatorAbi,
7878
signer
7979
)
80+
const validatorWalletCreator = await rollupCreator.validatorWalletCreator()
8081

8182
try {
8283
//// funds for deploying L2 factories
@@ -96,7 +97,7 @@ export async function createRollup(
9697
// Call the createRollup function
9798
console.log('Calling createRollup to generate a new rollup ...')
9899
const deployParams = isDevDeployment
99-
? await _getDevRollupConfig(feeToken)
100+
? await _getDevRollupConfig(feeToken, validatorWalletCreator)
100101
: {
101102
config: config.rollupConfig,
102103
validators: config.validators,
@@ -223,7 +224,10 @@ export async function createRollup(
223224
return null
224225
}
225226

226-
async function _getDevRollupConfig(feeToken: string) {
227+
async function _getDevRollupConfig(
228+
feeToken: string,
229+
validatorWalletCreator: string
230+
) {
227231
// set up owner address
228232
const ownerAddress =
229233
process.env.OWNER_ADDRESS !== undefined ? process.env.OWNER_ADDRESS : ''
@@ -239,7 +243,7 @@ async function _getDevRollupConfig(feeToken: string) {
239243
parseInt(process.env.AUTHORIZE_VALIDATORS as string, 0) || 0
240244
const validators: string[] = []
241245
for (let i = 1; i <= authorizeValidators; i++) {
242-
validators.push(ethers.Wallet.createRandom().address)
246+
validators.push(_createValidatorAddress(validatorWalletCreator, i))
243247
}
244248

245249
// get chain config
@@ -322,4 +326,15 @@ async function _getDevRollupConfig(feeToken: string) {
322326
batchPosters: batchPosters,
323327
batchPosterManager: batchPosterManager,
324328
}
329+
330+
function _createValidatorAddress(
331+
deployerAddress: string,
332+
nonce: number
333+
): string {
334+
const nonceHex = BigNumber.from(nonce).toHexString()
335+
return ethers.utils.getContractAddress({
336+
from: deployerAddress,
337+
nonce: nonceHex,
338+
})
339+
}
325340
}

0 commit comments

Comments
 (0)