-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.json
682 lines (682 loc) · 54.2 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
{
"client_name": "Volt Protocol",
"commit_hash": "86868c6f77fca67ed6586674437cc9bfc85c1963",
"date": "September 2022",
"date_interval": "September 12 to September 16, 2022",
"final_commit_hash": "1a1ce42f5131059084b8def03a75c334762fad98",
"issues": [
{
"active_lock_reason": null,
"assignee": null,
"assignees": [],
"author_association": "CONTRIBUTOR",
"body": "**Description**\r\n\r\nThe `OracleRef` contract is deployed with a few arguments:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L27-L39\r\n\r\nBefore setting the backup oracle, its value is checked to be different from `address(0)` and different from `_oracle`:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L41-L43\r\n\r\nHowever, when calling the external method `setBackupOracle` the same checks are not applied:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L70-L78\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L133-L138\r\n\r\nWe can see the comment saying that the address zero can be set if we want to disable the oracle:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L133\r\n\r\nWhich disables the backup oracle in `readOracle`:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L103\r\n\r\nThe second check is not enforced, thus the backup oracle could be equal to the main oracle. \r\n\r\n**Recommendation**\r\n\r\nAdd a check to ensure that the backup oracle is different from the main oracle in the internal method `_setBackupOracle` and remove the same check in `constructor`.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/8/comments",
"created_at": "2022-09-18T07:08:56Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/8/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/8",
"id": 1376967974,
"labels": [
{
"color": "667788",
"default": false,
"description": null,
"id": 4517808809,
"name": "Report",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKqQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Report"
},
{
"color": "FF9500",
"default": false,
"description": null,
"id": 4517808866,
"name": "Medium",
"node_id": "LA_kwDOH-H9kc8AAAABDUhK4g",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Medium"
},
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/8/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5SEt0m",
"number": 8,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/8/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "open",
"state_reason": null,
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/8/timeline",
"title": "Setting the backup oracle should impose the same restrictions everywhere",
"updated_at": "2022-09-18T07:58:24Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/8",
"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 method `setDoInvert` sets a storage flag that affects the value read from the oracle.\r\n\r\nThe value determines if it is inverted according to `doInvert`\r\n\r\n$$\r\nf(x) = \r\n\\begin{cases}\r\n1/x & \\quad \\text{when doInvert is }true\\\\\r\nx & \\quad \\text{otherwise}\r\n\\end{cases}\r\n$$ \r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L108-L111\r\n\r\nThe value then proceeds to be scaled before being returned:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L113-L123\r\n\r\nThe storage slot `doInvert` is updated by calling the `external` method:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L54-L58\r\n\r\nThis proceeds to call internally `_setDoInvert`:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L140-L149\r\n\r\nIt is not obvious nor documented that changing the invert value will also update the decimals normalizer.\r\n\r\nConsider the example where the governance wants to update the oracle's invert and decimal scaling. To do that the following methods need to be executed:\r\n\r\n- `OracleRef.setDoInvert(bool)`\r\n- `OracleRef.setDecimalsNormalizer(int256)`\r\n\r\nDepending on the order of the called methods you will have different final values for the decimals normalizer.\r\n\r\n1. Updating `doInvert` first and `decimalsNormalizer` second\r\n\r\n##### Initial values\r\n```solidity\r\ndoInvert = false;\r\ndecimalsNormalizer = 18;\r\n```\r\n\r\n##### Update values\r\n```solidity\r\ndoInvert(true);\r\nsetDecimalsNormalizer(-12);\r\n```\r\n\r\n##### Final values\r\n```solidity\r\ndoInvert = true;\r\ndecimalsNormalizer = -12;\r\n```\r\n\r\n2. Updating `decimalsNormalizer` first and `doInvert` second\r\n\r\n##### We start from the same initial values\r\n```solidity\r\ndoInvert = false;\r\ndecimalsNormalizer = 18;\r\n```\r\n\r\n##### We update the values, but in a different order\r\n```solidity\r\nsetDecimalsNormalizer(-12);\r\ndoInvert(true);\r\n```\r\n\r\n##### The final values can be unexpected for the governance\r\n```solidity\r\ndoInvert = true;\r\ndecimalsNormalizer = 12;\r\n```\r\n\r\nEven though we set the decimals to be `-12`, because we also updated the invert flag, we obtained a different value for our decimals scaling. The order of operations determines our final value for the decimals scaling. \r\n\r\nThis time the `decimalsNormalizer` is updated first. Thus, we have `decimalsNormalizer = -12`.\r\n\r\nWhen the method `doInvert(true)` is executed, the old value is first saved, and the flag `doInvert` is set to `true`:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L140-L142\r\n\r\nAfter this, because the old value is different from the current value, the decimals normalizer is also inverted:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L144-L146\r\n\r\nThis might be unexpected because it's not obvious, it's \"hidden\" in the internal method and an event is not emitted.\r\n\r\nWe can clearly see how changing the order of the operations can unexpectedly update `decimalsNormalizer`.\r\n\r\n**Recommendation**\r\n\r\nConsider removing the logic related to updating `decimalsNormalizer` in the internal method `_setDoInvert `:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/refs/OracleRef.sol#L144-L146\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/7/comments",
"created_at": "2022-09-18T06:28:40Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/7/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/7",
"id": 1376960792,
"labels": [
{
"color": "667788",
"default": false,
"description": null,
"id": 4517808809,
"name": "Report",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKqQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Report"
},
{
"color": "FF9500",
"default": false,
"description": null,
"id": 4517808866,
"name": "Medium",
"node_id": "LA_kwDOH-H9kc8AAAABDUhK4g",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Medium"
},
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/7/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5SEsEY",
"number": 7,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/7/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "open",
"state_reason": null,
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/7/timeline",
"title": "Setting the invert flag in `OracleRef` might have unexpected consequences",
"updated_at": "2022-09-18T07:58:34Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/7",
"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 method `compountInterest` calculates the compounded interest if enough time has passed.\r\n\r\nIf the conditions are met, a new oracle price is saved and an event is emitted.\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/oracle/VoltSystemOracle.sol#L80-L88\r\n\r\nThe emission of the event can be gas optimized a bit, by using the stack value instead of the storage slot since they represent the same value.\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/e37f6c87bc8f25ff472803f3ee3f526249d2a0e0/code/contracts/oracle/VoltSystemOracle.sol#L83-L88\r\n\r\n**Recommendation**\r\n\r\nConsider emitting the stack value `periodEndTime` instead using the storage slot `periodStartTime` since they have the same value and will use less gas.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/6/comments",
"created_at": "2022-09-18T05:16:17Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/6/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/6",
"id": 1376948970,
"labels": [
{
"color": "667788",
"default": false,
"description": null,
"id": 4517808809,
"name": "Report",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKqQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Report"
},
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 4517808856,
"name": "Minor",
"node_id": "LA_kwDOH-H9kc8AAAABDUhK2A",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Minor"
},
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/6/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5SEpLq",
"number": 6,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/6/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "open",
"state_reason": null,
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/6/timeline",
"title": "Method `compoundInterest` can be gas optimized when emitting event",
"updated_at": "2022-09-18T07:58:47Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/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\nThe current oracle implementation does not account for external systems failures. There is no immediate threat, but the oracle system must be a very robust and trusted component.\r\n\r\nConsider this approach for implementing an oracle system.\r\n\r\nWe define a base class that handles passing the value obtained from an oracle implementation. This class implements a robust approach for getting the value, even if the implementation fails. \r\n\r\n```solidity\r\nabstract contract OracleBase {\r\n function value() external returns (uint256 value_, bool valid_) {\r\n // Try to get the value\r\n try this.obtainValue() returns (uint256 valueReturned, bool valid) {\r\n // Prepare the value to be returned\r\n value_ = valueReturned;\r\n // Pass the valid bool\r\n valid_ = valid;\r\n } catch {\r\n value_ = 0;\r\n valid_ = false;\r\n }\r\n\r\n return (value_, valid_);\r\n }\r\n\r\n function obtainValue() external virtual returns (uint256 value, bool valid);\r\n}\r\n```\r\n\r\nThe call to `obtainValue()` can fail because of external calls or improper developer implementation. Whatever the case, the base class can handle these fails and can do much more if multiple fails happen in a row, or provide a cached value, or notify a system that they're offline.\r\n\r\nAny oracle will use this base class and must implement `obtainValue` specific to the value they need to retrieve.\r\n\r\n```solidity\r\n\r\ncontract OracleImplementation is OracleBase {\r\n ExternalContract immutable public ec;\r\n\r\n constructor(ExternalContract _ec) {\r\n // Save the external provider's address\r\n ec = _ec;\r\n }\r\n\r\n function obtainValue() override(OracleBase) external returns (uint256, bool) {\r\n // Make sure this is not called externally by anyone else. \r\n require(msg.sender == address(this), \"Oracle must call itself to get the value\");\r\n\r\n // Talk to `ExternalContract` and get the scale\r\n uint256 scale = ec.getScale();\r\n\r\n // Sometimes you need to do something with the value\r\n scale = scale / 10;\r\n\r\n // Validate the processed value\r\n bool valid = scale <= 42;\r\n\r\n // Return scale\r\n return (scale, valid);\r\n }\r\n}\r\n```\r\n\r\nIn this case, `OracleImplementation` talks to an external system, and they don't need to account for any failures, unexpected upgrades or weird behavior.\r\n\r\nIts only purpose is to obtain the value, process it (if necessary), validate it and return the value if the validity.\r\n\r\n`OracleBase` should not care what the value represents, its purpose is to handle failures and pass on the values.\r\n\r\n`OracleImplementation` has to understand the value obtained and must know how to process and validate it.\r\n\r\nFinally, we tested this with an implementation that returns a value or sometimes fails to ensure our example implementation holds.\r\n\r\n```solidity\r\ncontract ExternalContract {\r\n function getScale() public view returns (uint256 scale_) {\r\n // Simulate random reverts\r\n if (block.number % 2 == 0) {\r\n // fail\r\n revert(\"Sometimes it fails\");\r\n } else {\r\n // return a value, do not fail\r\n return 12;\r\n }\r\n }\r\n}\r\n```\r\n\r\nSeparating the concerns between `OracleBase` and `OracleImplementation` allows for:\r\n\r\n- adding new developers that do not have to understand the whole system in order to develop an oracle;\r\n- protecting from unexpected external changes or upgrades;\r\n- protecting from unexpected external fails.\r\n\r\n**Recommendation**\r\n\r\nConsider stabilizing the oracle interface and implementation to allow for an increase in developer speed, while retaining robust principles and execution\r\n\r\n ",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/5/comments",
"created_at": "2022-09-16T08:46:48Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/5/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/5",
"id": 1375633898,
"labels": [
{
"color": "667788",
"default": false,
"description": null,
"id": 4517808809,
"name": "Report",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKqQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Report"
},
{
"color": "34C759",
"default": false,
"description": null,
"id": 4517808846,
"name": "Informational",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKzg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Informational"
},
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/5/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5R_oHq",
"number": 5,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/5/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "open",
"state_reason": null,
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/5/timeline",
"title": "Oracle implementation can be made more robust",
"updated_at": "2022-09-16T10:25:55Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/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\nWe can see the current `deposit` implementation:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/pcv/compound/ERC20CompoundPCVDeposit.sol#L24-L37\r\n\r\nThe method expects the tokens to already be in the contract's possession:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/pcv/compound/ERC20CompoundPCVDeposit.sol#L26\r\n\r\nProceeds to allow [`cToken`](https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/CToken.sol) to move tokens on its behalf:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/pcv/compound/ERC20CompoundPCVDeposit.sol#L28\r\n\r\nAnd calls `cToken.mint()`:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/pcv/compound/ERC20CompoundPCVDeposit.sol#L30-L34\r\n\r\nUnder the hood, `mint()` takes the tokens from the caller's account. We can see that by following the call stack in the canonical implementation:\r\n\r\nMint calls `mintInternal`:\r\n\r\nhttps://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/CErc20.sol#L43-L52\r\n\r\nWhich calls `mintFresh`:\r\n\r\nhttps://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/CToken.sol#L381-L390\r\n\r\nThe method `mintFresh` does a few things, but we're interested in the part where tokens are moved, which happens in `doTransferIn`:\r\n\r\nhttps://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/CToken.sol#L392-L398\r\n\r\nhttps://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/CToken.sol#L416-L424\r\n\r\nWhich tries to transfer the tokens from the caller (`ERC20CompoundPCVDeposit`) in the `CToken` implementation:\r\n\r\nhttps://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/CErc20.sol#L152-L182\r\n\r\nFollowing this complete call stack we see that the tokens are indeed moved in the `CToken` implementation.\r\n\r\nThus, when a user wants to deposit tokens in the contract `ERC20CompoundPCVDeposit`, they need to do these two actions:\r\n\r\n- send tokens to `ERC20CompoundPCVDeposit`\r\n- call `ERC20CompoundPCVDeposit.deposit()`\r\n\r\nThe method `deposit()` expects the tokens to be in the contract before the method is executed. This isn't obvious, but we made sure that's the case by discussing it with the development team and checking the canonical Compound implementation.\r\n\r\nHaving the tokens in the contract before `deposit()` is called, leaves room for attackers to front-run the execution of `deposit()`.\r\n\r\nEven if Compound implements this approach, it doesn't mean the same pattern needs to be implemented in `ERC20CompoundPCVDeposit`.\r\n\r\nHowever, having the tokens in `ERC20CompoundPCVDeposit` exposes the user to front-running attacks.\r\n\r\nWe can protect the user in a few ways.\r\n\r\n1. Create a proxy contract that bundles together `transfer` and `deposit`. This will be similar to how the tests currently work, since both actions happen synchronously and there is no possibility to front-run the execution of `deposit`. We can see this approach in the tests included in the repository that the `transfer` and `deposit` happen one after the other:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/test/integration/IntegrationTestCompoundPCVDeposits.t.sol#L44-L52\r\n\r\nBut this does not correctly simulate an external user interacting with the system because a user will likely create two separate transactions.\r\n\r\nWe can fix this if we only allow the users to interact with `ERC20CompoundPCVDeposit` through a contract.\r\n\r\nGoing in this direction, the development team needs to do a few things:\r\n\r\n- create a proxy actions contract that implements the desired interaction with the protocol;\r\n- add limits in `deposit()` to ensure `msg.sender` is a contract, reducing the risk of users sending the transactions one after the other.\r\n\r\nImplementing a proxy actions contract is a lot of work since the dev team will need to implement the action bundle described above and also every other action possible in the system. It also adds additional gas costs since a proxy action contract might be needed for each user before interacting with the system.\r\n\r\nTaking this approach doesn't seem to be the ideal one, since a lot of additional work needs to be put in. However, we have an alternative \ud83d\udc47 \r\n\r\n2. Modify `ERC20CompoundPCVDeposit` to use `transferFrom`\r\n\r\nA different implementation of `deposit` can protect the user from being front-run while reducing the amount of development work.\r\n\r\nIdeally we would add an argument to `deposit()` to specify the amount of tokens to deposit. This allows us to transfer the amount of tokens to `ERC20CompoundPCVDeposit` and call `CErc20(address(cToken)).mint(_amount)` which would safely move the tokens around.\r\n\r\n```solidity\r\n/// @notice deposit ERC-20 tokens to Compound\r\nfunction deposit(uint256 _amount) external override whenNotPaused {\r\n token.transferFrom(msg.sender, address(this), _amount);\r\n\r\n // Compound returns non-zero when there is an error\r\n require(\r\n CErc20(address(cToken)).mint(_amount) == 0,\r\n \"ERC20CompoundPCVDeposit: deposit error\"\r\n );\r\n\r\n emit Deposit(msg.sender, _amount);\r\n}\r\n\r\n```\r\n\r\nIf the method signature can't be changed because `IPCVDeposit` needs a `deposit()` method with no arguments, we can take a different approach.\r\n\r\n- Find out the amount of tokens the user has in their possession;\r\n- Find out the approval amount the user allows `ERC20CompoundPCVDeposit` to transfer in their behalf;\r\n- Deposit the minimum of the two values.\r\n\r\nAn example implementation would look like this:\r\n\r\n```solidity\r\n/// @notice deposit ERC-20 tokens to Compound\r\nfunction deposit() external override whenNotPaused {\r\n // We need the minimum of the two values, because the user \r\n // might approve more than their balance \r\n uint256 amount = min(\r\n // The amount of tokens we are allowed to move\r\n token.allowance(msg.sender, address(this)),\r\n // The user's total balance\r\n token.balanceOf(msg.sender)\r\n );\r\n\r\n token.transferFrom(msg.sender, address(this), amount);\r\n\r\n // Compound returns non-zero when there is an error\r\n require(\r\n CErc20(address(cToken)).mint(amount) == 0,\r\n \"ERC20CompoundPCVDeposit: deposit error\"\r\n );\r\n\r\n emit Deposit(msg.sender, amount);\r\n}\r\n```\r\n\r\nPlease do not use the example code verbatim since they haven't been tested at all and make sure to thoroughly test before doing the update.\r\n\r\n**Recommendation**\r\n\r\nConsider the two options and see if any presented approaches make sense to implement to protect the users from being front-run.\r\n\r\n**References**\r\n\r\n- [MakerDAO's DSSProxy](https://etherscan.io/address/0x82ecd135dce65fbc6dbdd0e4237e0af93ffd5038#code)\r\n- [OpenZeppelin Proxy](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Proxy)\r\n- [FIATDAO Action implementation](https://github.com/fiatdao/actions)",
"closed_at": "2022-09-15T10:15:59Z",
"comments": 1,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/4/comments",
"created_at": "2022-09-14T13:33:45Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/4/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/4",
"id": 1372998362,
"labels": [
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/4/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5R1kra",
"number": 4,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/4/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "closed",
"state_reason": "completed",
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/4/timeline",
"title": "Users can lose funds if they call `ERC20CompoundPCVDeposit.deposit()` directly",
"updated_at": "2022-09-15T10:15:59Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/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\nA price is considered valid if the internal method `_validPrice` returns true.\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/peg/PriceBoundPSM.sol#L122-L135\r\n\r\nThis method checks if the provided price is strictly greater than the floor and strictly less than the floor.\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/peg/PriceBoundPSM.sol#L129-L134\r\n\r\nThese methods are taken from the `Decimal` library.\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/external/Decimal.sol#L163-L177\r\n\r\nUsing a strictly greater/less check will exclude the values of floor and ceiling as being valid. This forces the governance to add floor and ceiling values similar to `floor = 0.7999999999999` and `ceiling = 1.199999999999` to describe a valid interval from `0.8` to `1.2`, included.\r\n\r\nIf the check would accept the limits as valid, the governance could set `floor = 0.8` and `ceiling = 1.2`, which are a lot easier to reason about and verify.\r\n\r\n**Recommendation**\r\n\r\nConsider using the methods `greaterThanOrEqualTo` and `lessThanOrEqualTo` provided by [`Decimal`](https://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/external/Decimal.sol#L179-L193) to avoid using awkward values.\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/external/Decimal.sol#L179-L193\r\n\r\n**[optional] References**\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/3/comments",
"created_at": "2022-09-12T14:43:03Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/3/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/3",
"id": 1370030322,
"labels": [
{
"color": "667788",
"default": false,
"description": null,
"id": 4517808809,
"name": "Report",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKqQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Report"
},
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 4517808856,
"name": "Minor",
"node_id": "LA_kwDOH-H9kc8AAAABDUhK2A",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Minor"
},
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/3/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5RqQDy",
"number": 3,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/3/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "open",
"state_reason": null,
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/3/timeline",
"title": "`_validPrice` can include floor and ceiling values when checking the validity",
"updated_at": "2022-09-18T07:58:04Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/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\nA governor or an admin can set the price floor and the ceiling between which swaps are enabled.\r\n\r\nTo set the ceiling, they call `setOracleCeilingBasisPoints`\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/peg/PriceBoundPSM.sol#L62-L69\r\n\r\nThe internal method `_setCeilingBasisPoints` make sure the provided value is \r\n\r\n- non zero\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/peg/PriceBoundPSM.sol#L84-L87\r\n- greater than the floor\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/peg/PriceBoundPSM.sol#L88-L98\r\n\r\nThe check that makes sure the value is non-zero is not required since the ceiling has to be greater than the floor, and the floor has to be greater than zero:\r\n\r\nhttps://github.com/akiratechhq/review-volt-core-2022-09/blob/5826c86d97f928c23d23c5d2b6cabefba4649e67/code/contracts/peg/PriceBoundPSM.sol#L105-L107\r\n\r\nTo increase readability and to help the developer reason about the code, the check can stay there. Still, to slightly decrease the gas cost, a comment can be added that explains why the non-zero check is not needed, retaining readability.\r\n\r\n**Recommendation**\r\n\r\nConsider replacing the `require` with a comment that explains why the check is not necessary.\r\n",
"closed_at": null,
"comments": 0,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/2/comments",
"created_at": "2022-09-12T14:26:56Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/2/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/2",
"id": 1370003654,
"labels": [
{
"color": "667788",
"default": false,
"description": null,
"id": 4517808809,
"name": "Report",
"node_id": "LA_kwDOH-H9kc8AAAABDUhKqQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Report"
},
{
"color": "FFCC00",
"default": false,
"description": null,
"id": 4517808856,
"name": "Minor",
"node_id": "LA_kwDOH-H9kc8AAAABDUhK2A",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Minor"
},
{
"color": "007AFF",
"default": false,
"description": null,
"id": 4517808974,
"name": "Acknowledged",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLTg",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/Acknowledged"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/2/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5RqJjG",
"number": 2,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/2/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "open",
"state_reason": null,
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/2/timeline",
"title": "Setting ceiling basis points does not need a non zero validation",
"updated_at": "2022-09-18T07:58:11Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/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\n**Recommendation**\r\n\r\n**[optional] References**\r\n",
"closed_at": "2022-09-16T10:06:32Z",
"comments": 1,
"comments_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/1/comments",
"created_at": "2022-09-12T13:55:54Z",
"events_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/1/events",
"html_url": "https://github.com/akiratechhq/review-volt-core-2022-09/issues/1",
"id": 1369955498,
"labels": [
{
"color": "6B08DC",
"default": false,
"description": null,
"id": 4517808993,
"name": "WIP",
"node_id": "LA_kwDOH-H9kc8AAAABDUhLYQ",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/labels/WIP"
}
],
"labels_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/1/labels{/name}",
"locked": false,
"milestone": null,
"node_id": "I_kwDOH-H9kc5Rp9yq",
"number": 1,
"performed_via_github_app": null,
"reactions": {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/1/reactions"
},
"repository_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09",
"state": "closed",
"state_reason": "completed",
"timeline_url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/1/timeline",
"title": "Core can be gas optimized by making `volt` immutable",
"updated_at": "2022-09-16T10:06:32Z",
"url": "https://api.github.com/repos/akiratechhq/review-volt-core-2022-09/issues/1",
"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"
}
}
],
"person_days": "5",
"project_name": "Volt Protocol Core",
"review_period": "1 week",
"source_repository": "https://github.com/volt-protocol/volt-protocol-core.git",
"template": "./Readme.md.mustache"
}