@@ -30,10 +30,10 @@ contract AggregatorTest is TestParameters, TestHelpers {
30
30
MockERC20 public rewardToken;
31
31
32
32
function setUp () public {
33
- // 0. Mock WETH
33
+ // 0. Mock WETH deployment
34
34
rewardToken = new MockERC20 ("WETH " , "Wrapped Ether " );
35
35
36
- // 1. Mock Uniswap v3 Router
36
+ // 1. Mock UniswapV3Router deployment
37
37
uniswapRouter = new MockUniswapV3Router ();
38
38
39
39
// 2. LooksRareToken deployment
@@ -80,7 +80,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
80
80
address (tokenDistributor)
81
81
);
82
82
83
- // 6. FeeSharingSetter deployment (distribution period is set at 100 blocks)
83
+ // 6. FeeSharingSetter deployment (w/ distribution period is set at 100 blocks)
84
84
feeSharingSetter = new FeeSharingSetter (address (feeSharingSystem), 30 , 1000 , 100 );
85
85
feeSharingSetter.grantRole (feeSharingSetter.OPERATOR_ROLE (), feeSharingSystem.owner ());
86
86
feeSharingSystem.transferOwnership (address (feeSharingSetter));
@@ -164,7 +164,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
164
164
uint256 amountDeposit = _parseEther (100 );
165
165
cheats.roll (_START_BLOCK + 5 );
166
166
167
- /** 1. Initial deposits at startBlock + 5
167
+ /** 1. Initial deposits at startBlock + 5
168
168
*/
169
169
address [4 ] memory users = [user1, user2, user3, user4];
170
170
for (uint256 i = 0 ; i < users.length ; i++ ) {
@@ -173,7 +173,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
173
173
}
174
174
assertEq (aggregatorFeeSharingWithUniswapV3.userInfo (user1), aggregatorFeeSharingWithUniswapV3.userInfo (user2));
175
175
176
- /** 2. Time travel to startBlock + 20 (15 blocks later)
176
+ /** 2. Time travel to startBlock + 20 (15 blocks later)
177
177
* User1 withdraws funds
178
178
*/
179
179
cheats.roll (_START_BLOCK + 20 );
@@ -189,21 +189,21 @@ contract AggregatorTest is TestParameters, TestHelpers {
189
189
currentBalanceUser + _parseEtherWithFloating (1125 , 1 ) + amountDeposit
190
190
);
191
191
192
- /** 3. Time travel to startBlock + 100 (80 blocks later)
192
+ /** 3. Time travel to startBlock + 100 (80 blocks later)
193
193
* User2 checks the value of her shares
194
194
*/
195
195
cheats.roll (_START_BLOCK + 100 );
196
196
197
197
// 80 blocks at 30 LOOKS/blocks = 2400 LOOKS
198
198
// 800 LOOKS for user
199
- // Total value of the shares = 800 LOOKS + 112.5 LOOKS + 100 LOOKS = 1012.5
199
+ // Total value of the shares = 800 LOOKS + 112.5 LOOKS + 100 LOOKS = 1012.5 LOOKS
200
200
// @dev To deal with minor precision losses due to division, we look at the boundaries
201
201
assertQuasiEq (
202
202
aggregatorFeeSharingWithUniswapV3.calculateSharesValueInLOOKS (user2),
203
203
_parseEtherWithFloating (10125 , 1 )
204
204
);
205
205
206
- /** 4. Time travel to startBlock + 170 (70 blocks later)
206
+ /** 4. Time travel to startBlock + 170 (70 blocks later)
207
207
* User2 withdraws all
208
208
*/
209
209
cheats.roll (_START_BLOCK + 170 );
@@ -217,7 +217,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
217
217
// Total = 1362.5 LOOKS
218
218
assertQuasiEq (looksRareToken.balanceOf (user2), currentBalanceUser + _parseEtherWithFloating (13625 , 1 ));
219
219
220
- /** 5. Time travel to startBlock + 400 (230 blocks later)
220
+ /** 5. Time travel to startBlock + 400 (230 blocks later)
221
221
* User3 withdraws all
222
222
*/
223
223
cheats.roll (_START_BLOCK + 400 );
@@ -233,7 +233,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
233
233
// Total = 2150 LOOKS
234
234
assertQuasiEq (looksRareToken.balanceOf (user3), currentBalanceUser + _parseEther (2150 ));
235
235
236
- /** 6. Time travel to startBlock + 400 (230 blocks later)
236
+ /** 6. Time travel to startBlock + 400 (230 blocks later)
237
237
* User4 withdraws all
238
238
*/
239
239
cheats.roll (_START_BLOCK + 450 );
@@ -244,12 +244,12 @@ contract AggregatorTest is TestParameters, TestHelpers {
244
244
// Should be same as user3 since LOOKS distribution is stopped
245
245
assertQuasiEq (looksRareToken.balanceOf (user4), currentBalanceUser + _parseEther (2150 ));
246
246
247
- // Verify the final supply is equal to the cap - supply not minted (for first 5 blocks)
247
+ // Verify the final total supply is equal to the cap - supply not minted (for first 5 blocks)
248
248
assertEq (looksRareToken.totalSupply (), _parseEther (_CAP) - _parseEther (500 ));
249
249
}
250
250
251
251
function testScenarioWithRouter () public {
252
- /** 0. Initial set up
252
+ /** 0. Initial set up
253
253
*/
254
254
cheats.roll (_START_BLOCK);
255
255
@@ -272,15 +272,15 @@ contract AggregatorTest is TestParameters, TestHelpers {
272
272
uint256 amountDeposit = _parseEther (100 );
273
273
cheats.roll (_START_BLOCK + 5 );
274
274
275
- /** 1. Initial deposits at startBlock + 5
275
+ /** 1. Initial deposits at startBlock + 5
276
276
*/
277
277
address [4 ] memory users = [user1, user2, user3, user4];
278
278
for (uint256 i = 0 ; i < users.length ; i++ ) {
279
279
cheats.prank (users[i]);
280
280
aggregatorFeeSharingWithUniswapV3.deposit (amountDeposit);
281
281
}
282
282
283
- /** 2. Time travel to startBlock + 20 (15 blocks later)
283
+ /** 2. Time travel to startBlock + 20 (15 blocks later)
284
284
* User1 withdraws funds
285
285
*/
286
286
cheats.roll (_START_BLOCK + 20 );
@@ -292,7 +292,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
292
292
// 15 blocks at 30 LOOKS/block = 450 LOOKS
293
293
// + 150 WETH sold at 1 WETH = 1.5 LOOKS --> 225 LOOKS
294
294
// 675 / 4 = 168.75 LOOKS for user
295
- // @dev 50 WETH are lost to the fee sharing system contract since nobody was staking for the first 5 blocks
295
+ // @dev 50 WETH are lost to the fee sharing system contract since no user was staking for the first 5 blocks
296
296
assertEq (
297
297
looksRareToken.balanceOf (user1),
298
298
currentBalanceUser + _parseEtherWithFloating (16875 , 2 ) + amountDeposit
@@ -322,7 +322,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
322
322
aggregatorFeeSharingWithUniswapV3.calculateSharesValueInLOOKS (user2)
323
323
);
324
324
325
- /** 3. Time travel to startBlock + 100 (80 blocks later)
325
+ /** 3. Time travel to startBlock + 100 (80 blocks later)
326
326
* User1 withdraws
327
327
*/
328
328
cheats.roll (_START_BLOCK + 100 );
@@ -343,7 +343,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
343
343
344
344
assertEq (feeSharingSystem.lastRewardBlock (), _START_BLOCK + 100 );
345
345
346
- /** 4. Start of new reward period over 300 blocks
346
+ /** 4. Start of new reward period over 300 blocks
347
347
*/
348
348
349
349
// Add 1500 WETH for distribution for next 300 blocks (5 WETH per block)
@@ -352,8 +352,8 @@ contract AggregatorTest is TestParameters, TestHelpers {
352
352
feeSharingSetter.updateRewards ();
353
353
assertEq (feeSharingSystem.currentRewardPerBlock (), _parseEther (5 ));
354
354
355
- /** 5. Time travel to the end of the LOOKS staking/fee-sharing period
356
- * All users withdraw their funds
355
+ /** 5. Time travel to the end of the LOOKS staking/fee-sharing period
356
+ * All 3 users withdraw their funds
357
357
*/
358
358
cheats.roll (_START_BLOCK + 401 );
359
359
@@ -383,7 +383,7 @@ contract AggregatorTest is TestParameters, TestHelpers {
383
383
// There should be around 50 WETH left in the fee sharing contract (for the first 5 blocks without user staking)
384
384
assertQuasiEq (rewardToken.balanceOf (address (feeSharingSystem)), _parseEther (50 ));
385
385
386
- // Verify the final supply is equal to the cap - supply not minted (for first 5 blocks)
386
+ // Verify the final total supply is equal to the cap - supply not minted (for first 5 blocks)
387
387
assertEq (looksRareToken.totalSupply (), _parseEther (_CAP) - _parseEther (500 ));
388
388
}
389
389
}
0 commit comments