@@ -77,6 +77,7 @@ export async function createRollup(
77
77
rollupCreatorAbi ,
78
78
signer
79
79
)
80
+ const validatorWalletCreator = await rollupCreator . validatorWalletCreator ( )
80
81
81
82
try {
82
83
//// funds for deploying L2 factories
@@ -96,7 +97,7 @@ export async function createRollup(
96
97
// Call the createRollup function
97
98
console . log ( 'Calling createRollup to generate a new rollup ...' )
98
99
const deployParams = isDevDeployment
99
- ? await _getDevRollupConfig ( feeToken )
100
+ ? await _getDevRollupConfig ( feeToken , validatorWalletCreator )
100
101
: {
101
102
config : config . rollupConfig ,
102
103
validators : config . validators ,
@@ -223,7 +224,10 @@ export async function createRollup(
223
224
return null
224
225
}
225
226
226
- async function _getDevRollupConfig ( feeToken : string ) {
227
+ async function _getDevRollupConfig (
228
+ feeToken : string ,
229
+ validatorWalletCreator : string
230
+ ) {
227
231
// set up owner address
228
232
const ownerAddress =
229
233
process . env . OWNER_ADDRESS !== undefined ? process . env . OWNER_ADDRESS : ''
@@ -239,7 +243,7 @@ async function _getDevRollupConfig(feeToken: string) {
239
243
parseInt ( process . env . AUTHORIZE_VALIDATORS as string , 0 ) || 0
240
244
const validators : string [ ] = [ ]
241
245
for ( let i = 1 ; i <= authorizeValidators ; i ++ ) {
242
- validators . push ( ethers . Wallet . createRandom ( ) . address )
246
+ validators . push ( _createValidatorAddress ( validatorWalletCreator , i ) )
243
247
}
244
248
245
249
// get chain config
@@ -322,4 +326,15 @@ async function _getDevRollupConfig(feeToken: string) {
322
326
batchPosters : batchPosters ,
323
327
batchPosterManager : batchPosterManager ,
324
328
}
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
+ }
325
340
}
0 commit comments