@@ -672,23 +672,22 @@ contract TestInitialize is Test {
672
672
managerChain1.initialize ();
673
673
}
674
674
675
- // TODO - Keep or remove depending on frontrunning discussion for deployment
676
- // function test_frontrunInitialize() public{
677
- // string memory url = "https://ethereum-goerli.publicnode.com";
678
- // vm.createSelectFork(url);
679
-
680
- // vm.chainId(chainId1);
681
- // DummyToken t1 = new DummyToken();
682
- // ManagerStandalone implementation =
683
- // new ManagerStandalone(address(t1), Manager.Mode.LOCKING, chainId1, 1 days);
684
-
685
- // managerChain1 = ManagerStandalone(address(new ERC1967Proxy(address(implementation), "")));
675
+ function test_cannotFrontrunInitialize () public {
676
+ string memory url = "https://ethereum-goerli.publicnode.com " ;
677
+ vm.createSelectFork (url);
686
678
687
- // vm.prank(userA);
679
+ vm.chainId (chainId1);
680
+ DummyToken t1 = new DummyToken ();
681
+ ManagerStandalone implementation =
682
+ new ManagerStandalone (address (t1), Manager.Mode.LOCKING, chainId1, 1 days);
688
683
689
- // // Frontrun of initialization occurs HERE
690
- // managerChain1.initialize();
684
+ managerChain1 = ManagerStandalone (address (new ERC1967Proxy (address (implementation), "" )));
691
685
692
- // require(address(this) == managerChain1.owner(), "Unexpected owner");
693
- // }
686
+ // Attempt to initialize the contract from a non-deployer account.
687
+ vm.prank (userA);
688
+ vm.expectRevert (
689
+ abi.encodeWithSignature ("UnexpectedOwner(address,address) " , address (this ), userA)
690
+ );
691
+ managerChain1.initialize ();
692
+ }
694
693
}
0 commit comments