@@ -21,6 +21,8 @@ contract HyperfundFactoryTest is Test {
2121 address public hypercertMinter;
2222 uint256 hypercertId;
2323 address manager;
24+ address feeRecipient;
25+ uint256 feePercentage = 100 ;
2426 uint256 public totalUnits = 100000000 ;
2527
2628 event Upgraded (address indexed implementation );
@@ -40,6 +42,7 @@ contract HyperfundFactoryTest is Test {
4042 hyperfundFactory = HyperfundFactory (address (proxy));
4143
4244 manager = address (this );
45+ feeRecipient = vm.addr (1 );
4346 // hypercertId = HT(hypercertMinter).mintClaim(
4447 // address(this), totalUnits, "uri", HT.TransferRestrictions.AllowAll
4548 // );
@@ -101,9 +104,9 @@ contract HyperfundFactoryTest is Test {
101104 vm.expectEmit (false , true , false , true );
102105 // We can't know the hyperfund address beforehand, but we can emit a dummy event
103106 // with the other parameters we expect
104- emit HyperfundFactory.HyperfundCreated (address (0 ), hypercertId, manager, manager, manager, manager);
107+ emit HyperfundFactory.HyperfundCreated (address (0 ), hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
105108
106- address hyperfundAddress = hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager);
109+ address hyperfundAddress = hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
107110
108111 bool createdHyperfund = hyperfundFactory.hyperfunds (hypercertId);
109112 assertTrue (createdHyperfund != false , "Hyperfund should be created and mapped correctly " );
@@ -115,37 +118,37 @@ contract HyperfundFactoryTest is Test {
115118 vm.expectEmit (false , true , false , true );
116119 // We can't know the hyperfund address beforehand, but we can emit a dummy event
117120 // with the other parameters we expect
118- emit HyperfundFactory.HyperstakerCreated (address (0 ), hypercertId, manager, manager, manager, manager);
121+ emit HyperfundFactory.HyperstakerCreated (address (0 ), hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
119122
120- address hyperstakerAddress = hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager);
123+ address hyperstakerAddress = hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
121124
122125 bool createdHyperstaker = hyperfundFactory.hyperstakers (hypercertId);
123126 assertTrue (createdHyperstaker != false , "Hyperstaker should be created and mapped correctly " );
124127 assertEq (Hyperstaker (hyperstakerAddress).hypercertTypeId (), hypercertId);
125128 }
126129
127130 function test_RevertWhen_RedeployingHyperfundWithSameHypercertId () public {
128- hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager);
131+ hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
129132
130133 vm.expectRevert (HyperfundFactory.AlreadyDeployed.selector );
131- hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager);
134+ hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
132135 }
133136
134137 function test_RevertWhen_RedeployingHyperStakerWithSameHypercertId () public {
135- hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager);
138+ hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
136139
137140 vm.expectRevert (HyperfundFactory.AlreadyDeployed.selector );
138- hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager);
141+ hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
139142 }
140143
141144 function test_RevertWhen_CreateHyperfundZeroManager () public {
142145 vm.expectRevert (HyperfundFactory.InvalidAddress.selector );
143- hyperfundFactory.createHyperfund (hypercertId, address (0 ), address (0 ), address (0 ), address (0 ));
146+ hyperfundFactory.createHyperfund (hypercertId, address (0 ), address (0 ), address (0 ), address (0 ), feeRecipient, feePercentage );
144147 }
145148
146149 function test_RevertWhen_CreateHyperstakerZeroManager () public {
147150 vm.expectRevert (HyperfundFactory.InvalidAddress.selector );
148- hyperfundFactory.createHyperstaker (hypercertId, address (0 ), address (0 ), address (0 ), address (0 ));
151+ hyperfundFactory.createHyperstaker (hypercertId, address (0 ), address (0 ), address (0 ), address (0 ), feeRecipient, feePercentage );
149152 }
150153
151154 function test_RevertWhen_FailedHyperfundDeployment () public {
@@ -170,7 +173,7 @@ contract HyperfundFactoryTest is Test {
170173 HyperfundFactory factory = HyperfundFactory (address (proxy));
171174
172175 vm.expectRevert ();
173- factory.createHyperfund (hypercertId, manager, manager, manager, manager);
176+ factory.createHyperfund (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
174177 }
175178
176179 function test_RevertWhen_FailedHyperstakerDeployment () public {
@@ -195,24 +198,24 @@ contract HyperfundFactoryTest is Test {
195198 HyperfundFactory factory = HyperfundFactory (address (proxy));
196199
197200 vm.expectRevert ();
198- factory.createHyperstaker (hypercertId, manager, manager, manager, manager);
201+ factory.createHyperstaker (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
199202 }
200203
201204 function test_RevertWhen_HyperfundCreatorNotOwnerOfHypercert () public {
202205 vm.prank (makeAddr ("user2 " ));
203206 vm.expectRevert (HyperfundFactory.NotOwnerOfHypercert.selector );
204- hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager);
207+ hyperfundFactory.createHyperfund (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
205208 }
206209
207210 function test_RevertWhen_HyperstakerCreatorNotOwnerOfHypercert () public {
208211 vm.prank (makeAddr ("user2 " ));
209212 vm.expectRevert (HyperfundFactory.NotOwnerOfHypercert.selector );
210- hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager);
213+ hyperfundFactory.createHyperstaker (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
211214 }
212215
213216 function test_CreateProject () public {
214217 (address hyperfundAddress , address hyperstakerAddress ) =
215- hyperfundFactory.createProject (hypercertId, manager, manager, manager, manager);
218+ hyperfundFactory.createProject (hypercertId, manager, manager, manager, manager, feeRecipient, feePercentage );
216219 assertTrue (hyperfundFactory.hyperfunds (hypercertId));
217220 assertTrue (hyperfundFactory.hyperstakers (hypercertId));
218221 assertEq (Hyperfund (hyperfundAddress).hypercertTypeId (), hypercertId);
0 commit comments