@@ -46,6 +46,15 @@ contract DeployProtocolOnL1 is DeployCapability {
46
46
uint24 constant PRECONF_COOLDOWN_WINDOW = 0 hours ;
47
47
uint24 constant DEVNET_COOLDOWN_WINDOW = 2 hours ;
48
48
49
+ struct VerifierAddresses {
50
+ address sgxGethVerifier;
51
+ address opGethVerifier;
52
+ address opRethVerifier;
53
+ address sgxRethVerifier;
54
+ address risc0RethVerifier;
55
+ address sp1RethVerifier;
56
+ }
57
+
49
58
modifier broadcast () {
50
59
uint256 privateKey = vm.envUint ("PRIVATE_KEY " );
51
60
require (privateKey != 0 , "invalid private key " );
@@ -71,15 +80,49 @@ contract DeployProtocolOnL1 is DeployCapability {
71
80
(address rollupResolver , address proofVerifier ) =
72
81
deployRollupContracts (sharedResolver, contractOwner);
73
82
83
+ address taikoInboxAddr =
84
+ IResolver (rollupResolver).resolve (uint64 (block .chainid ), LibStrings.B_TAIKO, false );
85
+ // Deploy verifiers
86
+ OpVerifier opImpl = new OpVerifier (rollupResolver);
87
+ VerifierAddresses memory verifiers = deployVerifiers (
88
+ contractOwner, rollupResolver, proofVerifier, taikoInboxAddr, address (opImpl)
89
+ );
90
+ if (vm.envBool ("DUMMY_VERIFIERS " )) {
91
+ UUPSUpgradeable (proofVerifier).upgradeTo ({
92
+ newImplementation: address (
93
+ new DevnetVerifier (
94
+ taikoInboxAddr,
95
+ verifiers.opGethVerifier,
96
+ verifiers.opRethVerifier,
97
+ address (0 ),
98
+ verifiers.risc0RethVerifier,
99
+ verifiers.sp1RethVerifier
100
+ )
101
+ )
102
+ });
103
+ } else {
104
+ UUPSUpgradeable (proofVerifier).upgradeTo ({
105
+ newImplementation: address (
106
+ new DevnetVerifier (
107
+ taikoInboxAddr,
108
+ verifiers.sgxGethVerifier,
109
+ verifiers.opRethVerifier,
110
+ verifiers.sgxRethVerifier,
111
+ verifiers.risc0RethVerifier,
112
+ verifiers.sp1RethVerifier
113
+ )
114
+ )
115
+ });
116
+ }
117
+
118
+ Ownable2StepUpgradeable (proofVerifier).transferOwnership (contractOwner);
74
119
// ---------------------------------------------------------------
75
120
// Signal service need to authorize the new rollup
76
121
address signalServiceAddr = IResolver (sharedResolver).resolve (
77
122
uint64 (block .chainid ), LibStrings.B_SIGNAL_SERVICE, false
78
123
);
79
124
SignalService signalService = SignalService (signalServiceAddr);
80
125
81
- address taikoInboxAddr =
82
- IResolver (rollupResolver).resolve (uint64 (block .chainid ), LibStrings.B_TAIKO, false );
83
126
TaikoInbox taikoInbox = TaikoInbox (payable (taikoInboxAddr));
84
127
85
128
if (vm.envAddress ("SHARED_RESOLVER " ) == address (0 )) {
@@ -363,28 +406,30 @@ contract DeployProtocolOnL1 is DeployCapability {
363
406
address owner ,
364
407
address rollupResolver ,
365
408
address proofVerifier ,
366
- address taikoInboxAddr
409
+ address taikoInboxAddr ,
410
+ address opImplAddr
367
411
)
368
412
private
413
+ returns (VerifierAddresses memory )
369
414
{
415
+ VerifierAddresses memory verifiers;
370
416
// OP verifier
371
- address opVerifier = deployProxy ({
417
+ verifiers.opRethVerifier = deployProxy ({
372
418
name: "op_verifier " ,
373
- impl: address ( new OpVerifier (rollupResolver)) ,
419
+ impl: opImplAddr ,
374
420
data: abi.encodeCall (OpVerifier.init, (owner)),
375
421
registerTo: rollupResolver
376
422
});
377
423
378
424
// Other verifiers
379
-
380
425
// No need to proxy these, because they are 3rd party. If we want to modify, we simply
381
426
// change the registerAddress("automata_dcap_attestation", address(attestation));
382
427
SigVerifyLib sigVerifyLib = new SigVerifyLib (address (new P256Verifier ()));
383
428
PEMCertChainLib pemCertChainLib = new PEMCertChainLib ();
384
- address automataDcapV3AttestationImpl = address (new AutomataDcapV3Attestation ());
385
429
// Log addresses for the user to register sgx instance
386
430
console2.log ("SigVerifyLib " , address (sigVerifyLib));
387
431
console2.log ("PemCertChainLib " , address (pemCertChainLib));
432
+ address automataDcapV3AttestationImpl = address (new AutomataDcapV3Attestation ());
388
433
address automataProxy = deployProxy ({
389
434
name: "automata_dcap_attestation " ,
390
435
impl: automataDcapV3AttestationImpl,
@@ -393,6 +438,24 @@ contract DeployProtocolOnL1 is DeployCapability {
393
438
),
394
439
registerTo: rollupResolver
395
440
});
441
+ uint64 l2ChainId = TaikoInbox (payable (taikoInboxAddr)).pacayaConfig ().chainId;
442
+ require (l2ChainId != block .chainid , "same chainid " );
443
+
444
+ verifiers.sgxRethVerifier = deployProxy ({
445
+ name: "sgx_reth_verifier " ,
446
+ impl: address (new SgxVerifier (l2ChainId, taikoInboxAddr, proofVerifier, automataProxy)),
447
+ data: abi.encodeCall (SgxVerifier.init, owner),
448
+ registerTo: rollupResolver
449
+ });
450
+
451
+ (verifiers.risc0RethVerifier, verifiers.sp1RethVerifier) =
452
+ deployZKVerifiers (owner, rollupResolver, l2ChainId);
453
+ verifiers.opGethVerifier = deployProxy ({
454
+ name: "op_geth_verifier " ,
455
+ impl: opImplAddr,
456
+ data: abi.encodeCall (OpVerifier.init, (owner)),
457
+ registerTo: rollupResolver
458
+ });
396
459
address sgxGethAutomataProxy = deployProxy ({
397
460
name: "sgx_geth_automata " ,
398
461
impl: automataDcapV3AttestationImpl,
@@ -401,56 +464,15 @@ contract DeployProtocolOnL1 is DeployCapability {
401
464
),
402
465
registerTo: rollupResolver
403
466
});
404
-
405
- TaikoInbox taikoInbox = TaikoInbox (payable (taikoInboxAddr));
406
- uint64 l2ChainId = taikoInbox.pacayaConfig ().chainId;
407
- require (l2ChainId != block .chainid , "same chainid " );
408
-
409
- address sgxRethVerifier = deployProxy ({
410
- name: "sgx_reth_verifier " ,
411
- impl: address (new SgxVerifier (l2ChainId, taikoInboxAddr, proofVerifier, automataProxy)),
412
- data: abi.encodeCall (SgxVerifier.init, owner),
413
- registerTo: rollupResolver
414
- });
415
- address sgxGethVerifier = deployProxy ({
467
+ verifiers.sgxGethVerifier = deployProxy ({
416
468
name: "sgx_geth_verifier " ,
417
469
impl: address (
418
470
new SgxVerifier (l2ChainId, taikoInboxAddr, proofVerifier, sgxGethAutomataProxy)
419
471
),
420
472
data: abi.encodeCall (SgxVerifier.init, owner),
421
473
registerTo: rollupResolver
422
474
});
423
-
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);
475
+ return verifiers;
454
476
}
455
477
456
478
function deployZKVerifiers (
0 commit comments