-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.json
709 lines (709 loc) · 54.3 KB
/
config.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
{
"client_name": "Opyn",
"commit_hash": "1248e6606feb3279a94104df6c6dfcb8d46271f4",
"date": "July 2021",
"date_interval": "July 26 to July 30, 2021",
"issues": [
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nWhen a round is started, the Vault owner will call `rollOver` function, which in turn calls `_distribute`. The `IAction.rolloverPosition` is called only if the percentage allocation amount is non-zero:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L447-L450\r\n\r\nWhen a round is closed, the `IAction.closePosition` function is always called:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L419-L422\r\n\r\nUpon rollover round, the state in the action is updated:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/utils/RollOverBase.sol#L64-L70\r\n\r\nAnd the close position step is dependent on this state in order to correctly function:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/example-actions/ShortOToken.sol#L234-L238\r\n\r\n**Recommendation**\r\n\r\nWhile we have yet to find a specific issue with the code under review, we believe that as a design decision, the system should always call `IAction.rolloverPosition` and `IAction.closePosition` in tandem.\r\n\r\nIn the case above, either _always_ call `IAction.rolloverPosition` regardless of the allocation percentage for the action or add code in `_closeAndWithdraw` function to only call `IAction.closePosition` if the action's balance is non-zero.",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/11/comments",
"created_at": "2021-07-30T10:21:48Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/11/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/11",
"id": 956614639,
"labels": [
{
"color": "34C759",
"default": false,
"description": null,
"id": 3203450799,
"name": "Informational",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzk5",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Informational"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/11/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTY2MTQ2Mzk=",
"number": 11,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "`IAction.rolloverPosition` and `IAction.closePosition` are not always called together as part round lifecycle",
"updated_at": "2021-07-30T10:24:02Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/11",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/342638?v=4",
"events_url": "https://api.github.com/users/andreiashu/events{/privacy}",
"followers_url": "https://api.github.com/users/andreiashu/followers",
"following_url": "https://api.github.com/users/andreiashu/following{/other_user}",
"gists_url": "https://api.github.com/users/andreiashu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreiashu",
"id": 342638,
"login": "andreiashu",
"node_id": "MDQ6VXNlcjM0MjYzOA==",
"organizations_url": "https://api.github.com/users/andreiashu/orgs",
"received_events_url": "https://api.github.com/users/andreiashu/received_events",
"repos_url": "https://api.github.com/users/andreiashu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreiashu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreiashu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreiashu"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nA Vault owner can call `rollOver` function in order to distribute the funds to the actions. The `_allocationPercentages` argument deals with how much each action should have allocated as a percentage of the available funds in the Vault:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L336-L341\r\n\r\nThe `_distribute` function is responsible for ensuring that each action has allocated its respective share of funds: \r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L434-L443\r\n\r\nThe issue is that there is no restriction about a maximum or minimum percentage allocation per action. This means that an owner can allocate 100% to only one action, irrespective of how many actions have been defined in the Vault.\r\n\r\nThis makes a Vault less transparent for its potential users since ultimately the owner can decide to allocate all the funds to only one (highly risky) action.\r\n\r\n**Recommendation**\r\n\r\nIn order to reduce the amount of trust that a user needs to place in a Vault owner, a `minActionAllocationPercentage` parameter should be added to the contract. It can be specified in the `init` function, along with the other Vault parameters. Once set this action should not be allowed to change (ie. no setter function).\r\n\r\nThe `minActionAllocationPercentage` parameter will specify a minimum allocation percentage for each action in the Vault. It will make the behavior of the system more predictable and transparent to its users. Even if set to 0 by the owner, its presence ensures that users know what they are signing up to when depositing assets into the vault.\r\n\r\nNB: care should be taken to ensure correct validation of its value during the `init` stage. For example, having a 34% value for this parameter for a Vault with 3 actions would render the contract unable to allocate funds during `rollOver` stage.",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/10/comments",
"created_at": "2021-07-30T05:39:23Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/10/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/10",
"id": 956421189,
"labels": [
{
"color": "FF9500",
"default": false,
"description": null,
"id": 3203450887,
"name": "Medium",
"node_id": "MDU6TGFiZWwzMjAzNDUwODg3",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Medium"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/10/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTY0MjExODk=",
"number": 10,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "A Vault owner can allocate 100% of tokens to one action",
"updated_at": "2021-07-30T10:11:07Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/10",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/342638?v=4",
"events_url": "https://api.github.com/users/andreiashu/events{/privacy}",
"followers_url": "https://api.github.com/users/andreiashu/followers",
"following_url": "https://api.github.com/users/andreiashu/following{/other_user}",
"gists_url": "https://api.github.com/users/andreiashu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreiashu",
"id": 342638,
"login": "andreiashu",
"node_id": "MDQ6VXNlcjM0MjYzOA==",
"organizations_url": "https://api.github.com/users/andreiashu/orgs",
"received_events_url": "https://api.github.com/users/andreiashu/received_events",
"repos_url": "https://api.github.com/users/andreiashu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreiashu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreiashu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreiashu"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nWhen the vault is locked, the users can still queue deposits and withdraws. However, they cannot be immediately accessed, so specific accounting needs to be done.\r\n\r\nUsers call `registerDeposit`:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/3d44603300dd9abffe5a1c1e1c2647e9f6b80c7b/code/contracts/core/OpynPerpVault.sol#L245\r\n\r\nThe funds they wish to deposit are moved into the vault.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/3d44603300dd9abffe5a1c1e1c2647e9f6b80c7b/code/contracts/core/OpynPerpVault.sol#L246\r\n\r\nAnd the accounting needs to be done for this user to be handled later.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/3d44603300dd9abffe5a1c1e1c2647e9f6b80c7b/code/contracts/core/OpynPerpVault.sol#L249-L251\r\n\r\nOn top of the initial value of `userRoundQueuedDepositAmount[_shareRecipient][round]`, we need to add the current deposited value of `_amount`.\r\n\r\nHowever, a copy/paste artifact from `registerWithdraw` was left in the code, the initial value used is `userRoundQueuedWithdrawShares[_shareRecipient][round]` instead of `userRoundQueuedDepositAmount[_shareRecipient][round]`.\r\n\r\n**Recommendation**\r\n\r\nUpdate the accounting to reflect the correct initial value of the queued deposit.\r\n\r\n**Observation**\r\n\r\nThese kinds of bugs should be caught by the tests. \r\n\r\nThe test that checks this functionality being right is located here.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/67ce34e00f9c9aa0036573e1c5e144c5f6cffd70/code/test/unit-tests/core/OpynPerpVault.ts#L318-L338\r\n\r\nHowever, the functionality isn't completely tested. This test only checks going from 0 to `depositAmount`. The broken functionality is related to increasing the deposit amount, which is done by this piece of code (where the bug exists):\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/67ce34e00f9c9aa0036573e1c5e144c5f6cffd70/code/contracts/core/OpynPerpVault.sol#L249-L251\r\n\r\nThis hints at the way the code was developed. A test-driven development is a good way to have well-tested code, but the tests need to be written before the code is implemented, and the code needs to only satisfy the tests. In this case, there is additional functionality (increasing the deposit size) that doesn't have an associated test.\r\n\r\nNot having a specific test for additional functionality, added to the fact that there are tests checking the code, gives a false sense of security about the correctness of the code.\r\n\r\n\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/9/comments",
"created_at": "2021-07-29T15:30:25Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/9/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/9",
"id": 955961952,
"labels": [
{
"color": "ff3b30",
"default": false,
"description": null,
"id": 3203450928,
"name": "Major",
"node_id": "MDU6TGFiZWwzMjAzNDUwOTI4",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Major"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/9/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTU5NjE5NTI=",
"number": 9,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "Registering a deposit uses the incorrect initial value for the user",
"updated_at": "2021-07-30T10:49:25Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/9",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/547012?v=4",
"events_url": "https://api.github.com/users/cleanunicorn/events{/privacy}",
"followers_url": "https://api.github.com/users/cleanunicorn/followers",
"following_url": "https://api.github.com/users/cleanunicorn/following{/other_user}",
"gists_url": "https://api.github.com/users/cleanunicorn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cleanunicorn",
"id": 547012,
"login": "cleanunicorn",
"node_id": "MDQ6VXNlcjU0NzAxMg==",
"organizations_url": "https://api.github.com/users/cleanunicorn/orgs",
"received_events_url": "https://api.github.com/users/cleanunicorn/received_events",
"repos_url": "https://api.github.com/users/cleanunicorn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cleanunicorn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cleanunicorn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cleanunicorn"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\n`rollOver` function is called by the admin in order to allocate different weights to actions in the Vault:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L336\r\n\r\nIn turn, the `_distribute` function is called which distributes the tokens according to the percentage allocation of each action:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L434-L435\r\n\r\nThe issue is that the `Rollover` event is called regardless of the effective balance of the contract:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L339\r\n\r\n**Recommendation**\r\n\r\nEnsure that the event is emitted only for non-null balances - when funds are actually allocated to actions.\r\n",
"closed_at": "2021-07-30T01:05:19Z",
"comments": 1,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/8/comments",
"created_at": "2021-07-29T11:03:56Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/8/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/8",
"id": 955722828,
"labels": [],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/8/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTU3MjI4Mjg=",
"number": 8,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "closed",
"title": "`rollOver` emits an event for 0 balance",
"updated_at": "2021-07-30T05:42:38Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/8",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/342638?v=4",
"events_url": "https://api.github.com/users/andreiashu/events{/privacy}",
"followers_url": "https://api.github.com/users/andreiashu/followers",
"following_url": "https://api.github.com/users/andreiashu/following{/other_user}",
"gists_url": "https://api.github.com/users/andreiashu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreiashu",
"id": 342638,
"login": "andreiashu",
"node_id": "MDQ6VXNlcjM0MjYzOA==",
"organizations_url": "https://api.github.com/users/andreiashu/orgs",
"received_events_url": "https://api.github.com/users/andreiashu/received_events",
"repos_url": "https://api.github.com/users/andreiashu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreiashu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreiashu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreiashu"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\n`withdrawFromQueue` can be called by anyone in order to withdraw deposited tokens from a round:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L305-L306\r\n\r\nThe emitted event is _incorrectly_ using the `withdrawQueueAmount` variable which holds the tokens leftover in the queue to be withdrawn:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L464-L471\r\n\r\n**Recommendation**\r\n\r\nFix the code to reference `withdrawAmount` instead which represents the number of tokens the user deposited in the round.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/7/comments",
"created_at": "2021-07-29T09:27:57Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/7/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/7",
"id": 955644499,
"labels": [
{
"color": "FF9500",
"default": false,
"description": null,
"id": 3203450887,
"name": "Medium",
"node_id": "MDU6TGFiZWwzMjAzNDUwODg3",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Medium"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/7/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTU2NDQ0OTk=",
"number": 7,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "`withdrawFromQueue` emits the wrong number of tokens withdrawn",
"updated_at": "2021-07-30T05:53:01Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/7",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/342638?v=4",
"events_url": "https://api.github.com/users/andreiashu/events{/privacy}",
"followers_url": "https://api.github.com/users/andreiashu/followers",
"following_url": "https://api.github.com/users/andreiashu/following{/other_user}",
"gists_url": "https://api.github.com/users/andreiashu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreiashu",
"id": 342638,
"login": "andreiashu",
"node_id": "MDQ6VXNlcjM0MjYzOA==",
"organizations_url": "https://api.github.com/users/andreiashu/orgs",
"received_events_url": "https://api.github.com/users/andreiashu/received_events",
"repos_url": "https://api.github.com/users/andreiashu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreiashu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreiashu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreiashu"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nThe EVM works with 256bit/32byte words. For smaller data types, further operations are performed to downscale from 256 bits to the required lower bites type, and therefore having `uint8` as an iterator consumes more gas than keeping it to `uint256`.\r\n\r\nThere are several places where `uint8` is used as the type for the loop iterator:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/3d44603300dd9abffe5a1c1e1c2647e9f6b80c7b/code/contracts/core/OpynPerpVault.sol#L420\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/3d44603300dd9abffe5a1c1e1c2647e9f6b80c7b/code/contracts/core/OpynPerpVault.sol#L441\r\n\r\n**Recommendation**\r\n\r\n\r\nThe example below shows the difference between 2 variants of code, one using `uint8` and the other `uint256` for the iterators:\r\n\r\n```solidity\r\npragma solidity ^0.7.2;\r\n\r\n/**\r\n * Show the difference in gas costs between a loop that uses a uint8 variable\r\n * and one that uses uint256 variable.\r\n * \r\n * Both contracts compiled with `Enable Optimization` set to 200 runs.\r\n */\r\n\r\ncontract LoopUint8 {\r\n // 1st call; size == 0: gas cost 21479\r\n // 2nd call; size == 1: gas cost 21558\r\n // 3rd call; size == 5: gas cost 21826\r\n // 4th call; size == 10: gas cost 22161\r\n function add(uint8 _size) public returns(uint8) {\r\n uint8 sum = 0;\r\n \r\n for (uint8 i = 0; i < _size; i++) {\r\n sum += i;\r\n }\r\n \r\n return sum;\r\n }\r\n}\r\n\r\n\r\ncontract LoopUint256 {\r\n // 1st call; size == 0: gas cost 21452\r\n // 2nd call; size == 1: gas cost 21519\r\n // 3rd call; size == 5: gas cost 21739\r\n // 4th call; size == 10: gas cost 22014\r\n function add(uint256 _size) public returns(uint256) {\r\n uint256 sum = 0;\r\n \r\n for (uint256 i = 0; i < _size; i++) {\r\n sum += i;\r\n }\r\n \r\n return sum;\r\n }\r\n}\r\n```\r\n\r\nIt's important to note that the loop below will always fail because of an out of gas issue. The iterator never hits the limit to stop, it will max out at 255 and restart from 0, thus it will never be larger than 300 to trigger the end of the loop.\r\n\r\n```solidity\r\nfor (uint8 i = 0; i < 300; i++) {\r\n // do something\r\n}\r\n```\r\n\r\n\r\n**Recommendation**\r\n\r\nUse `uint256` for the loop iterators.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/6/comments",
"created_at": "2021-07-28T13:33:14Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/6/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/6",
"id": 954860909,
"labels": [
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 3203450854,
"name": "Minor",
"node_id": "MDU6TGFiZWwzMjAzNDUwODU0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Minor"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/6/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTQ4NjA5MDk=",
"number": 6,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "Prefer using `uint256` instead of a type with less than 256 bits",
"updated_at": "2021-07-30T11:25:34Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/6",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/547012?v=4",
"events_url": "https://api.github.com/users/cleanunicorn/events{/privacy}",
"followers_url": "https://api.github.com/users/cleanunicorn/followers",
"following_url": "https://api.github.com/users/cleanunicorn/following{/other_user}",
"gists_url": "https://api.github.com/users/cleanunicorn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cleanunicorn",
"id": 547012,
"login": "cleanunicorn",
"node_id": "MDQ6VXNlcjU0NzAxMg==",
"organizations_url": "https://api.github.com/users/cleanunicorn/orgs",
"received_events_url": "https://api.github.com/users/cleanunicorn/received_events",
"repos_url": "https://api.github.com/users/cleanunicorn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cleanunicorn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cleanunicorn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cleanunicorn"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nA user can call `registerDeposit` when the vault is locked to add their own funds for the next investment round.\r\n\r\nAfter enough time passes and the round is closed, by calling `closePositions`, the user can come back to the contract to retrieve their locked funds, along with the realized yields.\r\n\r\nIn order to do this, they need to call `claimShares`.\r\n\r\nThe method calculates how many tokens they should have received, in case they were to join when the vault was unlocked and transfers those tokens to the depositor.\r\n\r\nThe calculated value can be zero, either in case the depositor never added tokens, or the depositor already claimed their tokens. However, the transfer happens either way, for 0 tokens or for a positive value of tokens.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L268-L271\r\n\r\n**Recommendation**\r\n\r\nIt might help users (from a UX point of view) and the contract to only send tokens when there are tokens to send. Consider transferring only if there is a positive amount to be sent.\r\n\r\nThis will reduce the number of events the contract emits, and the user knows before committing the transaction if they will receive tokens or not.",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/5/comments",
"created_at": "2021-07-27T14:57:35Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/5/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/5",
"id": 953973254,
"labels": [
{
"color": "FF9500",
"default": false,
"description": null,
"id": 3203450887,
"name": "Medium",
"node_id": "MDU6TGFiZWwzMjAzNDUwODg3",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Medium"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/5/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTM5NzMyNTQ=",
"number": 5,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "`claimShares` should send tokens only if there something to transfer",
"updated_at": "2021-07-30T05:47:47Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/5",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/547012?v=4",
"events_url": "https://api.github.com/users/cleanunicorn/events{/privacy}",
"followers_url": "https://api.github.com/users/cleanunicorn/followers",
"following_url": "https://api.github.com/users/cleanunicorn/following{/other_user}",
"gists_url": "https://api.github.com/users/cleanunicorn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cleanunicorn",
"id": 547012,
"login": "cleanunicorn",
"node_id": "MDQ6VXNlcjU0NzAxMg==",
"organizations_url": "https://api.github.com/users/cleanunicorn/orgs",
"received_events_url": "https://api.github.com/users/cleanunicorn/received_events",
"repos_url": "https://api.github.com/users/cleanunicorn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cleanunicorn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cleanunicorn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cleanunicorn"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nA user can deposit funds in the vault by calling `deposit()` or `registerDeposit()`.\r\n\r\nWhen they are called, the total amount of locked funds are checked to be up to the specified limit, called the `cap`.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L406\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L248\r\n\r\nThe check makes sure the amount of funds is strictly less than the limit. This will force the last user joining the vault to send an awkward amount of funds (similar to `99999999`). Allowing the total amount of funds to equal will make the user experience better, and also, the total reported amount of funds displayed will be easier to the eye.\r\n\r\n**Recommendation**\r\n\r\nChange the `require` to accept the sum of deposited amounts to be equal to the cap.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/4/comments",
"created_at": "2021-07-27T11:24:36Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/4/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/4",
"id": 953781547,
"labels": [
{
"color": "FF9500",
"default": false,
"description": null,
"id": 3203450887,
"name": "Medium",
"node_id": "MDU6TGFiZWwzMjAzNDUwODg3",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Medium"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/4/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTM3ODE1NDc=",
"number": 4,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "Depositing should allow up to or equal to the cap",
"updated_at": "2021-07-30T05:46:38Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/4",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/547012?v=4",
"events_url": "https://api.github.com/users/cleanunicorn/events{/privacy}",
"followers_url": "https://api.github.com/users/cleanunicorn/followers",
"following_url": "https://api.github.com/users/cleanunicorn/following{/other_user}",
"gists_url": "https://api.github.com/users/cleanunicorn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cleanunicorn",
"id": 547012,
"login": "cleanunicorn",
"node_id": "MDQ6VXNlcjU0NzAxMg==",
"organizations_url": "https://api.github.com/users/cleanunicorn/orgs",
"received_events_url": "https://api.github.com/users/cleanunicorn/received_events",
"repos_url": "https://api.github.com/users/cleanunicorn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cleanunicorn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cleanunicorn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cleanunicorn"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nWhen the total reported amount of assets is estimated by the actions, the storage variable `actions.length` is used. This value does not change over time (in this loop) and can be cached in a local variable, instead of retrieving the value from the storage.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L393-L395\r\n\r\nSimilarly for `_closeAndWithdraw()`:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/3d44603300dd9abffe5a1c1e1c2647e9f6b80c7b/code/contracts/core/OpynPerpVault.sol#L420\r\n\r\n**Recommendation**\r\n\r\nCache the length locally and use the local variable in the loop.\r\n\r\n**Reference**\r\n\r\nAn example was created to illustrate the gas difference with or without length cache.\r\n\r\nNot using a cache, for a set of 10 iterations uses **49157 gas**.\r\n\r\n```solidity\r\ncontract SumNumbers {\r\n uint[] public numbers;\r\n \r\n constructor(uint size) {\r\n // Add some data to work with\r\n for (uint i = 0; i < size; i++) {\r\n numbers.push(i);\r\n }\r\n }\r\n \r\n function sumNumbers() public view returns (uint) {\r\n uint sum;\r\n for(uint i = 0; i < numbers.length; i++) {\r\n sum += numbers[i];\r\n }\r\n \r\n return sum;\r\n }\r\n}\r\n```\r\n\r\nUsing a cache, for the same set of 10 iterations uses **48168 gas**.\r\n\r\n```solidity\r\ncontract SumNumbersWithCache {\r\n uint[] public numbers;\r\n \r\n constructor(uint size) {\r\n // Add some data to work with\r\n for (uint i = 0; i < size; i++) {\r\n numbers.push(i);\r\n }\r\n }\r\n \r\n function sumNumbers() public view returns (uint) {\r\n uint sum;\r\n uint size = numbers.length;\r\n \r\n for(uint i = 0; i < size; i++) {\r\n sum += numbers[i];\r\n }\r\n \r\n return sum;\r\n }\r\n}\r\n```\r\n\r\nBoth contracts were compiled with 200 optimization rounds.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/3/comments",
"created_at": "2021-07-27T09:53:07Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/3/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/3",
"id": 953707223,
"labels": [
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 3203450854,
"name": "Minor",
"node_id": "MDU6TGFiZWwzMjAzNDUwODU0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Minor"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/3/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTM3MDcyMjM=",
"number": 3,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "Cache the length of actions when looping over them",
"updated_at": "2021-07-30T05:44:57Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/3",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/547012?v=4",
"events_url": "https://api.github.com/users/cleanunicorn/events{/privacy}",
"followers_url": "https://api.github.com/users/cleanunicorn/followers",
"following_url": "https://api.github.com/users/cleanunicorn/following{/other_user}",
"gists_url": "https://api.github.com/users/cleanunicorn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cleanunicorn",
"id": 547012,
"login": "cleanunicorn",
"node_id": "MDQ6VXNlcjU0NzAxMg==",
"organizations_url": "https://api.github.com/users/cleanunicorn/orgs",
"received_events_url": "https://api.github.com/users/cleanunicorn/received_events",
"repos_url": "https://api.github.com/users/cleanunicorn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cleanunicorn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cleanunicorn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cleanunicorn"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nThe owner can call `setCap` to set a new limit for the accepted funds.\r\n\r\nAfter the cap was updated, an event is emitted.\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/518e4f6d174cae6ee75e316ad56789aaeb695069/code/contracts/core/OpynPerpVault.sol#L198-L201\r\n\r\nWhen the event is emitted, the storage variable is used. This forces an expensive `SLOAD` operation.\r\n\r\n**Recommendation**\r\n\r\nUse the argument received in the method when emitting the event instead of the storage variable.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/2/comments",
"created_at": "2021-07-27T09:31:59Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/2/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/2",
"id": 953690100,
"labels": [
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 3203450854,
"name": "Minor",
"node_id": "MDU6TGFiZWwzMjAzNDUwODU0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Minor"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/2/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTM2OTAxMDA=",
"number": 2,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "Improve gas costs by reducing the use of state variables when possible",
"updated_at": "2021-07-30T14:49:44Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/2",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/547012?v=4",
"events_url": "https://api.github.com/users/cleanunicorn/events{/privacy}",
"followers_url": "https://api.github.com/users/cleanunicorn/followers",
"following_url": "https://api.github.com/users/cleanunicorn/following{/other_user}",
"gists_url": "https://api.github.com/users/cleanunicorn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cleanunicorn",
"id": 547012,
"login": "cleanunicorn",
"node_id": "MDQ6VXNlcjU0NzAxMg==",
"organizations_url": "https://api.github.com/users/cleanunicorn/orgs",
"received_events_url": "https://api.github.com/users/cleanunicorn/received_events",
"repos_url": "https://api.github.com/users/cleanunicorn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cleanunicorn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cleanunicorn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cleanunicorn"
}
},
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nThe `LockState` modifier updates the `state` contract variable to `VaultState.Locked`:\r\n\r\nhttps://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/blob/d94fcb2e2173008272604705a9fc618710349462/code/contracts/core/OpynPerpVault.sol#L116-L120\r\n\r\nThe issue is that the documentation above is confusing.\r\n\r\n**Recommendation**\r\n\r\nReword the documentation text to read (_should_ instead of _can_):\r\n\r\n> should only be executed in the unlocked state\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/1/comments",
"created_at": "2021-07-27T04:52:29Z",
"events_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/1/events",
"html_url": "https://github.com/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/1",
"id": 953500444,
"labels": [
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 3203450854,
"name": "Minor",
"node_id": "MDU6TGFiZWwzMjAzNDUwODU0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Minor"
},
{
"color": "667788",
"default": false,
"description": null,
"id": 3203450744,
"name": "Report",
"node_id": "MDU6TGFiZWwzMjAzNDUwNzQ0",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/labels/Report"
}
],
"labels_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/1/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "MDU6SXNzdWU5NTM1MDA0NDQ=",
"number": 1,
"performed_via_github_app": null,
"repository_url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07",
"state": "open",
"title": "OpynPerpVault.onlyLocked() documentation update",
"updated_at": "2021-07-30T05:39:55Z",
"url": "https://api.github.com/repos/monoceros-alpha/review-opyn-perp-vault-templates-2021-07/issues/1",
"user": {
"avatar_url": "https://avatars.githubusercontent.com/u/342638?v=4",
"events_url": "https://api.github.com/users/andreiashu/events{/privacy}",
"followers_url": "https://api.github.com/users/andreiashu/followers",
"following_url": "https://api.github.com/users/andreiashu/following{/other_user}",
"gists_url": "https://api.github.com/users/andreiashu/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreiashu",
"id": 342638,
"login": "andreiashu",
"node_id": "MDQ6VXNlcjM0MjYzOA==",
"organizations_url": "https://api.github.com/users/andreiashu/orgs",
"received_events_url": "https://api.github.com/users/andreiashu/received_events",
"repos_url": "https://api.github.com/users/andreiashu/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreiashu/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreiashu/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreiashu"
}
}
],
"person_days": "10",
"project_name": "Perpetual Vault Template",
"review_period": "1 week",
"source_repository": "https://github.com/opynfinance/perp-vault-templates",
"template": "./Readme.md.mustache"
}