@@ -260,6 +260,7 @@ contract DeployProtocolOnL1 is DeployCapability {
260
260
copyRegister (rollupResolver, _sharedResolver, "signal_service " );
261
261
copyRegister (rollupResolver, _sharedResolver, "bridge " );
262
262
263
+ // Initializable the proxy for proofVerifier to get the contract address at first.
263
264
// Proof verifier
264
265
proofVerifier = deployProxy ({
265
266
name: "proof_verifier " ,
@@ -272,14 +273,6 @@ contract DeployProtocolOnL1 is DeployCapability {
272
273
registerTo: rollupResolver
273
274
});
274
275
275
- // OP verifier
276
- address opVerifier = deployProxy ({
277
- name: "op_verifier " ,
278
- impl: address (new OpVerifier (rollupResolver)),
279
- data: abi.encodeCall (OpVerifier.init, (owner)),
280
- registerTo: rollupResolver
281
- });
282
-
283
276
// Inbox
284
277
deployProxy ({
285
278
name: "mainnet_taiko " ,
@@ -353,28 +346,6 @@ contract DeployProtocolOnL1 is DeployCapability {
353
346
uint64 l2ChainId = taikoInbox.pacayaConfig ().chainId;
354
347
require (l2ChainId != block .chainid , "same chainid " );
355
348
356
- // Other verifiers
357
- // Initializable the proxy for proofVerifier to get the contract address at first.
358
- (address sgxRethVerifier , address sgxGethVerifier ) =
359
- deploySgxVerifier (owner, rollupResolver, l2ChainId, address (taikoInbox), proofVerifier);
360
-
361
- (address risc0RethVerifier , address sp1RethVerifier ) =
362
- deployZKVerifiers (owner, rollupResolver, l2ChainId);
363
-
364
- UUPSUpgradeable (proofVerifier).upgradeTo ({
365
- newImplementation: address (
366
- new DevnetVerifier (
367
- taikoInboxAddr,
368
- sgxGethVerifier,
369
- opVerifier,
370
- sgxRethVerifier,
371
- risc0RethVerifier,
372
- sp1RethVerifier
373
- )
374
- )
375
- });
376
- Ownable2StepUpgradeable (proofVerifier).transferOwnership (owner);
377
-
378
349
// Prover set
379
350
deployProxy ({
380
351
name: "prover_set " ,
@@ -388,23 +359,32 @@ contract DeployProtocolOnL1 is DeployCapability {
388
359
});
389
360
}
390
361
391
- function deploySgxVerifier (
362
+ function deployVerifiers (
392
363
address owner ,
393
364
address rollupResolver ,
394
- uint64 l2ChainId ,
395
- address taikoInbox ,
396
- address taikoProofVerifier
365
+ address proofVerifier ,
366
+ address taikoInboxAddr
397
367
)
398
368
private
399
- returns (address sgxRethVerifier , address sgxGethVerifier )
400
369
{
370
+ // OP verifier
371
+ address opVerifier = deployProxy ({
372
+ name: "op_verifier " ,
373
+ impl: address (new OpVerifier (rollupResolver)),
374
+ data: abi.encodeCall (OpVerifier.init, (owner)),
375
+ registerTo: rollupResolver
376
+ });
377
+
378
+ // Other verifiers
379
+
401
380
// No need to proxy these, because they are 3rd party. If we want to modify, we simply
402
381
// change the registerAddress("automata_dcap_attestation", address(attestation));
403
- P256Verifier p256Verifier = new P256Verifier ();
404
- SigVerifyLib sigVerifyLib = new SigVerifyLib (address (p256Verifier));
382
+ SigVerifyLib sigVerifyLib = new SigVerifyLib (address (new P256Verifier ()));
405
383
PEMCertChainLib pemCertChainLib = new PEMCertChainLib ();
406
384
address automataDcapV3AttestationImpl = address (new AutomataDcapV3Attestation ());
407
-
385
+ // Log addresses for the user to register sgx instance
386
+ console2.log ("SigVerifyLib " , address (sigVerifyLib));
387
+ console2.log ("PemCertChainLib " , address (pemCertChainLib));
408
388
address automataProxy = deployProxy ({
409
389
name: "automata_dcap_attestation " ,
410
390
impl: automataDcapV3AttestationImpl,
@@ -413,26 +393,64 @@ contract DeployProtocolOnL1 is DeployCapability {
413
393
),
414
394
registerTo: rollupResolver
415
395
});
396
+ address sgxGethAutomataProxy = deployProxy ({
397
+ name: "sgx_geth_automata " ,
398
+ impl: automataDcapV3AttestationImpl,
399
+ data: abi.encodeCall (
400
+ AutomataDcapV3Attestation.init, (owner, address (sigVerifyLib), address (pemCertChainLib))
401
+ ),
402
+ registerTo: rollupResolver
403
+ });
404
+
405
+ TaikoInbox taikoInbox = TaikoInbox (payable (taikoInboxAddr));
406
+ uint64 l2ChainId = taikoInbox.pacayaConfig ().chainId;
407
+ require (l2ChainId != block .chainid , "same chainid " );
416
408
417
- address sgxImpl =
418
- address (new SgxVerifier (l2ChainId, taikoInbox, taikoProofVerifier, automataProxy));
419
- sgxRethVerifier = deployProxy ({
409
+ address sgxRethVerifier = deployProxy ({
420
410
name: "sgx_reth_verifier " ,
421
- impl: sgxImpl ,
411
+ impl: address ( new SgxVerifier (l2ChainId, taikoInboxAddr, proofVerifier, automataProxy)) ,
422
412
data: abi.encodeCall (SgxVerifier.init, owner),
423
413
registerTo: rollupResolver
424
414
});
425
- sgxGethVerifier = deployProxy ({
415
+ address sgxGethVerifier = deployProxy ({
426
416
name: "sgx_geth_verifier " ,
427
- impl: sgxImpl,
417
+ impl: address (
418
+ new SgxVerifier (l2ChainId, taikoInboxAddr, proofVerifier, sgxGethAutomataProxy)
419
+ ),
428
420
data: abi.encodeCall (SgxVerifier.init, owner),
429
421
registerTo: rollupResolver
430
422
});
431
423
432
- // Log addresses for the user to register sgx instance
433
- console2.log ("SigVerifyLib " , address (sigVerifyLib));
434
- console2.log ("PemCertChainLib " , address (pemCertChainLib));
435
- console2.log ("AutomataDcapVaAttestation " , automataProxy);
424
+ (address risc0RethVerifier , address sp1RethVerifier ) =
425
+ deployZKVerifiers (owner, rollupResolver, l2ChainId);
426
+ if (vm.envBool ("DUMMY_VERIFIERS " )) {
427
+ UUPSUpgradeable (proofVerifier).upgradeTo ({
428
+ newImplementation: address (
429
+ new DevnetVerifier (
430
+ taikoInboxAddr,
431
+ opVerifier,
432
+ opVerifier,
433
+ address (0 ),
434
+ risc0RethVerifier,
435
+ sp1RethVerifier
436
+ )
437
+ )
438
+ });
439
+ } else {
440
+ UUPSUpgradeable (proofVerifier).upgradeTo ({
441
+ newImplementation: address (
442
+ new DevnetVerifier (
443
+ taikoInboxAddr,
444
+ sgxGethVerifier,
445
+ opVerifier,
446
+ sgxRethVerifier,
447
+ risc0RethVerifier,
448
+ sp1RethVerifier
449
+ )
450
+ )
451
+ });
452
+ }
453
+ Ownable2StepUpgradeable (proofVerifier).transferOwnership (owner);
436
454
}
437
455
438
456
function deployZKVerifiers (
0 commit comments