-
Notifications
You must be signed in to change notification settings - Fork 1
/
AccountantDelegator.json
605 lines (605 loc) · 185 KB
/
AccountantDelegator.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
{
"address": "0x4F6DCfa2F69AF7350AAc48D3a3d5B8D03b5378AA",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
},
{
"internalType": "address",
"name": "admin_",
"type": "address"
},
{
"internalType": "address",
"name": "cnoteAddress_",
"type": "address"
},
{
"internalType": "address",
"name": "noteAddress_",
"type": "address"
},
{
"internalType": "address",
"name": "comptrollerAddress_",
"type": "address"
},
{
"internalType": "address",
"name": "treasury_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "treasury",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "SweepError",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "lendingMarketAddress",
"type": "address"
}
],
"name": "AcctInit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "AcctRedeemed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "err",
"type": "uint256"
}
],
"name": "AcctSupplied",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "oldAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "admin",
"type": "address"
}
],
"name": "NewAdmin",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "oldImplementation",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "NewImplementation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "oldPendingAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newPendingAdmin",
"type": "address"
}
],
"name": "NewPendingAdmin",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "_acceptAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newPendingAdmin",
"type": "address"
}
],
"name": "_setPendingAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "cnote",
"outputs": [
{
"internalType": "contract CNote",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "comptroller",
"outputs": [
{
"internalType": "contract ComptrollerInterface",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "delegateToImplementation",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "delegateToViewImplementation",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "note",
"outputs": [
{
"internalType": "contract Note",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "redeemMarket",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"name": "setImplementation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "supplyMarket",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "sweepInterest",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "treasury",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x10bcd1e4a72f5828f98c0b17498105a1733b0ce656cee400dcba36081443bdd2",
"receipt": {
"to": null,
"from": "0x2fA8e44e9A3D833019FCc52D62B4dD05125cA1b1",
"contractAddress": "0x4F6DCfa2F69AF7350AAc48D3a3d5B8D03b5378AA",
"transactionIndex": 0,
"gasUsed": "946694",
"logsBloom": "0x00000000000000000000010000000000000000000000000000400000060000000000000000000000000000000000000000000000010000010200000000200000008000000000080000000000000000000000000000000000000000000400000000008000000000000000000000000000000080000010000000000000010000000000000000000000000000000000000000000000000004000000000000000000420000000080000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000400000000000000010000002000000000000000000000084000002000000000000000080000000",
"blockHash": "0x2673f401542f2555dc143fb71d6ffd99aff0dd28fe124a8cc5f63cb2b2100571",
"transactionHash": "0x10bcd1e4a72f5828f98c0b17498105a1733b0ce656cee400dcba36081443bdd2",
"logs": [
{
"transactionIndex": 0,
"blockNumber": 224964,
"transactionHash": "0x10bcd1e4a72f5828f98c0b17498105a1733b0ce656cee400dcba36081443bdd2",
"address": "0x5E23dC409Fc2F832f83CEc191E245A191a4bCc5C",
"topics": [
"0x3ab23ab0d51cccc0c3085aec51f99228625aa1a922b3a8ca89a26b0f2027a1a5"
],
"data": "0x000000000000000000000000ee602429ef7ece0a13e4ffe8dbc16e101049504c0000000000000000000000004f6dcfa2f69af7350aac48d3a3d5b8d03b5378aa",
"logIndex": 0,
"blockHash": "0x2673f401542f2555dc143fb71d6ffd99aff0dd28fe124a8cc5f63cb2b2100571"
},
{
"transactionIndex": 0,
"blockNumber": 224964,
"transactionHash": "0x10bcd1e4a72f5828f98c0b17498105a1733b0ce656cee400dcba36081443bdd2",
"address": "0x4F6DCfa2F69AF7350AAc48D3a3d5B8D03b5378AA",
"topics": [
"0x66b7ee3f5e716ea1950e2554720e086c3ea39ada5a90ab123cfda46d48b12ac6"
],
"data": "0x000000000000000000000000ee602429ef7ece0a13e4ffe8dbc16e101049504c",
"logIndex": 1,
"blockHash": "0x2673f401542f2555dc143fb71d6ffd99aff0dd28fe124a8cc5f63cb2b2100571"
},
{
"transactionIndex": 0,
"blockNumber": 224964,
"transactionHash": "0x10bcd1e4a72f5828f98c0b17498105a1733b0ce656cee400dcba36081443bdd2",
"address": "0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x0000000000000000000000004f6dcfa2f69af7350aac48d3a3d5b8d03b5378aa",
"0x000000000000000000000000ee602429ef7ece0a13e4ffe8dbc16e101049504c"
],
"data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"logIndex": 2,
"blockHash": "0x2673f401542f2555dc143fb71d6ffd99aff0dd28fe124a8cc5f63cb2b2100571"
},
{
"transactionIndex": 0,
"blockNumber": 224964,
"transactionHash": "0x10bcd1e4a72f5828f98c0b17498105a1733b0ce656cee400dcba36081443bdd2",
"address": "0x4F6DCfa2F69AF7350AAc48D3a3d5B8D03b5378AA",
"topics": [
"0xd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0ce8477c81a9f6c972976440c7b3305c37432f3",
"logIndex": 3,
"blockHash": "0x2673f401542f2555dc143fb71d6ffd99aff0dd28fe124a8cc5f63cb2b2100571"
}
],
"blockNumber": 224964,
"cumulativeGasUsed": "946694",
"status": 1,
"byzantium": true
},
"args": [
"0xC0ce8477c81A9F6C972976440C7b3305C37432f3",
"0x2fA8e44e9A3D833019FCc52D62B4dD05125cA1b1",
"0xEe602429Ef7eCe0a13e4FfE8dBC16e101049504C",
"0x4e71A2E537B7f9D9413D3991D37958c0b5e1e503",
"0x5E23dC409Fc2F832f83CEc191E245A191a4bCc5C",
"0xa9F16643c3fE301b3B1e54d35622e661b6f36663"
],
"numDeployments": 2,
"solcInputHash": "a822655fb04b3944b585567b09afe37c",
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"cnoteAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"noteAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"comptrollerAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"lendingMarketAddress\",\"type\":\"address\"}],\"name\":\"AcctInit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AcctRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"err\",\"type\":\"uint256\"}],\"name\":\"AcctSupplied\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"}],\"name\":\"NewAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldImplementation\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"NewImplementation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPendingAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newPendingAdmin\",\"type\":\"address\"}],\"name\":\"NewPendingAdmin\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"_acceptAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPendingAdmin\",\"type\":\"address\"}],\"name\":\"_setPendingAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cnote\",\"outputs\":[{\"internalType\":\"contract CNote\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"comptroller\",\"outputs\":[{\"internalType\":\"contract ComptrollerInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"delegateToImplementation\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"delegateToViewImplementation\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"note\",\"outputs\":[{\"internalType\":\"contract Note\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"redeemMarket\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"name\":\"setImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"supplyMarket\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sweepInterest\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"admin_\":\"admin address (Timelock)\",\"cnoteAddress_\":\"lending market address (CNote)\",\"comptrollerAddress_\":\", address of Comptroller Delegator(Unitroller)\",\"implementation_\":\"implementation address (the AccountantDelegate)\",\"noteAddress_\":\"note address (note erc20 contract)\",\"treasury_\":\"treasury address (TreasuryDelegator)\"}},\"delegateToImplementation(bytes)\":{\"details\":\"It returns to the external caller whatever the implementation returns or forwards reverts\",\"params\":{\"data\":\"The raw data to delegatecall\"},\"returns\":{\"_0\":\"The returned bytes from the delegatecall\"}},\"delegateToViewImplementation(bytes)\":{\"details\":\"It returns to the external caller whatever the implementation returns or forwards reverts There are an additional 2 prefix uints from the wrapper returndata, which we ignore since we make an extra hop.\",\"params\":{\"data\":\"The raw data to delegatecall\"},\"returns\":{\"_0\":\"The returned bytes from the delegatecall\"}},\"redeemMarket(uint256)\":{\"params\":{\"amount\":\"The address of the ERC-20 token to sweep\"}},\"setImplementation(address)\":{\"params\":{\"implementation_\":\"The address of the new implementation for delegation\"}},\"supplyMarket(uint256)\":{\"params\":{\"amount\":\"amount of Note Accountant is supplying to market\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"delegateToImplementation(bytes)\":{\"notice\":\"Delegates execution to the implementation contract\"},\"delegateToViewImplementation(bytes)\":{\"notice\":\"Delegates execution to an implementation contract\"},\"redeemMarket(uint256)\":{\"notice\":\"A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\"},\"setImplementation(address)\":{\"notice\":\"Called by the admin to update the implementation of the delegator\"},\"supplyMarket(uint256)\":{\"notice\":\"A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\"},\"sweepInterest()\":{\"notice\":\"A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Accountant/AccountantDelegator.sol\":\"AccountantDelegator\"},\"evmVersion\":\"london\",\"libraries\":{\":__CACHE_BREAKER__\":\"0x0000000000000031363630313837333733303434\"},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"src/Accountant/AccountantDelegator.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"./AccountantInterfaces.sol\\\";\\n\\ncontract AccountantDelegator is AccountantInterface, AccountantDelegatorInterface {\\n\\n\\t/** \\n * @param implementation_ implementation address (the AccountantDelegate)\\n * @param admin_ admin address (Timelock)\\n * @param cnoteAddress_ lending market address (CNote)\\n * @param noteAddress_ note address (note erc20 contract)\\n * @param comptrollerAddress_, address of Comptroller Delegator(Unitroller)\\n * @param treasury_ treasury address (TreasuryDelegator)\\n */ \\n constructor(\\n\\t\\t\\taddress implementation_,\\n\\t\\t\\taddress admin_,\\n address cnoteAddress_,\\n address noteAddress_,\\n address comptrollerAddress_, \\n address treasury_) {\\n require(admin_ != address(0));\\n // Admin set to msg.sender for initialization\\n admin = msg.sender;\\n\\n\\n delegateTo(implementation_, abi.encodeWithSignature(\\\"initialize(address,address,address,address)\\\", \\n treasury_, \\n cnoteAddress_, \\n noteAddress_,\\n comptrollerAddress_));\\n setImplementation(implementation_);\\n\\n\\t\\tadmin = admin_;\\n\\t}\\n\\n /**\\n * @notice Called by the admin to update the implementation of the delegator\\n * @param implementation_ The address of the new implementation for delegation\\n */\\n function setImplementation(address implementation_) public override {\\n require(msg.sender == admin, \\\"AccountantDelegator::_setImplementation: admin only\\\");\\n require(implementation_ != address(0), \\\"AccountantDelegator::_setImplementation: invalid implementation address\\\");\\n emit NewImplementation(implementation, implementation_);\\n \\n implementation = implementation_;\\n }\\n\\n function _setPendingAdmin(address newPendingAdmin) override external {\\n require(msg.sender == admin, \\\"AccountantDelegator::admin only\\\");\\n delegateToImplementation(abi.encodeWithSignature(\\\"_setPendingAdmin(address)\\\", newPendingAdmin));\\n }\\n\\n function _acceptAdmin() override external {\\n require(msg.sender == pendingAdmin, \\\"AccountantDelegator::sender not pendingAdmin\\\");\\n delegateToImplementation(abi.encodeWithSignature(\\\"_acceptAdmin()\\\"));\\n }\\n /**\\n * @notice A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\\n * @param amount amount of Note Accountant is supplying to market\\n */\\n function supplyMarket(uint amount ) external override returns(uint) {\\n bytes memory data = delegateToImplementation(abi.encodeWithSignature(\\\"supplyMarket(uint256)\\\", amount));\\n return abi.decode(data, (uint));\\n }\\n\\n /**\\n * @notice A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\\n * @param amount The address of the ERC-20 token to sweep\\n */\\n function redeemMarket(uint amount) external override returns(uint) {\\n bytes memory data = delegateToImplementation(abi.encodeWithSignature(\\\"redeemMarket(uint256)\\\", amount));\\n return abi.decode(data, (uint));\\n }\\n\\n /**\\n * @notice A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\\n */\\n function sweepInterest() external override {\\n delegateToImplementation(abi.encodeWithSignature(\\\"sweepInterest()\\\"));\\n }\\n\\n /**\\n * @notice Internal method to delegate execution to another contract\\n * @dev It returns to the external caller whatever the implementation returns or forwards reverts\\n * @param callee The contract to delegatecall\\n * @param data The raw data to delegatecall\\n */\\n function delegateTo(address callee, bytes memory data) internal returns(bytes memory) {\\n (bool success, bytes memory returnData) = callee.delegatecall(data);\\n assembly {\\n if eq(success, 0) {\\n revert(add(returnData, 0x20), returndatasize())\\n }\\n }\\n return returnData;\\n }\\n\\n /**\\n * @notice Delegates execution to the implementation contract\\n * @dev It returns to the external caller whatever the implementation returns or forwards reverts\\n * @param data The raw data to delegatecall\\n * @return The returned bytes from the delegatecall\\n */\\n function delegateToImplementation(bytes memory data) public returns (bytes memory) {\\n return delegateTo(implementation, data);\\n }\\n\\n /**\\n * @notice Delegates execution to an implementation contract\\n * @dev It returns to the external caller whatever the implementation returns or forwards reverts\\n * There are an additional 2 prefix uints from the wrapper returndata, which we ignore since we make an extra hop.\\n * @param data The raw data to delegatecall\\n * @return The returned bytes from the delegatecall\\n */\\n function delegateToViewImplementation(bytes memory data) public view returns (bytes memory) {\\n (bool success, bytes memory returnData) = address(this).staticcall(abi.encodeWithSignature(\\\"delegateToImplementation(bytes)\\\", data));\\n assembly {\\n if eq(success, 0) {\\n revert(add(returnData, 0x20), returndatasize())\\n }\\n }\\n return abi.decode(returnData, (bytes));\\n }\\n\\n\\n /**\\n * @notice Delegates execution to an implementation contract\\n * @dev It returns to the external caller whatever the implementation returns or forwards reverts\\n */\\n fallback () external payable {\\n require(msg.value == 0,\\\"AccountantDelegator:fallback: cannot send value to fallback\\\");\\n\\n (bool success, ) = implementation.delegatecall(msg.data); // delegate all other functions to current implementation\\n\\n assembly {\\n let free_mem_ptr := mload(0x40)\\n returndatacopy(free_mem_ptr, 0, returndatasize())\\n\\n switch success\\n case 0 { revert(free_mem_ptr, returndatasize()) }\\n default { return(free_mem_ptr, returndatasize()) }\\n }\\n }\\n}\",\"keccak256\":\"0x719fc860f3c55ebfd78dc2fe7ad0ac530edd73bc6d79c379e16b3bb5ebdf447b\"},\"src/Accountant/AccountantInterfaces.sol\":{\"content\":\"pragma solidity ^0.8.10;\\nimport \\\"../Note.sol\\\";\\nimport \\\"../CNote.sol\\\";\\nimport \\\"../ComptrollerInterface.sol\\\";\\n\\n\\ncontract AccountantErrors {\\n error SenderNotAdmin(address sender); //emitted in admin only methods \\n error SenderNotCNote(address sender); // emitted in CNote only events\\n error InvalidAddress(address addr);\\n error ErrorMarketEntering(uint errCode);\\n error AccountantInitializedAgain();\\n}\\n\\n\\ncontract AccountantDelegatorStorage {\\n address public pendingAdmin;\\n address public admin; // admin address (Timelock)\\n address public implementation; // implementation address\\n\\n}\\n\\ncontract AccountantStorageV1 is AccountantDelegatorStorage{\\n event AcctInit(address lendingMarketAddress);\\n\\tevent AcctSupplied(uint amount, uint err);\\n event AcctRedeemed(uint amount);\\n event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\\n event NewAdmin(address oldAdmin, address admin);\\n\\n error SweepError(address treasury, uint amount); \\n\\n Note public note; // note address\\n CNote public cnote; // lending market address\\n ComptrollerInterface public comptroller; // comptroller address\\n address public treasury; // treasury address\\n}\\n\\nabstract contract AccountantDelegatorInterface {\\n event NewImplementation(address oldImplementation, address newImplementation);\\n function setImplementation(address implementation_) public virtual;\\n}\\n\\nabstract contract AccountantInterface is AccountantStorageV1 {\\n function _setPendingAdmin(address newPendingAdmin) external virtual;\\n function _acceptAdmin() external virtual;\\n function supplyMarket(uint amount) external virtual returns(uint);\\n function redeemMarket(uint amount) external virtual returns(uint);\\n function sweepInterest() external virtual;\\n}\",\"keccak256\":\"0x0d8ae34ccffbf6ec82c97068bf61507c41059f9d9d43f528b8d2435d11d50ae8\"},\"src/CErc20.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./CToken.sol\\\";\\n\\ninterface CompLike {\\n function delegate(address delegatee) external;\\n}\\n\\n/**\\n * @title Compound's CErc20 Contract\\n * @notice CTokens which wrap an EIP-20 underlying\\n * @author Compound\\n */\\ncontract CErc20 is CToken, CErc20Interface {\\n /**\\n * @notice Initialize the new money market\\n * @param underlying_ The address of the underlying asset\\n * @param comptroller_ The address of the Comptroller\\n * @param interestRateModel_ The address of the interest rate model\\n * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18\\n * @param name_ ERC-20 name of this token\\n * @param symbol_ ERC-20 symbol of this token\\n * @param decimals_ ERC-20 decimal precision of this token\\n */\\n function initialize(address underlying_,\\n ComptrollerInterface comptroller_,\\n InterestRateModel interestRateModel_,\\n uint initialExchangeRateMantissa_,\\n string memory name_,\\n string memory symbol_,\\n uint8 decimals_\\n ) public {\\n\\n // CToken initialize does the bulk of the work\\n super.initialize(comptroller_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_);\\n\\n // Set underlying and sanity check it\\n underlying = underlying_;\\n EIP20Interface(underlying).totalSupply();\\n }\\n\\n /*** User Interface ***/\\n\\n /**\\n * @notice Sender supplies assets into the market and receives cTokens in exchange\\n * @dev Accrues interest whether or not the operation succeeds, unless reverted\\n * @param mintAmount The amount of the underlying asset to supply\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function mint(uint mintAmount) override external returns (uint) {\\n mintInternal(mintAmount);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sender redeems cTokens in exchange for the underlying asset\\n * @dev Accrues interest whether or not the operation succeeds, unless reverted\\n * @param redeemTokens The number of cTokens to redeem into underlying\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function redeem(uint redeemTokens) override external returns (uint) {\\n redeemInternal(redeemTokens);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sender redeems cTokens in exchange for a specified amount of underlying asset\\n * @dev Accrues interest whether or not the operation succeeds, unless reverted\\n * @param redeemAmount The amount of underlying to redeem\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function redeemUnderlying(uint redeemAmount) override external returns (uint) {\\n redeemUnderlyingInternal(redeemAmount);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sender borrows assets from the protocol to their own address\\n * @param borrowAmount The amount of the underlying asset to borrow\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function borrow(uint borrowAmount) override external returns (uint) {\\n borrowInternal(borrowAmount);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sender repays their own borrow\\n * @param repayAmount The amount to repay, or -1 for the full outstanding amount\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function repayBorrow(uint repayAmount) override external returns (uint) {\\n repayBorrowInternal(repayAmount);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sender repays a borrow belonging to borrower\\n * @param borrower the account with the debt being payed off\\n * @param repayAmount The amount to repay, or -1 for the full outstanding amount\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function repayBorrowBehalf(address borrower, uint repayAmount) override external returns (uint) {\\n repayBorrowBehalfInternal(borrower, repayAmount);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice The sender liquidates the borrowers collateral.\\n * The collateral seized is transferred to the liquidator.\\n * @param borrower The borrower of this cToken to be liquidated\\n * @param repayAmount The amount of the underlying borrowed asset to repay\\n * @param cTokenCollateral The market in which to seize collateral from the borrower\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function liquidateBorrow(address borrower, uint repayAmount, CTokenInterface cTokenCollateral) override external returns (uint) {\\n liquidateBorrowInternal(borrower, repayAmount, cTokenCollateral);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)\\n * @param token The address of the ERC-20 token to sweep\\n */\\n function sweepToken(EIP20NonStandardInterface token) override external {\\n require(msg.sender == admin, \\\"CErc20::sweepToken: only admin can sweep tokens\\\");\\n require(address(token) != underlying, \\\"CErc20::sweepToken: can not sweep underlying token\\\");\\n uint256 balance = token.balanceOf(address(this));\\n token.transfer(admin, balance);\\n }\\n\\n /**\\n * @notice The sender adds to reserves.\\n * @param addAmount The amount fo underlying token to add as reserves\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _addReserves(uint addAmount) override external returns (uint) {\\n return _addReservesInternal(addAmount);\\n }\\n\\n /*** Safe Token ***/\\n\\n /**\\n * @notice Gets balance of this contract in terms of the underlying\\n * @dev This excludes the value of the current message, if any\\n * @return The quantity of underlying tokens owned by this contract\\n */\\n function getCashPrior() virtual override internal view returns (uint) {\\n EIP20Interface token = EIP20Interface(underlying);\\n return token.balanceOf(address(this));\\n }\\n\\n /**\\n * @dev Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case.\\n * This will revert due to insufficient balance or insufficient allowance.\\n * This function returns the actual amount received,\\n * which may be less than `amount` if there is a fee attached to the transfer.\\n *\\n * Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value.\\n * See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca\\n */\\n function doTransferIn(address from, uint amount) virtual override internal returns (uint) {\\n // Read from storage once\\n address underlying_ = underlying;\\n EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying_);\\n uint balanceBefore = EIP20Interface(underlying_).balanceOf(address(this));\\n token.transferFrom(from, address(this), amount);\\n\\n bool success;\\n assembly {\\n switch returndatasize()\\n case 0 { // This is a non-standard ERC-20\\n success := not(0) // set success to true\\n }\\n case 32 { // This is a compliant ERC-20\\n returndatacopy(0, 0, 32)\\n success := mload(0) // Set `success = returndata` of override external call\\n }\\n default { // This is an excessively non-compliant ERC-20, revert.\\n revert(0, 0)\\n }\\n }\\n require(success, \\\"TOKEN_TRANSFER_IN_FAILED\\\");\\n\\n // Calculate the amount that was *actually* transferred\\n uint balanceAfter = EIP20Interface(underlying_).balanceOf(address(this));\\n return balanceAfter - balanceBefore; // underflow already checked above, just subtract\\n }\\n\\n /**\\n * @dev Similar to EIP20 transfer, except it handles a False success from `transfer` and returns an explanatory\\n * error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to\\n * insufficient cash held in this contract. If caller has checked protocol's balance prior to this call, and verified\\n * it is >= amount, this should not revert in normal conditions.\\n *\\n * Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value.\\n * See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca\\n */\\n function doTransferOut(address payable to, uint amount) virtual override internal {\\n EIP20NonStandardInterface token = EIP20NonStandardInterface(underlying);\\n token.transfer(to, amount);\\n\\n bool success;\\n assembly {\\n switch returndatasize()\\n case 0 { // This is a non-standard ERC-20\\n success := not(0) // set success to true\\n }\\n case 32 { // This is a compliant ERC-20\\n returndatacopy(0, 0, 32)\\n success := mload(0) // Set `success = returndata` of override external call\\n }\\n default { // This is an excessively non-compliant ERC-20, revert.\\n revert(0, 0)\\n }\\n }\\n require(success, \\\"TOKEN_TRANSFER_OUT_FAILED\\\");\\n }\\n\\n /**\\n * @notice Admin call to delegate the votes of the COMP-like underlying\\n * @param compLikeDelegatee The address to delegate votes to\\n * @dev CTokens whose underlying are not CompLike should revert here\\n */\\n function _delegateCompLikeTo(address compLikeDelegatee) external {\\n require(msg.sender == admin, \\\"only the admin may set the comp-like delegate\\\");\\n CompLike(underlying).delegate(compLikeDelegatee);\\n }\\n}\\n\",\"keccak256\":\"0x2ad70a2023585c7d12e88907cbb5ea7db9b9465f31f238f0839e8c9ba5eabb3a\",\"license\":\"BSD-3-Clause\"},\"src/CErc20Delegate.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./CErc20.sol\\\";\\n\\n/**\\n * @title Compound's CErc20Delegate Contract\\n * @notice CTokens which wrap an EIP-20 underlying and are delegated to\\n * @author Compound\\n */\\ncontract CErc20Delegate is CErc20, CDelegateInterface {\\n /**\\n * @notice Construct an empty delegate\\n */\\n constructor() {}\\n\\n /**\\n * @notice Called by the delegator on a delegate to initialize it for duty\\n * @param data The encoded bytes data for any initialization\\n */\\n function _becomeImplementation(bytes memory data) virtual override public {\\n // Shh -- currently unused\\n data;\\n\\n // Shh -- we don't ever want this hook to be marked pure\\n if (false) {\\n implementation = address(0);\\n }\\n\\n require(msg.sender == admin, \\\"only the admin may call _becomeImplementation\\\");\\n }\\n\\n /**\\n * @notice Called by the delegator on a delegate to forfeit its responsibility\\n */\\n function _resignImplementation() virtual override public {\\n // Shh -- we don't ever want this hook to be marked pure\\n if (false) {\\n implementation = address(0);\\n }\\n\\n require(msg.sender == admin, \\\"only the admin may call _resignImplementation\\\");\\n }\\n}\\n\",\"keccak256\":\"0xacfa60fb19f923ccd8530868d53853fa181fc27ff0c4fc6afc4633c7453172a2\",\"license\":\"BSD-3-Clause\"},\"src/CNote.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"./CErc20Delegate.sol\\\";\\nimport \\\"./Accountant/AccountantInterfaces.sol\\\";\\nimport \\\"./Treasury/TreasuryInterfaces.sol\\\";\\nimport \\\"./ErrorReporter.sol\\\";\\nimport \\\"./NoteInterest.sol\\\";\\n\\ncontract CNote is CErc20Delegate {\\n event AccountantSet(address accountant, address accountantPrior);\\n error FailedTransfer(uint256 amount);\\n\\n AccountantInterface public _accountant; // accountant private _accountant = Accountant(address(0));\\n\\n function setAccountantContract(address accountant_) public {\\n require(\\n msg.sender == admin,\\n \\\"CNote::_setAccountantContract:Only admin may call this function\\\"\\n );\\n\\n emit AccountantSet(accountant_, address(_accountant));\\n _accountant = AccountantInterface(accountant_);\\n }\\n\\n /**\\n * @dev return the current address of the Accounant\\n */\\n function getAccountant() external view returns (address) {\\n return address(_accountant);\\n }\\n\\n /**\\n * @dev getCashPrior retrieves balance of the accountant (not cNote contract)\\n */\\n function getCashPrior() internal view virtual override returns (uint256) {\\n EIP20Interface token = EIP20Interface(underlying);\\n return token.balanceOf(address(_accountant));\\n }\\n\\n function accrueInterest() public virtual override returns (uint256) {\\n NoteRateModel(address(interestRateModel)).updateBaseRate(); //update the baseRate of Note\\n return super.accrueInterest();\\n }\\n\\n /**\\n * @notice Calculates the exchange rate from Note to cNote\\n * @dev This function does not accrue efore calculating the exchange rate\\n * @return calculated exchange rate scaled by 1e18\\n */\\n function exchangeRateStoredInternal()\\n internal\\n view\\n virtual\\n override\\n returns (uint256)\\n {\\n uint256 _totalSupply = totalSupply;\\n if (_totalSupply == 0) {\\n /*\\n * If there are no tokens minted:\\n * exchangeRate = initialExchangeRate\\n */\\n return initialExchangeRateMantissa;\\n } else {\\n /*\\n * Otherwise:\\n * exchangeRate = (totalCash + totalBorrows - totalReserves) / totalSupply\\n */\\n uint256 cashPlusBorrowsMinusReserves = totalBorrows - totalReserves; // totalCash in cNote Lending Market is zero, thus it is not factored into the exchangeRate\\n uint256 exchangeRate = (cashPlusBorrowsMinusReserves * expScale) /\\n _totalSupply;\\n\\n return exchangeRate;\\n }\\n }\\n\\n /**\\n * @dev Similar to EIP20 transfer, except it handles a False result from `transferFrom` and reverts in that case.\\n * This will revert due to insufficient balance or insufficient allowance.\\n * This function returns the actual amount received,\\n * which may be less than `amount` if there is a fee attached to the transfer.\\n *\\n * Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value.\\n * See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca\\n */\\n function doTransferIn(address from, uint256 amount)\\n internal\\n virtual\\n override\\n returns (uint256)\\n {\\n require(address(_accountant) != address(0)); //check that the accountant has been set\\n\\n EIP20Interface token = EIP20Interface(underlying);\\n token.transferFrom(from, address(this), amount); //allowance set before\\n\\n //revert if transfer fails\\n bool success;\\n assembly {\\n switch returndatasize()\\n case 0 {\\n // This is a non-standard ERC-20\\n success := not(0) // set success to true\\n }\\n case 32 {\\n // This is a compliant ERC-20\\n returndatacopy(0, 0, 32)\\n success := mload(0) // Set `success = returndata` of override external call\\n }\\n default {\\n // This is an excessively non-compliant ERC-20, revert.\\n revert(0, 0)\\n }\\n }\\n require(success, \\\"CNote::TOKEN_TRANSFER_IN_FAILED\\\");\\n\\n uint256 balanceAfter = token.balanceOf(address(this)); // Calculate the amount that was *actually* transferred\\n\\n if (from != address(_accountant)) {\\n uint256 err = _accountant.redeemMarket(balanceAfter); //Whatever is transferred into cNote is then redeemed by the accountant\\n if (err != 0) {\\n revert AccountantSupplyError(balanceAfter);\\n }\\n }\\n\\n return balanceAfter; // underflow already checked above, just subtract\\n }\\n\\n /**\\n * @dev Similar to EIP20 transfer, except it handles a False success from `transfer` and returns an explanatory\\n * error code rather than reverting. If caller has not called checked protocol's balance, this may revert due to\\n * insufficient cash held in this contract. If caller has checked protocol's balance prior to this call, and verified\\n * it is >= amount, this should not revert in normal conditions.\\n *\\n * Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value.\\n * See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca\\n */\\n function doTransferOut(address payable to, uint256 amount)\\n internal\\n virtual\\n override\\n {\\n require(address(_accountant) != address(0)); //check that the accountant has been set\\n EIP20Interface token = EIP20Interface(underlying);\\n\\n if (to != address(_accountant)) {\\n uint256 err = _accountant.supplyMarket(amount); //Accountant redeems requisite cNote to supply this market\\n if (err != 0) {\\n revert AccountantRedeemError(amount);\\n }\\n }\\n\\n token.transfer(to, amount);\\n\\n bool success;\\n assembly {\\n switch returndatasize()\\n case 0 {\\n // This is a non-standard ERC-20\\n success := not(0) // set success to true\\n }\\n case 32 {\\n // This is a compliant ERC-20\\n returndatacopy(0, 0, 32)\\n success := mload(0) // Set `success = returndata` of override external call\\n }\\n default {\\n // This is an excessively non-compliant ERC-20, revert.\\n revert(0, 0)\\n }\\n }\\n require(success, \\\"TOKEN_TRANSFER_OUT_FAILED\\\");\\n }\\n\\n /**\\n * @notice Users borrow assets from the protocol to their own address\\n * @param borrowAmount The amount of the underlying asset to borrow\\n */\\n function borrowFresh(address payable borrower, uint256 borrowAmount)\\n internal\\n override\\n {\\n /* Fail if borrow not allowed */\\n uint256 allowed = comptroller.borrowAllowed(\\n address(this),\\n borrower,\\n borrowAmount\\n );\\n if (allowed != 0) {\\n revert BorrowComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert BorrowFreshnessCheck();\\n }\\n\\n /* Fail gracefully if protocol has insufficient underlying cash */\\n if (getCashPrior() < borrowAmount) {\\n revert BorrowCashNotAvailable();\\n }\\n\\n /*\\n * We calculate the new borrower and total borrow balances, failing on overflow:\\n * accountBorrowNew = accountBorrow + borrowAmount\\n * totalBorrowsNew = totalBorrows + borrowAmount\\n */\\n uint256 accountBorrowsPrev = borrowBalanceStoredInternal(borrower);\\n uint256 accountBorrowsNew = accountBorrowsPrev + borrowAmount;\\n uint256 totalBorrowsNew = totalBorrows + borrowAmount;\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /*\\n * We invoke doTransferOut for the borrower and the borrowAmount.\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * On success, the cToken borrowAmount less of cash.\\n * doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n */\\n doTransferOut(borrower, borrowAmount);\\n\\n /*\\n * We write the previously calculated values into storage.\\n * These values must be updated after the accountant has received cTokens at the previous exchangeRate (without totalBorrows being updated)\\n `*/\\n accountBorrows[borrower].principal = accountBorrowsNew;\\n accountBorrows[borrower].interestIndex = borrowIndex;\\n totalBorrows = totalBorrowsNew;\\n\\n /* We emit a Borrow event */\\n emit Borrow(borrower, borrowAmount, accountBorrowsNew, totalBorrowsNew);\\n }\\n\\n /**\\n * @notice User redeems cTokens in exchange for the underlying asset\\n * @dev Assumes interest has already been accrued up to the current block\\n * @param redeemer The address of the account which is redeeming the tokens\\n * @param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\\n * @param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)\\n */\\n function redeemFresh(\\n address payable redeemer,\\n uint256 redeemTokensIn,\\n uint256 redeemAmountIn\\n ) internal override {\\n require(\\n redeemTokensIn == 0 || redeemAmountIn == 0,\\n \\\"one of redeemTokensIn or redeemAmountIn must be zero\\\"\\n );\\n /* exchangeRate = invoke Exchange Rate Stored() */\\n Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\\n uint256 redeemTokens;\\n uint256 redeemAmount;\\n /* If redeemTokensIn > 0: */\\n if (redeemTokensIn > 0) {\\n /*\\n * We calculate the exchange rate and the amount of underlying to be redeemed:\\n * redeemTokens = redeemTokensIn\\n * redeemAmount = redeemTokensIn x exchangeRateCurrent\\n */\\n redeemTokens = redeemTokensIn;\\n redeemAmount = mul_ScalarTruncate(exchangeRate, redeemTokensIn);\\n } else {\\n /*\\n * We get the current exchange rate and calculate the amount to be redeemed:\\n * redeemTokens = redeemAmountIn / exchangeRate\\n * redeemAmount = redeemAmountIn\\n */\\n redeemTokens = div_(redeemAmountIn, exchangeRate);\\n redeemAmount = redeemAmountIn;\\n }\\n\\n /* Fail if redeem not allowed */\\n uint256 allowed = comptroller.redeemAllowed(\\n address(this),\\n redeemer,\\n redeemTokens\\n );\\n if (allowed != 0) {\\n revert RedeemComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert RedeemFreshnessCheck();\\n }\\n\\n /* Fail gracefully if protocol has insufficient cash */\\n if (getCashPrior() < redeemAmount) {\\n revert RedeemTransferOutNotPossible();\\n }\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n /*\\n * We invoke doTransferOut for the redeemer and the redeemAmount.\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * On success, the cToken has redeemAmount less of cash.\\n * doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n * accountant supplies market and receives cTokens at current exchange Rate\\n */\\n doTransferOut(redeemer, redeemAmount);\\n\\n /*\\n * We write the previously calculated values into storage.\\n * totalSupply is updated after the accountant has supplied enough tokens for the transfer, and has received cTokens at the prior exchange Rate (without totalSupply being updated)\\n */\\n totalSupply = totalSupply - redeemTokens;\\n accountTokens[redeemer] = accountTokens[redeemer] - redeemTokens;\\n\\n /* We emit a Transfer event, and a Redeem event */\\n emit Transfer(redeemer, address(this), redeemTokens);\\n emit Redeem(redeemer, redeemAmount, redeemTokens);\\n\\n /* We call the defense hook */\\n comptroller.redeemVerify(\\n address(this),\\n redeemer,\\n redeemAmount,\\n redeemTokens\\n );\\n }\\n\\n /*** Reentrancy Guard ***/\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n */\\n modifier nonReentrant() override {\\n if (msg.sender != address(_accountant)) {\\n require(_notEntered, \\\"re-entered\\\"); //this is required as the Accountant must redeem / mint before users are able to borrow / repayBorrow\\n }\\n _notEntered = false;\\n _;\\n _notEntered = true; // get a gas-refund post-Istanbul\\n }\\n}\\n\",\"keccak256\":\"0x6f63be909e911993a107d397b8d8e6a8a74132bfcd275bea461ea86e4beeb0e0\"},\"src/CToken.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./ComptrollerInterface.sol\\\";\\nimport \\\"./CTokenInterfaces.sol\\\";\\nimport \\\"./ErrorReporter.sol\\\";\\nimport \\\"./EIP20Interface.sol\\\";\\nimport \\\"./InterestRateModel.sol\\\";\\nimport \\\"./ExponentialNoError.sol\\\";\\n\\n/**\\n * @title Compound's CToken Contract\\n * @notice Abstract base for CTokens\\n * @author Compound\\n */\\nabstract contract CToken is CTokenInterface, ExponentialNoError, TokenErrorReporter {\\n /**\\n * @notice Initialize the money market\\n * @param comptroller_ The address of the Comptroller\\n * @param interestRateModel_ The address of the interest rate model\\n * @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18\\n * @param name_ EIP-20 name of this token\\n * @param symbol_ EIP-20 symbol of this token\\n * @param decimals_ EIP-20 decimal precision of this token\\n */\\n function initialize(ComptrollerInterface comptroller_,\\n InterestRateModel interestRateModel_,\\n uint initialExchangeRateMantissa_,\\n string memory name_,\\n string memory symbol_,\\n uint8 decimals_\\n ) public {\\n require(msg.sender == admin, \\\"only admin may initialize the market\\\");\\n require(accrualBlockNumber == 0 && borrowIndex == 0, \\\"market may only be initialized once\\\");\\n // Set initial exchange rate\\n initialExchangeRateMantissa = initialExchangeRateMantissa_;\\n require(initialExchangeRateMantissa > 0, \\\"initial exchange rate must be greater than zero.\\\");\\n\\n // Set the comptroller\\n uint err = _setComptroller(comptroller_);\\n require(err == NO_ERROR, \\\"setting comptroller failed\\\");\\n\\n // Initialize block number and borrow index (block number mocks depend on comptroller being set)\\n accrualBlockNumber = getBlockNumber();\\n borrowIndex = mantissaOne;\\n\\n // Set the interest rate model (depends on block number / borrow index)\\n err = _setInterestRateModelFresh(interestRateModel_);\\n require(err == NO_ERROR, \\\"setting interest rate model failed\\\");\\n\\n name = name_; \\n symbol = symbol_;\\n decimals = decimals_;\\n\\n // The counter starts true to prevent changing it from zero to non-zero (i.e. smaller cost/refund)\\n _notEntered = true;\\n }\\n\\n /**\\n * @notice Transfer `tokens` tokens from `src` to `dst` by `spender`\\n * @dev Called by both `transfer` and `transferFrom` internally\\n * @param spender The address of the account performing the transfer\\n * @param src The address of the source account\\n * @param dst The address of the destination account\\n * @param tokens The number of tokens to transfer\\n * @return 0 if the transfer succeeded, else revert\\n */\\n function transferTokens(address spender, address src, address dst, uint tokens) internal returns (uint) {\\n /* Fail if transfer not allowed */\\n uint allowed = comptroller.transferAllowed(address(this), src, dst, tokens);\\n if (allowed != 0) {\\n revert TransferComptrollerRejection(allowed);\\n }\\n\\n /* Do not allow self-transfers */\\n if (src == dst) {\\n revert TransferNotAllowed();\\n }\\n\\n /* Get the allowance, infinite for the account owner */\\n uint startingAllowance = 0;\\n if (spender == src) {\\n startingAllowance = type(uint).max;\\n } else {\\n startingAllowance = transferAllowances[src][spender];\\n }\\n\\n /* Do the calculations, checking for {under,over}flow */\\n uint allowanceNew = startingAllowance - tokens;\\n uint srcTokensNew = accountTokens[src] - tokens;\\n uint dstTokensNew = accountTokens[dst] + tokens;\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n accountTokens[src] = srcTokensNew;\\n accountTokens[dst] = dstTokensNew;\\n\\n /* Eat some of the allowance (if necessary) */\\n if (startingAllowance != type(uint).max) {\\n transferAllowances[src][spender] = allowanceNew;\\n }\\n\\n /* We emit a Transfer event */\\n emit Transfer(src, dst, tokens);\\n\\n // unused function\\n // comptroller.transferVerify(address(this), src, dst, tokens);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Transfer `amount` tokens from `msg.sender` to `dst`\\n * @param dst The address of the destination account\\n * @param amount The number of tokens to transfer\\n * @return Whether or not the transfer succeeded\\n */\\n function transfer(address dst, uint256 amount) override external nonReentrant returns (bool) {\\n return transferTokens(msg.sender, msg.sender, dst, amount) == NO_ERROR;\\n }\\n\\n /**\\n * @notice Transfer `amount` tokens from `src` to `dst`\\n * @param src The address of the source account\\n * @param dst The address of the destination account\\n * @param amount The number of tokens to transfer\\n * @return Whether or not the transfer succeeded\\n */\\n function transferFrom(address src, address dst, uint256 amount) override external nonReentrant returns (bool) {\\n return transferTokens(msg.sender, src, dst, amount) == NO_ERROR;\\n }\\n\\n /**\\n * @notice Approve `spender` to transfer up to `amount` from `src`\\n * @dev This will overwrite the approval amount for `spender`\\n * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)\\n * @param spender The address of the account which may transfer tokens\\n * @param amount The number of tokens that are approved (uint256.max means infinite)\\n * @return Whether or not the approval succeeded\\n */\\n function approve(address spender, uint256 amount) override external returns (bool) {\\n address src = msg.sender;\\n transferAllowances[src][spender] = amount;\\n emit Approval(src, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @notice Get the current allowance from `owner` for `spender`\\n * @param owner The address of the account which owns the tokens to be spent\\n * @param spender The address of the account which may transfer tokens\\n * @return The number of tokens allowed to be spent (-1 means infinite)\\n */\\n function allowance(address owner, address spender) override external view returns (uint256) {\\n return transferAllowances[owner][spender];\\n }\\n\\n /**\\n * @notice Get the token balance of the `owner`\\n * @param owner The address of the account to query\\n * @return The number of tokens owned by `owner`\\n */\\n function balanceOf(address owner) override external view returns (uint256) {\\n return accountTokens[owner];\\n }\\n\\n /**\\n * @notice Get the underlying balance of the `owner`\\n * @dev This also accrues interest in a transaction\\n * @param owner The address of the account to query\\n * @return The amount of underlying owned by `owner`\\n */\\n function balanceOfUnderlying(address owner) override external returns (uint) {\\n Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});\\n return mul_ScalarTruncate(exchangeRate, accountTokens[owner]);\\n }\\n\\n /**\\n * @notice Get a snapshot of the account's balances, and the cached exchange rate\\n * @dev This is used by comptroller to more efficiently perform liquidity checks.\\n * @param account Address of the account to snapshot\\n * @return (possible error, token balance, borrow balance, exchange rate mantissa)\\n */\\n function getAccountSnapshot(address account) override external view returns (uint, uint, uint, uint) {\\n return (\\n NO_ERROR,\\n accountTokens[account],\\n borrowBalanceStoredInternal(account),\\n exchangeRateStoredInternal()\\n );\\n }\\n\\n /**\\n * @dev Function to simply retrieve block number\\n * This exists mainly for inheriting test contracts to stub this result.\\n */\\n function getBlockNumber() virtual internal view returns (uint) {\\n return block.number;\\n }\\n\\n /**\\n * @notice Returns the current per-block borrow interest rate for this cToken\\n * @return The borrow interest rate per block, scaled by 1e18\\n */\\n function borrowRatePerBlock() override view external returns (uint) {\\n return interestRateModel.getBorrowRate(getCashPrior(), totalBorrows, totalReserves);\\n }\\n\\n /**\\n * @notice Returns the current per-block supply interest rate for this cToken\\n * @return The supply interest rate per block, scaled by 1e18\\n */\\n function supplyRatePerBlock() override view external returns (uint) {\\n return interestRateModel.getSupplyRate(getCashPrior(), totalBorrows, totalReserves, reserveFactorMantissa);\\n }\\n\\n /**\\n * @notice Returns the current total borrows plus accrued interest\\n * @return The total borrows with interest\\n */\\n function totalBorrowsCurrent() override external nonReentrant returns (uint) {\\n accrueInterest();\\n return totalBorrows;\\n }\\n\\n /**\\n * @notice Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex\\n * @param account The address whose balance should be calculated after updating borrowIndex\\n * @return The calculated balance\\n */\\n function borrowBalanceCurrent(address account) override external nonReentrant returns (uint) {\\n accrueInterest();\\n return borrowBalanceStored(account);\\n }\\n\\n /**\\n * @notice Return the borrow balance of account based on stored data\\n * @param account The address whose balance should be calculated\\n * @return The calculated balance\\n */\\n function borrowBalanceStored(address account) override public view returns (uint) {\\n return borrowBalanceStoredInternal(account);\\n }\\n\\n /**\\n * @notice Return the borrow balance of account based on stored data\\n * @param account The address whose balance should be calculated\\n * @return (error code, the calculated balance or 0 if error code is non-zero)\\n */\\n function borrowBalanceStoredInternal(address account) internal view returns (uint) {\\n /* Get borrowBalance and borrowIndex */\\n BorrowSnapshot storage borrowSnapshot = accountBorrows[account];\\n\\n /* If borrowBalance = 0 then borrowIndex is likely also 0.\\n * Rather than failing the calculation with a division by 0, we immediately return 0 in this case.\\n */\\n if (borrowSnapshot.principal == 0) {\\n return 0;\\n }\\n\\n /* Calculate new borrow balance using the interest index:\\n * recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex\\n */\\n uint principalTimesIndex = borrowSnapshot.principal * borrowIndex;\\n return principalTimesIndex / borrowSnapshot.interestIndex;\\n }\\n\\n /**\\n * @notice Accrue interest then return the up-to-date exchange rate\\n * @return Calculated exchange rate scaled by 1e18\\n */\\n function exchangeRateCurrent() override public nonReentrant returns (uint) {\\n accrueInterest();\\n return exchangeRateStored();\\n }\\n\\n /**\\n * @notice Calculates the exchange rate from the underlying to the CToken\\n * @dev This function does not accrue interest before calculating the exchange rate\\n * @return Calculated exchange rate scaled by 1e18\\n */\\n function exchangeRateStored() override public view returns (uint) {\\n return exchangeRateStoredInternal();\\n }\\n\\n /**\\n * @notice Calculates the exchange rate from the underlying to the CToken\\n * @dev This function does not accrue efore calculating the exchange rate\\n * @return calculated exchange rate scaled by 1e18\\n */\\n function exchangeRateStoredInternal() virtual internal view returns (uint) {\\n uint _totalSupply = totalSupply;\\n if (_totalSupply == 0) {\\n /*\\n * If there are no tokens minted:\\n * exchangeRate = initialExchangeRate\\n */\\n return initialExchangeRateMantissa;\\n } else {\\n /*\\n * Otherwise:\\n * exchangeRate = (totalCash + totalBorrows - totalReserves) / totalSupply\\n */\\n\\n uint totalCash = getCashPrior();\\n\\n uint cashPlusBorrowsMinusReserves = totalCash + totalBorrows - totalReserves;\\n uint exchangeRate = cashPlusBorrowsMinusReserves * expScale / _totalSupply;\\n\\n return exchangeRate;\\n }\\n }\\n\\n /**\\n * @notice Get cash balance of this cToken in the underlying asset\\n * @return The quantity of underlying asset owned by this contract\\n */\\n function getCash() override external view returns (uint) {\\n return getCashPrior();\\n }\\n\\n /**\\n * @notice Applies accrued interest to total borrows and reserves\\n * @dev This calculates interest accrued from the last checkpointed block\\n * up to the current block and writes new checkpoint to storage.\\n */\\n function accrueInterest() virtual override public returns (uint) {\\n /* Remember the initial block number */\\n uint currentBlockNumber = getBlockNumber();\\n uint accrualBlockNumberPrior = accrualBlockNumber;\\n\\n /* Short-circuit accumulating 0 interest */\\n if (accrualBlockNumberPrior == currentBlockNumber) {\\n return NO_ERROR;\\n }\\n\\n /* Read the previous values out of storage */\\n uint cashPrior = getCashPrior();\\n uint borrowsPrior = totalBorrows;\\n uint reservesPrior = totalReserves;\\n uint borrowIndexPrior = borrowIndex;\\n\\n /* Calculate the current borrow interest rate */\\n uint borrowRateMantissa = interestRateModel.getBorrowRate(cashPrior, borrowsPrior, reservesPrior);\\n\\n require(borrowRateMantissa <= borrowRateMaxMantissa, \\\"borrow rate is absurdly high\\\");\\n\\n /* Calculate the number of blocks elapsed since the last accrual */\\n uint blockDelta = currentBlockNumber - accrualBlockNumberPrior;\\n\\n /*\\n * Calculate the interest accumulated into borrows and reserves and the new index:\\n * simpleInterestFactor = borrowRate * blockDelta\\n * interestAccumulated = simpleInterestFactor * totalBorrows\\n * totalBorrowsNew = interestAccumulated + totalBorrows\\n * totalReservesNew = interestAccumulated * reserveFactor + totalReserves\\n * borrowIndexNew = simpleInterestFactor * borrowIndex + borrowIndex\\n */\\n\\n Exp memory simpleInterestFactor = mul_(Exp({mantissa: borrowRateMantissa}), blockDelta);\\n uint interestAccumulated = mul_ScalarTruncate(simpleInterestFactor, borrowsPrior);\\n uint totalBorrowsNew = interestAccumulated + borrowsPrior;\\n uint totalReservesNew = mul_ScalarTruncateAddUInt(Exp({mantissa: reserveFactorMantissa}), interestAccumulated, reservesPrior);\\n uint borrowIndexNew = mul_ScalarTruncateAddUInt(simpleInterestFactor, borrowIndexPrior, borrowIndexPrior);\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /* We write the previously calculated values into storage */\\n accrualBlockNumber = currentBlockNumber;\\n borrowIndex = borrowIndexNew;\\n totalBorrows = totalBorrowsNew;\\n totalReserves = totalReservesNew;\\n\\n /* We emit an AccrueInterest event */\\n emit AccrueInterest(cashPrior, interestAccumulated, borrowIndexNew, totalBorrowsNew);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sender supplies assets into the market and receives cTokens in exchange\\n * @dev Accrues interest whether or not the operation succeeds, unless reverted\\n * @param mintAmount The amount of the underlying asset to supply\\n */\\n function mintInternal(uint mintAmount) internal nonReentrant {\\n accrueInterest();\\n // mintFresh emits the actual Mint event if successful and logs on errors, so we don't need to\\n mintFresh(msg.sender, mintAmount);\\n }\\n\\n /**\\n * @notice User supplies assets into the market and receives cTokens in exchange\\n * @dev Assumes interest has already been accrued up to the current block\\n * @param minter The address of the account which is supplying the assets\\n * @param mintAmount The amount of the underlying asset to supply\\n */\\n function mintFresh(address minter, uint mintAmount) internal virtual {\\n /* Fail if mint not allowed */\\n uint allowed = comptroller.mintAllowed(address(this), minter, mintAmount);\\n if (allowed != 0) {\\n revert MintComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert MintFreshnessCheck();\\n }\\n\\n Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /*\\n * We call `doTransferIn` for the minter and the mintAmount.\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * `doTransferIn` reverts if anything goes wrong, since we can't be sure if\\n * side-effects occurred. The function returns the amount ac\\n tually transferred,\\n * in case of a fee. On success, the cToken holds an additional `actualMintAmount`\\n * of cash.\\n */\\n uint actualMintAmount = doTransferIn(minter, mintAmount);\\n\\n /*\\n * We get the current exchange rate and calculate the number of cTokens to be minted:\\n * mintTokens = actualMintAmount / exchangeRate\\n */\\n\\n uint mintTokens = div_(actualMintAmount, exchangeRate);\\n /*\\n * We calculate the new total supply of cTokens and minter token balance, checking for overflow:\\n * totalSupplyNew = totalSupply + mintTokens\\n * accountTokensNew = accountTokens[minter] + mintTokens\\n * And write them into storage\\n */\\n totalSupply = totalSupply + mintTokens;\\n accountTokens[minter] = accountTokens[minter] + mintTokens;\\n\\n /* We emit a Mint event, and a Transfer event */\\n emit Mint(minter, actualMintAmount, mintTokens);\\n emit Transfer(address(this), minter, mintTokens);\\n\\n /* We call the defense hook */\\n // unused function\\n // comptroller.mintVerify(address(this), minter, actualMintAmount, mintTokens);\\n }\\n\\n /**\\n * @notice Sender redeems cTokens in exchange for the underlying asset\\n * @dev Accrues interest whether or not the operation succeeds, unless reverted\\n * @param redeemTokens The number of cTokens to redeem into underlying\\n */\\n function redeemInternal(uint redeemTokens) internal nonReentrant {\\n accrueInterest(); \\n // redeemFresh emits redeem-specific logs on errors, so we don't need to\\n redeemFresh(payable(msg.sender), redeemTokens, 0);\\n }\\n\\n /**\\n * @notice Sender redeems cTokens in exchange for a specified amount of underlying asset\\n * @dev Accrues interest whether or not the operation succeeds, unless reverted\\n * @param redeemAmount The amount of underlying to receive from redeeming cTokens\\n */\\n function redeemUnderlyingInternal(uint redeemAmount) internal nonReentrant {\\n accrueInterest();\\n // redeemFresh emits redeem-specific logs on errors, so we don't need to\\n redeemFresh(payable(msg.sender), 0, redeemAmount);\\n }\\n\\n /**\\n * @notice User redeems cTokens in exchange for the underlying asset\\n * @dev Assumes interest has already been accrued up to the current block\\n * @param redeemer The address of the account which is redeeming the tokens\\n * @param redeemTokensIn The number of cTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)\\n * @param redeemAmountIn The number of underlying tokens to receive from redeeming cTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)\\n */\\n function redeemFresh(address payable redeemer, uint redeemTokensIn, uint redeemAmountIn) internal virtual {\\n require(redeemTokensIn == 0 || redeemAmountIn == 0, \\\"one of redeemTokensIn or redeemAmountIn must be zero\\\");\\n /* exchangeRate = invoke Exchange Rate Stored() */\\n Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal() });\\n uint redeemTokens;\\n uint redeemAmount;\\n /* If redeemTokensIn > 0: */\\n if (redeemTokensIn > 0) {\\n /*\\n * We calculate the exchange rate and the amount of underlying to be redeemed:\\n * redeemTokens = redeemTokensIn\\n * redeemAmount = redeemTokensIn x exchangeRateCurrent\\n */\\n redeemTokens = redeemTokensIn;\\n redeemAmount = mul_ScalarTruncate(exchangeRate, redeemTokensIn);\\n } else {\\n /*\\n * We get the current exchange rate and calculate the amount to be redeemed:\\n * redeemTokens = redeemAmountIn / exchangeRate\\n * redeemAmount = redeemAmountIn\\n */\\n redeemTokens = div_(redeemAmountIn, exchangeRate);\\n redeemAmount = redeemAmountIn;\\n }\\n\\n /* Fail if redeem not allowed */\\n uint allowed = comptroller.redeemAllowed(address(this), redeemer, redeemTokens);\\n if (allowed != 0) {\\n revert RedeemComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert RedeemFreshnessCheck();\\n }\\n\\n /* Fail gracefully if protocol has insufficient cash */\\n if (getCashPrior() < redeemAmount) {\\n revert RedeemTransferOutNotPossible();\\n }\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n \\n /*\\n * We write the previously calculated values into storage.\\n * Note: Avoid token reentrancy attacks by writing reduced supply before external transfer.\\n */\\n totalSupply = totalSupply - redeemTokens;\\n accountTokens[redeemer] = accountTokens[redeemer] - redeemTokens;\\n \\n /*\\n * We invoke doTransferOut for the redeemer and the redeemAmount.\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * On success, the cToken has redeemAmount less of cash.\\n * doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n * accountant supplies market and receives cTokens at current exchange Rate \\n */\\n doTransferOut(redeemer, redeemAmount);\\n\\n /* We emit a Transfer event, and a Redeem event */\\n emit Transfer(redeemer, address(this), redeemTokens);\\n emit Redeem(redeemer, redeemAmount, redeemTokens);\\n\\n /* We call the defense hook */\\n comptroller.redeemVerify(address(this), redeemer, redeemAmount, redeemTokens);\\n }\\n\\n /**\\n * @notice Sender borrows assets from the protocol to their own address\\n * @param borrowAmount The amount of the underlying asset to borrow\\n */\\n function borrowInternal(uint borrowAmount) internal nonReentrant {\\n accrueInterest();\\n // borrowFresh emits borrow-specific logs on errors, so we don't need to\\n borrowFresh(payable(msg.sender), borrowAmount);\\n }\\n\\n /**\\n * @notice Users borrow assets from the protocol to their own address\\n * @param borrowAmount The amount of the underlying asset to borrow\\n */\\n function borrowFresh(address payable borrower, uint borrowAmount) internal virtual {\\n /* Fail if borrow not allowed */\\n uint allowed = comptroller.borrowAllowed(address(this), borrower, borrowAmount);\\n if (allowed != 0) {\\n revert BorrowComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert BorrowFreshnessCheck();\\n }\\n\\n /* Fail gracefully if protocol has insufficient underlying cash */\\n if (getCashPrior() < borrowAmount) {\\n revert BorrowCashNotAvailable();\\n }\\n\\n /*\\n * We calculate the new borrower and total borrow balances, failing on overflow:\\n * accountBorrowNew = accountBorrow + borrowAmount\\n * totalBorrowsNew = totalBorrows + borrowAmount\\n */\\n uint accountBorrowsPrev = borrowBalanceStoredInternal(borrower);\\n uint accountBorrowsNew = accountBorrowsPrev + borrowAmount;\\n uint totalBorrowsNew = totalBorrows + borrowAmount;\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /*\\n * We write the previously calculated values into storage.\\n * Note: Avoid token reentrancy attacks by writing increased borrow before external transfer.\\n `*/\\n accountBorrows[borrower].principal = accountBorrowsNew;\\n accountBorrows[borrower].interestIndex = borrowIndex;\\n totalBorrows = totalBorrowsNew;\\n \\n /*\\n * We invoke doTransferOut for the borrower and the borrowAmount.\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * On success, the cToken borrowAmount less of cash.\\n * doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n */\\n doTransferOut(borrower, borrowAmount);\\n\\n /* We emit a Borrow event */\\n emit Borrow(borrower, borrowAmount, accountBorrowsNew, totalBorrowsNew);\\n }\\n\\n /**\\n * @notice Sender repays their own borrow\\n * @param repayAmount The amount to repay, or -1 for the full outstanding amount\\n */\\n function repayBorrowInternal(uint repayAmount) internal nonReentrant {\\n accrueInterest();\\n // repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to\\n repayBorrowFresh(msg.sender, msg.sender, repayAmount);\\n }\\n\\n /**\\n * @notice Sender repays a borrow belonging to borrower\\n * @param borrower the account with the debt being payed off\\n * @param repayAmount The amount to repay, or -1 for the full outstanding amount\\n */\\n function repayBorrowBehalfInternal(address borrower, uint repayAmount) internal nonReentrant {\\n accrueInterest();\\n // repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to\\n repayBorrowFresh(msg.sender, borrower, repayAmount);\\n }\\n\\n /**\\n * @notice Borrows are repaid by another user (possibly the borrower).\\n * @param payer the account paying off the borrow\\n * @param borrower the account with the debt being payed off\\n * @param repayAmount the amount of underlying tokens being returned, or -1 for the full outstanding amount\\n * @return (uint) the actual repayment amount.\\n */\\n function repayBorrowFresh(address payer, address borrower, uint repayAmount) internal virtual returns (uint) {\\n\\n /* Fail if repayBorrow not allowed */\\n uint allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount);\\n if (allowed != 0) {\\n revert RepayBorrowComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert RepayBorrowFreshnessCheck();\\n }\\n\\n /* We fetch the amount the borrower owes, with accumulated interest */\\n uint accountBorrowsPrev = borrowBalanceStoredInternal(borrower);\\n\\n /* If repayAmount == -1, repayAmount = accountBorrows */\\n uint repayAmountFinal = repayAmount == type(uint).max ? accountBorrowsPrev : repayAmount;\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /*\\n * We call doTransferIn for the payer and the repayAmount\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * On success, the cToken holds an additional repayAmount of cash.\\n * doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n * it returns the amount actually transferred, in case of a fee.\\n */\\n uint actualRepayAmount = doTransferIn(payer, repayAmountFinal);\\n\\n /*\\n * We calculate the new borrower and total borrow balances, failing on underflow:\\n * accountBorrowsNew = accountBorrows - actualRepayAmount\\n * totalBorrowsNew = totalBorrows - actualRepayAmount\\n */\\n uint accountBorrowsNew = accountBorrowsPrev - actualRepayAmount;\\n uint totalBorrowsNew = totalBorrows - actualRepayAmount;\\n\\n /* We write the previously calculated values into storage */\\n accountBorrows[borrower].principal = accountBorrowsNew;\\n accountBorrows[borrower].interestIndex = borrowIndex;\\n totalBorrows = totalBorrowsNew;\\n\\n /* We emit a RepayBorrow event */\\n emit RepayBorrow(payer, borrower, actualRepayAmount, accountBorrowsNew, totalBorrowsNew);\\n\\n return actualRepayAmount;\\n }\\n\\n /**\\n * @notice The sender liquidates the borrowers collateral.\\n * The collateral seized is transferred to the liquidator.\\n * @param borrower The borrower of this cToken to be liquidated\\n * @param cTokenCollateral The market in which to seize collateral from the borrower\\n * @param repayAmount The amount of the underlying borrowed asset to repay\\n */\\n function liquidateBorrowInternal(address borrower, uint repayAmount, CTokenInterface cTokenCollateral) internal nonReentrant {\\n accrueInterest();\\n\\n uint error = cTokenCollateral.accrueInterest();\\n if (error != NO_ERROR) {\\n // accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed\\n revert LiquidateAccrueCollateralInterestFailed(error);\\n }\\n\\n // liquidateBorrowFresh emits borrow-specific logs on errors, so we don't need to\\n liquidateBorrowFresh(msg.sender, borrower, repayAmount, cTokenCollateral);\\n }\\n\\n /**\\n * @notice The liquidator liquidates the borrowers collateral.\\n * The collateral seized is transferred to the liquidator.\\n * @param borrower The borrower of this cToken to be liquidated\\n * @param liquidator The address repaying the borrow and seizing collateral\\n * @param cTokenCollateral The market in which to seize collateral from the borrower\\n * @param repayAmount The amount of the underlying borrowed asset to repay\\n */\\n function liquidateBorrowFresh(address liquidator, address borrower, uint repayAmount, CTokenInterface cTokenCollateral) internal {\\n /* Fail if liquidate not allowed */\\n uint allowed = comptroller.liquidateBorrowAllowed(address(this), address(cTokenCollateral), liquidator, borrower, repayAmount);\\n if (allowed != 0) {\\n revert LiquidateComptrollerRejection(allowed);\\n }\\n\\n /* Verify market's block number equals current block number */\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert LiquidateFreshnessCheck();\\n }\\n\\n /* Verify cTokenCollateral market's block number equals current block number */\\n if (cTokenCollateral.accrualBlockNumber() != getBlockNumber()) {\\n revert LiquidateCollateralFreshnessCheck();\\n }\\n\\n /* Fail if borrower = liquidator */\\n if (borrower == liquidator) {\\n revert LiquidateLiquidatorIsBorrower();\\n }\\n\\n /* Fail if repayAmount = 0 */\\n if (repayAmount == 0) {\\n revert LiquidateCloseAmountIsZero();\\n }\\n\\n /* Fail if repayAmount = -1 */\\n if (repayAmount == type(uint).max) {\\n revert LiquidateCloseAmountIsUintMax();\\n }\\n\\n /* Fail if repayBorrow fails */\\n uint actualRepayAmount = repayBorrowFresh(liquidator, borrower, repayAmount);\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /* We calculate the number of collateral tokens that will be seized */\\n (uint amountSeizeError, uint seizeTokens) = comptroller.liquidateCalculateSeizeTokens(address(this), address(cTokenCollateral), actualRepayAmount);\\n require(amountSeizeError == NO_ERROR, \\\"LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED\\\");\\n\\n /* Revert if borrower collateral token balance < seizeTokens */\\n require(cTokenCollateral.balanceOf(borrower) >= seizeTokens, \\\"LIQUIDATE_SEIZE_TOO_MUCH\\\");\\n\\n // If this is also the collateral, run seizeInternal to avoid re-entrancy, otherwise make an external call\\n if (address(cTokenCollateral) == address(this)) {\\n seizeInternal(address(this), liquidator, borrower, seizeTokens);\\n } else {\\n require(cTokenCollateral.seize(liquidator, borrower, seizeTokens) == NO_ERROR, \\\"token seizure failed\\\");\\n }\\n\\n /* We emit a LiquidateBorrow event */\\n emit LiquidateBorrow(liquidator, borrower, actualRepayAmount, address(cTokenCollateral), seizeTokens);\\n }\\n\\n /**\\n * @notice Transfers collateral tokens (this market) to the liquidator.\\n * @dev Will fail unless called by another cToken during the process of liquidation.\\n * Its absolutely critical to use msg.sender as the borrowed cToken and not a parameter.\\n * @param liquidator The account receiving seized collateral\\n * @param borrower The account having collateral seized\\n * @param seizeTokens The number of cTokens to seize\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function seize(address liquidator, address borrower, uint seizeTokens) override external nonReentrant returns (uint) {\\n seizeInternal(msg.sender, liquidator, borrower, seizeTokens);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Transfers collateral tokens (this market) to the liquidator.\\n * @dev Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another CToken.\\n * Its absolutely critical to use msg.sender as the seizer cToken and not a parameter.\\n * @param seizerToken The contract seizing the collateral (i.e. borrowed cToken)\\n * @param liquidator The account receiving seized collateral\\n * @param borrower The account having collateral seized\\n * @param seizeTokens The number of cTokens to seize\\n */\\n function seizeInternal(address seizerToken, address liquidator, address borrower, uint seizeTokens) internal {\\n /* Fail if seize not allowed */\\n uint allowed = comptroller.seizeAllowed(address(this), seizerToken, liquidator, borrower, seizeTokens);\\n if (allowed != 0) {\\n revert LiquidateSeizeComptrollerRejection(allowed);\\n }\\n\\n /* Fail if borrower = liquidator */\\n if (borrower == liquidator) {\\n revert LiquidateSeizeLiquidatorIsBorrower();\\n }\\n\\n /*\\n * We calculate the new borrower and liquidator token balances, failing on underflow/overflow:\\n * borrowerTokensNew = accountTokens[borrower] - seizeTokens\\n * liquidatorTokensNew = accountTokens[liquidator] + seizeTokens\\n */\\n uint protocolSeizeTokens = mul_(seizeTokens, Exp({mantissa: protocolSeizeShareMantissa}));\\n uint liquidatorSeizeTokens = seizeTokens - protocolSeizeTokens;\\n Exp memory exchangeRate = Exp({mantissa: exchangeRateStoredInternal()});\\n uint protocolSeizeAmount = mul_ScalarTruncate(exchangeRate, protocolSeizeTokens);\\n uint totalReservesNew = totalReserves + protocolSeizeAmount;\\n\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /* We write the calculated values into storage */\\n totalReserves = totalReservesNew;\\n totalSupply = totalSupply - protocolSeizeTokens;\\n accountTokens[borrower] = accountTokens[borrower] - seizeTokens;\\n accountTokens[liquidator] = accountTokens[liquidator] + liquidatorSeizeTokens;\\n\\n /* Emit a Transfer event */\\n emit Transfer(borrower, liquidator, liquidatorSeizeTokens);\\n emit Transfer(borrower, address(this), protocolSeizeTokens);\\n emit ReservesAdded(address(this), protocolSeizeAmount, totalReservesNew);\\n }\\n\\n\\n /*** Admin Functions ***/\\n\\n /**\\n * @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\\n * @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\\n * @param newPendingAdmin New pending admin.\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setPendingAdmin(address payable newPendingAdmin) override external returns (uint) {\\n // Check caller = admin\\n if (msg.sender != admin) {\\n revert SetPendingAdminOwnerCheck();\\n }\\n\\n // Save current value, if any, for inclusion in log\\n address oldPendingAdmin = pendingAdmin;\\n\\n // Store pendingAdmin with value newPendingAdmin\\n pendingAdmin = newPendingAdmin;\\n\\n // Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)\\n emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin\\n * @dev Admin function for pending admin to accept role and update admin\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _acceptAdmin() override external returns (uint) {\\n // Check caller is pendingAdmin and pendingAdmin \\u2260 address(0)\\n if (msg.sender != pendingAdmin || msg.sender == address(0)) {\\n revert AcceptAdminPendingAdminCheck();\\n }\\n\\n // Save current values for inclusion in log\\n address oldAdmin = admin;\\n address oldPendingAdmin = pendingAdmin;\\n\\n // Store admin with value pendingAdmin\\n admin = pendingAdmin;\\n\\n // Clear the pending value\\n pendingAdmin = payable(address(0));\\n\\n emit NewAdmin(oldAdmin, admin);\\n emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Sets a new comptroller for the market\\n * @dev Admin function to set a new comptroller\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setComptroller(ComptrollerInterface newComptroller) override public returns (uint) {\\n // Check caller is admin\\n if (msg.sender != admin) {\\n revert SetComptrollerOwnerCheck();\\n }\\n\\n ComptrollerInterface oldComptroller = comptroller;\\n // Ensure invoke comptroller.isComptroller() returns true\\n require(newComptroller.isComptroller(), \\\"marker method returned false\\\");\\n\\n // Set market's comptroller to newComptroller\\n comptroller = newComptroller;\\n\\n // Emit NewComptroller(oldComptroller, newComptroller)\\n emit NewComptroller(oldComptroller, newComptroller);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh\\n * @dev Admin function to accrue interest and set a new reserve factor\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setReserveFactor(uint newReserveFactorMantissa) override external nonReentrant returns (uint) {\\n accrueInterest();\\n // _setReserveFactorFresh emits reserve-factor-specific logs on errors, so we don't need to.\\n return _setReserveFactorFresh(newReserveFactorMantissa);\\n }\\n\\n /**\\n * @notice Sets a new reserve factor for the protocol (*requires fresh interest accrual)\\n * @dev Admin function to set a new reserve factor\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setReserveFactorFresh(uint newReserveFactorMantissa) internal returns (uint) {\\n // Check caller is admin\\n if (msg.sender != admin) {\\n revert SetReserveFactorAdminCheck();\\n }\\n\\n // Verify market's block number equals current block number\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert SetReserveFactorFreshCheck();\\n }\\n\\n // Check newReserveFactor \\u2264 maxReserveFactor\\n if (newReserveFactorMantissa > reserveFactorMaxMantissa) {\\n revert SetReserveFactorBoundsCheck();\\n }\\n\\n uint oldReserveFactorMantissa = reserveFactorMantissa;\\n reserveFactorMantissa = newReserveFactorMantissa;\\n\\n emit NewReserveFactor(oldReserveFactorMantissa, newReserveFactorMantissa);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Accrues interest and reduces reserves by transferring from msg.sender\\n * @param addAmount Amount of addition to reserves\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _addReservesInternal(uint addAmount) internal nonReentrant returns (uint) {\\n accrueInterest();\\n\\n // _addReservesFresh emits reserve-addition-specific logs on errors, so we don't need to.\\n _addReservesFresh(addAmount);\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice Add reserves by transferring from caller\\n * @dev Requires fresh interest accrual\\n * @param addAmount Amount of addition to reserves\\n * @return (uint, uint) An error code (0=success, otherwise a failure (see ErrorReporter.sol for details)) and the actual amount added, net token fees\\n */\\n function _addReservesFresh(uint addAmount) internal returns (uint, uint) {\\n // totalReserves + actualAddAmount\\n uint totalReservesNew;\\n uint actualAddAmount;\\n\\n // We fail gracefully unless market's block number equals current block number\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert AddReservesFactorFreshCheck(actualAddAmount);\\n }\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n /*\\n * We call doTransferIn for the caller and the addAmount\\n * Note: The cToken must handle variations between ERC-20 and ETH underlying.\\n * On success, the cToken holds an additional addAmount of cash.\\n * doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n * it returns the amount actually transferred, in case of a fee.\\n */\\n\\n actualAddAmount = doTransferIn(msg.sender, addAmount);\\n\\n totalReservesNew = totalReserves + actualAddAmount;\\n\\n // Store reserves[n+1] = reserves[n] + actualAddAmount\\n totalReserves = totalReservesNew;\\n\\n /* Emit NewReserves(admin, actualAddAmount, reserves[n+1]) */\\n emit ReservesAdded(msg.sender, actualAddAmount, totalReservesNew);\\n\\n /* Return (NO_ERROR, actualAddAmount) */\\n return (NO_ERROR, actualAddAmount);\\n }\\n\\n\\n /**\\n * @notice Accrues interest and reduces reserves by transferring to admin\\n * @param reduceAmount Amount of reduction to reserves\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _reduceReserves(uint reduceAmount) override external nonReentrant returns (uint) {\\n accrueInterest();\\n // _reduceReservesFresh emits reserve-reduction-specific logs on errors, so we don't need to.\\n return _reduceReservesFresh(reduceAmount);\\n }\\n\\n /**\\n * @notice Reduces reserves by transferring to admin\\n * @dev Requires fresh interest accrual\\n * @param reduceAmount Amount of reduction to reserves\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _reduceReservesFresh(uint reduceAmount) internal returns (uint) {\\n // totalReserves - reduceAmount\\n uint totalReservesNew;\\n\\n // Check caller is admin\\n if (msg.sender != admin) {\\n revert ReduceReservesAdminCheck();\\n }\\n\\n // We fail gracefully unless market's block number equals current block number\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert ReduceReservesFreshCheck();\\n }\\n\\n // Fail gracefully if protocol has insufficient underlying cash\\n if (getCashPrior() < reduceAmount) {\\n revert ReduceReservesCashNotAvailable();\\n }\\n\\n // Check reduceAmount \\u2264 reserves[n] (totalReserves)\\n if (reduceAmount > totalReserves) {\\n revert ReduceReservesCashValidation();\\n }\\n\\n /////////////////////////\\n // EFFECTS & INTERACTIONS\\n // (No safe failures beyond this point)\\n\\n totalReservesNew = totalReserves - reduceAmount;\\n\\n // Store reserves[n+1] = reserves[n] - reduceAmount\\n totalReserves = totalReservesNew;\\n\\n // doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.\\n doTransferOut(admin, reduceAmount);\\n\\n emit ReservesReduced(admin, reduceAmount, totalReservesNew);\\n\\n return NO_ERROR;\\n }\\n\\n /**\\n * @notice accrues interest and updates the interest rate model using _setInterestRateModelFresh\\n * @dev Admin function to accrue interest and update the interest rate model\\n * @param newInterestRateModel the new interest rate model to use\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setInterestRateModel(InterestRateModel newInterestRateModel) override public returns (uint) {\\n accrueInterest();\\n // _setInterestRateModelFresh emits interest-rate-model-update-specific logs on errors, so we don't need to.\\n return _setInterestRateModelFresh(newInterestRateModel);\\n }\\n\\n /**\\n * @notice updates the interest rate model (*requires fresh interest accrual)\\n * @dev Admin function to update the interest rate model\\n * @param newInterestRateModel the new interest rate model to use\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setInterestRateModelFresh(InterestRateModel newInterestRateModel) internal returns (uint) {\\n\\n // Used to store old model for use in the event that is emitted on success\\n InterestRateModel oldInterestRateModel;\\n\\n // Check caller is admin\\n if (msg.sender != admin) {\\n revert SetInterestRateModelOwnerCheck();\\n }\\n\\n // We fail gracefully unless market's block number equals current block number\\n if (accrualBlockNumber != getBlockNumber()) {\\n revert SetInterestRateModelFreshCheck();\\n }\\n\\n // Track the market's current interest rate model\\n oldInterestRateModel = interestRateModel;\\n\\n // Ensure invoke newInterestRateModel.isInterestRateModel() returns true\\n require(newInterestRateModel.isInterestRateModel(), \\\"marker method returned false\\\");\\n\\n // Set the interest rate model to newInterestRateModel\\n interestRateModel = newInterestRateModel;\\n\\n // Emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel)\\n emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel);\\n\\n return NO_ERROR;\\n }\\n\\n /*** Safe Token ***/\\n\\n /**\\n * @notice Gets balance of this contract in terms of the underlying\\n * @dev This excludes the value of the current message, if any\\n * @return The quantity of underlying owned by this contract\\n */\\n function getCashPrior() virtual internal view returns (uint);\\n\\n /**\\n * @dev Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee.\\n * This may revert due to insufficient balance or insufficient allowance.\\n */\\n function doTransferIn(address from, uint amount) virtual internal returns (uint);\\n\\n /**\\n * @dev Performs a transfer out, ideally returning an explanatory error code upon failure rather than reverting.\\n * If caller has not called checked protocol's balance, may revert due to insufficient cash held in the contract.\\n * If caller has checked protocol's balance, and verified it is >= amount, this should not revert in normal conditions.\\n */\\n function doTransferOut(address payable to, uint amount) virtual internal;\\n\\n\\n /*** Reentrancy Guard ***/\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n */\\n modifier nonReentrant() virtual {\\n require(_notEntered, \\\"re-entered\\\");\\n _notEntered = false;\\n _;\\n _notEntered = true; // get a gas-refund post-Istanbul\\n }\\n}\\n\",\"keccak256\":\"0x7f567aef305688baf2cf4e58f5f2d25d4c32e661fb0908b212f14d06be8a00f5\",\"license\":\"BSD-3-Clause\"},\"src/CTokenInterfaces.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./ComptrollerInterface.sol\\\";\\nimport \\\"./InterestRateModel.sol\\\";\\nimport \\\"./EIP20NonStandardInterface.sol\\\";\\nimport \\\"./ErrorReporter.sol\\\";\\n\\ncontract CTokenStorage {\\n /**\\n * @dev Guard variable for re-entrancy checks\\n */\\n bool internal _notEntered;\\n\\n /**\\n * @notice EIP-20 token name for this token\\n */\\n string public name;\\n\\n /**\\n * @notice EIP-20 token symbol for this token\\n */\\n string public symbol;\\n\\n /**\\n * @notice EIP-20 token decimals for this token\\n */\\n uint8 public decimals;\\n\\n // Maximum borrow rate that can ever be applied (.0005% / block)\\n uint internal constant borrowRateMaxMantissa = 0.0005e16;\\n\\n // Maximum fraction of interest that can be set aside for reserves\\n uint internal constant reserveFactorMaxMantissa = 1e18;\\n\\n /**\\n * @notice Administrator for this contract\\n */\\n address payable public admin;\\n\\n /**\\n * @notice Pending administrator for this contract\\n */\\n address payable public pendingAdmin;\\n\\n /**\\n * @notice Contract which oversees inter-cToken operations\\n */\\n ComptrollerInterface public comptroller;\\n\\n /**\\n * @notice Model which tells what the current interest rate should be\\n */\\n InterestRateModel public interestRateModel;\\n\\n // Initial exchange rate used when minting the first CTokens (used when totalSupply = 0)\\n uint internal initialExchangeRateMantissa;\\n\\n /**\\n * @notice Fraction of interest currently set aside for reserves\\n */\\n uint public reserveFactorMantissa;\\n\\n /**\\n * @notice Block number that interest was last accrued at\\n */\\n uint public accrualBlockNumber;\\n\\n /**\\n * @notice Accumulator of the total earned interest rate since the opening of the market\\n */\\n uint public borrowIndex;\\n\\n /**\\n * @notice Total amount of outstanding borrows of the underlying in this market\\n */\\n uint public totalBorrows;\\n\\n /**\\n * @notice Total amount of reserves of the underlying held in this market\\n */\\n uint public totalReserves;\\n\\n /**\\n * @notice Total number of tokens in circulation\\n */\\n uint public totalSupply;\\n\\n // Official record of token balances for each account\\n mapping (address => uint) internal accountTokens;\\n\\n // Approved token transfer amounts on behalf of others\\n mapping (address => mapping (address => uint)) internal transferAllowances;\\n\\n /**\\n * @notice Container for borrow balance information\\n * @member principal Total balance (with accrued interest), after applying the most recent balance-changing action\\n * @member interestIndex Global borrowIndex as of the most recent balance-changing action\\n */\\n struct BorrowSnapshot {\\n uint principal;\\n uint interestIndex;\\n }\\n\\n // Mapping of account addresses to outstanding borrow balances\\n mapping(address => BorrowSnapshot) internal accountBorrows;\\n\\n /**\\n * @notice Share of seized collateral that is added to reserves\\n */\\n uint public constant protocolSeizeShareMantissa = 2.8e16; //2.8%\\n}\\n\\nabstract contract CTokenInterface is CTokenStorage {\\n /**\\n * @notice Indicator that this is a CToken contract (for inspection)\\n */\\n bool public constant isCToken = true;\\n\\n\\n /*** Market Events ***/\\n \\n /**\\n * @notice Event emitted when interest is accrued\\n */\\n event AccrueInterest(uint cashPrior, uint interestAccumulated, uint borrowIndex, uint totalBorrows);\\n\\n /**\\n * @notice Event emitted when tokens are minted\\n */\\n event Mint(address minter, uint mintAmount, uint mintTokens);\\n\\n /**\\n * @notice Event emitted when tokens are redeemed\\n */\\n event Redeem(address redeemer, uint redeemAmount, uint redeemTokens);\\n\\n /**\\n * @notice Event emitted when underlying is borrowed\\n */\\n event Borrow(address borrower, uint borrowAmount, uint accountBorrows, uint totalBorrows);\\n\\n /**\\n * @notice Event emitted when a borrow is repaid\\n */\\n event RepayBorrow(address payer, address borrower, uint repayAmount, uint accountBorrows, uint totalBorrows);\\n\\n /**\\n * @notice Event emitted when a borrow is liquidated\\n */\\n event LiquidateBorrow(address liquidator, address borrower, uint repayAmount, address cTokenCollateral, uint seizeTokens);\\n\\n\\n /*** Admin Events ***/\\n\\n /**\\n * @notice Event emitted when pendingAdmin is changed\\n */\\n event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\\n\\n /**\\n * @notice Event emitted when pendingAdmin is accepted, which means admin is updated\\n */\\n event NewAdmin(address oldAdmin, address newAdmin);\\n\\n /**\\n * @notice Event emitted when comptroller is changed\\n */\\n event NewComptroller(ComptrollerInterface oldComptroller, ComptrollerInterface newComptroller);\\n\\n /**\\n * @notice Event emitted when interestRateModel is changed\\n */\\n event NewMarketInterestRateModel(InterestRateModel oldInterestRateModel, InterestRateModel newInterestRateModel);\\n\\n /**\\n * @notice Event emitted when the reserve factor is changed\\n */\\n event NewReserveFactor(uint oldReserveFactorMantissa, uint newReserveFactorMantissa);\\n\\n /**\\n * @notice Event emitted when the reserves are added\\n */\\n event ReservesAdded(address benefactor, uint addAmount, uint newTotalReserves);\\n\\n /**\\n * @notice Event emitted when the reserves are reduced\\n */\\n event ReservesReduced(address admin, uint reduceAmount, uint newTotalReserves);\\n\\n /**\\n * @notice EIP20 Transfer event\\n */\\n event Transfer(address indexed from, address indexed to, uint amount);\\n\\n /**\\n * @notice EIP20 Approval event\\n */\\n event Approval(address indexed owner, address indexed spender, uint amount);\\n\\n\\n /*** User Interface ***/\\n\\n function transfer(address dst, uint amount) virtual external returns (bool);\\n function transferFrom(address src, address dst, uint amount) virtual external returns (bool);\\n function approve(address spender, uint amount) virtual external returns (bool);\\n function allowance(address owner, address spender) virtual external view returns (uint);\\n function balanceOf(address owner) virtual external view returns (uint);\\n function balanceOfUnderlying(address owner) virtual external returns (uint);\\n function getAccountSnapshot(address account) virtual external view returns (uint, uint, uint, uint);\\n function borrowRatePerBlock() virtual view external returns (uint);\\n function supplyRatePerBlock() virtual view external returns (uint);\\n function totalBorrowsCurrent() virtual external returns (uint);\\n function borrowBalanceCurrent(address account) virtual external returns (uint);\\n function borrowBalanceStored(address account) virtual external view returns (uint);\\n function exchangeRateCurrent() virtual external returns (uint);\\n function exchangeRateStored() virtual external view returns (uint);\\n function getCash() virtual external view returns (uint);\\n function accrueInterest() virtual external returns (uint);\\n function seize(address liquidator, address borrower, uint seizeTokens) virtual external returns (uint);\\n\\n\\n /*** Admin Functions ***/\\n\\n function _setPendingAdmin(address payable newPendingAdmin) virtual external returns (uint);\\n function _acceptAdmin() virtual external returns (uint);\\n function _setComptroller(ComptrollerInterface newComptroller) virtual external returns (uint);\\n function _setReserveFactor(uint newReserveFactorMantissa) virtual external returns (uint);\\n function _reduceReserves(uint reduceAmount) virtual external returns (uint);\\n function _setInterestRateModel(InterestRateModel newInterestRateModel) virtual external returns (uint);\\n}\\n\\ncontract CErc20Storage {\\n /**\\n * @notice Underlying asset for this CToken\\n */\\n address public underlying;\\n}\\n\\n\\nabstract contract CErc20Interface is CErc20Storage {\\n\\n /*** User Interface ***/\\n\\n function mint(uint mintAmount) virtual external returns (uint);\\n function redeem(uint redeemTokens) virtual external returns (uint);\\n function redeemUnderlying(uint redeemAmount) virtual external returns (uint);\\n function borrow(uint borrowAmount) virtual external returns (uint);\\n function repayBorrow(uint repayAmount) virtual external returns (uint);\\n function repayBorrowBehalf(address borrower, uint repayAmount) virtual external returns (uint);\\n function liquidateBorrow(address borrower, uint repayAmount, CTokenInterface cTokenCollateral) virtual external returns (uint);\\n function sweepToken(EIP20NonStandardInterface token) virtual external;\\n\\n\\n /*** Admin Functions ***/\\n\\n function _addReserves(uint addAmount) virtual external returns (uint);\\n}\\n\\ncontract CDelegationStorage {\\n /**\\n * @notice Implementation address for this contract\\n */\\n address public implementation;\\n}\\n\\nabstract contract CDelegatorInterface is CDelegationStorage {\\n /**\\n * @notice Emitted when implementation is changed\\n */\\n event NewImplementation(address oldImplementation, address newImplementation);\\n\\n /**\\n * @notice Called by the admin to update the implementation of the delegator\\n * @param implementation_ The address of the new implementation for delegation\\n * @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation\\n * @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation\\n */\\n function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData) virtual external;\\n}\\n\\nabstract contract CDelegateInterface is CDelegationStorage {\\n /**\\n * @notice Called by the delegator on a delegate to initialize it for duty\\n * @dev Should revert if any issues arise which make it unfit for delegation\\n * @param data The encoded bytes data for any initialization\\n */\\n function _becomeImplementation(bytes memory data) virtual external;\\n\\n /**\\n * @notice Called by the delegator on a delegate to forfeit its responsibility\\n */\\n function _resignImplementation() virtual external;\\n}\\n\",\"keccak256\":\"0xa6abc5ed675f12404c665671db54b8fa6af14f5151599555a8972bb605f761e4\",\"license\":\"BSD-3-Clause\"},\"src/ComptrollerInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nabstract contract ComptrollerInterface {\\n /// @notice Indicator that this is a Comptroller contract (for inspection)\\n bool public constant isComptroller = true;\\n\\n /*** Assets You Are In ***/\\n\\n function enterMarkets(address[] calldata cTokens) virtual external returns (uint[] memory);\\n function exitMarket(address cToken) virtual external returns (uint);\\n\\n /*** Policy Hooks ***/\\n\\n function mintAllowed(address cToken, address minter, uint mintAmount) virtual external returns (uint);\\n function mintVerify(address cToken, address minter, uint mintAmount, uint mintTokens) virtual external;\\n\\n function redeemAllowed(address cToken, address redeemer, uint redeemTokens) virtual external returns (uint);\\n function redeemVerify(address cToken, address redeemer, uint redeemAmount, uint redeemTokens) virtual external;\\n\\n function borrowAllowed(address cToken, address borrower, uint borrowAmount) virtual external returns (uint);\\n function borrowVerify(address cToken, address borrower, uint borrowAmount) virtual external;\\n\\n function repayBorrowAllowed(\\n address cToken,\\n address payer,\\n address borrower,\\n uint repayAmount) virtual external returns (uint);\\n function repayBorrowVerify(\\n address cToken,\\n address payer,\\n address borrower,\\n uint repayAmount,\\n uint borrowerIndex) virtual external;\\n\\n function liquidateBorrowAllowed(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n address liquidator,\\n address borrower,\\n uint repayAmount) virtual external returns (uint);\\n function liquidateBorrowVerify(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n address liquidator,\\n address borrower,\\n uint repayAmount,\\n uint seizeTokens) virtual external;\\n\\n function seizeAllowed(\\n address cTokenCollateral,\\n address cTokenBorrowed,\\n address liquidator,\\n address borrower,\\n uint seizeTokens) virtual external returns (uint);\\n function seizeVerify(\\n address cTokenCollateral,\\n address cTokenBorrowed,\\n address liquidator,\\n address borrower,\\n uint seizeTokens) virtual external;\\n\\n function transferAllowed(address cToken, address src, address dst, uint transferTokens) virtual external returns (uint);\\n function transferVerify(address cToken, address src, address dst, uint transferTokens) virtual external;\\n\\n /*** Liquidity/Liquidation Calculations ***/\\n\\n function liquidateCalculateSeizeTokens(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n uint repayAmount) virtual external view returns (uint, uint);\\n}\\n\",\"keccak256\":\"0x4111ff0414696caca696cf36ecf3add15133933b51ba57c56cfb08989c82d44f\",\"license\":\"BSD-3-Clause\"},\"src/EIP20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\n/**\\n * @title ERC 20 Token Standard Interface\\n * https://eips.ethereum.org/EIPS/eip-20\\n */\\ninterface EIP20Interface {\\n function name() external view returns (string memory);\\n function symbol() external view returns (string memory);\\n function decimals() external view returns (uint8);\\n\\n /**\\n * @notice Get the total number of tokens in circulation\\n * @return The supply of tokens\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @notice Gets the balance of the specified address\\n * @param owner The address from which the balance will be retrieved\\n * @return balance The balance\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @notice Transfer `amount` tokens from `msg.sender` to `dst`\\n * @param dst The address of the destination account\\n * @param amount The number of tokens to transfer\\n * @return success Whether or not the transfer succeeded\\n */\\n function transfer(address dst, uint256 amount) external returns (bool success);\\n\\n /**\\n * @notice Transfer `amount` tokens from `src` to `dst`\\n * @param src The address of the source account\\n * @param dst The address of the destination account\\n * @param amount The number of tokens to transfer\\n * @return success Whether or not the transfer succeeded\\n */\\n function transferFrom(address src, address dst, uint256 amount) external returns (bool success);\\n\\n /**\\n * @notice Approve `spender` to transfer up to `amount` from `src`\\n * @dev This will overwrite the approval amount for `spender`\\n * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)\\n * @param spender The address of the account which may transfer tokens\\n * @param amount The number of tokens that are approved (-1 means infinite)\\n * @return success Whether or not the approval succeeded\\n */\\n function approve(address spender, uint256 amount) external returns (bool success);\\n\\n /**\\n * @notice Get the current allowance from `owner` for `spender`\\n * @param owner The address of the account which owns the tokens to be spent\\n * @param spender The address of the account which may transfer tokens\\n * @return remaining The number of tokens allowed to be spent (-1 means infinite)\\n */\\n function allowance(address owner, address spender) external view returns (uint256 remaining);\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n}\\n\",\"keccak256\":\"0xf44fc7783d4a0060119f0096a122c3f305c7a03da75aa21408393d8d7a2e649b\",\"license\":\"BSD-3-Clause\"},\"src/EIP20NonStandardInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\n/**\\n * @title EIP20NonStandardInterface\\n * @dev Version of ERC20 with no return values for `transfer` and `transferFrom`\\n * See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca\\n */\\ninterface EIP20NonStandardInterface {\\n\\n /**\\n * @notice Get the total number of tokens in circulation\\n * @return The supply of tokens\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @notice Gets the balance of the specified address\\n * @param owner The address from which the balance will be retrieved\\n * @return balance The balance\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n ///\\n /// !!!!!!!!!!!!!!\\n /// !!! NOTICE !!! `transfer` does not return a value, in violation of the ERC-20 specification\\n /// !!!!!!!!!!!!!!\\n ///\\n\\n /**\\n * @notice Transfer `amount` tokens from `msg.sender` to `dst`\\n * @param dst The address of the destination account\\n * @param amount The number of tokens to transfer\\n */\\n function transfer(address dst, uint256 amount) external;\\n\\n ///\\n /// !!!!!!!!!!!!!!\\n /// !!! NOTICE !!! `transferFrom` does not return a value, in violation of the ERC-20 specification\\n /// !!!!!!!!!!!!!!\\n ///\\n\\n /**\\n * @notice Transfer `amount` tokens from `src` to `dst`\\n * @param src The address of the source account\\n * @param dst The address of the destination account\\n * @param amount The number of tokens to transfer\\n */\\n function transferFrom(address src, address dst, uint256 amount) external;\\n\\n /**\\n * @notice Approve `spender` to transfer up to `amount` from `src`\\n * @dev This will overwrite the approval amount for `spender`\\n * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)\\n * @param spender The address of the account which may transfer tokens\\n * @param amount The number of tokens that are approved\\n * @return success Whether or not the approval succeeded\\n */\\n function approve(address spender, uint256 amount) external returns (bool success);\\n\\n /**\\n * @notice Get the current allowance from `owner` for `spender`\\n * @param owner The address of the account which owns the tokens to be spent\\n * @param spender The address of the account which may transfer tokens\\n * @return remaining The number of tokens allowed to be spent\\n */\\n function allowance(address owner, address spender) external view returns (uint256 remaining);\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n}\\n\",\"keccak256\":\"0x5ce25bb36a4ec9490617567a24b55bc813e943bcd4411e060afffe122bea0416\",\"license\":\"BSD-3-Clause\"},\"src/ERC20.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"./EIP20Interface.sol\\\";\\n\\ncontract ERC20 is EIP20Interface {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n uint256 public _initialSupply;\\n \\n\\n uint8 public _decimals;\\n\\n string private _name;\\n string private _symbol;\\n\\n uint256 MAX_INT = 2**256-1;\\n \\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_, uint256 totalSupply_, uint8 decimals_) public {\\n _name = name_;\\n _symbol = symbol_;\\n\\t _initialSupply = totalSupply_;\\n\\t _totalSupply = totalSupply_;\\n _balances[msg.sender] = totalSupply_;\\n _decimals = decimals_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view returns (uint8) {\\n return _decimals;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view returns (uint256) {\\n\\t return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public returns (bool) {\\n\\t address owner = msg.sender;\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public returns (bool) {\\n address owner = msg.sender;\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public returns (bool) {\\n address spender = msg.sender;\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {\\n address owner = msg.sender;\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {\\n address owner = msg.sender;\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n\\t _approve(owner, spender, currentAllowance - subtractedValue);\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n \\n \\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n _balances[from] = fromBalance - amount;\\n _balances[to] += amount;\\n\\n emit Transfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _totalSupply += amount;\\n _balances[account] += amount;\\n emit Transfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n\\t _balances[account] = accountBalance - amount;\\n _totalSupply -= amount;\\n\\n emit Transfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != MAX_INT) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n\\t _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n}\",\"keccak256\":\"0x6e96a1aa19c637b5ed58eb9b5b4712af85e249393fe329ffaae3bc3ffdc30111\"},\"src/ErrorReporter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\ncontract ComptrollerErrorReporter {\\n enum Error {\\n NO_ERROR,\\n UNAUTHORIZED,\\n COMPTROLLER_MISMATCH,\\n INSUFFICIENT_SHORTFALL,\\n INSUFFICIENT_LIQUIDITY,\\n INVALID_CLOSE_FACTOR,\\n INVALID_COLLATERAL_FACTOR,\\n INVALID_LIQUIDATION_INCENTIVE,\\n MARKET_NOT_ENTERED, // no longer possible\\n MARKET_NOT_LISTED,\\n MARKET_ALREADY_LISTED,\\n MATH_ERROR,\\n NONZERO_BORROW_BALANCE,\\n PRICE_ERROR,\\n REJECTION,\\n SNAPSHOT_ERROR,\\n TOO_MANY_ASSETS,\\n TOO_MUCH_REPAY\\n }\\n\\n enum FailureInfo {\\n ACCEPT_ADMIN_PENDING_ADMIN_CHECK,\\n ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK,\\n EXIT_MARKET_BALANCE_OWED,\\n EXIT_MARKET_REJECTION,\\n SET_CLOSE_FACTOR_OWNER_CHECK,\\n SET_CLOSE_FACTOR_VALIDATION,\\n SET_COLLATERAL_FACTOR_OWNER_CHECK,\\n SET_COLLATERAL_FACTOR_NO_EXISTS,\\n SET_COLLATERAL_FACTOR_VALIDATION,\\n SET_COLLATERAL_FACTOR_WITHOUT_PRICE,\\n SET_IMPLEMENTATION_OWNER_CHECK,\\n SET_LIQUIDATION_INCENTIVE_OWNER_CHECK,\\n SET_LIQUIDATION_INCENTIVE_VALIDATION,\\n SET_MAX_ASSETS_OWNER_CHECK,\\n SET_PENDING_ADMIN_OWNER_CHECK,\\n SET_PENDING_IMPLEMENTATION_OWNER_CHECK,\\n SET_PRICE_ORACLE_OWNER_CHECK,\\n SUPPORT_MARKET_EXISTS,\\n SUPPORT_MARKET_OWNER_CHECK,\\n SET_PAUSE_GUARDIAN_OWNER_CHECK\\n }\\n\\n /**\\n * @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary\\n * contract-specific code that enables us to report opaque error codes from upgradeable contracts.\\n **/\\n event Failure(uint error, uint info, uint detail);\\n\\n /**\\n * @dev use this when reporting a known error from the money market or a non-upgradeable collaborator\\n */\\n function fail(Error err, FailureInfo info) internal returns (uint) {\\n emit Failure(uint(err), uint(info), 0);\\n\\n return uint(err);\\n }\\n\\n /**\\n * @dev use this when reporting an opaque error from an upgradeable collaborator contract\\n */\\n function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {\\n emit Failure(uint(err), uint(info), opaqueError);\\n\\n return uint(err);\\n }\\n}\\n\\ncontract TokenErrorReporter {\\n uint public constant NO_ERROR = 0; // support legacy return codes\\n\\n error TransferComptrollerRejection(uint256 errorCode);\\n error TransferNotAllowed();\\n error TransferNotEnough();\\n error TransferTooMuch();\\n\\n error MintComptrollerRejection(uint256 errorCode);\\n error MintFreshnessCheck();\\n\\n error RedeemComptrollerRejection(uint256 errorCode);\\n error RedeemFreshnessCheck();\\n error RedeemTransferOutNotPossible();\\n\\n error BorrowComptrollerRejection(uint256 errorCode);\\n error BorrowFreshnessCheck();\\n error BorrowCashNotAvailable();\\n\\n error RepayBorrowComptrollerRejection(uint256 errorCode);\\n error RepayBorrowFreshnessCheck();\\n\\n error LiquidateComptrollerRejection(uint256 errorCode);\\n error LiquidateFreshnessCheck();\\n error LiquidateCollateralFreshnessCheck();\\n error LiquidateAccrueBorrowInterestFailed(uint256 errorCode);\\n error LiquidateAccrueCollateralInterestFailed(uint256 errorCode);\\n error LiquidateLiquidatorIsBorrower();\\n error LiquidateCloseAmountIsZero();\\n error LiquidateCloseAmountIsUintMax();\\n error LiquidateRepayBorrowFreshFailed(uint256 errorCode);\\n\\n error LiquidateSeizeComptrollerRejection(uint256 errorCode);\\n error LiquidateSeizeLiquidatorIsBorrower();\\n\\n error AcceptAdminPendingAdminCheck();\\n\\n error SetComptrollerOwnerCheck();\\n error SetPendingAdminOwnerCheck();\\n\\n error SetReserveFactorAdminCheck();\\n error SetReserveFactorFreshCheck();\\n error SetReserveFactorBoundsCheck();\\n\\n error AddReservesFactorFreshCheck(uint256 actualAddAmount);\\n\\n error ReduceReservesAdminCheck();\\n error ReduceReservesFreshCheck();\\n error ReduceReservesCashNotAvailable();\\n error ReduceReservesCashValidation();\\n\\n error SetInterestRateModelOwnerCheck();\\n error SetInterestRateModelFreshCheck();\\n\\n //Accountant Error Codes\\n error AccountantSupplyError(uint256 borrowAmount);\\n error AccountantRedeemError(uint256 redeemAmount);\\n}\\n\",\"keccak256\":\"0x4782810ec7d04cb8c3eeb4660fb6650f8b2edfd8b1e2d123dcbe93eff29373d8\",\"license\":\"BSD-3-Clause\"},\"src/ExponentialNoError.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\n/**\\n * @title Exponential module for storing fixed-precision decimals\\n * @author Compound\\n * @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.\\n * Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:\\n * `Exp({mantissa: 5100000000000000000})`.\\n */\\ncontract ExponentialNoError {\\n uint constant expScale = 1e18;\\n uint constant doubleScale = 1e36;\\n uint constant halfExpScale = expScale/2;\\n uint constant mantissaOne = expScale;\\n\\n struct Exp {\\n uint mantissa;\\n }\\n\\n struct Double {\\n uint mantissa;\\n }\\n\\n /**\\n * @dev Truncates the given exp to a whole number value.\\n * For example, truncate(Exp{mantissa: 15 * expScale}) = 15\\n */\\n function truncate(Exp memory exp) pure internal returns (uint) {\\n // Note: We are not using careful math here as we're performing a division that cannot fail\\n return exp.mantissa / expScale;\\n }\\n\\n /**\\n * @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.\\n */\\n function mul_ScalarTruncate(Exp memory a, uint scalar) pure internal returns (uint) {\\n Exp memory product = mul_(a, scalar);\\n return truncate(product);\\n }\\n\\n /**\\n * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.\\n */\\n function mul_ScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (uint) {\\n Exp memory product = mul_(a, scalar);\\n return add_(truncate(product), addend);\\n }\\n\\n /**\\n * @dev Checks if first Exp is less than second Exp.\\n */\\n function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {\\n return left.mantissa < right.mantissa;\\n }\\n\\n /**\\n * @dev Checks if left Exp <= right Exp.\\n */\\n function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {\\n return left.mantissa <= right.mantissa;\\n }\\n\\n /**\\n * @dev Checks if left Exp > right Exp.\\n */\\n function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {\\n return left.mantissa > right.mantissa;\\n }\\n\\n /**\\n * @dev returns true if Exp is exactly zero\\n */\\n function isZeroExp(Exp memory value) pure internal returns (bool) {\\n return value.mantissa == 0;\\n }\\n\\n function safe224(uint n, string memory errorMessage) pure internal returns (uint224) {\\n require(n < 2**224, errorMessage);\\n return uint224(n);\\n }\\n\\n function safe32(uint n, string memory errorMessage) pure internal returns (uint32) {\\n require(n < 2**32, errorMessage);\\n return uint32(n);\\n }\\n\\n function add_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\\n return Exp({mantissa: add_(a.mantissa, b.mantissa)});\\n }\\n\\n function add_(Double memory a, Double memory b) pure internal returns (Double memory) {\\n return Double({mantissa: add_(a.mantissa, b.mantissa)});\\n }\\n\\n function add_(uint a, uint b) pure internal returns (uint) {\\n return a + b;\\n }\\n\\n function sub_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\\n return Exp({mantissa: sub_(a.mantissa, b.mantissa)});\\n }\\n\\n function sub_(Double memory a, Double memory b) pure internal returns (Double memory) {\\n return Double({mantissa: sub_(a.mantissa, b.mantissa)});\\n }\\n\\n function sub_(uint a, uint b) pure internal returns (uint) {\\n return a - b;\\n }\\n\\n function mul_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\\n return Exp({mantissa: mul_(a.mantissa, b.mantissa) / expScale});\\n }\\n\\n function mul_(Exp memory a, uint b) pure internal returns (Exp memory) {\\n return Exp({mantissa: mul_(a.mantissa, b)});\\n }\\n\\n function mul_(uint a, Exp memory b) pure internal returns (uint) {\\n return mul_(a, b.mantissa) / expScale;\\n }\\n\\n function mul_(Double memory a, Double memory b) pure internal returns (Double memory) {\\n return Double({mantissa: mul_(a.mantissa, b.mantissa) / doubleScale});\\n }\\n\\n function mul_(Double memory a, uint b) pure internal returns (Double memory) {\\n return Double({mantissa: mul_(a.mantissa, b)});\\n }\\n\\n function mul_(uint a, Double memory b) pure internal returns (uint) {\\n return mul_(a, b.mantissa) / doubleScale;\\n }\\n\\n function mul_(uint a, uint b) pure internal returns (uint) {\\n return a * b;\\n }\\n\\n function div_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {\\n return Exp({mantissa: div_(mul_(a.mantissa, expScale), b.mantissa)});\\n }\\n\\n function div_(Exp memory a, uint b) pure internal returns (Exp memory) {\\n return Exp({mantissa: div_(a.mantissa, b)});\\n }\\n\\n function div_(uint a, Exp memory b) pure internal returns (uint) {\\n return div_(mul_(a, expScale), b.mantissa);\\n }\\n\\n function div_(Double memory a, Double memory b) pure internal returns (Double memory) {\\n return Double({mantissa: div_(mul_(a.mantissa, doubleScale), b.mantissa)});\\n }\\n\\n function div_(Double memory a, uint b) pure internal returns (Double memory) {\\n return Double({mantissa: div_(a.mantissa, b)});\\n }\\n\\n function div_(uint a, Double memory b) pure internal returns (uint) {\\n return div_(mul_(a, doubleScale), b.mantissa);\\n }\\n\\n function div_(uint a, uint b) pure internal returns (uint) {\\n return a / b;\\n }\\n\\n function fraction(uint a, uint b) pure internal returns (Double memory) {\\n return Double({mantissa: div_(mul_(a, doubleScale), b)});\\n }\\n}\\n\",\"keccak256\":\"0x3a05062282ef8cbf6ec372abc73387ac8105a7eb0ea0f38069ebfd0f434ff98b\",\"license\":\"BSD-3-Clause\"},\"src/IProposal.sol\":{\"content\":\"pragma experimental ABIEncoderV2;\\n\\n\\n//Interface name is not important, however functions in it are important\\ninterface IProposal{\\n struct Proposal {\\n \\n // proposal id\\n uint id;\\n\\n // title of proposal\\n string title;\\n\\n // description of proposal\\n string desc;\\n\\n // the ordered list of target addresses for calls to be made\\n address[] targets;\\n\\n // the amounts that will be sent by the treasury to each address\\n uint[] values;\\n\\n // the denoms that the treasury will send\\n string[] signatures;\\n\\n // SHOULD BE NULL\\n bytes[] calldatas;\\n }\\n\\n\\n function QueryProp(uint propId) external view returns(Proposal memory);\\n}\\n\",\"keccak256\":\"0xb162f997a373bfcc13fac0a63108c38389acf21bb520cd26c5d15556796bfff0\"},\"src/InterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\n/**\\n * @title Compound's InterestRateModel Interface\\n * @author Compound\\n */\\nabstract contract InterestRateModel {\\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\\n bool public constant isInterestRateModel = true;\\n\\n /**\\n * @notice Calculates the current borrow interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(uint cash, uint borrows, uint reserves) virtual view external returns (uint);\\n\\n /**\\n * @notice Calculates the current supply interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) virtual view external returns (uint);\\n}\\n\",\"keccak256\":\"0x8076506ade5e37e9d2acb71a3685b4ecb88dfe12ee8a9936bdfd146ce48aa541\",\"license\":\"BSD-3-Clause\"},\"src/Note.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"./ERC20.sol\\\";\\n\\ncontract Note is ERC20 {\\n address public accountant;\\n address public admin;\\n\\n constructor() ERC20(\\\"Note\\\", \\\"NOTE\\\", 0, 18) {\\n admin = msg.sender;\\n }\\n\\n function _mint_to_Accountant(address accountantDelegator) internal {\\n _mint(accountantDelegator, type(uint).max);\\n }\\n\\n function RetAccountant() public view returns(address) {\\n\\t return accountant;\\n }\\n \\n function _setAccountantAddress(address accountant_) external {\\n require(msg.sender == admin);\\n require(address(accountant) == address(0)); //Note cannot be initialized twice\\n // set the New Accountant\\n accountant = accountant_; \\n if (balanceOf(accountant) != type(uint).max) {\\n _mint_to_Accountant(accountant);\\n admin = accountant; //admin of this account is now the accountant\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0562e523f1ae97137e851d8b06b6c7118892add32b4465dd04b43671894d31f0\"},\"src/NoteInterest.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\n\\nimport \\\"./PriceOracle.sol\\\";\\nimport \\\"./SafeMath.sol\\\";\\nimport \\\"./CErc20.sol\\\";\\n/**\\n * @title note's interest rate model contract\\n * @author canto\\n */\\n\\ncontract NoteRateModel is InterestRateModel{\\n\\n using SafeMath for uint;\\n \\n /**\\n * @notice The approximate number of blocks per year that is assumed by the interest rate model\\n */\\n uint public constant BlocksPerYear = 5256666;\\n\\n\\n uint public constant BASE = 1e18;\\n\\n uint public decimals;\\n\\n uint public scale;\\n\\n /**\\n * @notice The variable to keep track of the last update on Note's interest rate, initialized at the current block number\\n */\\n uint public lastUpdateBlock;\\n\\n /**\\n * @notice baseRatePerYear The per year interest rate, as a mantissa (scaled by 1e18)\\n */\\n uint public baseRatePerYear;\\n\\n /**\\n * @notice baseRatePerBlock The per block interest rate, as a mantissa (scaled by 1e18)\\n */\\n uint public baseRatePerBlock;\\n\\n /**\\n * @notice The level of aggressiveness to adjust interest rate according to twap's deviation from the peg\\n */\\n uint public adjusterCoefficient; // set by admin, default 1\\n /**\\n * @notice The frequency of updating Note's base rate\\n */\\n uint public updateFrequency = 2160; // set by admin, default 6 hours = 216000 seconds / 6 secs per block\\n\\n PriceOracle public oracle;\\n\\n /**\\n * @notice The CToken identifier for Note\\n */\\n CErc20 public cUsdc;\\n\\n /**\\n * @notice administrator for this contract\\n */\\n address private admin;\\n\\n\\n /// @notice Emitted when base rate is changed by admin\\n event NewBaseRate(uint oldBaseRateMantissa, uint newBaseRateMantissa);\\n\\n /// @notice Emitted when adjuster coefficient is changed by admin\\n event NewAdjusterCoefficient(uint oldAdjusterCoefficient, uint newAdjusterCoefficient);\\n\\n /// @notice Emitted when update frequency is changed by admin\\n event NewUpdateFrequency(uint oldUpdateFrequency, uint newUpdateFrequency);\\n\\n /// @notice Emitted when new baserateperblock is set\\n event NewInterestParams(uint baserateperblock);\\n\\n /// @notice Emitted when new PriceOracle is set\\n event NewPriceOracle(address oldOracle, address newOracle);\\n\\n /// @notice Emitted when new admin is set\\n event NewAdmin(address oldAdmin, address newAdmin);\\n\\n /// @notice reverted if the getUnderlying Price fails \\n error FailedPriceRetrieval(CToken ctoken);\\n\\n /// @notice reverted if sender is not admin\\n error SenderNotAdmin(address sender);\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param _baseRatePerYear The approximate target base APR, as a mantissa (scaled by 1e18), set by admin, default 2%\\n */\\n constructor(uint _baseRatePerYear) {\\n baseRatePerYear = _baseRatePerYear;\\n baseRatePerBlock = _baseRatePerYear.div(BlocksPerYear);\\n emit NewInterestParams(baseRatePerBlock);\\n admin = msg.sender;\\n lastUpdateBlock = block.number;\\n }\\n\\n function initialize(address cUsdcAddr, address oracleAddress) external {\\n require(address(oracle) == address(0) && address(cUsdc) == address(0));\\n if (msg.sender != admin ) {\\n revert SenderNotAdmin(msg.sender);\\n } \\n address oldPriceOracle = address(oracle);\\n cUsdc = CErc20(cUsdcAddr);\\n decimals = EIP20Interface(cUsdc.underlying()).decimals();\\n scale = (10) ** (18 - decimals);\\n oracle = PriceOracle(oracleAddress);\\n emit NewPriceOracle(oldPriceOracle, oracleAddress);\\n }\\n\\n function setAdmin(address newAdmin) external {\\n if (msg.sender != admin) {\\n revert SenderNotAdmin(msg.sender);\\n }\\n admin = newAdmin;\\n }\\n\\n function setOracle(address oracle_) external {\\n if (msg.sender != admin) {\\n revert SenderNotAdmin(msg.sender);\\n }\\n address oldPriceOracle = address(oracle);\\n oracle = PriceOracle(oracle_);\\n emit NewPriceOracle(oldPriceOracle, oracle_);\\n }\\n\\n function getBorrowRate(uint cash, uint borrows, uint reserves) external view override returns(uint) {\\n return baseRatePerBlock;\\n }\\n\\n\\n /**\\n * @notice Calculates the current supply rate per block, which is the same as the borrow rate\\n * @notice The following parameters are irrelevent for calculating Note's interest rate. They are passed in to align with the standard function definition `getSupplyRate` in InterestRateModel\\n * @return Note's supply rate percentage per block as a mantissa (scaled by 1e18)\\n */\\n function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view override returns (uint) {\\n return baseRatePerBlock;\\n }\\n\\n /**\\n * @notice Updates the Note's base rate per year at a given interval (Update Frequency)\\n * @notice This interest rate is calculated as follows f(x) = max(0, (1 - $NOTE) * adjusterCoefficient + priorInterestRate ) \\n * @notice If Note is trading above 1$ then lower the interest rate to benefit suppliers\\n * This function is called in accrue Interest by the cNote Contract \\n */\\n function updateBaseRate() external {\\n // check the current block number\\n uint blockNumber = block.number;\\n uint deltaBlocks = blockNumber - lastUpdateBlock;\\n if (deltaBlocks > updateFrequency) {\\n uint twapMantissa = oracle.getUnderlyingPrice(cUsdc) / scale; // returns price as mantissa / scale to 18 decimals, by (1e12)\\n uint notePrice = BASE * BASE/ twapMantissa; // Price of Note in USDC is 1/ (PRice of UDSC in Note)\\n\\n uint diff = (BASE >= notePrice) ? BASE - notePrice : notePrice - BASE; //difference between price of USDC and expected Price (in note)\\n uint interestAdjust = (diff * adjusterCoefficient)/BASE; // these values are both scaled by 1e18\\n\\n uint newBaseRatePerYear;\\n if (notePrice > BASE) {\\n // note is over-performing the dollar defer to borrowers: decrease borrowRate (have users borrow note, swap for usdc)\\n newBaseRatePerYear = (interestAdjust <= baseRatePerYear) ? baseRatePerYear - interestAdjust : 0; \\n } else { \\n // note is under-performing the dollar, defer to suppliers: increase the supply rate (have users swap usdc for note to supply it)\\n newBaseRatePerYear = interestAdjust + baseRatePerYear; \\n }\\n\\n baseRatePerYear = newBaseRatePerYear;\\n // convert it to base rate per block\\n baseRatePerBlock = baseRatePerYear.div(BlocksPerYear);\\n lastUpdateBlock = blockNumber;\\n emit NewInterestParams(baseRatePerYear);\\n }\\n }\\n\\n // Admin functions\\n\\n /**\\n * @notice Sets the base interest rate for Note\\n * @dev Admin function to set per-market base interest rate\\n * @param newBaseRateMantissa The new base interest rate, scaled by 1e18\\n */\\n function _setBaseRatePerYear(uint newBaseRateMantissa) external {\\n // Check caller is admin\\n require(msg.sender == admin, \\\"only the admin may set the base rate\\\");\\n uint oldBaseRatePerYear = baseRatePerYear;\\n baseRatePerYear = newBaseRateMantissa;\\n emit NewBaseRate(oldBaseRatePerYear, baseRatePerYear);\\n }\\n\\n /**\\n * @notice Sets the adjuster coefficient for Note\\n * @dev Admin function to set per-market adjuster coefficient\\n * @param newAdjusterCoefficient The new adjuster coefficient, scaled by 1e18\\n */\\n function _setAdjusterCoefficient(uint newAdjusterCoefficient) external {\\n // Check caller is admin\\n require(msg.sender == admin, \\\"only the admin may set the adjuster coefficient\\\");\\n uint oldAdjusterCoefficient = adjusterCoefficient;\\n adjusterCoefficient = newAdjusterCoefficient;\\n emit NewAdjusterCoefficient(oldAdjusterCoefficient, adjusterCoefficient);\\n }\\n\\n /**\\n * @notice Sets the update frequency for Note's interest rate\\n * @dev Admin function to set the update frequency\\n * @param newUpdateFrequency The new update frequency, in blocks\\n */\\n function _setUpdateFrequency(uint newUpdateFrequency) external {\\n // Check caller is admin\\n require(msg.sender == admin, \\\"only the admin may set the update frequency\\\");\\n uint oldUpdateFrequency = updateFrequency;\\n updateFrequency = newUpdateFrequency;\\n emit NewUpdateFrequency(oldUpdateFrequency, updateFrequency);\\n }\\n}\",\"keccak256\":\"0xacb1891049cfef738b7213856922b6ed42ec7067cb8469c2e79666dd79fe6c43\"},\"src/PriceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./CToken.sol\\\";\\n\\nabstract contract PriceOracle {\\n /// @notice Indicator that this is a PriceOracle contract (for inspection)\\n bool public constant isPriceOracle = true;\\n\\n /**\\n * @notice Get the underlying price of a cToken asset\\n * @param cToken The cToken to get the underlying price of\\n * @return The underlying asset price mantissa (scaled by 1e18).\\n * Zero means the price is unavailable.\\n */\\n function getUnderlyingPrice(CToken cToken) virtual external view returns (uint);\\n}\\n\",\"keccak256\":\"0x3bdb44d513360f19ba6e93960fbf37184cd7952492ab0ee4a91f514b3f2ea923\",\"license\":\"BSD-3-Clause\"},\"src/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\n// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol\\n// Subject to the MIT license.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeMath {\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting on overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n uint256 c;\\n unchecked { c = a + b; }\\n require(c >= a, \\\"SafeMath: addition overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.\\n *\\n * Counterpart to Solidity's `+` operator.\\n *\\n * Requirements:\\n * - Addition cannot overflow.\\n */\\n function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n uint256 c;\\n unchecked { c = a + b; }\\n require(c >= a, errorMessage);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot underflow.\\n */\\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n return sub(a, b, \\\"SafeMath: subtraction underflow\\\");\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).\\n *\\n * Counterpart to Solidity's `-` operator.\\n *\\n * Requirements:\\n * - Subtraction cannot underflow.\\n */\\n function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b <= a, errorMessage);\\n uint256 c = a - b;\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c;\\n unchecked { c = a * b; }\\n require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, reverting on overflow.\\n *\\n * Counterpart to Solidity's `*` operator.\\n *\\n * Requirements:\\n * - Multiplication cannot overflow.\\n */\\n function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) {\\n return 0;\\n }\\n\\n uint256 c;\\n unchecked { c = a * b; }\\n require(c / a == b, errorMessage);\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers.\\n * Reverts on division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n return div(a, b, \\\"SafeMath: division by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the integer division of two unsigned integers.\\n * Reverts with custom message on division by zero. The result is rounded towards zero.\\n *\\n * Counterpart to Solidity's `/` operator. Note: this function uses a\\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n * uses an invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n // Solidity only automatically asserts when dividing by 0\\n require(b > 0, errorMessage);\\n uint256 c = a / b;\\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\\n\\n return c;\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n return mod(a, b, \\\"SafeMath: modulo by zero\\\");\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n * Reverts with custom message when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * Requirements:\\n * - The divisor cannot be zero.\\n */\\n function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n require(b != 0, errorMessage);\\n return a % b;\\n }\\n}\\n\",\"keccak256\":\"0xadaf3cd4210722dbf84790bcdbff78389a0a2772b11e75e42a4f2430a6d1e14e\",\"license\":\"BSD-3-Clause\"},\"src/Treasury/TreasuryInterfaces.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"../EIP20Interface.sol\\\";\\nimport \\\"../IProposal.sol\\\"; \\n\\ncontract TreasuryDelegatorStorage {\\n address public pendingAdmin;\\n address public admin; // admin address (Timelock)\\n address public implementation; // implementation address (TreasuryDelegate)\\n}\\n\\ncontract TreasuryStorageV1 is TreasuryDelegatorStorage {\\n EIP20Interface public note; // note interface, for handling transfers and querying balance\\n IProposal public unigov; // unigov Interface for handling proposals\\n error SendFundError(uint amount);\\n error SenderNotAdmin(address sender);\\n error FailedInitialization();\\n error InvalidAddress();\\n error InsufficientFunds(uint balance, uint funds);\\n error InvalidDenom(string denom);\\n event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\\n event NewAdmin(address oldAdmin, address admin);\\n}\\n\\nabstract contract TreasuryDelegatorInterface {\\n event NewImplementation(address oldImplementation, address newImplementation);\\n event Received(address sender, uint amount); \\n\\n function setImplementation(address implementation_) public virtual;\\n fallback() external payable virtual;\\n receive() external payable virtual;\\n}\\n\\nabstract contract TreasuryInterface is TreasuryStorageV1 {\\n function _setPendingAdmin(address newPendingAdmin) external virtual;\\n function _acceptAdmin() external virtual;\\n\\n function queryCantoBalance() external virtual view returns(uint);\\n function queryNoteBalance() external virtual view returns(uint);\\n function sendFund(address recipient, uint amount, string calldata denom) external virtual;\\n function redeem(address cNote, uint cTokens) external virtual;\\n}\\n\\n\",\"keccak256\":\"0x96d095842fb8d0fd771abdce60232cb3cfaafef1d4e7a838f93b7a1cc6cbcda7\"}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b5060405162000f3638038062000f368339810160408190526200003491620002f2565b6001600160a01b0385166200004857600080fd5b600180546001600160a01b031916331790556040516001600160a01b0382811660248301528581166044830152848116606483015283166084820152620000c290879060a40160408051601f198184030181529190526020810180516001600160e01b03908116637c643b2f60e11b17909152620000fb16565b50620000ce866200017a565b5050600180546001600160a01b0319166001600160a01b03949094169390931790925550620003b1915050565b6060600080846001600160a01b0316846040516200011a919062000373565b600060405180830381855af49150503d806000811462000157576040519150601f19603f3d011682016040523d82523d6000602084013e6200015c565b606091505b5091509150600082141562000172573d60208201fd5b949350505050565b6001546001600160a01b03163314620001ef5760405162461bcd60e51b8152602060048201526033602482015260008051602062000f1683398151915260448201527f6e746174696f6e3a2061646d696e206f6e6c790000000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b0381166200026c5760405162461bcd60e51b8152602060048201526047602482015260008051602062000f1683398151915260448201527f6e746174696f6e3a20696e76616c696420696d706c656d656e746174696f6e206064820152666164647265737360c81b608482015260a401620001e6565b600254604080516001600160a01b03928316815291831660208301527fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b80516001600160a01b0381168114620002ed57600080fd5b919050565b60008060008060008060c087890312156200030c57600080fd5b6200031787620002d5565b95506200032760208801620002d5565b94506200033760408801620002d5565b93506200034760608801620002d5565b92506200035760808801620002d5565b91506200036760a08801620002d5565b90509295509295509295565b6000825160005b818110156200039657602081860181015185830152016200037a565b81811115620003a6576000828501525b509190910192915050565b610b5580620003c16000396000f3fe6080604052600436106100e85760003560e01c806361d027b31161008a578063b972aa0511610059578063b972aa051461036f578063d784d4261461038f578063e9c714f2146103af578063f851a440146103c4576100e8565b806361d027b3146102e1578063778bc487146103015780638003c7d31461032f578063b71d1a0c1461034f576100e8565b80633342f689116100c65780633342f6891461026a5780634487152f146102815780635c60da1b146102a15780635fe3b567146102c1576100e8565b80630933c1ed146101dc578063267822471461021257806326d111f51461024a575b34156101615760405162461bcd60e51b815260206004820152603b60248201527f4163636f756e74616e7444656c656761746f723a66616c6c6261636b3a20636160448201527f6e6e6f742073656e642076616c756520746f2066616c6c6261636b000000000060648201526084015b60405180910390fd5b6002546040516000916001600160a01b03169061018190839036906108cf565b600060405180830381855af49150503d80600081146101bc576040519150601f19603f3d011682016040523d82523d6000602084013e6101c1565b606091505b505090506040513d6000823e8180156101d8573d82f35b3d82fd5b3480156101e857600080fd5b506101fc6101f736600461094e565b6103e4565b60405161020991906109fe565b60405180910390f35b34801561021e57600080fd5b50600054610232906001600160a01b031681565b6040516001600160a01b039091168152602001610209565b34801561025657600080fd5b50600354610232906001600160a01b031681565b34801561027657600080fd5b5061027f610403565b005b34801561028d57600080fd5b506101fc61029c36600461094e565b610438565b3480156102ad57600080fd5b50600254610232906001600160a01b031681565b3480156102cd57600080fd5b50600554610232906001600160a01b031681565b3480156102ed57600080fd5b50600654610232906001600160a01b031681565b34801561030d57600080fd5b5061032161031c366004610a31565b6104fe565b604051908152602001610209565b34801561033b57600080fd5b5061032161034a366004610a31565b610563565b34801561035b57600080fd5b5061027f61036a366004610a4a565b6105ab565b34801561037b57600080fd5b50600454610232906001600160a01b031681565b34801561039b57600080fd5b5061027f6103aa366004610a4a565b610651565b3480156103bb57600080fd5b5061027f6107bc565b3480156103d057600080fd5b50600154610232906001600160a01b031681565b6002546060906103fd906001600160a01b03168361085d565b92915050565b6040805160048152602481019091526020810180516001600160e01b0316633342f68960e01b179052610435906103e4565b50565b6060600080306001600160a01b03168460405160240161045891906109fe565b60408051601f198184030181529181526020820180516001600160e01b0316630933c1ed60e01b1790525161048d9190610a73565b600060405180830381855afa9150503d80600081146104c8576040519150601f19603f3d011682016040523d82523d6000602084013e6104cd565b606091505b509150915060008214156104e2573d60208201fd5b808060200190518101906104f69190610a8f565b949350505050565b6000806105468360405160240161051791815260200190565b60408051601f198184030181529190526020810180516001600160e01b031663778bc48760e01b1790526103e4565b90508080602001905181019061055c9190610b06565b9392505050565b6000806105468360405160240161057c91815260200190565b60408051601f198184030181529190526020810180516001600160e01b0316638003c7d360e01b1790526103e4565b6001546001600160a01b031633146106055760405162461bcd60e51b815260206004820152601f60248201527f4163636f756e74616e7444656c656761746f723a3a61646d696e206f6e6c79006044820152606401610158565b6040516001600160a01b038216602482015261064d9060440160408051601f198184030181529190526020810180516001600160e01b0316632dc7468360e21b1790526103e4565b5050565b6001546001600160a01b031633146106c75760405162461bcd60e51b815260206004820152603360248201527f4163636f756e74616e7444656c656761746f723a3a5f736574496d706c656d656044820152726e746174696f6e3a2061646d696e206f6e6c7960681b6064820152608401610158565b6001600160a01b0381166107535760405162461bcd60e51b815260206004820152604760248201527f4163636f756e74616e7444656c656761746f723a3a5f736574496d706c656d6560448201527f6e746174696f6e3a20696e76616c696420696d706c656d656e746174696f6e206064820152666164647265737360c81b608482015260a401610158565b600254604080516001600160a01b03928316815291831660208301527fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461082b5760405162461bcd60e51b815260206004820152602c60248201527f4163636f756e74616e7444656c656761746f723a3a73656e646572206e6f742060448201526b3832b73234b733a0b236b4b760a11b6064820152608401610158565b6040805160048152602481019091526020810180516001600160e01b03166374e38a7960e11b179052610435906103e4565b6060600080846001600160a01b03168460405161087a9190610a73565b600060405180830381855af49150503d80600081146108b5576040519150601f19603f3d011682016040523d82523d6000602084013e6108ba565b606091505b509150915060008214156104f6573d60208201fd5b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561091e5761091e6108df565b604052919050565b600067ffffffffffffffff821115610940576109406108df565b50601f01601f191660200190565b60006020828403121561096057600080fd5b813567ffffffffffffffff81111561097757600080fd5b8201601f8101841361098857600080fd5b803561099b61099682610926565b6108f5565b8181528560208385010111156109b057600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b838110156109e95781810151838201526020016109d1565b838111156109f8576000848401525b50505050565b6020815260008251806020840152610a1d8160408501602087016109ce565b601f01601f19169190910160400192915050565b600060208284031215610a4357600080fd5b5035919050565b600060208284031215610a5c57600080fd5b81356001600160a01b038116811461055c57600080fd5b60008251610a858184602087016109ce565b9190910192915050565b600060208284031215610aa157600080fd5b815167ffffffffffffffff811115610ab857600080fd5b8201601f81018413610ac957600080fd5b8051610ad761099682610926565b818152856020838501011115610aec57600080fd5b610afd8260208301602086016109ce565b95945050505050565b600060208284031215610b1857600080fd5b505191905056fea2646970667358221220eaa23417c0e274735f080afe6df001716db4ff3db634e29d709b6cf9f41cb8f264736f6c634300080b00334163636f756e74616e7444656c656761746f723a3a5f736574496d706c656d65",
"deployedBytecode": "0x6080604052600436106100e85760003560e01c806361d027b31161008a578063b972aa0511610059578063b972aa051461036f578063d784d4261461038f578063e9c714f2146103af578063f851a440146103c4576100e8565b806361d027b3146102e1578063778bc487146103015780638003c7d31461032f578063b71d1a0c1461034f576100e8565b80633342f689116100c65780633342f6891461026a5780634487152f146102815780635c60da1b146102a15780635fe3b567146102c1576100e8565b80630933c1ed146101dc578063267822471461021257806326d111f51461024a575b34156101615760405162461bcd60e51b815260206004820152603b60248201527f4163636f756e74616e7444656c656761746f723a66616c6c6261636b3a20636160448201527f6e6e6f742073656e642076616c756520746f2066616c6c6261636b000000000060648201526084015b60405180910390fd5b6002546040516000916001600160a01b03169061018190839036906108cf565b600060405180830381855af49150503d80600081146101bc576040519150601f19603f3d011682016040523d82523d6000602084013e6101c1565b606091505b505090506040513d6000823e8180156101d8573d82f35b3d82fd5b3480156101e857600080fd5b506101fc6101f736600461094e565b6103e4565b60405161020991906109fe565b60405180910390f35b34801561021e57600080fd5b50600054610232906001600160a01b031681565b6040516001600160a01b039091168152602001610209565b34801561025657600080fd5b50600354610232906001600160a01b031681565b34801561027657600080fd5b5061027f610403565b005b34801561028d57600080fd5b506101fc61029c36600461094e565b610438565b3480156102ad57600080fd5b50600254610232906001600160a01b031681565b3480156102cd57600080fd5b50600554610232906001600160a01b031681565b3480156102ed57600080fd5b50600654610232906001600160a01b031681565b34801561030d57600080fd5b5061032161031c366004610a31565b6104fe565b604051908152602001610209565b34801561033b57600080fd5b5061032161034a366004610a31565b610563565b34801561035b57600080fd5b5061027f61036a366004610a4a565b6105ab565b34801561037b57600080fd5b50600454610232906001600160a01b031681565b34801561039b57600080fd5b5061027f6103aa366004610a4a565b610651565b3480156103bb57600080fd5b5061027f6107bc565b3480156103d057600080fd5b50600154610232906001600160a01b031681565b6002546060906103fd906001600160a01b03168361085d565b92915050565b6040805160048152602481019091526020810180516001600160e01b0316633342f68960e01b179052610435906103e4565b50565b6060600080306001600160a01b03168460405160240161045891906109fe565b60408051601f198184030181529181526020820180516001600160e01b0316630933c1ed60e01b1790525161048d9190610a73565b600060405180830381855afa9150503d80600081146104c8576040519150601f19603f3d011682016040523d82523d6000602084013e6104cd565b606091505b509150915060008214156104e2573d60208201fd5b808060200190518101906104f69190610a8f565b949350505050565b6000806105468360405160240161051791815260200190565b60408051601f198184030181529190526020810180516001600160e01b031663778bc48760e01b1790526103e4565b90508080602001905181019061055c9190610b06565b9392505050565b6000806105468360405160240161057c91815260200190565b60408051601f198184030181529190526020810180516001600160e01b0316638003c7d360e01b1790526103e4565b6001546001600160a01b031633146106055760405162461bcd60e51b815260206004820152601f60248201527f4163636f756e74616e7444656c656761746f723a3a61646d696e206f6e6c79006044820152606401610158565b6040516001600160a01b038216602482015261064d9060440160408051601f198184030181529190526020810180516001600160e01b0316632dc7468360e21b1790526103e4565b5050565b6001546001600160a01b031633146106c75760405162461bcd60e51b815260206004820152603360248201527f4163636f756e74616e7444656c656761746f723a3a5f736574496d706c656d656044820152726e746174696f6e3a2061646d696e206f6e6c7960681b6064820152608401610158565b6001600160a01b0381166107535760405162461bcd60e51b815260206004820152604760248201527f4163636f756e74616e7444656c656761746f723a3a5f736574496d706c656d6560448201527f6e746174696f6e3a20696e76616c696420696d706c656d656e746174696f6e206064820152666164647265737360c81b608482015260a401610158565b600254604080516001600160a01b03928316815291831660208301527fd604de94d45953f9138079ec1b82d533cb2160c906d1076d1f7ed54befbca97a910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461082b5760405162461bcd60e51b815260206004820152602c60248201527f4163636f756e74616e7444656c656761746f723a3a73656e646572206e6f742060448201526b3832b73234b733a0b236b4b760a11b6064820152608401610158565b6040805160048152602481019091526020810180516001600160e01b03166374e38a7960e11b179052610435906103e4565b6060600080846001600160a01b03168460405161087a9190610a73565b600060405180830381855af49150503d80600081146108b5576040519150601f19603f3d011682016040523d82523d6000602084013e6108ba565b606091505b509150915060008214156104f6573d60208201fd5b8183823760009101908152919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561091e5761091e6108df565b604052919050565b600067ffffffffffffffff821115610940576109406108df565b50601f01601f191660200190565b60006020828403121561096057600080fd5b813567ffffffffffffffff81111561097757600080fd5b8201601f8101841361098857600080fd5b803561099b61099682610926565b6108f5565b8181528560208385010111156109b057600080fd5b81602084016020830137600091810160200191909152949350505050565b60005b838110156109e95781810151838201526020016109d1565b838111156109f8576000848401525b50505050565b6020815260008251806020840152610a1d8160408501602087016109ce565b601f01601f19169190910160400192915050565b600060208284031215610a4357600080fd5b5035919050565b600060208284031215610a5c57600080fd5b81356001600160a01b038116811461055c57600080fd5b60008251610a858184602087016109ce565b9190910192915050565b600060208284031215610aa157600080fd5b815167ffffffffffffffff811115610ab857600080fd5b8201601f81018413610ac957600080fd5b8051610ad761099682610926565b818152856020838501011115610aec57600080fd5b610afd8260208301602086016109ce565b95945050505050565b600060208284031215610b1857600080fd5b505191905056fea2646970667358221220eaa23417c0e274735f080afe6df001716db4ff3db634e29d709b6cf9f41cb8f264736f6c634300080b0033",
"devdoc": {
"kind": "dev",
"methods": {
"constructor": {
"params": {
"admin_": "admin address (Timelock)",
"cnoteAddress_": "lending market address (CNote)",
"comptrollerAddress_": ", address of Comptroller Delegator(Unitroller)",
"implementation_": "implementation address (the AccountantDelegate)",
"noteAddress_": "note address (note erc20 contract)",
"treasury_": "treasury address (TreasuryDelegator)"
}
},
"delegateToImplementation(bytes)": {
"details": "It returns to the external caller whatever the implementation returns or forwards reverts",
"params": {
"data": "The raw data to delegatecall"
},
"returns": {
"_0": "The returned bytes from the delegatecall"
}
},
"delegateToViewImplementation(bytes)": {
"details": "It returns to the external caller whatever the implementation returns or forwards reverts There are an additional 2 prefix uints from the wrapper returndata, which we ignore since we make an extra hop.",
"params": {
"data": "The raw data to delegatecall"
},
"returns": {
"_0": "The returned bytes from the delegatecall"
}
},
"redeemMarket(uint256)": {
"params": {
"amount": "The address of the ERC-20 token to sweep"
}
},
"setImplementation(address)": {
"params": {
"implementation_": "The address of the new implementation for delegation"
}
},
"supplyMarket(uint256)": {
"params": {
"amount": "amount of Note Accountant is supplying to market"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"delegateToImplementation(bytes)": {
"notice": "Delegates execution to the implementation contract"
},
"delegateToViewImplementation(bytes)": {
"notice": "Delegates execution to an implementation contract"
},
"redeemMarket(uint256)": {
"notice": "A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)"
},
"setImplementation(address)": {
"notice": "Called by the admin to update the implementation of the delegator"
},
"supplyMarket(uint256)": {
"notice": "A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)"
},
"sweepInterest()": {
"notice": "A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)"
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 749,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "pendingAdmin",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 751,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "admin",
"offset": 0,
"slot": "1",
"type": "t_address"
},
{
"astId": 753,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "implementation",
"offset": 0,
"slot": "2",
"type": "t_address"
},
{
"astId": 791,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "note",
"offset": 0,
"slot": "3",
"type": "t_contract(Note)20842"
},
{
"astId": 794,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "cnote",
"offset": 0,
"slot": "4",
"type": "t_contract(CNote)4139"
},
{
"astId": 797,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "comptroller",
"offset": 0,
"slot": "5",
"type": "t_contract(ComptrollerInterface)14870"
},
{
"astId": 799,
"contract": "src/Accountant/AccountantDelegator.sol:AccountantDelegator",
"label": "treasury",
"offset": 0,
"slot": "6",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(CNote)4139": {
"encoding": "inplace",
"label": "contract CNote",
"numberOfBytes": "20"
},
"t_contract(ComptrollerInterface)14870": {
"encoding": "inplace",
"label": "contract ComptrollerInterface",
"numberOfBytes": "20"
},
"t_contract(Note)20842": {
"encoding": "inplace",
"label": "contract Note",
"numberOfBytes": "20"
}
}
}
}