@@ -57,14 +57,14 @@ contract TaskAVSRegistrarBaseUnitTests is
5757        // Deploy the registrar with proxy pattern 
5858        proxyAdmin =  new  ProxyAdmin ();
5959        MockTaskAVSRegistrar registrarImpl =  new  MockTaskAVSRegistrar (
60-             avs,
61-             IAllocationManager (address (allocationManager)),
62-             IKeyRegistrar (address (keyRegistrar))
60+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
6361        );
6462        TransparentUpgradeableProxy proxy =  new  TransparentUpgradeableProxy (
6563            address (registrarImpl),
6664            address (proxyAdmin),
67-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, initialConfig)
65+             abi.encodeWithSelector (
66+                 MockTaskAVSRegistrar.initialize.selector , avs, owner, initialConfig
67+             )
6868        );
6969        registrar =  MockTaskAVSRegistrar (address (proxy));
7070    }
@@ -139,14 +139,12 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
139139        // Deploy new registrar with proxy pattern 
140140        ProxyAdmin newProxyAdmin =  new  ProxyAdmin ();
141141        MockTaskAVSRegistrar newRegistrarImpl =  new  MockTaskAVSRegistrar (
142-             avs,
143-             IAllocationManager (address (allocationManager)),
144-             IKeyRegistrar (address (keyRegistrar))
142+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
145143        );
146144        TransparentUpgradeableProxy newProxy =  new  TransparentUpgradeableProxy (
147145            address (newRegistrarImpl),
148146            address (newProxyAdmin),
149-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, config)
147+             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , avs,  owner, config)
150148        );
151149        MockTaskAVSRegistrar newRegistrar =  MockTaskAVSRegistrar (address (newProxy));
152150
@@ -168,9 +166,7 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
168166        // Deploy implementation 
169167        ProxyAdmin newProxyAdmin =  new  ProxyAdmin ();
170168        MockTaskAVSRegistrar newRegistrarImpl =  new  MockTaskAVSRegistrar (
171-             avs,
172-             IAllocationManager (address (allocationManager)),
173-             IKeyRegistrar (address (keyRegistrar))
169+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
174170        );
175171
176172        // Expect event during initialization 
@@ -181,7 +177,7 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
181177        new  TransparentUpgradeableProxy (
182178            address (newRegistrarImpl),
183179            address (newProxyAdmin),
184-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, config)
180+             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , avs,  owner, config)
185181        );
186182    }
187183
@@ -191,17 +187,15 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
191187        // Deploy implementation 
192188        ProxyAdmin newProxyAdmin =  new  ProxyAdmin ();
193189        MockTaskAVSRegistrar newRegistrarImpl =  new  MockTaskAVSRegistrar (
194-             avs,
195-             IAllocationManager (address (allocationManager)),
196-             IKeyRegistrar (address (keyRegistrar))
190+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
197191        );
198192
199193        // Expect revert during initialization 
200194        vm.expectRevert (ExecutorOperatorSetIdsEmpty.selector );
201195        new  TransparentUpgradeableProxy (
202196            address (newRegistrarImpl),
203197            address (newProxyAdmin),
204-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, config)
198+             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , avs,  owner, config)
205199        );
206200    }
207201
@@ -211,17 +205,15 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
211205        // Deploy implementation 
212206        ProxyAdmin newProxyAdmin =  new  ProxyAdmin ();
213207        MockTaskAVSRegistrar newRegistrarImpl =  new  MockTaskAVSRegistrar (
214-             avs,
215-             IAllocationManager (address (allocationManager)),
216-             IKeyRegistrar (address (keyRegistrar))
208+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
217209        );
218210
219211        // Expect revert during initialization 
220212        vm.expectRevert (InvalidAggregatorOperatorSetId.selector );
221213        new  TransparentUpgradeableProxy (
222214            address (newRegistrarImpl),
223215            address (newProxyAdmin),
224-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, config)
216+             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , avs,  owner, config)
225217        );
226218    }
227219
@@ -231,17 +223,15 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
231223        // Deploy implementation 
232224        ProxyAdmin newProxyAdmin =  new  ProxyAdmin ();
233225        MockTaskAVSRegistrar newRegistrarImpl =  new  MockTaskAVSRegistrar (
234-             avs,
235-             IAllocationManager (address (allocationManager)),
236-             IKeyRegistrar (address (keyRegistrar))
226+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
237227        );
238228
239229        // Expect revert during initialization 
240230        vm.expectRevert (DuplicateExecutorOperatorSetId.selector );
241231        new  TransparentUpgradeableProxy (
242232            address (newRegistrarImpl),
243233            address (newProxyAdmin),
244-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, config)
234+             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , avs,  owner, config)
245235        );
246236    }
247237
@@ -251,17 +241,15 @@ contract TaskAVSRegistrarBaseUnitTests_Constructor is TaskAVSRegistrarBaseUnitTe
251241        // Deploy implementation 
252242        ProxyAdmin newProxyAdmin =  new  ProxyAdmin ();
253243        MockTaskAVSRegistrar newRegistrarImpl =  new  MockTaskAVSRegistrar (
254-             avs,
255-             IAllocationManager (address (allocationManager)),
256-             IKeyRegistrar (address (keyRegistrar))
244+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
257245        );
258246
259247        // Expect revert during initialization 
260248        vm.expectRevert (DuplicateExecutorOperatorSetId.selector );
261249        new  TransparentUpgradeableProxy (
262250            address (newRegistrarImpl),
263251            address (newProxyAdmin),
264-             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , owner, config)
252+             abi.encodeWithSelector (MockTaskAVSRegistrar.initialize.selector , avs,  owner, config)
265253        );
266254    }
267255}
@@ -419,20 +407,18 @@ contract TaskAVSRegistrarBaseUnitTests_Upgradeable is TaskAVSRegistrarBaseUnitTe
419407    function test_Initialize_OnlyOnce  () public  {
420408        // Try to initialize again, should revert 
421409        vm.expectRevert ("Initializable: contract is already initialized " );
422-         registrar.initialize (address (0x9999 ), _createValidAvsConfig ());
410+         registrar.initialize (avs,  address (0x9999 ), _createValidAvsConfig ());
423411    }
424412
425413    function test_Implementation_CannotBeInitialized  () public  {
426414        // Deploy a new implementation 
427415        MockTaskAVSRegistrar newImpl =  new  MockTaskAVSRegistrar (
428-             avs,
429-             IAllocationManager (address (allocationManager)),
430-             IKeyRegistrar (address (keyRegistrar))
416+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
431417        );
432418
433419        // Try to initialize the implementation directly, should revert 
434420        vm.expectRevert ("Initializable: contract is already initialized " );
435-         newImpl.initialize (owner, _createValidAvsConfig ());
421+         newImpl.initialize (avs,  owner, _createValidAvsConfig ());
436422    }
437423
438424    function test_ProxyUpgrade  () public  {
@@ -449,9 +435,7 @@ contract TaskAVSRegistrarBaseUnitTests_Upgradeable is TaskAVSRegistrarBaseUnitTe
449435
450436        // Deploy new implementation (could have new functions/logic) 
451437        MockTaskAVSRegistrar newImpl =  new  MockTaskAVSRegistrar (
452-             avs,
453-             IAllocationManager (address (allocationManager)),
454-             IKeyRegistrar (address (keyRegistrar))
438+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
455439        );
456440
457441        // Upgrade proxy to new implementation 
@@ -476,9 +460,7 @@ contract TaskAVSRegistrarBaseUnitTests_Upgradeable is TaskAVSRegistrarBaseUnitTe
476460
477461        // Deploy new implementation 
478462        MockTaskAVSRegistrar newImpl =  new  MockTaskAVSRegistrar (
479-             avs,
480-             IAllocationManager (address (allocationManager)),
481-             IKeyRegistrar (address (keyRegistrar))
463+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
482464        );
483465
484466        // Try to upgrade from non-owner, should revert 
@@ -526,9 +508,7 @@ contract TaskAVSRegistrarBaseUnitTests_Upgradeable is TaskAVSRegistrarBaseUnitTe
526508
527509        // Deploy new implementation 
528510        MockTaskAVSRegistrar newImpl =  new  MockTaskAVSRegistrar (
529-             avs,
530-             IAllocationManager (address (allocationManager)),
531-             IKeyRegistrar (address (keyRegistrar))
511+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
532512        );
533513
534514        // Upgrade 
@@ -557,7 +537,6 @@ contract TaskAVSRegistrarBaseUnitTests_Upgradeable is TaskAVSRegistrarBaseUnitTe
557537        TransparentUpgradeableProxy uninitializedProxy =  new  TransparentUpgradeableProxy (
558538            address (
559539                new  MockTaskAVSRegistrar (
560-                     avs,
561540                    IAllocationManager (address (allocationManager)),
562541                    IKeyRegistrar (address (keyRegistrar))
563542                )
@@ -571,25 +550,23 @@ contract TaskAVSRegistrarBaseUnitTests_Upgradeable is TaskAVSRegistrarBaseUnitTe
571550
572551        // Initialize it once 
573552        AvsConfig memory  config =  _createValidAvsConfig ();
574-         uninitializedRegistrar.initialize (owner, config);
553+         uninitializedRegistrar.initialize (avs,  owner, config);
575554        assertEq (uninitializedRegistrar.owner (), owner);
576555
577556        // Try to initialize again, should fail 
578557        vm.expectRevert ("Initializable: contract is already initialized " );
579-         uninitializedRegistrar.initialize (address (0x9999 ), config);
558+         uninitializedRegistrar.initialize (avs,  address (0x9999 ), config);
580559    }
581560
582561    function test_DisableInitializers_InImplementation  () public  {
583562        // This test verifies that the implementation contract has initializers disabled 
584563        MockTaskAVSRegistrar impl =  new  MockTaskAVSRegistrar (
585-             avs,
586-             IAllocationManager (address (allocationManager)),
587-             IKeyRegistrar (address (keyRegistrar))
564+             IAllocationManager (address (allocationManager)), IKeyRegistrar (address (keyRegistrar))
588565        );
589566
590567        // Try to initialize the implementation, should revert 
591568        vm.expectRevert ("Initializable: contract is already initialized " );
592-         impl.initialize (owner, _createValidAvsConfig ());
569+         impl.initialize (avs,  owner, _createValidAvsConfig ());
593570    }
594571}
595572
0 commit comments