-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTreasuryDelegate.json
More file actions
412 lines (412 loc) · 251 KB
/
Copy pathTreasuryDelegate.json
File metadata and controls
412 lines (412 loc) · 251 KB
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
{
"address": "0x0dEE3d0F890dDaaA44D6bD2ce99b746cB7C6aF56",
"abi": [
{
"inputs": [],
"name": "FailedInitialization",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "balance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "funds",
"type": "uint256"
}
],
"name": "InsufficientFunds",
"type": "error"
},
{
"inputs": [],
"name": "InvalidAddress",
"type": "error"
},
{
"inputs": [
{
"internalType": "string",
"name": "denom",
"type": "string"
}
],
"name": "InvalidDenom",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "SendFundError",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "SenderNotAdmin",
"type": "error"
},
{
"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": "oldPendingAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newPendingAdmin",
"type": "address"
}
],
"name": "NewPendingAdmin",
"type": "event"
},
{
"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": "implementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "note_",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "note",
"outputs": [
{
"internalType": "contract EIP20Interface",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "queryCantoBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "queryNoteBalance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "cNote",
"type": "address"
},
{
"internalType": "uint256",
"name": "cTokens",
"type": "uint256"
}
],
"name": "redeem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "string",
"name": "denom",
"type": "string"
}
],
"name": "sendFund",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unigov",
"outputs": [
{
"internalType": "contract IProposal",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x430ef03d3570d61369cc151637956bd7ac68954c3e9db560f551f6366200a7f1",
"receipt": {
"to": null,
"from": "0x2fA8e44e9A3D833019FCc52D62B4dD05125cA1b1",
"contractAddress": "0x0dEE3d0F890dDaaA44D6bD2ce99b746cB7C6aF56",
"transactionIndex": 0,
"gasUsed": "628952",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xe5a3117be56294cc02a504a1dcda39ad047819b5eb13faaa26a0ca35073b17d5",
"transactionHash": "0x430ef03d3570d61369cc151637956bd7ac68954c3e9db560f551f6366200a7f1",
"logs": [],
"blockNumber": 224949,
"cumulativeGasUsed": "628952",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 2,
"solcInputHash": "a822655fb04b3944b585567b09afe37c",
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"FailedInitialization\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"funds\",\"type\":\"uint256\"}],\"name\":\"InsufficientFunds\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"denom\",\"type\":\"string\"}],\"name\":\"InvalidDenom\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SendFundError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"SenderNotAdmin\",\"type\":\"error\"},{\"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\":\"oldPendingAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newPendingAdmin\",\"type\":\"address\"}],\"name\":\"NewPendingAdmin\",\"type\":\"event\"},{\"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\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"note_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"note\",\"outputs\":[{\"internalType\":\"contract EIP20Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"queryCantoBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"queryNoteBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"cNote\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cTokens\",\"type\":\"uint256\"}],\"name\":\"redeem\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"denom\",\"type\":\"string\"}],\"name\":\"sendFund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unigov\",\"outputs\":[{\"internalType\":\"contract IProposal\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"_acceptAdmin()\":{\"details\":\"Admin function for pending admin to accept role and update admin\"},\"_setPendingAdmin(address)\":{\"details\":\"Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\",\"params\":{\"newPendingAdmin\":\"New pending admin.\"}},\"initialize(address)\":{\"params\":{\"note_\":\"The address of note ERC20 contract\"}},\"queryCantoBalance()\":{\"returns\":{\"_0\":\"treasuryCantoBalance the canto balance\"}},\"queryNoteBalance()\":{\"returns\":{\"_0\":\"treasuryNoteBalance the note balance \"}},\"sendFund(address,uint256,string)\":{\"details\":\"Only the admin can call this method (Timelock contract)\",\"params\":{\"amount\":\"Amount to send\",\"denom\":\"Denomination of fund to send \",\"recipient\":\"Address receiving funds\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"_acceptAdmin()\":{\"notice\":\"Accepts transfer of admin rights. msg.sender must be pendingAdmin\"},\"_setPendingAdmin(address)\":{\"notice\":\"Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.\"},\"initialize(address)\":{\"notice\":\"Initializes the note contract\"},\"queryCantoBalance()\":{\"notice\":\"Method to query current balance of CANTO in the treasury\"},\"queryNoteBalance()\":{\"notice\":\"Method to query current balance of NOTE in the treasury \"},\"sendFund(address,uint256,string)\":{\"notice\":\"Method to send treasury funds to recipient\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Treasury/TreasuryDelegate.sol\":\"TreasuryDelegate\"},\"evmVersion\":\"london\",\"libraries\":{\":__CACHE_BREAKER__\":\"0x0000000000000031363630313837333733303434\"},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"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/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/Comptroller.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./CToken.sol\\\";\\nimport \\\"./ErrorReporter.sol\\\";\\nimport \\\"./PriceOracle.sol\\\";\\nimport \\\"./ComptrollerInterface.sol\\\";\\nimport \\\"./ComptrollerStorage.sol\\\";\\nimport \\\"./Unitroller.sol\\\";\\nimport \\\"./Governance/Comp.sol\\\";\\nimport \\\"./WETH.sol\\\";\\n/**\\n * @title Compound's Comptroller Contract\\n * @author Compound\\n */\\ncontract Comptroller is ComptrollerV7Storage, ComptrollerInterface, ComptrollerErrorReporter, ExponentialNoError {\\n /// @notice Emitted when an admin supports a market\\n event MarketListed(CToken cToken);\\n\\n /// @notice Emitted when an account enters a market\\n event MarketEntered(CToken cToken, address account);\\n\\n /// @notice Emitted when an account exits a market\\n event MarketExited(CToken cToken, address account);\\n\\n /// @notice Emitted when close factor is changed by admin\\n event NewCloseFactor(uint oldCloseFactorMantissa, uint newCloseFactorMantissa);\\n\\n /// @notice Emitted when a collateral factor is changed by admin\\n event NewCollateralFactor(CToken cToken, uint oldCollateralFactorMantissa, uint newCollateralFactorMantissa);\\n\\n /// @notice Emitted when liquidation incentive is changed by admin\\n event NewLiquidationIncentive(uint oldLiquidationIncentiveMantissa, uint newLiquidationIncentiveMantissa);\\n\\n /// @notice Emitted when price oracle is changed\\n event NewPriceOracle(PriceOracle oldPriceOracle, PriceOracle newPriceOracle);\\n\\n /// @notice Emitted when pause guardian is changed\\n event NewPauseGuardian(address oldPauseGuardian, address newPauseGuardian);\\n\\n /// @notice Emitted when an action is paused globally\\n event ActionPaused(string action, bool pauseState);\\n\\n /// @notice Emitted when an action is paused on a market\\n event ActionPaused(CToken cToken, string action, bool pauseState);\\n\\n /// @notice Emitted when a new borrow-side COMP speed is calculated for a market\\n event CompBorrowSpeedUpdated(CToken indexed cToken, uint newSpeed);\\n\\n /// @notice Emitted when a new supply-side COMP speed is calculated for a market\\n event CompSupplySpeedUpdated(CToken indexed cToken, uint newSpeed);\\n\\n /// @notice Emitted when a new COMP speed is set for a contributor\\n event ContributorCompSpeedUpdated(address indexed contributor, uint newSpeed);\\n\\n /// @notice Emitted when COMP is distributed to a supplier\\n event DistributedSupplierComp(CToken indexed cToken, address indexed supplier, uint compDelta, uint compSupplyIndex);\\n\\n /// @notice Emitted when COMP is distributed to a borrower\\n event DistributedBorrowerComp(CToken indexed cToken, address indexed borrower, uint compDelta, uint compBorrowIndex);\\n\\n /// @notice Emitted when borrow cap for a cToken is changed\\n event NewBorrowCap(CToken indexed cToken, uint newBorrowCap);\\n\\n /// @notice Emitted when borrow cap guardian is changed\\n event NewBorrowCapGuardian(address oldBorrowCapGuardian, address newBorrowCapGuardian);\\n\\n /// @notice Emitted when COMP is granted by admin\\n event CompGranted(address recipient, uint amount);\\n\\n /// @notice Emitted when COMP accrued for a user has been manually adjusted.\\n event CompAccruedAdjusted(address indexed user, uint oldCompAccrued, uint newCompAccrued);\\n\\n /// @notice Emitted when COMP receivable for a user has been updated.\\n event CompReceivableUpdated(address indexed user, uint oldCompReceivable, uint newCompReceivable);\\n\\n /// @notice The initial COMP index for a market\\n uint224 public constant compInitialIndex = 1e36;\\n\\n // closeFactorMantissa must be strictly greater than this value\\n uint internal constant closeFactorMinMantissa = 0.05e18; // 0.05\\n\\n // closeFactorMantissa must not exceed this value\\n uint internal constant closeFactorMaxMantissa = 0.9e18; // 0.9\\n\\n // No collateralFactorMantissa may exceed this value\\n uint internal constant collateralFactorMaxMantissa = 0.9e18; // 0.9\\n\\n\\n //here for testing purposes\\n address public WethAddr;\\n\\n\\n constructor() {\\n admin = msg.sender;\\n }\\n\\n /*** Assets You Are In ***/\\n\\n /**\\n * @notice Returns the assets an account has entered\\n * @param account The address of the account to pull assets for\\n * @return A dynamic list with the assets the account has entered\\n */\\n function getAssetsIn(address account) external view returns (CToken[] memory) {\\n CToken[] memory assetsIn = accountAssets[account];\\n\\n return assetsIn;\\n }\\n\\n /**\\n * @notice Returns whether the given account is entered in the given asset\\n * @param account The address of the account to check\\n * @param cToken The cToken to check\\n * @return True if the account is in the asset, otherwise false.\\n */\\n function checkMembership(address account, CToken cToken) external view returns (bool) {\\n return markets[address(cToken)].accountMembership[account];\\n }\\n\\n /**\\n * @notice Add assets to be included in account liquidity calculation\\n * @param cTokens The list of addresses of the cToken markets to be enabled\\n * @return Success indicator for whether each corresponding market was entered\\n */\\n function enterMarkets(address[] memory cTokens) override public returns (uint[] memory) {\\n uint len = cTokens.length;\\n\\n uint[] memory results = new uint[](len);\\n for (uint i = 0; i < len; i++) {\\n CToken cToken = CToken(cTokens[i]);\\n\\n results[i] = uint(addToMarketInternal(cToken, msg.sender));\\n }\\n\\n return results;\\n }\\n\\n /**\\n * @notice Add the market to the borrower's \\\"assets in\\\" for liquidity calculations\\n * @param cToken The market to enter\\n * @param borrower The address of the account to modify\\n * @return Success indicator for whether the market was entered\\n */\\n function addToMarketInternal(CToken cToken, address borrower) internal returns (Error) {\\n Market storage marketToJoin = markets[address(cToken)];\\n\\n if (!marketToJoin.isListed) {\\n // market is not listed, cannot join\\n return Error.MARKET_NOT_LISTED;\\n }\\n\\n if (marketToJoin.accountMembership[borrower] == true) {\\n // already joined\\n return Error.NO_ERROR;\\n }\\n\\n // survived the gauntlet, add to list\\n // NOTE: we store these somewhat redundantly as a significant optimization\\n // this avoids having to iterate through the list for the most common use cases\\n // that is, only when we need to perform liquidity checks\\n // and not whenever we want to check if an account is in a particular market\\n marketToJoin.accountMembership[borrower] = true;\\n accountAssets[borrower].push(cToken);\\n\\n emit MarketEntered(cToken, borrower);\\n\\n return Error.NO_ERROR;\\n }\\n\\n /**\\n * @notice Removes asset from sender's account liquidity calculation\\n * @dev Sender must not have an outstanding borrow balance in the asset,\\n * or be providing necessary collateral for an outstanding borrow.\\n * @param cTokenAddress The address of the asset to be removed\\n * @return Whether or not the account successfully exited the market\\n */\\n function exitMarket(address cTokenAddress) override external returns (uint) {\\n CToken cToken = CToken(cTokenAddress);\\n /* Get sender tokensHeld and amountOwed underlying from the cToken */\\n (uint oErr, uint tokensHeld, uint amountOwed, ) = cToken.getAccountSnapshot(msg.sender);\\n require(oErr == 0, \\\"exitMarket: getAccountSnapshot failed\\\"); // semi-opaque error code\\n\\n /* Fail if the sender has a borrow balance */\\n if (amountOwed != 0) {\\n return fail(Error.NONZERO_BORROW_BALANCE, FailureInfo.EXIT_MARKET_BALANCE_OWED);\\n }\\n\\n /* Fail if the sender is not permitted to redeem all of their tokens */\\n uint allowed = redeemAllowedInternal(cTokenAddress, msg.sender, tokensHeld);\\n if (allowed != 0) {\\n return failOpaque(Error.REJECTION, FailureInfo.EXIT_MARKET_REJECTION, allowed);\\n }\\n\\n Market storage marketToExit = markets[address(cToken)];\\n\\n /* Return true if the sender is not already \\u2018in\\u2019 the market */\\n if (!marketToExit.accountMembership[msg.sender]) {\\n return uint(Error.NO_ERROR);\\n }\\n\\n /* Set cToken account membership to false */\\n delete marketToExit.accountMembership[msg.sender];\\n\\n /* Delete cToken from the account\\u2019s list of assets */\\n // load into memory for faster iteration\\n CToken[] memory userAssetList = accountAssets[msg.sender];\\n uint len = userAssetList.length;\\n uint assetIndex = len;\\n for (uint i = 0; i < len; i++) {\\n if (userAssetList[i] == cToken) {\\n assetIndex = i;\\n break;\\n }\\n }\\n\\n // We *must* have found the asset in the list or our redundant data structure is broken\\n assert(assetIndex < len);\\n\\n // copy last item in list to location of item to be removed, reduce length by 1\\n CToken[] storage storedList = accountAssets[msg.sender];\\n storedList[assetIndex] = storedList[storedList.length - 1];\\n storedList.pop();\\n\\n emit MarketExited(cToken, msg.sender);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /*** Policy Hooks ***/\\n\\n /**\\n * @notice Checks if the account should be allowed to mint tokens in the given market\\n * @param cToken The market to verify the mint against\\n * @param minter The account which would get the minted tokens\\n * @param mintAmount The amount of underlying being supplied to the market in exchange for tokens\\n * @return 0 if the mint is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\\n */\\n function mintAllowed(address cToken, address minter, uint mintAmount) override external returns (uint) {\\n // Pausing is a very serious situation - we revert to sound the alarms\\n require(!mintGuardianPaused[cToken], \\\"mint is paused\\\");\\n\\n // Shh - currently unused\\n minter;\\n mintAmount;\\n\\n if (!markets[cToken].isListed) {\\n return uint(Error.MARKET_NOT_LISTED);\\n }\\n\\n // Keep the flywheel moving\\n updateCompSupplyIndex(cToken);\\n distributeSupplierComp(cToken, minter);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates mint and reverts on rejection. May emit logs.\\n * @param cToken Asset being minted\\n * @param minter The address minting the tokens\\n * @param actualMintAmount The amount of the underlying asset being minted\\n * @param mintTokens The number of tokens being minted\\n */\\n function mintVerify(address cToken, address minter, uint actualMintAmount, uint mintTokens) override external {\\n // Shh - currently unused\\n cToken;\\n minter;\\n actualMintAmount;\\n mintTokens;\\n\\n // Shh - we don't ever want this hook to be marked pure\\n if (false) {\\n maxAssets = maxAssets;\\n }\\n }\\n\\n /**\\n * @notice Checks if the account should be allowed to redeem tokens in the given market\\n * @param cToken The market to verify the redeem against\\n * @param redeemer The account which would redeem the tokens\\n * @param redeemTokens The number of cTokens to exchange for the underlying asset in the market\\n * @return 0 if the redeem is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\\n */\\n function redeemAllowed(address cToken, address redeemer, uint redeemTokens) override external returns (uint) {\\n uint allowed = redeemAllowedInternal(cToken, redeemer, redeemTokens);\\n if (allowed != uint(Error.NO_ERROR)) {\\n return allowed;\\n }\\n\\n // Keep the flywheel moving\\n updateCompSupplyIndex(cToken);\\n distributeSupplierComp(cToken, redeemer);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n function redeemAllowedInternal(address cToken, address redeemer, uint redeemTokens) internal view returns (uint) {\\n if (!markets[cToken].isListed) {\\n return uint(Error.MARKET_NOT_LISTED);\\n }\\n\\n /* If the redeemer is not 'in' the market, then we can bypass the liquidity check */\\n if (!markets[cToken].accountMembership[redeemer]) {\\n return uint(Error.NO_ERROR);\\n }\\n\\n /* Otherwise, perform a hypothetical liquidity check to guard against shortfall */\\n (Error err, , uint shortfall) = getHypotheticalAccountLiquidityInternal(redeemer, CToken(cToken), redeemTokens, 0);\\n if (err != Error.NO_ERROR) {\\n return uint(err);\\n }\\n if (shortfall > 0) {\\n return uint(Error.INSUFFICIENT_LIQUIDITY);\\n }\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates redeem and reverts on rejection. May emit logs.\\n * @param cToken Asset being redeemed\\n * @param redeemer The address redeeming the tokens\\n * @param redeemAmount The amount of the underlying asset being redeemed\\n * @param redeemTokens The number of tokens being redeemed\\n */\\n function redeemVerify(address cToken, address redeemer, uint redeemAmount, uint redeemTokens) override external {\\n // Shh - currently unused\\n cToken;\\n redeemer;\\n\\n // Require tokens is zero or amount is also zero\\n if (redeemTokens == 0 && redeemAmount > 0) {\\n revert(\\\"redeemTokens zero\\\");\\n }\\n }\\n\\n /**\\n * @notice Checks if the account should be allowed to borrow the underlying asset of the given market\\n * @param cToken The market to verify the borrow against\\n * @param borrower The account which would borrow the asset\\n * @param borrowAmount The amount of underlying the account would borrow\\n * @return 0 if the borrow is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\\n */\\n function borrowAllowed(address cToken, address borrower, uint borrowAmount) override external returns (uint) {\\n // Pausing is a very serious situation - we revert to sound the alarms\\n require(!borrowGuardianPaused[cToken], \\\"borrow is paused\\\");\\n\\n if (!markets[cToken].isListed) {\\n return uint(Error.MARKET_NOT_LISTED);\\n }\\n\\n if (!markets[cToken].accountMembership[borrower]) {\\n // only cTokens may call borrowAllowed if borrower not in market\\n require(msg.sender == cToken, \\\"sender must be cToken\\\");\\n\\n // attempt to add borrower to the market\\n Error err = addToMarketInternal(CToken(msg.sender), borrower);\\n if (err != Error.NO_ERROR) {\\n return uint(err);\\n }\\n\\n // it should be impossible to break the important invariant\\n assert(markets[cToken].accountMembership[borrower]);\\n }\\n\\n if (oracle.getUnderlyingPrice(CToken(cToken)) == 0) {\\n return uint(Error.PRICE_ERROR);\\n }\\n\\n\\n uint borrowCap = borrowCaps[cToken];\\n // Borrow cap of 0 corresponds to unlimited borrowing\\n if (borrowCap != 0) {\\n uint totalBorrows = CToken(cToken).totalBorrows();\\n uint nextTotalBorrows = add_(totalBorrows, borrowAmount);\\n require(nextTotalBorrows < borrowCap, \\\"market borrow cap reached\\\");\\n }\\n\\n (Error err, , uint shortfall) = getHypotheticalAccountLiquidityInternal(borrower, CToken(cToken), 0, borrowAmount);\\n if (err != Error.NO_ERROR) {\\n return uint(err);\\n }\\n if (shortfall > 0) {\\n return uint(Error.INSUFFICIENT_LIQUIDITY);\\n }\\n\\n // Keep the flywheel moving\\n Exp memory borrowIndex = Exp({mantissa: CToken(cToken).borrowIndex()});\\n updateCompBorrowIndex(cToken, borrowIndex);\\n distributeBorrowerComp(cToken, borrower, borrowIndex);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates borrow and reverts on rejection. May emit logs.\\n * @param cToken Asset whose underlying is being borrowed\\n * @param borrower The address borrowing the underlying\\n * @param borrowAmount The amount of the underlying asset requested to borrow\\n */\\n function borrowVerify(address cToken, address borrower, uint borrowAmount) override external {\\n // Shh - currently unused\\n cToken;\\n borrower;\\n borrowAmount;\\n\\n // Shh - we don't ever want this hook to be marked pure\\n if (false) {\\n maxAssets = maxAssets;\\n }\\n }\\n\\n /**\\n * @notice Checks if the account should be allowed to repay a borrow in the given market\\n * @param cToken The market to verify the repay against\\n * @param payer The account which would repay the asset\\n * @param borrower The account which would borrowed the asset\\n * @param repayAmount The amount of the underlying asset the account would repay\\n * @return 0 if the repay is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\\n */\\n function repayBorrowAllowed(\\n address cToken,\\n address payer,\\n address borrower,\\n uint repayAmount) override external returns (uint) {\\n // Shh - currently unused\\n payer;\\n borrower;\\n repayAmount;\\n\\n if (!markets[cToken].isListed) {\\n return uint(Error.MARKET_NOT_LISTED);\\n }\\n\\n // Keep the flywheel moving\\n Exp memory borrowIndex = Exp({mantissa: CToken(cToken).borrowIndex()});\\n updateCompBorrowIndex(cToken, borrowIndex);\\n distributeBorrowerComp(cToken, borrower, borrowIndex);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates repayBorrow and reverts on rejection. May emit logs.\\n * @param cToken Asset being repaid\\n * @param payer The address repaying the borrow\\n * @param borrower The address of the borrower\\n * @param actualRepayAmount The amount of underlying being repaid\\n */\\n function repayBorrowVerify(\\n address cToken,\\n address payer,\\n address borrower,\\n uint actualRepayAmount,\\n uint borrowerIndex) override external {\\n // Shh - currently unused\\n cToken;\\n payer;\\n borrower;\\n actualRepayAmount;\\n borrowerIndex;\\n\\n // Shh - we don't ever want this hook to be marked pure\\n if (false) {\\n maxAssets = maxAssets;\\n }\\n }\\n\\n /**\\n * @notice Checks if the liquidation should be allowed to occur\\n * @param cTokenBorrowed Asset which was borrowed by the borrower\\n * @param cTokenCollateral Asset which was used as collateral and will be seized\\n * @param liquidator The address repaying the borrow and seizing the collateral\\n * @param borrower The address of the borrower\\n * @param repayAmount The amount of underlying being repaid\\n */\\n function liquidateBorrowAllowed(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n address liquidator,\\n address borrower,\\n uint repayAmount) override external returns (uint) {\\n // Shh - currently unused\\n liquidator;\\n\\n if (!markets[cTokenBorrowed].isListed || !markets[cTokenCollateral].isListed) {\\n return uint(Error.MARKET_NOT_LISTED);\\n }\\n\\n uint borrowBalance = CToken(cTokenBorrowed).borrowBalanceStored(borrower);\\n\\n /* allow accounts to be liquidated if the market is deprecated */\\n if (isDeprecated(CToken(cTokenBorrowed))) {\\n require(borrowBalance >= repayAmount, \\\"Can not repay more than the total borrow\\\");\\n } else {\\n /* The borrower must have shortfall in order to be liquidatable */\\n (Error err, , uint shortfall) = getAccountLiquidityInternal(borrower);\\n if (err != Error.NO_ERROR) {\\n return uint(err);\\n }\\n\\n if (shortfall == 0) {\\n return uint(Error.INSUFFICIENT_SHORTFALL);\\n }\\n\\n /* The liquidator may not repay more than what is allowed by the closeFactor */\\n uint maxClose = mul_ScalarTruncate(Exp({mantissa: closeFactorMantissa}), borrowBalance);\\n if (repayAmount > maxClose) {\\n return uint(Error.TOO_MUCH_REPAY);\\n }\\n }\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates liquidateBorrow and reverts on rejection. May emit logs.\\n * @param cTokenBorrowed Asset which was borrowed by the borrower\\n * @param cTokenCollateral Asset which was used as collateral and will be seized\\n * @param liquidator The address repaying the borrow and seizing the collateral\\n * @param borrower The address of the borrower\\n * @param actualRepayAmount The amount of underlying being repaid\\n */\\n function liquidateBorrowVerify(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n address liquidator,\\n address borrower,\\n uint actualRepayAmount,\\n uint seizeTokens) override external {\\n // Shh - currently unused\\n cTokenBorrowed;\\n cTokenCollateral;\\n liquidator;\\n borrower;\\n actualRepayAmount;\\n seizeTokens;\\n\\n // Shh - we don't ever want this hook to be marked pure\\n if (false) {\\n maxAssets = maxAssets;\\n }\\n }\\n\\n /**\\n * @notice Checks if the seizing of assets should be allowed to occur\\n * @param cTokenCollateral Asset which was used as collateral and will be seized\\n * @param cTokenBorrowed Asset which was borrowed by the borrower\\n * @param liquidator The address repaying the borrow and seizing the collateral\\n * @param borrower The address of the borrower\\n * @param seizeTokens The number of collateral tokens to seize\\n */\\n function seizeAllowed(\\n address cTokenCollateral,\\n address cTokenBorrowed,\\n address liquidator,\\n address borrower,\\n uint seizeTokens) override external returns (uint) {\\n // Pausing is a very serious situation - we revert to sound the alarms\\n require(!seizeGuardianPaused, \\\"seize is paused\\\");\\n\\n // Shh - currently unused\\n seizeTokens;\\n\\n if (!markets[cTokenCollateral].isListed || !markets[cTokenBorrowed].isListed) {\\n return uint(Error.MARKET_NOT_LISTED);\\n }\\n\\n if (CToken(cTokenCollateral).comptroller() != CToken(cTokenBorrowed).comptroller()) {\\n return uint(Error.COMPTROLLER_MISMATCH);\\n }\\n\\n // Keep the flywheel moving\\n updateCompSupplyIndex(cTokenCollateral);\\n distributeSupplierComp(cTokenCollateral, borrower);\\n distributeSupplierComp(cTokenCollateral, liquidator);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates seize and reverts on rejection. May emit logs.\\n * @param cTokenCollateral Asset which was used as collateral and will be seized\\n * @param cTokenBorrowed Asset which was borrowed by the borrower\\n * @param liquidator The address repaying the borrow and seizing the collateral\\n * @param borrower The address of the borrower\\n * @param seizeTokens The number of collateral tokens to seize\\n */\\n function seizeVerify(\\n address cTokenCollateral,\\n address cTokenBorrowed,\\n address liquidator,\\n address borrower,\\n uint seizeTokens) override external {\\n // Shh - currently unused\\n cTokenCollateral;\\n cTokenBorrowed;\\n liquidator;\\n borrower;\\n seizeTokens;\\n\\n // Shh - we don't ever want this hook to be marked pure\\n if (false) {\\n maxAssets = maxAssets;\\n }\\n }\\n\\n /**\\n * @notice Checks if the account should be allowed to transfer tokens in the given market\\n * @param cToken The market to verify the transfer against\\n * @param src The account which sources the tokens\\n * @param dst The account which receives the tokens\\n * @param transferTokens The number of cTokens to transfer\\n * @return 0 if the transfer is allowed, otherwise a semi-opaque error code (See ErrorReporter.sol)\\n */\\n function transferAllowed(address cToken, address src, address dst, uint transferTokens) override external returns (uint) {\\n // Pausing is a very serious situation - we revert to sound the alarms\\n require(!transferGuardianPaused, \\\"transfer is paused\\\");\\n\\n // Currently the only consideration is whether or not\\n // the src is allowed to redeem this many tokens\\n uint allowed = redeemAllowedInternal(cToken, src, transferTokens);\\n if (allowed != uint(Error.NO_ERROR)) {\\n return allowed;\\n }\\n\\n // Keep the flywheel moving\\n updateCompSupplyIndex(cToken);\\n distributeSupplierComp(cToken, src);\\n distributeSupplierComp(cToken, dst);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Validates transfer and reverts on rejection. May emit logs.\\n * @param cToken Asset being transferred\\n * @param src The account which sources the tokens\\n * @param dst The account which receives the tokens\\n * @param transferTokens The number of cTokens to transfer\\n */\\n function transferVerify(address cToken, address src, address dst, uint transferTokens) override external {\\n // Shh - currently unused\\n cToken;\\n src;\\n dst;\\n transferTokens;\\n\\n // Shh - we don't ever want this hook to be marked pure\\n if (false) {\\n maxAssets = maxAssets;\\n }\\n }\\n\\n /*** Liquidity/Liquidation Calculations ***/\\n\\n /**\\n * @dev Local vars for avoiding stack-depth limits in calculating account liquidity.\\n * Note that `cTokenBalance` is the number of cTokens the account owns in the market,\\n * whereas `borrowBalance` is the amount of underlying that the account has borrowed.\\n */\\n struct AccountLiquidityLocalVars {\\n uint sumCollateral;\\n uint sumBorrowPlusEffects;\\n uint cTokenBalance;\\n uint borrowBalance;\\n uint exchangeRateMantissa;\\n uint oraclePriceMantissa;\\n Exp collateralFactor;\\n Exp exchangeRate;\\n Exp oraclePrice;\\n Exp tokensToDenom;\\n }\\n\\n /**\\n * @notice Determine the current account liquidity wrt collateral requirements\\n * @return (possible error code (semi-opaque),\\n account liquidity in excess of collateral requirements,\\n * account shortfall below collateral requirements)\\n */\\n function getAccountLiquidity(address account) public view returns (uint, uint, uint) {\\n (Error err, uint liquidity, uint shortfall) = getHypotheticalAccountLiquidityInternal(account, CToken(address(0)), 0, 0);\\n\\n return (uint(err), liquidity, shortfall);\\n }\\n\\n /**\\n * @notice Determine the current account liquidity wrt collateral requirements\\n * @return (possible error code,\\n account liquidity in excess of collateral requirements,\\n * account shortfall below collateral requirements)\\n */\\n function getAccountLiquidityInternal(address account) internal view returns (Error, uint, uint) {\\n return getHypotheticalAccountLiquidityInternal(account, CToken(address(0)), 0, 0);\\n }\\n\\n /**\\n * @notice Determine what the account liquidity would be if the given amounts were redeemed/borrowed\\n * @param cTokenModify The market to hypothetically redeem/borrow in\\n * @param account The account to determine liquidity for\\n * @param redeemTokens The number of tokens to hypothetically redeem\\n * @param borrowAmount The amount of underlying to hypothetically borrow\\n * @return (possible error code (semi-opaque),\\n hypothetical account liquidity in excess of collateral requirements,\\n * hypothetical account shortfall below collateral requirements)\\n */\\n function getHypotheticalAccountLiquidity(\\n address account,\\n address cTokenModify,\\n uint redeemTokens,\\n uint borrowAmount) public view returns (uint, uint, uint) {\\n (Error err, uint liquidity, uint shortfall) = getHypotheticalAccountLiquidityInternal(account, CToken(cTokenModify), redeemTokens, borrowAmount);\\n return (uint(err), liquidity, shortfall);\\n }\\n \\n\\n /**\\n * @notice Determine what the account liquidity would be if the given amounts were redeemed/borrowed\\n * @param cTokenModify The market to hypothetically redeem/borrow in\\n * @param account The account to determine liquidity for\\n * @param redeemTokens The number of tokens to hypothetically redeem\\n * @param borrowAmount The amount of underlying to hypothetically borrow\\n * @dev Note that we calculate the exchangeRateStored for each collateral cToken using stored data,\\n * without calculating accumulated interest.\\n * @return (possible error code,\\n hypothetical account liquidity in excess of collateral requirements,\\n * hypothetical account shortfall below collateral requirements)\\n */\\n function getHypotheticalAccountLiquidityInternal(\\n address account,\\n CToken cTokenModify,\\n uint redeemTokens,\\n uint borrowAmount) internal view returns (Error, uint, uint) {\\n \\n\\n AccountLiquidityLocalVars memory vars; // Holds all our calculation results\\n uint oErr;\\n\\n // For each asset the account is in\\n CToken[] memory assets = accountAssets[account];\\n for (uint i = 0; i < assets.length; i++) {\\n CToken asset = assets[i];\\n // Read the balances and exchange rate from the cToken\\n (oErr, vars.cTokenBalance, vars.borrowBalance, vars.exchangeRateMantissa) = asset.getAccountSnapshot(account);\\n if (oErr != 0) { // semi-opaque error code, we assume NO_ERROR == 0 is invariant between upgrades\\n return (Error.SNAPSHOT_ERROR, 0, 0);\\n }\\n vars.collateralFactor = Exp({mantissa: markets[address(asset)].collateralFactorMantissa});\\n vars.exchangeRate = Exp({mantissa: vars.exchangeRateMantissa});\\n\\n // Get the normalized price of the asset\\n vars.oraclePriceMantissa = oracle.getUnderlyingPrice(asset);\\n if (vars.oraclePriceMantissa == 0) {\\n return (Error.PRICE_ERROR, 0, 0);\\n }\\n vars.oraclePrice = Exp({mantissa: vars.oraclePriceMantissa});\\n\\n // Pre-compute a conversion factor from tokens -> note (normalized price value)\\n vars.tokensToDenom = mul_(mul_(vars.collateralFactor, vars.exchangeRate), vars.oraclePrice);\\n // sumCollateral += tokensToDenom * cTokenBalance\\n vars.sumCollateral = mul_ScalarTruncateAddUInt(vars.tokensToDenom, vars.cTokenBalance, vars.sumCollateral);\\n\\n\\n // sumBorrowPlusEffects += oraclePrice * borrowBalance\\n vars.sumBorrowPlusEffects = mul_ScalarTruncateAddUInt(vars.oraclePrice, vars.borrowBalance, vars.sumBorrowPlusEffects);\\n\\n // Calculate effects of interacting with cTokenModify\\n if (asset == cTokenModify) {\\n // redeem effect\\n // sumBorrowPlusEffects += tokensToDenom * redeemTokens\\n vars.sumBorrowPlusEffects = mul_ScalarTruncateAddUInt(vars.tokensToDenom, redeemTokens, vars.sumBorrowPlusEffects);\\n\\n // borrow effect\\n // sumBorrowPlusEffects += oraclePrice * borrowAmount\\n vars.sumBorrowPlusEffects = mul_ScalarTruncateAddUInt(vars.oraclePrice, borrowAmount, vars.sumBorrowPlusEffects);\\n }\\n }\\n // These are safe, as the underflow condition is checked first\\n if (vars.sumCollateral > vars.sumBorrowPlusEffects) {\\n return (Error.NO_ERROR, vars.sumCollateral - vars.sumBorrowPlusEffects, 0);\\n } else {\\n return (Error.NO_ERROR, 0, vars.sumBorrowPlusEffects - vars.sumCollateral);\\n }\\n }\\n\\n /**\\n * @notice Calculate number of tokens of collateral asset to seize given an underlying amount\\n * @dev Used in liquidation (called in cToken.liquidateBorrowFresh)\\n * @param cTokenBorrowed The address of the borrowed cToken\\n * @param cTokenCollateral The address of the collateral cToken\\n * @param actualRepayAmount The amount of cTokenBorrowed underlying to convert into cTokenCollateral tokens\\n * @return (errorCode, number of cTokenCollateral tokens to be seized in a liquidation)\\n */\\n function liquidateCalculateSeizeTokens(address cTokenBorrowed, address cTokenCollateral, uint actualRepayAmount) override external view returns (uint, uint) {\\n /* Read oracle prices for borrowed and collateral markets */\\n uint priceBorrowedMantissa = oracle.getUnderlyingPrice(CToken(cTokenBorrowed));\\n uint priceCollateralMantissa = oracle.getUnderlyingPrice(CToken(cTokenCollateral));\\n if (priceBorrowedMantissa == 0 || priceCollateralMantissa == 0) {\\n return (uint(Error.PRICE_ERROR), 0);\\n }\\n\\n /*\\n * Get the exchange rate and calculate the number of collateral tokens to seize:\\n * seizeAmount = actualRepayAmount * liquidationIncentive * priceBorrowed / priceCollateral\\n * seizeTokens = seizeAmount / exchangeRate\\n * = actualRepayAmount * (liquidationIncentive * priceBorrowed) / (priceCollateral * exchangeRate)\\n */\\n uint exchangeRateMantissa = CToken(cTokenCollateral).exchangeRateStored(); // Note: reverts on error\\n uint seizeTokens;\\n Exp memory numerator;\\n Exp memory denominator;\\n Exp memory ratio;\\n\\n numerator = mul_(Exp({mantissa: liquidationIncentiveMantissa}), Exp({mantissa: priceBorrowedMantissa}));\\n denominator = mul_(Exp({mantissa: priceCollateralMantissa}), Exp({mantissa: exchangeRateMantissa}));\\n ratio = div_(numerator, denominator);\\n\\n seizeTokens = mul_ScalarTruncate(ratio, actualRepayAmount);\\n\\n return (uint(Error.NO_ERROR), seizeTokens);\\n }\\n\\n /*** Admin Functions ***/\\n\\n /**\\n * @notice Sets a new price oracle for the comptroller\\n * @dev Admin function to set a new price oracle\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _setPriceOracle(PriceOracle newOracle) public returns (uint) {\\n // Check caller is admin\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK);\\n }\\n\\n // Track the old oracle for the comptroller\\n PriceOracle oldOracle = oracle;\\n\\n // Set comptroller's oracle to newOracle\\n oracle = newOracle;\\n\\n // Emit NewPriceOracle(oldOracle, newOracle)\\n emit NewPriceOracle(oldOracle, newOracle);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Sets the closeFactor used when liquidating borrows\\n * @dev Admin function to set closeFactor\\n * @param newCloseFactorMantissa New close factor, scaled by 1e18\\n * @return uint 0=success, otherwise a failure\\n */\\n function _setCloseFactor(uint newCloseFactorMantissa) external returns (uint) {\\n // Check caller is admin\\n \\trequire(msg.sender == admin, \\\"only admin can set close factor\\\");\\n\\n uint oldCloseFactorMantissa = closeFactorMantissa;\\n closeFactorMantissa = newCloseFactorMantissa;\\n emit NewCloseFactor(oldCloseFactorMantissa, closeFactorMantissa);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Sets the collateralFactor for a market\\n * @dev Admin function to set per-market collateralFactor\\n * @param cToken The market to set the factor on\\n * @param newCollateralFactorMantissa The new collateral factor, scaled by 1e18\\n * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)\\n */\\n function _setCollateralFactor(CToken cToken, uint newCollateralFactorMantissa) external returns (uint) {\\n // Check caller is admin\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SET_COLLATERAL_FACTOR_OWNER_CHECK);\\n }\\n\\n // Verify market is listed\\n Market storage market = markets[address(cToken)];\\n if (!market.isListed) {\\n return fail(Error.MARKET_NOT_LISTED, FailureInfo.SET_COLLATERAL_FACTOR_NO_EXISTS);\\n }\\n\\n\\n Exp memory newCollateralFactorExp = Exp({mantissa: newCollateralFactorMantissa});\\n\\n // Check collateral factor <= 0.9\\n Exp memory highLimit = Exp({mantissa: collateralFactorMaxMantissa});\\n if (lessThanExp(highLimit, newCollateralFactorExp)) {\\n return fail(Error.INVALID_COLLATERAL_FACTOR, FailureInfo.SET_COLLATERAL_FACTOR_VALIDATION);\\n }\\n\\n // If collateral factor != 0, fail if price == 0\\n if (newCollateralFactorMantissa != 0 && oracle.getUnderlyingPrice(cToken) == 0) {\\n return fail(Error.PRICE_ERROR, FailureInfo.SET_COLLATERAL_FACTOR_WITHOUT_PRICE);\\n }\\n\\n // Set market's collateral factor to new collateral factor, remember old value\\n uint oldCollateralFactorMantissa = market.collateralFactorMantissa;\\n market.collateralFactorMantissa = newCollateralFactorMantissa;\\n\\n // Emit event with asset, old collateral factor, and new collateral factor\\n emit NewCollateralFactor(cToken, oldCollateralFactorMantissa, newCollateralFactorMantissa);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Sets liquidationIncentive\\n * @dev Admin function to set liquidationIncentive\\n * @param newLiquidationIncentiveMantissa New liquidationIncentive scaled by 1e18\\n * @return uint 0=success, otherwise a failure. (See ErrorReporter for details)\\n */\\n function _setLiquidationIncentive(uint newLiquidationIncentiveMantissa) external returns (uint) {\\n // Check caller is admin\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SET_LIQUIDATION_INCENTIVE_OWNER_CHECK);\\n }\\n\\n // Save current value for use in log\\n uint oldLiquidationIncentiveMantissa = liquidationIncentiveMantissa;\\n\\n // Set liquidation incentive to new incentive\\n liquidationIncentiveMantissa = newLiquidationIncentiveMantissa;\\n\\n // Emit event with old incentive, new incentive\\n emit NewLiquidationIncentive(oldLiquidationIncentiveMantissa, newLiquidationIncentiveMantissa);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Add the market to the markets mapping and set it as listed\\n * @dev Admin function to set isListed and add support for the market\\n * @param cToken The address of the market (token) to list\\n * @return uint 0=success, otherwise a failure. (See enum Error for details)\\n */\\n function _supportMarket(CToken cToken) external returns (uint) {\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SUPPORT_MARKET_OWNER_CHECK);\\n }\\n\\n if (markets[address(cToken)].isListed) {\\n return fail(Error.MARKET_ALREADY_LISTED, FailureInfo.SUPPORT_MARKET_EXISTS);\\n }\\n\\n cToken.isCToken(); // Sanity check to make sure its really a CToken\\n\\n // Note that isComped is not in active use anymore\\n Market storage newMarket = markets[address(cToken)];\\n newMarket.isListed = true;\\n newMarket.isComped = false;\\n newMarket.collateralFactorMantissa = 0;\\n\\n _addMarketInternal(address(cToken));\\n _initializeMarket(address(cToken));\\n\\n emit MarketListed(cToken);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n function _addMarketInternal(address cToken) internal {\\n for (uint i = 0; i < allMarkets.length; i ++) {\\n require(allMarkets[i] != CToken(cToken), \\\"market already added\\\");\\n }\\n allMarkets.push(CToken(cToken));\\n }\\n\\n function _initializeMarket(address cToken) internal {\\n uint32 blockNumber = safe32(getBlockNumber(), \\\"block number exceeds 32 bits\\\");\\n\\n CompMarketState storage supplyState = compSupplyState[cToken];\\n CompMarketState storage borrowState = compBorrowState[cToken];\\n\\n /*\\n * Update market state indices\\n */\\n if (supplyState.index == 0) {\\n // Initialize supply state index with default value\\n supplyState.index = compInitialIndex;\\n }\\n\\n if (borrowState.index == 0) {\\n // Initialize borrow state index with default value\\n borrowState.index = compInitialIndex;\\n }\\n\\n /*\\n * Update market state block numbers\\n */\\n supplyState.block = borrowState.block = blockNumber;\\n }\\n\\n\\n /**\\n * @notice Set the given borrow caps for the given cToken markets. Borrowing that brings total borrows to or above borrow cap will revert.\\n * @dev Admin or borrowCapGuardian function to set the borrow caps. A borrow cap of 0 corresponds to unlimited borrowing.\\n * @param cTokens The addresses of the markets (tokens) to change the borrow caps for\\n * @param newBorrowCaps The new borrow cap values in underlying to be set. A value of 0 corresponds to unlimited borrowing.\\n */\\n function _setMarketBorrowCaps(CToken[] calldata cTokens, uint[] calldata newBorrowCaps) external {\\n \\trequire(msg.sender == admin || msg.sender == borrowCapGuardian, \\\"only admin or borrow cap guardian can set borrow caps\\\");\\n\\n uint numMarkets = cTokens.length;\\n uint numBorrowCaps = newBorrowCaps.length;\\n\\n require(numMarkets != 0 && numMarkets == numBorrowCaps, \\\"invalid input\\\");\\n\\n for(uint i = 0; i < numMarkets; i++) {\\n borrowCaps[address(cTokens[i])] = newBorrowCaps[i];\\n emit NewBorrowCap(cTokens[i], newBorrowCaps[i]);\\n }\\n }\\n\\n /**\\n * @notice Admin function to change the Borrow Cap Guardian\\n * @param newBorrowCapGuardian The address of the new Borrow Cap Guardian\\n */\\n function _setBorrowCapGuardian(address newBorrowCapGuardian) external {\\n require(msg.sender == admin, \\\"only admin can set borrow cap guardian\\\");\\n\\n // Save current value for inclusion in log\\n address oldBorrowCapGuardian = borrowCapGuardian;\\n\\n // Store borrowCapGuardian with value newBorrowCapGuardian\\n borrowCapGuardian = newBorrowCapGuardian;\\n\\n // Emit NewBorrowCapGuardian(OldBorrowCapGuardian, NewBorrowCapGuardian)\\n emit NewBorrowCapGuardian(oldBorrowCapGuardian, newBorrowCapGuardian);\\n }\\n\\n /**\\n * @notice Admin function to change the Pause Guardian\\n * @param newPauseGuardian The address of the new Pause Guardian\\n * @return uint 0=success, otherwise a failure. (See enum Error for details)\\n */\\n function _setPauseGuardian(address newPauseGuardian) public returns (uint) {\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SET_PAUSE_GUARDIAN_OWNER_CHECK);\\n }\\n\\n // Save current value for inclusion in log\\n address oldPauseGuardian = pauseGuardian;\\n\\n // Store pauseGuardian with value newPauseGuardian\\n pauseGuardian = newPauseGuardian;\\n\\n // Emit NewPauseGuardian(OldPauseGuardian, NewPauseGuardian)\\n emit NewPauseGuardian(oldPauseGuardian, pauseGuardian);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n function _setMintPaused(CToken cToken, bool state) public returns (bool) {\\n require(markets[address(cToken)].isListed, \\\"cannot pause a market that is not listed\\\");\\n require(msg.sender == pauseGuardian || msg.sender == admin, \\\"only pause guardian and admin can pause\\\");\\n require(msg.sender == admin || state == true, \\\"only admin can unpause\\\");\\n\\n mintGuardianPaused[address(cToken)] = state;\\n emit ActionPaused(cToken, \\\"Mint\\\", state);\\n return state;\\n }\\n\\n function _setBorrowPaused(CToken cToken, bool state) public returns (bool) {\\n require(markets[address(cToken)].isListed, \\\"cannot pause a market that is not listed\\\");\\n require(msg.sender == pauseGuardian || msg.sender == admin, \\\"only pause guardian and admin can pause\\\");\\n require(msg.sender == admin || state == true, \\\"only admin can unpause\\\");\\n\\n borrowGuardianPaused[address(cToken)] = state;\\n emit ActionPaused(cToken, \\\"Borrow\\\", state);\\n return state;\\n }\\n\\n function _setTransferPaused(bool state) public returns (bool) {\\n require(msg.sender == pauseGuardian || msg.sender == admin, \\\"only pause guardian and admin can pause\\\");\\n require(msg.sender == admin || state == true, \\\"only admin can unpause\\\");\\n\\n transferGuardianPaused = state;\\n emit ActionPaused(\\\"Transfer\\\", state);\\n return state;\\n }\\n\\n function _setSeizePaused(bool state) public returns (bool) {\\n require(msg.sender == pauseGuardian || msg.sender == admin, \\\"only pause guardian and admin can pause\\\");\\n require(msg.sender == admin || state == true, \\\"only admin can unpause\\\");\\n\\n seizeGuardianPaused = state;\\n emit ActionPaused(\\\"Seize\\\", state);\\n return state;\\n }\\n\\n function _become(Unitroller unitroller) public {\\n require(msg.sender == unitroller.admin(), \\\"only unitroller admin can change brains\\\");\\n require(unitroller._acceptImplementation() == 0, \\\"change not authorized\\\");\\n }\\n\\n /// @notice Delete this function after proposal 65 is executed\\n function fixBadAccruals(address[] calldata affectedUsers, uint[] calldata amounts) external {\\n require(msg.sender == admin, \\\"Only admin can call this function\\\"); // Only the timelock can call this function\\n require(!proposal65FixExecuted, \\\"Already executed this one-off function\\\"); // Require that this function is only called once\\n require(affectedUsers.length == amounts.length, \\\"Invalid input\\\");\\n\\n // Loop variables\\n address user;\\n uint currentAccrual;\\n uint amountToSubtract;\\n uint newAccrual;\\n\\n // Iterate through all affected users\\n for (uint i = 0; i < affectedUsers.length; ++i) {\\n user = affectedUsers[i];\\n currentAccrual = compAccrued[user];\\n\\n amountToSubtract = amounts[i];\\n\\n // The case where the user has claimed and received an incorrect amount of COMP.\\n // The user has less currently accrued than the amount they incorrectly received.\\n if (amountToSubtract > currentAccrual) {\\n // Amount of COMP the user owes the protocol\\n uint accountReceivable = amountToSubtract - currentAccrual; // Underflow safe since amountToSubtract > currentAccrual\\n\\n uint oldReceivable = compReceivable[user];\\n uint newReceivable = add_(oldReceivable, accountReceivable);\\n\\n // Accounting: record the COMP debt for the user\\n compReceivable[user] = newReceivable;\\n\\n emit CompReceivableUpdated(user, oldReceivable, newReceivable);\\n\\n amountToSubtract = currentAccrual;\\n }\\n\\n if (amountToSubtract > 0) {\\n // Subtract the bad accrual amount from what they have accrued.\\n // Users will keep whatever they have correctly accrued.\\n compAccrued[user] = newAccrual = sub_(currentAccrual, amountToSubtract);\\n\\n emit CompAccruedAdjusted(user, currentAccrual, newAccrual);\\n }\\n }\\n\\n proposal65FixExecuted = true; // Makes it so that this function cannot be called again\\n }\\n\\n /**\\n * @notice Checks caller is admin, or this contract is becoming the new implementation\\n */\\n function adminOrInitializing() internal view returns (bool) {\\n return msg.sender == admin || msg.sender == comptrollerImplementation;\\n }\\n\\n /*** Comp Distribution ***/\\n\\n /**\\n * @notice Set COMP speed for a single market\\n * @param cToken The market whose COMP speed to update\\n * @param supplySpeed New supply-side COMP speed for market\\n * @param borrowSpeed New borrow-side COMP speed for market\\n */\\n function setCompSpeedInternal(CToken cToken, uint supplySpeed, uint borrowSpeed) internal {\\n Market storage market = markets[address(cToken)];\\n require(market.isListed, \\\"comp market is not listed\\\");\\n\\n if (compSupplySpeeds[address(cToken)] != supplySpeed) {\\n // Supply speed updated so let's update supply state to ensure that\\n // 1. COMP accrued properly for the old speed, and\\n // 2. COMP accrued at the new speed starts after this block.\\n updateCompSupplyIndex(address(cToken));\\n\\n // Update speed and emit event\\n compSupplySpeeds[address(cToken)] = supplySpeed;\\n emit CompSupplySpeedUpdated(cToken, supplySpeed);\\n }\\n\\n if (compBorrowSpeeds[address(cToken)] != borrowSpeed) {\\n // Borrow speed updated so let's update borrow state to ensure that\\n // 1. COMP accrued properly for the old speed, and\\n // 2. COMP accrued at the new speed starts after this block.\\n Exp memory borrowIndex = Exp({mantissa: cToken.borrowIndex()});\\n updateCompBorrowIndex(address(cToken), borrowIndex);\\n\\n // Update speed and emit event\\n compBorrowSpeeds[address(cToken)] = borrowSpeed;\\n emit CompBorrowSpeedUpdated(cToken, borrowSpeed);\\n }\\n }\\n\\n /**\\n * @notice Accrue COMP to the market by updating the supply index\\n * @param cToken The market whose supply index to update\\n * @dev Index is a cumulative sum of the COMP per cToken accrued.\\n */\\n function updateCompSupplyIndex(address cToken) internal {\\n CompMarketState storage supplyState = compSupplyState[cToken];\\n uint supplySpeed = compSupplySpeeds[cToken];\\n uint32 blockNumber = safe32(getBlockNumber(), \\\"block number exceeds 32 bits\\\");\\n uint deltaBlocks = sub_(uint(blockNumber), uint(supplyState.block));\\n if (deltaBlocks > 0 && supplySpeed > 0) {\\n uint supplyTokens = CToken(cToken).totalSupply();\\n uint compAccrued = mul_(deltaBlocks, supplySpeed);\\n Double memory ratio = supplyTokens > 0 ? fraction(compAccrued, supplyTokens) : Double({mantissa: 0});\\n supplyState.index = safe224(add_(Double({mantissa: supplyState.index}), ratio).mantissa, \\\"new index exceeds 224 bits\\\");\\n supplyState.block = blockNumber;\\n } else if (deltaBlocks > 0) {\\n supplyState.block = blockNumber;\\n }\\n }\\n\\n /**\\n * @notice Accrue COMP to the market by updating the borrow index\\n * @param cToken The market whose borrow index to update\\n * @dev Index is a cumulative sum of the COMP per cToken accrued.\\n */\\n function updateCompBorrowIndex(address cToken, Exp memory marketBorrowIndex) internal {\\n CompMarketState storage borrowState = compBorrowState[cToken];\\n uint borrowSpeed = compBorrowSpeeds[cToken];\\n uint32 blockNumber = safe32(getBlockNumber(), \\\"block number exceeds 32 bits\\\");\\n uint deltaBlocks = sub_(uint(blockNumber), uint(borrowState.block));\\n if (deltaBlocks > 0 && borrowSpeed > 0) {\\n uint borrowAmount = div_(CToken(cToken).totalBorrows(), marketBorrowIndex);\\n uint compAccrued = mul_(deltaBlocks, borrowSpeed);\\n Double memory ratio = borrowAmount > 0 ? fraction(compAccrued, borrowAmount) : Double({mantissa: 0});\\n borrowState.index = safe224(add_(Double({mantissa: borrowState.index}), ratio).mantissa, \\\"new index exceeds 224 bits\\\");\\n borrowState.block = blockNumber;\\n } else if (deltaBlocks > 0) {\\n borrowState.block = blockNumber;\\n }\\n }\\n\\n /**\\n * @notice Calculate COMP accrued by a supplier and possibly transfer it to them\\n * @param cToken The market in which the supplier is interacting\\n * @param supplier The address of the supplier to distribute COMP to\\n */\\n function distributeSupplierComp(address cToken, address supplier) internal {\\n // TODO: Don't distribute supplier COMP if the user is not in the supplier market.\\n // This check should be as gas efficient as possible as distributeSupplierComp is called in many places.\\n // - We really don't want to call an external contract as that's quite expensive.\\n\\n CompMarketState storage supplyState = compSupplyState[cToken];\\n uint supplyIndex = supplyState.index;\\n uint supplierIndex = compSupplierIndex[cToken][supplier];\\n\\n // Update supplier's index to the current index since we are distributing accrued COMP\\n compSupplierIndex[cToken][supplier] = supplyIndex;\\n\\n if (supplierIndex == 0 && supplyIndex >= compInitialIndex) {\\n // Covers the case where users supplied tokens before the market's supply state index was set.\\n // Rewards the user with COMP accrued from the start of when supplier rewards were first\\n // set for the market.\\n supplierIndex = compInitialIndex;\\n }\\n\\n // Calculate change in the cumulative sum of the COMP per cToken accrued\\n Double memory deltaIndex = Double({mantissa: sub_(supplyIndex, supplierIndex)});\\n\\n uint supplierTokens = CToken(cToken).balanceOf(supplier);\\n\\n // Calculate COMP accrued: cTokenAmount * accruedPerCToken\\n uint supplierDelta = mul_(supplierTokens, deltaIndex);\\n\\n uint supplierAccrued = add_(compAccrued[supplier], supplierDelta);\\n compAccrued[supplier] = supplierAccrued;\\n\\n emit DistributedSupplierComp(CToken(cToken), supplier, supplierDelta, supplyIndex);\\n }\\n\\n /**\\n * @notice Calculate COMP accrued by a borrower and possibly transfer it to them\\n * @dev Borrowers will not begin to accrue until after the first interaction with the protocol.\\n * @param cToken The market in which the borrower is interacting\\n * @param borrower The address of the borrower to distribute COMP to\\n */\\n function distributeBorrowerComp(address cToken, address borrower, Exp memory marketBorrowIndex) internal {\\n // TODO: Don't distribute supplier COMP if the user is not in the borrower market.\\n // This check should be as gas efficient as possible as distributeBorrowerComp is called in many places.\\n // - We really don't want to call an external contract as that's quite expensive.\\n\\n CompMarketState storage borrowState = compBorrowState[cToken];\\n uint borrowIndex = borrowState.index;\\n uint borrowerIndex = compBorrowerIndex[cToken][borrower];\\n\\n // Update borrowers's index to the current index since we are distributing accrued COMP\\n compBorrowerIndex[cToken][borrower] = borrowIndex;\\n\\n if (borrowerIndex == 0 && borrowIndex >= compInitialIndex) {\\n // Covers the case where users borrowed tokens before the market's borrow state index was set.\\n // Rewards the user with COMP accrued from the start of when borrower rewards were first\\n // set for the market.\\n borrowerIndex = compInitialIndex;\\n }\\n\\n // Calculate change in the cumulative sum of the COMP per borrowed unit accrued\\n Double memory deltaIndex = Double({mantissa: sub_(borrowIndex, borrowerIndex)});\\n\\n uint borrowerAmount = div_(CToken(cToken).borrowBalanceStored(borrower), marketBorrowIndex);\\n\\n // Calculate COMP accrued: cTokenAmount * accruedPerBorrowedUnit\\n uint borrowerDelta = mul_(borrowerAmount, deltaIndex);\\n\\n uint borrowerAccrued = add_(compAccrued[borrower], borrowerDelta);\\n compAccrued[borrower] = borrowerAccrued;\\n\\n emit DistributedBorrowerComp(CToken(cToken), borrower, borrowerDelta, borrowIndex);\\n }\\n\\n /**\\n * @notice Calculate additional accrued COMP for a contributor since last accrual\\n * @param contributor The address to calculate contributor rewards for\\n */\\n function updateContributorRewards(address contributor) public {\\n uint compSpeed = compContributorSpeeds[contributor];\\n uint blockNumber = getBlockNumber();\\n uint deltaBlocks = sub_(blockNumber, lastContributorBlock[contributor]);\\n if (deltaBlocks > 0 && compSpeed > 0) {\\n uint newAccrued = mul_(deltaBlocks, compSpeed);\\n uint contributorAccrued = add_(compAccrued[contributor], newAccrued);\\n\\n compAccrued[contributor] = contributorAccrued;\\n lastContributorBlock[contributor] = blockNumber;\\n }\\n }\\n\\n /**\\n * @notice Claim all the comp accrued by holder in all markets\\n * @param holder The address to claim COMP for\\n */\\n function claimComp(address holder) public {\\n return claimComp(holder, allMarkets);\\n }\\n\\n /**\\n * @notice Claim all the comp accrued by holder in the specified markets\\n * @param holder The address to claim COMP for\\n * @param cTokens The list of markets to claim COMP in\\n */\\n function claimComp(address holder, CToken[] memory cTokens) public {\\n address[] memory holders = new address[](1);\\n holders[0] = holder;\\n claimComp(holders, cTokens, true, true);\\n }\\n\\n /**\\n * @notice Claim all comp accrued by the holders\\n * @param holders The addresses to claim COMP for\\n * @param cTokens The list of markets to claim COMP in\\n * @param borrowers Whether or not to claim COMP earned by borrowing\\n * @param suppliers Whether or not to claim COMP earned by supplying\\n */\\n function claimComp(address[] memory holders, CToken[] memory cTokens, bool borrowers, bool suppliers) public {\\n for (uint i = 0; i < cTokens.length; i++) {\\n CToken cToken = cTokens[i];\\n require(markets[address(cToken)].isListed, \\\"market must be listed\\\");\\n if (borrowers == true) {\\n Exp memory borrowIndex = Exp({mantissa: cToken.borrowIndex()});\\n updateCompBorrowIndex(address(cToken), borrowIndex);\\n for (uint j = 0; j < holders.length; j++) {\\n distributeBorrowerComp(address(cToken), holders[j], borrowIndex);\\n }\\n }\\n if (suppliers == true) {\\n updateCompSupplyIndex(address(cToken));\\n for (uint j = 0; j < holders.length; j++) {\\n distributeSupplierComp(address(cToken), holders[j]);\\n }\\n }\\n }\\n for (uint j = 0; j < holders.length; j++) {\\n compAccrued[holders[j]] = grantCompInternal(holders[j], compAccrued[holders[j]]);\\n }\\n }\\n\\n /**\\n * @notice Transfer WETH to the user\\n * @dev Note: If there is not enough WETH, we do not perform the transfer all.\\n * @param user The address of the user to transfer WETH to\\n * @param amount The amount of WETH to (possibly) transfer\\n * @return The amount of WETH which was NOT transferred to the user\\n */\\n function grantCompInternal(address user, uint amount) internal returns (uint) {\\n WETH comp = WETH(payable(getWETHAddress())); \\n uint compRemaining = comp.balanceOf(address(this));\\n if (amount > 0 && amount <= compRemaining) {\\n comp.transfer(user, amount);\\n return 0;\\n }\\n return amount;\\n }\\n\\n /*** Comp Distribution Admin ***/\\n\\n /**\\n * @notice Transfer COMP to the recipient\\n * @dev Note: If there is not enough COMP, we do not perform the transfer all.\\n * @param recipient The address of the recipient to transfer COMP to\\n * @param amount The amount of COMP to (possibly) transfer\\n */\\n function _grantComp(address recipient, uint amount) public {\\n require(adminOrInitializing(), \\\"only admin can grant comp\\\");\\n uint amountLeft = grantCompInternal(recipient, amount);\\n require(amountLeft == 0, \\\"insufficient comp for grant\\\");\\n emit CompGranted(recipient, amount);\\n }\\n\\n /**\\n * @notice Set COMP borrow and supply speeds for the specified markets.\\n * @param cTokens The markets whose COMP speed to update.\\n * @param supplySpeeds New supply-side COMP speed for the corresponding market.\\n * @param borrowSpeeds New borrow-side COMP speed for the corresponding market.\\n */\\n function _setCompSpeeds(CToken[] memory cTokens, uint[] memory supplySpeeds, uint[] memory borrowSpeeds) public {\\n require(adminOrInitializing(), \\\"only admin can set comp speed\\\");\\n\\n uint numTokens = cTokens.length;\\n require(numTokens == supplySpeeds.length && numTokens == borrowSpeeds.length, \\\"Comptroller::_setCompSpeeds invalid input\\\");\\n\\n for (uint i = 0; i < numTokens; ++i) {\\n setCompSpeedInternal(cTokens[i], supplySpeeds[i], borrowSpeeds[i]);\\n }\\n }\\n\\n /**\\n * @notice Set COMP speed for a single contributor\\n * @param contributor The contributor whose COMP speed to update\\n * @param compSpeed New COMP speed for contributor\\n */\\n function _setContributorCompSpeed(address contributor, uint compSpeed) public {\\n require(adminOrInitializing(), \\\"only admin can set comp speed\\\");\\n\\n // note that COMP speed could be set to 0 to halt liquidity rewards for a contributor\\n updateContributorRewards(contributor);\\n if (compSpeed == 0) {\\n // release storage\\n delete lastContributorBlock[contributor];\\n } else {\\n lastContributorBlock[contributor] = getBlockNumber();\\n }\\n compContributorSpeeds[contributor] = compSpeed;\\n\\n emit ContributorCompSpeedUpdated(contributor, compSpeed);\\n }\\n\\n /**\\n * @notice Return all of the markets\\n * @dev The automatic getter may be used to access an individual market.\\n * @return The list of market addresses\\n */\\n function getAllMarkets() public view returns (CToken[] memory) {\\n return allMarkets;\\n }\\n\\n /**\\n * @notice Returns true if the given cToken market has been deprecated\\n * @dev All borrows in a deprecated cToken market can be immediately liquidated\\n * @param cToken The market to check if deprecated\\n */\\n function isDeprecated(CToken cToken) public view returns (bool) {\\n return\\n markets[address(cToken)].collateralFactorMantissa == 0 &&\\n borrowGuardianPaused[address(cToken)] == true &&\\n cToken.reserveFactorMantissa() == 1e18;\\n }\\n\\n function getBlockNumber() virtual public view returns (uint) {\\n return block.number;\\n }\\n\\n /**\\n * @notice Return the address of the COMP token\\n * @return The address of COMP\\n */\\n function getWETHAddress() virtual public view returns (address) {\\n return WethAddr;\\n }\\n\\n function setWETHAddress(address wethAddr) virtual public {\\n require(msg.sender == admin, \\\"Only admin may initialize Weth Address\\\");\\n WethAddr = wethAddr;\\n }\\n}\\n\",\"keccak256\":\"0xc99d9e06446368efffe90f6abd0c8652dc1eac36e34c514577d57a8c88ad60b7\",\"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/ComptrollerStorage.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./CToken.sol\\\";\\nimport \\\"./PriceOracle.sol\\\";\\n\\ncontract UnitrollerAdminStorage {\\n /**\\n * @notice Administrator for this contract\\n */\\n address public admin;\\n\\n /**\\n * @notice Pending administrator for this contract\\n */\\n address public pendingAdmin;\\n\\n /**\\n * @notice Active brains of Unitroller\\n */\\n address public comptrollerImplementation;\\n\\n /**\\n * @notice Pending brains of Unitroller\\n */\\n address public pendingComptrollerImplementation;\\n}\\n\\ncontract ComptrollerV1Storage is UnitrollerAdminStorage {\\n\\n /**\\n * @notice Oracle which gives the price of any given asset\\n */\\n PriceOracle public oracle;\\n\\n /**\\n * @notice Multiplier used to calculate the maximum repayAmount when liquidating a borrow\\n */\\n uint public closeFactorMantissa;\\n\\n /**\\n * @notice Multiplier representing the discount on collateral that a liquidator receives\\n */\\n uint public liquidationIncentiveMantissa;\\n\\n /**\\n * @notice Max number of assets a single account can participate in (borrow or use as collateral)\\n */\\n uint public maxAssets;\\n\\n /**\\n * @notice Per-account mapping of \\\"assets you are in\\\", capped by maxAssets\\n */\\n mapping(address => CToken[]) public accountAssets;\\n\\n}\\n\\ncontract ComptrollerV2Storage is ComptrollerV1Storage {\\n struct Market {\\n // Whether or not this market is listed\\n bool isListed;\\n\\n // Multiplier representing the most one can borrow against their collateral in this market.\\n // For instance, 0.9 to allow borrowing 90% of collateral value.\\n // Must be between 0 and 1, and stored as a mantissa.\\n uint collateralFactorMantissa;\\n\\n // Per-market mapping of \\\"accounts in this asset\\\"\\n mapping(address => bool) accountMembership;\\n\\n // Whether or not this market receives COMP\\n bool isComped;\\n }\\n\\n /**\\n * @notice Official mapping of cTokens -> Market metadata\\n * @dev Used e.g. to determine if a market is supported\\n */\\n mapping(address => Market) public markets;\\n\\n\\n /**\\n * @notice The Pause Guardian can pause certain actions as a safety mechanism.\\n * Actions which allow users to remove their own assets cannot be paused.\\n * Liquidation / seizing / transfer can only be paused globally, not by market.\\n */\\n address public pauseGuardian;\\n bool public _mintGuardianPaused;\\n bool public _borrowGuardianPaused;\\n bool public transferGuardianPaused;\\n bool public seizeGuardianPaused;\\n mapping(address => bool) public mintGuardianPaused;\\n mapping(address => bool) public borrowGuardianPaused;\\n}\\n\\ncontract ComptrollerV3Storage is ComptrollerV2Storage {\\n struct CompMarketState {\\n // The market's last updated compBorrowIndex or compSupplyIndex\\n uint224 index;\\n\\n // The block number the index was last updated at\\n uint32 block;\\n }\\n\\n /// @notice A list of all markets\\n CToken[] public allMarkets;\\n\\n /// @notice The rate at which the flywheel distributes COMP, per block\\n uint public compRate;\\n\\n /// @notice The portion of compRate that each market currently receives\\n mapping(address => uint) public compSpeeds;\\n\\n /// @notice The COMP market supply state for each market\\n mapping(address => CompMarketState) public compSupplyState;\\n\\n /// @notice The COMP market borrow state for each market\\n mapping(address => CompMarketState) public compBorrowState;\\n\\n /// @notice The COMP borrow index for each market for each supplier as of the last time they accrued COMP\\n mapping(address => mapping(address => uint)) public compSupplierIndex;\\n\\n /// @notice The COMP borrow index for each market for each borrower as of the last time they accrued COMP\\n mapping(address => mapping(address => uint)) public compBorrowerIndex;\\n\\n /// @notice The COMP accrued but not yet transferred to each user\\n mapping(address => uint) public compAccrued;\\n}\\n\\ncontract ComptrollerV4Storage is ComptrollerV3Storage {\\n // @notice The borrowCapGuardian can set borrowCaps to any number for any market. Lowering the borrow cap could disable borrowing on the given market.\\n address public borrowCapGuardian;\\n\\n // @notice Borrow caps enforced by borrowAllowed for each cToken address. Defaults to zero which corresponds to unlimited borrowing.\\n mapping(address => uint) public borrowCaps;\\n}\\n\\ncontract ComptrollerV5Storage is ComptrollerV4Storage {\\n /// @notice The portion of COMP that each contributor receives per block\\n mapping(address => uint) public compContributorSpeeds;\\n\\n /// @notice Last block at which a contributor's COMP rewards have been allocated\\n mapping(address => uint) public lastContributorBlock;\\n}\\n\\ncontract ComptrollerV6Storage is ComptrollerV5Storage {\\n /// @notice The rate at which comp is distributed to the corresponding borrow market (per block)\\n mapping(address => uint) public compBorrowSpeeds;\\n\\n /// @notice The rate at which comp is distributed to the corresponding supply market (per block)\\n mapping(address => uint) public compSupplySpeeds;\\n}\\n\\ncontract ComptrollerV7Storage is ComptrollerV6Storage {\\n /// @notice Flag indicating whether the function to fix COMP accruals has been executed (RE: proposal 62 bug)\\n bool public proposal65FixExecuted;\\n\\n /// @notice Accounting storage mapping account addresses to how much COMP they owe the protocol.\\n mapping(address => uint) public compReceivable;\\n}\\n\",\"keccak256\":\"0x0dff6d19b6f74a4fd85d63ce6b6f213b3e9c118dd61185de4dadfc3d3b54182c\",\"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/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/Governance/Comp.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\ncontract Comp {\\n /// @notice EIP-20 token name for this token\\n string public constant name = \\\"Compound\\\";\\n\\n /// @notice EIP-20 token symbol for this token\\n string public constant symbol = \\\"COMP\\\";\\n\\n /// @notice EIP-20 token decimals for this token\\n uint8 public constant decimals = 18;\\n\\n /// @notice Total number of tokens in circulation\\n uint public constant totalSupply = 10000000e18; // 10 million Comp\\n\\n /// @notice Allowance amounts on behalf of others\\n mapping (address => mapping (address => uint96)) internal allowances;\\n\\n /// @notice Official record of token balances for each account\\n mapping (address => uint96) internal balances;\\n\\n /// @notice A record of each accounts delegate\\n mapping (address => address) public delegates;\\n\\n /// @notice A checkpoint for marking number of votes from a given block\\n struct Checkpoint {\\n uint32 fromBlock;\\n uint96 votes;\\n }\\n\\n /// @notice A record of votes checkpoints for each account, by index\\n mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;\\n\\n /// @notice The number of checkpoints for each account\\n mapping (address => uint32) public numCheckpoints;\\n\\n /// @notice The EIP-712 typehash for the contract's domain\\n bytes32 public constant DOMAIN_TYPEHASH = keccak256(\\\"EIP712Domain(string name,uint256 chainId,address verifyingContract)\\\");\\n\\n /// @notice The EIP-712 typehash for the delegation struct used by the contract\\n bytes32 public constant DELEGATION_TYPEHASH = keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n /// @notice A record of states for signing / validating signatures\\n mapping (address => uint) public nonces;\\n\\n /// @notice An event thats emitted when an account changes its delegate\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /// @notice An event thats emitted when a delegate account's vote balance changes\\n event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);\\n\\n /// @notice The standard EIP-20 transfer event\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n /// @notice The standard EIP-20 approval event\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /**\\n * @notice Construct a new Comp token\\n * @param account The initial account to grant all the tokens\\n */\\n constructor(address account) public {\\n balances[account] = uint96(totalSupply);\\n emit Transfer(address(0), account, totalSupply);\\n }\\n\\n /**\\n * @notice Get the number of tokens `spender` is approved to spend on behalf of `account`\\n * @param account The address of the account holding the funds\\n * @param spender The address of the account spending the funds\\n * @return The number of tokens approved\\n */\\n function allowance(address account, address spender) external view returns (uint) {\\n return allowances[account][spender];\\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 rawAmount The number of tokens that are approved (2^256-1 means infinite)\\n * @return Whether or not the approval succeeded\\n */\\n function approve(address spender, uint rawAmount) external returns (bool) {\\n uint96 amount;\\n if (rawAmount == type(uint).max) {\\n amount = type(uint96).max;\\n } else {\\n amount = safe96(rawAmount, \\\"Comp::approve: amount exceeds 96 bits\\\");\\n }\\n\\n allowances[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @notice Get the number of tokens held by the `account`\\n * @param account The address of the account to get the balance of\\n * @return The number of tokens held\\n */\\n function balanceOf(address account) external view returns (uint) {\\n return balances[account];\\n }\\n\\n /**\\n * @notice Transfer `amount` tokens from `msg.sender` to `dst`\\n * @param dst The address of the destination account\\n * @param rawAmount The number of tokens to transfer\\n * @return Whether or not the transfer succeeded\\n */\\n function transfer(address dst, uint rawAmount) external returns (bool) {\\n uint96 amount = safe96(rawAmount, \\\"Comp::transfer: amount exceeds 96 bits\\\");\\n _transferTokens(msg.sender, dst, amount);\\n return true;\\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 rawAmount The number of tokens to transfer\\n * @return Whether or not the transfer succeeded\\n */\\n function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {\\n address spender = msg.sender;\\n uint96 spenderAllowance = allowances[src][spender];\\n uint96 amount = safe96(rawAmount, \\\"Comp::approve: amount exceeds 96 bits\\\");\\n\\n if (spender != src && spenderAllowance != type(uint96).max) {\\n uint96 newAllowance = sub96(spenderAllowance, amount, \\\"Comp::transferFrom: transfer amount exceeds spender allowance\\\");\\n allowances[src][spender] = newAllowance;\\n\\n emit Approval(src, spender, newAllowance);\\n }\\n\\n _transferTokens(src, dst, amount);\\n return true;\\n }\\n\\n /**\\n * @notice Delegate votes from `msg.sender` to `delegatee`\\n * @param delegatee The address to delegate votes to\\n */\\n function delegate(address delegatee) public {\\n return _delegate(msg.sender, delegatee);\\n }\\n\\n /**\\n * @notice Delegates votes from signatory to `delegatee`\\n * @param delegatee The address to delegate votes to\\n * @param nonce The contract state required to match the signature\\n * @param expiry The time at which to expire the signature\\n * @param v The recovery byte of the signature\\n * @param r Half of the ECDSA signature pair\\n * @param s Half of the ECDSA signature pair\\n */\\n function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {\\n bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));\\n bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n address signatory = ecrecover(digest, v, r, s);\\n require(signatory != address(0), \\\"Comp::delegateBySig: invalid signature\\\");\\n require(nonce == nonces[signatory]++, \\\"Comp::delegateBySig: invalid nonce\\\");\\n require(block.timestamp <= expiry, \\\"Comp::delegateBySig: signature expired\\\");\\n return _delegate(signatory, delegatee);\\n }\\n\\n /**\\n * @notice Gets the current votes balance for `account`\\n * @param account The address to get votes balance\\n * @return The number of current votes for `account`\\n */\\n function getCurrentVotes(address account) external view returns (uint96) {\\n uint32 nCheckpoints = numCheckpoints[account];\\n return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;\\n }\\n\\n /**\\n * @notice Determine the prior number of votes for an account as of a block number\\n * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.\\n * @param account The address of the account to check\\n * @param blockNumber The block number to get the vote balance at\\n * @return The number of votes the account had as of the given block\\n */\\n function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {\\n require(blockNumber < block.number, \\\"Comp::getPriorVotes: not yet determined\\\");\\n\\n uint32 nCheckpoints = numCheckpoints[account];\\n if (nCheckpoints == 0) {\\n return 0;\\n }\\n\\n // First check most recent balance\\n if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {\\n return checkpoints[account][nCheckpoints - 1].votes;\\n }\\n\\n // Next check implicit zero balance\\n if (checkpoints[account][0].fromBlock > blockNumber) {\\n return 0;\\n }\\n\\n uint32 lower = 0;\\n uint32 upper = nCheckpoints - 1;\\n while (upper > lower) {\\n uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow\\n Checkpoint memory cp = checkpoints[account][center];\\n if (cp.fromBlock == blockNumber) {\\n return cp.votes;\\n } else if (cp.fromBlock < blockNumber) {\\n lower = center;\\n } else {\\n upper = center - 1;\\n }\\n }\\n return checkpoints[account][lower].votes;\\n }\\n\\n function _delegate(address delegator, address delegatee) internal {\\n address currentDelegate = delegates[delegator];\\n uint96 delegatorBalance = balances[delegator];\\n delegates[delegator] = delegatee;\\n\\n emit DelegateChanged(delegator, currentDelegate, delegatee);\\n\\n _moveDelegates(currentDelegate, delegatee, delegatorBalance);\\n }\\n\\n function _transferTokens(address src, address dst, uint96 amount) internal {\\n require(src != address(0), \\\"Comp::_transferTokens: cannot transfer from the zero address\\\");\\n require(dst != address(0), \\\"Comp::_transferTokens: cannot transfer to the zero address\\\");\\n\\n balances[src] = sub96(balances[src], amount, \\\"Comp::_transferTokens: transfer amount exceeds balance\\\");\\n balances[dst] = add96(balances[dst], amount, \\\"Comp::_transferTokens: transfer amount overflows\\\");\\n emit Transfer(src, dst, amount);\\n\\n _moveDelegates(delegates[src], delegates[dst], amount);\\n }\\n\\n function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {\\n if (srcRep != dstRep && amount > 0) {\\n if (srcRep != address(0)) {\\n uint32 srcRepNum = numCheckpoints[srcRep];\\n uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;\\n uint96 srcRepNew = sub96(srcRepOld, amount, \\\"Comp::_moveVotes: vote amount underflows\\\");\\n _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);\\n }\\n\\n if (dstRep != address(0)) {\\n uint32 dstRepNum = numCheckpoints[dstRep];\\n uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;\\n uint96 dstRepNew = add96(dstRepOld, amount, \\\"Comp::_moveVotes: vote amount overflows\\\");\\n _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);\\n }\\n }\\n }\\n\\n function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {\\n uint32 blockNumber = safe32(block.number, \\\"Comp::_writeCheckpoint: block number exceeds 32 bits\\\");\\n\\n if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {\\n checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;\\n } else {\\n checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);\\n numCheckpoints[delegatee] = nCheckpoints + 1;\\n }\\n\\n emit DelegateVotesChanged(delegatee, oldVotes, newVotes);\\n }\\n\\n function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {\\n require(n < 2**32, errorMessage);\\n return uint32(n);\\n }\\n\\n function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {\\n require(n < 2**96, errorMessage);\\n return uint96(n);\\n }\\n\\n function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {\\n uint96 c = a + b;\\n require(c >= a, errorMessage);\\n return c;\\n }\\n\\n function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {\\n require(b <= a, errorMessage);\\n return a - b;\\n }\\n\\n function getChainId() internal view returns (uint) {\\n uint256 chainId;\\n assembly { chainId := chainid() }\\n return chainId;\\n }\\n}\\n\",\"keccak256\":\"0xe78ba89997df7bcbc0579b77a7e66c9b6c07e381797098f77b45302e59370b23\",\"license\":\"BSD-3-Clause\"},\"src/Governance/GovernorBravoDelegate.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./GovernorBravoInterfaces.sol\\\";\\n\\ncontract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoEvents {\\n\\n /// @notice The name of this contract\\n string public constant name = \\\"Compound Governor Bravo\\\";\\n\\n /// @notice The maximum number of actions that can be included in a proposal\\n uint public constant proposalMaxOperations = 10; // 10 actions\\n\\n /// @notice The EIP-712 typehash for the contract's domain\\n bytes32 public constant DOMAIN_TYPEHASH = keccak256(\\\"EIP712Domain(string name,uint256 chainId,address verifyingContract)\\\");\\n\\n /// @notice The EIP-712 typehash for the ballot struct used by the contract\\n bytes32 public constant BALLOT_TYPEHASH = keccak256(\\\"Ballot(uint256 proposalId,uint8 support)\\\");\\n\\n /**\\n * @notice Used to initialize the contract during delegator constructor\\n * @param timelock_ The address of the Timelock\\n */\\n function initialize(address timelock_) virtual public {\\n require(address(timelock) == address(0), \\\"GovernorBravo::initialize: can only initialize once\\\");\\n require(msg.sender == admin, \\\"GovernorBravo::initialize: admin only\\\");\\n require(timelock_ != address(0), \\\"GovernorBravo::initialize: invalid timelock address\\\");\\n unigov = IProposal(0x648a5Aa0C4FbF2C1CF5a3B432c2766EeaF8E402d);\\n\\n timelock = TimelockInterface(timelock_);\\n }\\n\\n /**\\n * @notice Queues a proposal of state succeeded\\n * @param proposalId The id of the proposal to queue\\n */\\n function queue(uint proposalId) external {\\n // Query the proposal from the unigov map contract\\n IProposal.Proposal memory unigovProposal = unigov.QueryProp(proposalId);\\n\\n // Allow addresses above proposal threshold and whitelisted addresses to propose\\n require(unigovProposal.targets.length == unigovProposal.values.length && \\n unigovProposal.targets.length == unigovProposal.signatures.length && \\n unigovProposal.targets.length == unigovProposal.calldatas.length, \\n \\\"GovernorBravo::queue: proposal function information arity mismatch\\\");\\n require(unigovProposal.targets.length != 0, \\\"GovernorBravo::queue: must provide actions\\\");\\n require(unigovProposal.targets.length <= proposalMaxOperations, \\\"GovernorBravo::queue: too many actions\\\");\\n\\n // Add proposal to proposals storage\\n Proposal storage newProposal = proposals[unigovProposal.id];\\n\\n // Make sure you are not overriding an existing proposal \\n require(proposals[unigovProposal.id].id == 0, \\\"GovernorBravo::queue: Proposal has already been queued\\\");\\n\\n // Set newProposal to the fields of unigov proposal\\n newProposal.id = unigovProposal.id;\\n newProposal.eta = 0;\\n newProposal.targets = unigovProposal.targets;\\n newProposal.values = unigovProposal.values;\\n newProposal.signatures = unigovProposal.signatures;\\n newProposal.calldatas = unigovProposal.calldatas;\\n\\t\\n uint eta = add256(block.timestamp, timelock.delay());\\n \\n\\n for (uint i = 0; i < newProposal.targets.length; i++) {\\n queueOrRevertInternal(newProposal.targets[i], newProposal.values[i], newProposal.signatures[i], newProposal.calldatas[i], eta);\\n }\\n\\n newProposal.eta = eta;\\n\\n emit ProposalQueued(proposalId, eta);\\n }\\n\\n function queueOrRevertInternal(address target, uint value, string memory signature, bytes memory data, uint eta) internal {\\n require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), \\\"GovernorBravo::queueOrRevertInternal: identical proposal action already queued at eta\\\");\\n timelock.queueTransaction(target, value, signature, data, eta);\\n }\\n\\n /**\\n * @notice Executes a queued proposal if eta has passed\\n * @param proposalId The id of the proposal to execute\\n */\\n function execute(uint proposalId) external payable {\\n require(state(proposalId) == ProposalState.Queued, \\\"GovernorBravo::execute: proposal can only be executed if it is queued\\\");\\n Proposal storage proposal = proposals[proposalId];\\n proposal.executed = true;\\n for (uint i = 0; i < proposal.targets.length; i++) {\\n timelock.executeTransaction{value: proposal.values[i]}(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);\\n }\\n emit ProposalExecuted(proposalId);\\n }\\n\\n /**\\n * @notice Gets actions of a proposal\\n * @param proposalId the id of the proposal\\n * @return targets of the proposal actions\\n * @return values of the proposal actions\\n * @return signatures of the proposal actions\\n * @return calldatas of the proposal actions\\n */\\n function getActions(uint proposalId) external view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {\\n Proposal storage p = proposals[proposalId];\\n return (p.targets, p.values, p.signatures, p.calldatas);\\n }\\n\\n /**\\n * @notice Gets the state of a proposal\\n * @param proposalId The id of the proposal\\n * @return Proposal state\\n */\\n function state(uint proposalId) public view returns (ProposalState) {\\n Proposal storage proposal = proposals[proposalId];\\n if (proposal.executed) {\\n return ProposalState.Executed;\\n } else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {\\n return ProposalState.Expired;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @notice Initiate the GovernorBravo contract\\n * @dev Admin only. Sets initial proposal id which initiates the contract, ensuring a continuous proposal id count\\n */\\n function _initiate() external {\\n require(msg.sender == admin, \\\"GovernorBravo::_initiate: admin only\\\");\\n require(initialProposalId == 0, \\\"GovernorBravo::_initiate: can only initiate once\\\");\\n timelock.acceptAdmin();\\n }\\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 */\\n function _setPendingAdmin(address newPendingAdmin) external {\\n // Check caller = admin\\n require(msg.sender == admin, \\\"GovernorBravo:_setPendingAdmin: admin only\\\");\\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\\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 */\\n function _acceptAdmin() external {\\n // Check caller is pendingAdmin and pendingAdmin \\u2260 address(0), msg.sender cannot == address(0)\\n require(msg.sender == pendingAdmin, \\\"GovernorBravo:_acceptAdmin: pending admin only\\\");\\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 = address(0);\\n\\n emit NewAdmin(oldAdmin, admin);\\n emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\\n }\\n\\n function add256(uint256 a, uint256 b) internal pure returns (uint) {\\n uint c = a + b;\\n require(c >= a, \\\"addition overflow\\\");\\n return c;\\n }\\n\\n function sub256(uint256 a, uint256 b) internal pure returns (uint) {\\n require(b <= a, \\\"subtraction underflow\\\");\\n return a - b;\\n }\\n\\n function getChainIdInternal() internal view returns (uint) {\\n uint chainId;\\n assembly { chainId := chainid() }\\n return chainId;\\n }\\n}\\n\",\"keccak256\":\"0x8899ce1d3eaabf70f237ab8243479a4faab7cc75ac367e59567642998603ae97\",\"license\":\"BSD-3-Clause\"},\"src/Governance/GovernorBravoInterfaces.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"../IProposal.sol\\\";\\n\\n\\ncontract GovernorBravoEvents {\\n /// @notice An event emitted when a new proposal is created\\n event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);\\n\\n /// @notice An event emitted when a proposal has been canceled\\n event ProposalCanceled(uint id);\\n\\n /// @notice An event emitted when a proposal has been queued in the Timelock\\n event ProposalQueued(uint id, uint eta);\\n\\n /// @notice An event emitted when a proposal has been executed in the Timelock\\n event ProposalExecuted(uint id);\\n\\n /// @notice Emitted when implementation is changed\\n event NewImplementation(address oldImplementation, address newImplementation);\\n\\n /// @notice Emitted when proposal threshold is set\\n event ProposalThresholdSet(uint oldProposalThreshold, uint newProposalThreshold);\\n\\n /// @notice Emitted when pendingAdmin is changed\\n event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\\n\\n /// @notice Emitted when pendingAdmin is accepted, which means admin is updated\\n event NewAdmin(address oldAdmin, address newAdmin);\\n\\n}\\n\\ncontract GovernorBravoDelegatorStorage {\\n /// @notice Administrator for this contract\\n address public admin;\\n\\n /// @notice Pending administrator for this contract\\n address public pendingAdmin;\\n\\n /// @notice Active brains of Governor\\n address public implementation;\\n}\\n\\n\\n/**\\n * @title Storage for Governor Bravo Delegate\\n * @notice For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new\\n * contract which implements GovernorBravoDelegateStorageV1 and following the naming convention\\n * GovernorBravoDelegateStorageVX.\\n */\\ncontract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage {\\n /// @notice The number of votes required in order for a voter to become a proposer\\n uint public proposalThreshold;\\n \\n uint public initialProposalId;\\n\\n /// @notice The address of the Compound Protocol Timelock\\n TimelockInterface public timelock;\\n\\n /// @notice The official record of all proposals ever proposed\\n mapping (uint => Proposal) public proposals;\\n\\n /// @notice The latest proposal for each proposer\\n mapping (address => uint) public latestProposalIds;\\n\\n\\n struct Proposal {\\n /// @notice Unique id for looking up a proposal\\n uint id;\\n\\n /// @notice Creator of the proposal\\n address proposer;\\n\\n /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds\\n uint eta;\\n\\n /// @notice the ordered list of target addresses for calls to be made\\n address[] targets;\\n\\n /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made\\n uint[] values;\\n\\n /// @notice The ordered list of function signatures to be called\\n string[] signatures;\\n\\n /// @notice The ordered list of calldata to be passed to each call\\n bytes[] calldatas;\\n\\n /// @notice Flag marking whether the proposal has been canceled\\n bool canceled;\\n\\n /// @notice Flag marking whether the proposal has been executed\\n bool executed;\\n }\\n\\n /// @notice Possible states that a proposal may be in\\n enum ProposalState {\\n Queued,\\n Expired,\\n Executed\\n }\\n}\\n\\ncontract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {\\n IProposal unigov; //Proposal Store object defined as primitive contract in Canto-Testnet <URL HERE>\\n}\\n\\ninterface TimelockInterface {\\n function delay() external view returns (uint);\\n function GRACE_PERIOD() external view returns (uint);\\n function acceptAdmin() external;\\n function queuedTransactions(bytes32 hash) external view returns (bool);\\n function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);\\n function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;\\n function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);\\n}\",\"keccak256\":\"0x555277660d19a04e437c020ded28608bff9ed267dcf32c5ac767f61a9037c6f6\",\"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/Lens/CompoundLens.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"../CErc20.sol\\\";\\nimport \\\"../CToken.sol\\\";\\nimport \\\"../PriceOracle.sol\\\";\\nimport \\\"../EIP20Interface.sol\\\";\\nimport \\\"../Governance/GovernorBravoDelegate.sol\\\";\\nimport \\\"../Governance/Comp.sol\\\";\\n\\ninterface ComptrollerLensInterface {\\n function markets(address) external view returns (bool, uint);\\n function oracle() external view returns (PriceOracle);\\n function getAccountLiquidity(address) external view returns (uint, uint, uint);\\n function getAssetsIn(address) external view returns (CToken[] memory);\\n function claimComp(address) external;\\n function compAccrued(address) external view returns (uint);\\n function compSpeeds(address) external view returns (uint);\\n function compSupplySpeeds(address) external view returns (uint);\\n function compBorrowSpeeds(address) external view returns (uint);\\n function borrowCaps(address) external view returns (uint);\\n}\\n\\ninterface GovernorBravoInterface {\\n struct Proposal {\\n uint id;\\n address proposer;\\n uint eta;\\n address[] targets;\\n uint[] values;\\n string[] signatures;\\n bytes[] calldatas;\\n bool canceled;\\n bool executed;\\n }\\n function getActions(uint proposalId) external view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas);\\n function proposals(uint proposalId) external view returns (Proposal memory);\\n}\\n\\ncontract CompoundLens {\\n struct CTokenMetadata {\\n address cToken;\\n uint exchangeRateCurrent;\\n uint supplyRatePerBlock;\\n uint borrowRatePerBlock;\\n uint reserveFactorMantissa;\\n uint totalBorrows;\\n uint totalReserves;\\n uint totalSupply;\\n uint totalCash;\\n bool isListed;\\n uint collateralFactorMantissa;\\n address underlyingAssetAddress;\\n uint cTokenDecimals;\\n uint underlyingDecimals;\\n uint compSupplySpeed;\\n uint compBorrowSpeed;\\n uint borrowCap;\\n }\\n\\n function getCompSpeeds(ComptrollerLensInterface comptroller, CToken cToken) internal returns (uint, uint) {\\n // Getting comp speeds is gnarly due to not every network having the\\n // split comp speeds from Proposal 62 and other networks don't even\\n // have comp speeds.\\n uint compSupplySpeed = 0;\\n (bool compSupplySpeedSuccess, bytes memory compSupplySpeedReturnData) =\\n address(comptroller).call(\\n abi.encodePacked(\\n comptroller.compSupplySpeeds.selector,\\n abi.encode(address(cToken))\\n )\\n );\\n if (compSupplySpeedSuccess) {\\n compSupplySpeed = abi.decode(compSupplySpeedReturnData, (uint));\\n }\\n\\n uint compBorrowSpeed = 0;\\n (bool compBorrowSpeedSuccess, bytes memory compBorrowSpeedReturnData) =\\n address(comptroller).call(\\n abi.encodePacked(\\n comptroller.compBorrowSpeeds.selector,\\n abi.encode(address(cToken))\\n )\\n );\\n if (compBorrowSpeedSuccess) {\\n compBorrowSpeed = abi.decode(compBorrowSpeedReturnData, (uint));\\n }\\n\\n // If the split comp speeds call doesn't work, try the oldest non-spit version.\\n if (!compSupplySpeedSuccess || !compBorrowSpeedSuccess) {\\n (bool compSpeedSuccess, bytes memory compSpeedReturnData) =\\n address(comptroller).call(\\n abi.encodePacked(\\n comptroller.compSpeeds.selector,\\n abi.encode(address(cToken))\\n )\\n );\\n if (compSpeedSuccess) {\\n compSupplySpeed = compBorrowSpeed = abi.decode(compSpeedReturnData, (uint));\\n }\\n }\\n return (compSupplySpeed, compBorrowSpeed);\\n }\\n\\n function cTokenMetadata(CToken cToken) public returns (CTokenMetadata memory) {\\n uint exchangeRateCurrent = cToken.exchangeRateCurrent();\\n ComptrollerLensInterface comptroller = ComptrollerLensInterface(address(cToken.comptroller()));\\n (bool isListed, uint collateralFactorMantissa) = comptroller.markets(address(cToken));\\n address underlyingAssetAddress;\\n uint underlyingDecimals;\\n\\n if (compareStrings(cToken.symbol(), \\\"cCANTO\\\")) {\\n underlyingAssetAddress = address(0);\\n underlyingDecimals = 18;\\n } else {\\n CErc20 cErc20 = CErc20(address(cToken));\\n underlyingAssetAddress = cErc20.underlying();\\n underlyingDecimals = EIP20Interface(cErc20.underlying()).decimals();\\n }\\n\\n (uint compSupplySpeed, uint compBorrowSpeed) = getCompSpeeds(comptroller, cToken);\\n\\n uint borrowCap = 0;\\n (bool borrowCapSuccess, bytes memory borrowCapReturnData) =\\n address(comptroller).call(\\n abi.encodePacked(\\n comptroller.borrowCaps.selector,\\n abi.encode(address(cToken))\\n )\\n );\\n if (borrowCapSuccess) {\\n borrowCap = abi.decode(borrowCapReturnData, (uint));\\n }\\n\\n return CTokenMetadata({\\n cToken: address(cToken),\\n exchangeRateCurrent: exchangeRateCurrent,\\n supplyRatePerBlock: cToken.supplyRatePerBlock(),\\n borrowRatePerBlock: cToken.borrowRatePerBlock(),\\n reserveFactorMantissa: cToken.reserveFactorMantissa(),\\n totalBorrows: cToken.totalBorrows(),\\n totalReserves: cToken.totalReserves(),\\n totalSupply: cToken.totalSupply(),\\n totalCash: cToken.getCash(),\\n isListed: isListed,\\n collateralFactorMantissa: collateralFactorMantissa,\\n underlyingAssetAddress: underlyingAssetAddress,\\n cTokenDecimals: cToken.decimals(),\\n underlyingDecimals: underlyingDecimals,\\n compSupplySpeed: compSupplySpeed,\\n compBorrowSpeed: compBorrowSpeed,\\n borrowCap: borrowCap\\n });\\n }\\n\\n function cTokenMetadataAll(CToken[] calldata cTokens) external returns (CTokenMetadata[] memory) {\\n uint cTokenCount = cTokens.length;\\n CTokenMetadata[] memory res = new CTokenMetadata[](cTokenCount);\\n for (uint i = 0; i < cTokenCount; i++) {\\n res[i] = cTokenMetadata(cTokens[i]);\\n }\\n return res;\\n }\\n\\n struct CTokenBalances {\\n address cToken;\\n uint balanceOf;\\n uint borrowBalanceCurrent;\\n uint balanceOfUnderlying;\\n uint tokenBalance;\\n uint tokenAllowance;\\n }\\n\\n function cTokenBalances(CToken cToken, address payable account) public returns (CTokenBalances memory) {\\n uint balanceOf = cToken.balanceOf(account);\\n uint borrowBalanceCurrent = cToken.borrowBalanceCurrent(account);\\n uint balanceOfUnderlying = cToken.balanceOfUnderlying(account);\\n uint tokenBalance;\\n uint tokenAllowance;\\n\\n if (compareStrings(cToken.symbol(), \\\"cCANTO\\\")) {\\n tokenBalance = account.balance;\\n tokenAllowance = account.balance;\\n } else {\\n CErc20 cErc20 = CErc20(address(cToken));\\n EIP20Interface underlying = EIP20Interface(cErc20.underlying());\\n tokenBalance = underlying.balanceOf(account);\\n tokenAllowance = underlying.allowance(account, address(cToken));\\n }\\n\\n return CTokenBalances({\\n cToken: address(cToken),\\n balanceOf: balanceOf,\\n borrowBalanceCurrent: borrowBalanceCurrent,\\n balanceOfUnderlying: balanceOfUnderlying,\\n tokenBalance: tokenBalance,\\n tokenAllowance: tokenAllowance\\n });\\n }\\n\\n function cTokenBalancesAll(CToken[] calldata cTokens, address payable account) external returns (CTokenBalances[] memory) {\\n uint cTokenCount = cTokens.length;\\n CTokenBalances[] memory res = new CTokenBalances[](cTokenCount);\\n for (uint i = 0; i < cTokenCount; i++) {\\n res[i] = cTokenBalances(cTokens[i], account);\\n }\\n return res;\\n }\\n\\n struct CTokenUnderlyingPrice {\\n address cToken;\\n uint underlyingPrice;\\n }\\n\\n function cTokenUnderlyingPrice(CToken cToken) public returns (CTokenUnderlyingPrice memory) {\\n ComptrollerLensInterface comptroller = ComptrollerLensInterface(address(cToken.comptroller()));\\n PriceOracle priceOracle = comptroller.oracle();\\n\\n return CTokenUnderlyingPrice({\\n cToken: address(cToken),\\n underlyingPrice: priceOracle.getUnderlyingPrice(cToken)\\n });\\n }\\n\\n function cTokenUnderlyingPriceAll(CToken[] calldata cTokens) external returns (CTokenUnderlyingPrice[] memory) {\\n uint cTokenCount = cTokens.length;\\n CTokenUnderlyingPrice[] memory res = new CTokenUnderlyingPrice[](cTokenCount);\\n for (uint i = 0; i < cTokenCount; i++) {\\n res[i] = cTokenUnderlyingPrice(cTokens[i]);\\n }\\n return res;\\n }\\n\\n struct AccountLimits {\\n CToken[] markets;\\n uint liquidity;\\n uint shortfall;\\n }\\n\\n function getAccountLimits(ComptrollerLensInterface comptroller, address account) public returns (AccountLimits memory) {\\n (uint errorCode, uint liquidity, uint shortfall) = comptroller.getAccountLiquidity(account);\\n require(errorCode == 0);\\n\\n return AccountLimits({\\n markets: comptroller.getAssetsIn(account),\\n liquidity: liquidity,\\n shortfall: shortfall\\n });\\n }\\n\\n function setProposal(GovernorBravoInterface.Proposal memory res, GovernorBravoInterface governor, uint proposalId) internal view {\\n res = governor.proposals(proposalId);\\n }\\n\\n function getGovProposals(GovernorBravoInterface governor, uint[] calldata proposalIds) external view returns (GovernorBravoInterface.Proposal[] memory) {\\n GovernorBravoInterface.Proposal[] memory res = new GovernorBravoInterface.Proposal[](proposalIds.length);\\n for (uint i = 0; i < proposalIds.length; i++) {\\n (\\n address[] memory targets,\\n uint[] memory values,\\n string[] memory signatures,\\n bytes[] memory calldatas\\n ) = governor.getActions(proposalIds[i]);\\n res[i] = GovernorBravoInterface.Proposal({\\n id: 0,\\n proposer: address(0),\\n eta: 0,\\n targets: targets,\\n values: values,\\n signatures: signatures,\\n calldatas: calldatas,\\n canceled: false,\\n executed: false\\n });\\n setProposal(res[i], governor, proposalIds[i]);\\n }\\n return res;\\n }\\n\\n struct GovBravoProposal {\\n uint proposalId;\\n address proposer;\\n uint eta;\\n address[] targets;\\n uint[] values;\\n string[] signatures;\\n bytes[] calldatas;\\n bool canceled;\\n bool executed;\\n }\\n\\n function setBravoProposal(GovBravoProposal memory res, GovernorBravoInterface governor, uint proposalId) internal view {\\n GovernorBravoInterface.Proposal memory p = governor.proposals(proposalId);\\n\\n res.proposalId = proposalId;\\n res.proposer = p.proposer;\\n res.eta = p.eta;\\n res.canceled = p.canceled;\\n res.executed = p.executed;\\n }\\n\\n function getGovBravoProposals(GovernorBravoInterface governor, uint[] calldata proposalIds) external view returns (GovBravoProposal[] memory) {\\n GovBravoProposal[] memory res = new GovBravoProposal[](proposalIds.length);\\n for (uint i = 0; i < proposalIds.length; i++) {\\n (\\n address[] memory targets,\\n uint[] memory values,\\n string[] memory signatures,\\n bytes[] memory calldatas\\n ) = governor.getActions(proposalIds[i]);\\n res[i] = GovBravoProposal({\\n proposalId: 0,\\n proposer: address(0),\\n eta: 0,\\n targets: targets,\\n values: values,\\n signatures: signatures,\\n calldatas: calldatas,\\n canceled: false,\\n executed: false\\n });\\n setBravoProposal(res[i], governor, proposalIds[i]);\\n }\\n return res;\\n }\\n\\n struct CompBalanceMetadata {\\n uint balance;\\n uint votes;\\n address delegate;\\n }\\n\\n function getCompBalanceMetadata(Comp comp, address account) external view returns (CompBalanceMetadata memory) {\\n return CompBalanceMetadata({\\n balance: comp.balanceOf(account),\\n votes: uint256(comp.getCurrentVotes(account)),\\n delegate: comp.delegates(account)\\n });\\n }\\n\\n struct CompBalanceMetadataExt {\\n uint balance;\\n uint votes;\\n address delegate;\\n uint allocated;\\n }\\n\\n function getCompBalanceMetadataExt(Comp comp, ComptrollerLensInterface comptroller, address account) external returns (CompBalanceMetadataExt memory) {\\n uint balance = comp.balanceOf(account);\\n comptroller.claimComp(account);\\n uint newBalance = comp.balanceOf(account);\\n uint accrued = comptroller.compAccrued(account);\\n uint total = add(accrued, newBalance, \\\"sum comp total\\\");\\n uint allocated = sub(total, balance, \\\"sub allocated\\\");\\n\\n return CompBalanceMetadataExt({\\n balance: balance,\\n votes: uint256(comp.getCurrentVotes(account)),\\n delegate: comp.delegates(account),\\n allocated: allocated\\n });\\n }\\n\\n struct CompVotes {\\n uint blockNumber;\\n uint votes;\\n }\\n\\n function getCompVotes(Comp comp, address account, uint32[] calldata blockNumbers) external view returns (CompVotes[] memory) {\\n CompVotes[] memory res = new CompVotes[](blockNumbers.length);\\n for (uint i = 0; i < blockNumbers.length; i++) {\\n res[i] = CompVotes({\\n blockNumber: uint256(blockNumbers[i]),\\n votes: uint256(comp.getPriorVotes(account, blockNumbers[i]))\\n });\\n }\\n return res;\\n }\\n\\n function compareStrings(string memory a, string memory b) internal pure returns (bool) {\\n return (keccak256(abi.encodePacked((a))) == keccak256(abi.encodePacked((b))));\\n }\\n\\n function add(uint a, uint b, string memory errorMessage) internal pure returns (uint) {\\n uint c = a + b;\\n require(c >= a, errorMessage);\\n return c;\\n }\\n\\n function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {\\n require(b <= a, errorMessage);\\n uint c = a - b;\\n return c;\\n }\\n}\\n\",\"keccak256\":\"0x93434c0b3c890723bec017ea631c72ec5ab3fae00ea4af72b46f2c7006aff587\",\"license\":\"BSD-3-Clause\"},\"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/Treasury/TreasuryDelegate.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"../IProposal.sol\\\";\\nimport \\\"../EIP20Interface.sol\\\";\\nimport \\\"../Lens/CompoundLens.sol\\\";\\nimport \\\"../Comptroller.sol\\\";\\nimport \\\"./TreasuryInterfaces.sol\\\";\\nimport \\\"../CTokenInterfaces.sol\\\";\\n\\ncontract TreasuryDelegate is TreasuryInterface {\\n\\n bytes32 constant cantoDenom = keccak256(bytes(\\\"CANTO\\\"));\\n bytes32 constant noteDenom = keccak256(bytes(\\\"NOTE\\\")); //cache hashed values to reduce unnecessary gas costs\\n\\n /**\\n * @notice Initializes the note contract\\n * @param note_ The address of note ERC20 contract\\n */\\n function initialize(address note_) public {\\n if (msg.sender != admin) {\\n revert SenderNotAdmin(msg.sender);\\n }\\n if(note_ == address(0) || address(note) != address(0)) {\\n revert FailedInitialization(); //initialize should be called once, and with a valid Note address\\n }\\n\\t note = EIP20Interface(note_);\\n }\\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 */\\n function _setPendingAdmin(address newPendingAdmin) override external {\\n // Check caller = admin\\n require(msg.sender == admin, \\\"TreasuryDelegator:_setPendingAdmin: admin only\\\");\\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\\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 */\\n function _acceptAdmin() override external {\\n // Check caller is pendingAdmin and pendingAdmin \\u2260 address(0), msg.sender cannot == address(0)\\n require(msg.sender == pendingAdmin, \\\"TreasuryDelegator:_acceptAdmin: pending admin only\\\");\\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 = address(0);\\n\\n emit NewAdmin(oldAdmin, admin);\\n emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\\n }\\n\\n\\n /**\\n * @notice Method to query current balance of CANTO in the treasury\\n * @return treasuryCantoBalance the canto balance\\n */\\n function queryCantoBalance() external view override returns (uint) {\\n uint treasuryCantoBalance = address(this).balance;\\n return treasuryCantoBalance;\\n }\\n\\n /**\\n * @notice Method to query current balance of NOTE in the treasury \\n * @return treasuryNoteBalance the note balance \\n */\\n function queryNoteBalance() external view override returns (uint) {\\n uint treasuryNoteBalance = note.balanceOf(address(this));\\n return treasuryNoteBalance;\\n }\\n\\n // function to call redeem on the cnote lending Market\\n function redeem(address cNote, uint cTokens) external override {\\n if (cNote == address(0)) {\\n revert InvalidAddress();\\n }\\n CErc20Interface cnote = CErc20Interface(cNote); //initialize cNote\\n uint err = cnote.redeem(cTokens); //\\n if (err != 0) {\\n revert SendFundError(cTokens);\\n }\\n }\\n \\n /**\\n * @notice Method to send treasury funds to recipient\\n * @dev Only the admin can call this method (Timelock contract)\\n * @param recipient Address receiving funds\\n * @param amount Amount to send\\n * @param denom Denomination of fund to send \\n */\\n function sendFund(address recipient, uint amount, string calldata denom) external override {\\n if (msg.sender != admin ) {\\n revert SenderNotAdmin(msg.sender);\\n }\\n bool success;\\n\\n bytes32 encodeDenom = keccak256(bytes(denom));\\n if (encodeDenom != cantoDenom && encodeDenom != noteDenom) {\\n revert InvalidDenom(denom);\\n }\\n //sending CANTO\\n if (encodeDenom == cantoDenom) {\\n if (address(this).balance < amount) {\\n revert InsufficientFunds(address(this).balance, amount);\\n }\\n (success, ) = recipient.call{value: amount}(\\\"\\\"); //use call instead of transfer\\n } \\n // sending NOTE\\n else if (encodeDenom == noteDenom) {\\n uint bal = note.balanceOf(address(this));\\n if (bal < amount) {\\n revert InsufficientFunds(bal, amount);\\n } \\n note.transfer(recipient, amount);\\n assembly {\\n switch returndatasize()\\n case 0 {success := not(0)}\\n case 32 {\\n returndatacopy(0,0,32)\\n success := mload(0) //retrieve boolean return value from ERC20 transfer\\n }\\n default {\\n revert(0,0)\\n }\\n }\\n }\\n if (!success) {\\n revert SendFundError(amount);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x561416af173c23510044eaf0a76632a084c3b896eb476ba4dde7a9d9b9583267\"},\"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\"},\"src/Unitroller.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.10;\\n\\nimport \\\"./ErrorReporter.sol\\\";\\nimport \\\"./ComptrollerStorage.sol\\\";\\n/**\\n * @title ComptrollerCore\\n * @dev Storage for the comptroller is at this address, while execution is delegated to the `comptrollerImplementation`.\\n * CTokens should reference this contract as their comptroller.\\n */\\ncontract Unitroller is UnitrollerAdminStorage, ComptrollerErrorReporter {\\n\\n /**\\n * @notice Emitted when pendingComptrollerImplementation is changed\\n */\\n event NewPendingImplementation(address oldPendingImplementation, address newPendingImplementation);\\n\\n /**\\n * @notice Emitted when pendingComptrollerImplementation is accepted, which means comptroller implementation is updated\\n */\\n event NewImplementation(address oldImplementation, address newImplementation);\\n\\n /**\\n * @notice Emitted when pendingAdmin is changed\\n */\\n event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);\\n\\n /**\\n * @notice Emitted when pendingAdmin is accepted, which means admin is updated\\n */\\n event NewAdmin(address oldAdmin, address newAdmin);\\n\\n constructor() public {\\n // Set admin to caller\\n admin = msg.sender;\\n }\\n\\n /*** Admin Functions ***/\\n function _setPendingImplementation(address newPendingImplementation) public returns (uint) {\\n\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_IMPLEMENTATION_OWNER_CHECK);\\n }\\n\\n address oldPendingImplementation = pendingComptrollerImplementation;\\n\\n pendingComptrollerImplementation = newPendingImplementation;\\n\\n emit NewPendingImplementation(oldPendingImplementation, pendingComptrollerImplementation);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @notice Accepts new implementation of comptroller. msg.sender must be pendingImplementation\\n * @dev Admin function for new implementation to accept it's role as implementation\\n * @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)\\n */\\n function _acceptImplementation() public returns (uint) {\\n // Check caller is pendingImplementation and pendingImplementation \\u2260 address(0)\\n if (msg.sender != pendingComptrollerImplementation || pendingComptrollerImplementation == address(0)) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK);\\n }\\n\\n // Save current values for inclusion in log\\n address oldImplementation = comptrollerImplementation;\\n address oldPendingImplementation = pendingComptrollerImplementation;\\n\\n comptrollerImplementation = pendingComptrollerImplementation;\\n\\n pendingComptrollerImplementation = address(0);\\n\\n emit NewImplementation(oldImplementation, comptrollerImplementation);\\n emit NewPendingImplementation(oldPendingImplementation, pendingComptrollerImplementation);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\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 newPendingAdmin) public returns (uint) {\\n // Check caller = admin\\n if (msg.sender != admin) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK);\\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 uint(Error.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() public returns (uint) {\\n // Check caller is pendingAdmin and pendingAdmin \\u2260 address(0)\\n if (msg.sender != pendingAdmin || msg.sender == address(0)) {\\n return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK);\\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 = address(0);\\n\\n emit NewAdmin(oldAdmin, admin);\\n emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);\\n\\n return uint(Error.NO_ERROR);\\n }\\n\\n /**\\n * @dev Delegates execution to an implementation contract.\\n * It returns to the external caller whatever the implementation returns\\n * or forwards reverts.\\n */\\n fallback() payable external {\\n // delegate all other functions to current implementation\\n (bool success, ) = comptrollerImplementation.delegatecall(msg.data);\\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}\\n\",\"keccak256\":\"0xe8f57584490697b95ab1be9860432e219d1c960dad74e228abe6c06b8d9b61da\",\"license\":\"BSD-3-Clause\"},\"src/WETH.sol\":{\"content\":\"pragma solidity ^0.8.10;\\n\\nimport \\\"./EIP20Interface.sol\\\";\\n\\ncontract WETH is EIP20Interface {\\n string private _name;\\n string private _symbol;\\n uint8 private _decimals = 18;\\n mapping (address => uint) public _balanceOf;\\n mapping (address => mapping (address => uint)) public _allowance;\\n\\n\\n constructor(string memory name_, string memory symbol_) {\\n\\t _name = name_;\\n\\t _symbol = symbol_;\\n }\\n\\n receive() external payable {\\n deposit();\\n }\\n\\n function deposit() public payable {\\n _balanceOf[msg.sender] += msg.value;\\n emit Deposit(msg.sender, msg.value);\\n }\\n\\n \\n function withdraw(uint wamount) public {\\n require(_balanceOf[msg.sender] >= wamount, \\\"sender balance insufficient for withdrawal\\\");\\n _balanceOf[msg.sender] -= wamount;\\n payable(msg.sender).transfer(wamount); // rentrant attack must be less than 2300 gas\\n emit Withdrawal(msg.sender, wamount);\\n }\\n\\n \\n function name() external view returns (string memory) {\\n\\t return _name;\\n }\\n function symbol() external view returns (string memory) {\\n\\t return _symbol;\\n }\\n function decimals() external view returns (uint8) {\\n\\t return _decimals;\\n }\\n \\n function totalSupply() public view returns (uint) {\\n return address(this).balance;\\n }\\n\\n function balanceOf(address owner) external view returns(uint256) {\\n\\t return _balanceOf[owner];\\n }\\n \\n \\n function approve(address spender, uint amount) public returns (bool) {\\n _approve(msg.sender, spender, amount);\\n emit Approval(msg.sender, spender, amount);\\n return true;\\n }\\n\\n function transfer(address dst, uint wad) public returns (bool) {\\n return transferFrom(msg.sender, dst, wad);\\n }\\n\\n function transferFrom(address src, address dst, uint wad)\\n public\\n returns (bool)\\n {\\n require(_balanceOf[src] >= wad, \\\"WETH::transfeFrom: balance insufficient\\\");\\n\\n if (src != msg.sender && _allowance[src][msg.sender] != type(uint).max) {\\n require(_allowance[src][msg.sender] >= wad, \\\"WETH::transferFrom:allowance insufficient\\\");\\n _allowance[src][msg.sender] -= wad;\\n }\\n\\n _balanceOf[src] -= wad;\\n _balanceOf[dst] += wad;\\n\\n emit Transfer(src, dst, wad);\\n\\n return true;\\n }\\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 _allowance[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n function allowance(address owner, address spender) external view returns (uint256) {\\n\\t return _allowance[owner][spender];\\n }\\n \\n event Deposit(address indexed dst, uint wad);\\n event Withdrawal(address indexed src, uint wad);\\n}\\n\\n\",\"keccak256\":\"0x8177dea49cf12de998d7e7adf1854f65448053b8f8e4eadb047263c84ffbcd0e\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50610a6a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80637b26673c116100715780637b26673c1461013c578063864392181461014f578063b71d1a0c14610162578063c4d66de814610175578063e9c714f214610188578063f851a4401461019057600080fd5b806303cc29a5146100b95780631ce78bb2146100ce5780631e9a6950146100d657806326782247146100eb57806326d111f5146101165780635c60da1b14610129575b600080fd5b475b6040519081526020015b60405180910390f35b6100bb6101a3565b6100e96100e43660046108e7565b61021a565b005b6000546100fe906001600160a01b031681565b6040516001600160a01b0390911681526020016100c5565b6003546100fe906001600160a01b031681565b6002546100fe906001600160a01b031681565b6100e961014a366004610911565b6102e0565b6004546100fe906001600160a01b031681565b6100e9610170366004610998565b610648565b6100e9610183366004610998565b61071b565b6100e96107a8565b6001546100fe906001600160a01b031681565b6003546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156101f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021491906109ba565b92915050565b6001600160a01b0382166102415760405163e6c4247b60e01b815260040160405180910390fd5b60405163db006a7560e01b81526004810182905282906000906001600160a01b0383169063db006a75906024016020604051808303816000875af115801561028d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b191906109ba565b905080156102da576040516308426a1d60e01b8152600481018490526024015b60405180910390fd5b50505050565b6001546001600160a01b0316331461030d5760405163c0d4daef60e01b81523360048201526024016102d1565b60008083836040516103209291906109d3565b60408051918290038220828201909152600582526443414e544f60d81b60209092019190915290507fac9fb8ee1ff16cf8a1fd14f2b033007d13cc70a50a3cbd4154efb8e0b247187d81148015906103b457506040805180820190915260048152634e4f544560e01b6020909101527f7343b220e6b2909c69d3adb479e1a2847c2e830def068bc249b12af112094ed58114155b156103d6578383604051635790efdb60e01b81526004016102d19291906109e3565b60408051808201909152600581526443414e544f60d81b6020909101527fac9fb8ee1ff16cf8a1fd14f2b033007d13cc70a50a3cbd4154efb8e0b247187d81141561049d57844710156104445760405162fae2d560e21b8152476004820152602481018690526044016102d1565b6040516001600160a01b038716908690600081818185875af1925050503d806000811461048d576040519150601f19603f3d011682016040523d82523d6000602084013e610492565b606091505b50508092505061061f565b6040805180820190915260048152634e4f544560e01b6020909101527f7343b220e6b2909c69d3adb479e1a2847c2e830def068bc249b12af112094ed581141561061f576003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561052a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054e91906109ba565b90508581101561057a5760405162fae2d560e21b815260048101829052602481018790526044016102d1565b60035460405163a9059cbb60e01b81526001600160a01b038981166004830152602482018990529091169063a9059cbb906044016020604051808303816000875af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190610a12565b503d8015610606576020811461061057600080fd5b600019935061061c565b60206000803e60005193505b50505b81610640576040516308426a1d60e01b8152600481018690526024016102d1565b505050505050565b6001546001600160a01b031633146106b95760405162461bcd60e51b815260206004820152602e60248201527f547265617375727944656c656761746f723a5f73657450656e64696e6741646d60448201526d696e3a2061646d696e206f6e6c7960901b60648201526084016102d1565b600080546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a991015b60405180910390a15050565b6001546001600160a01b031633146107485760405163c0d4daef60e01b81523360048201526024016102d1565b6001600160a01b038116158061076857506003546001600160a01b031615155b1561078657604051637dabd39960e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461081d5760405162461bcd60e51b815260206004820152603260248201527f547265617375727944656c656761746f723a5f61636365707441646d696e3a2060448201527170656e64696e672061646d696e206f6e6c7960701b60648201526084016102d1565b60018054600080546001600160a01b038082166001600160a01b031980861682179096559490911690915560408051919092168082526020820184905292917ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc910160405180910390a1600054604080516001600160a01b03808516825290921660208301527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9910161070f565b80356001600160a01b03811681146108e257600080fd5b919050565b600080604083850312156108fa57600080fd5b610903836108cb565b946020939093013593505050565b6000806000806060858703121561092757600080fd5b610930856108cb565b935060208501359250604085013567ffffffffffffffff8082111561095457600080fd5b818701915087601f83011261096857600080fd5b81358181111561097757600080fd5b88602082850101111561098957600080fd5b95989497505060200194505050565b6000602082840312156109aa57600080fd5b6109b3826108cb565b9392505050565b6000602082840312156109cc57600080fd5b5051919050565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600060208284031215610a2457600080fd5b815180151581146109b357600080fdfea26469706673582212206c0ae917d2ee40ba83749f17c15ca5e7b68c3500ec7ae50de5026c3f9d3acadb64736f6c634300080b0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80637b26673c116100715780637b26673c1461013c578063864392181461014f578063b71d1a0c14610162578063c4d66de814610175578063e9c714f214610188578063f851a4401461019057600080fd5b806303cc29a5146100b95780631ce78bb2146100ce5780631e9a6950146100d657806326782247146100eb57806326d111f5146101165780635c60da1b14610129575b600080fd5b475b6040519081526020015b60405180910390f35b6100bb6101a3565b6100e96100e43660046108e7565b61021a565b005b6000546100fe906001600160a01b031681565b6040516001600160a01b0390911681526020016100c5565b6003546100fe906001600160a01b031681565b6002546100fe906001600160a01b031681565b6100e961014a366004610911565b6102e0565b6004546100fe906001600160a01b031681565b6100e9610170366004610998565b610648565b6100e9610183366004610998565b61071b565b6100e96107a8565b6001546100fe906001600160a01b031681565b6003546040516370a0823160e01b815230600482015260009182916001600160a01b03909116906370a0823190602401602060405180830381865afa1580156101f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021491906109ba565b92915050565b6001600160a01b0382166102415760405163e6c4247b60e01b815260040160405180910390fd5b60405163db006a7560e01b81526004810182905282906000906001600160a01b0383169063db006a75906024016020604051808303816000875af115801561028d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b191906109ba565b905080156102da576040516308426a1d60e01b8152600481018490526024015b60405180910390fd5b50505050565b6001546001600160a01b0316331461030d5760405163c0d4daef60e01b81523360048201526024016102d1565b60008083836040516103209291906109d3565b60408051918290038220828201909152600582526443414e544f60d81b60209092019190915290507fac9fb8ee1ff16cf8a1fd14f2b033007d13cc70a50a3cbd4154efb8e0b247187d81148015906103b457506040805180820190915260048152634e4f544560e01b6020909101527f7343b220e6b2909c69d3adb479e1a2847c2e830def068bc249b12af112094ed58114155b156103d6578383604051635790efdb60e01b81526004016102d19291906109e3565b60408051808201909152600581526443414e544f60d81b6020909101527fac9fb8ee1ff16cf8a1fd14f2b033007d13cc70a50a3cbd4154efb8e0b247187d81141561049d57844710156104445760405162fae2d560e21b8152476004820152602481018690526044016102d1565b6040516001600160a01b038716908690600081818185875af1925050503d806000811461048d576040519150601f19603f3d011682016040523d82523d6000602084013e610492565b606091505b50508092505061061f565b6040805180820190915260048152634e4f544560e01b6020909101527f7343b220e6b2909c69d3adb479e1a2847c2e830def068bc249b12af112094ed581141561061f576003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa15801561052a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054e91906109ba565b90508581101561057a5760405162fae2d560e21b815260048101829052602481018790526044016102d1565b60035460405163a9059cbb60e01b81526001600160a01b038981166004830152602482018990529091169063a9059cbb906044016020604051808303816000875af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190610a12565b503d8015610606576020811461061057600080fd5b600019935061061c565b60206000803e60005193505b50505b81610640576040516308426a1d60e01b8152600481018690526024016102d1565b505050505050565b6001546001600160a01b031633146106b95760405162461bcd60e51b815260206004820152602e60248201527f547265617375727944656c656761746f723a5f73657450656e64696e6741646d60448201526d696e3a2061646d696e206f6e6c7960901b60648201526084016102d1565b600080546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a991015b60405180910390a15050565b6001546001600160a01b031633146107485760405163c0d4daef60e01b81523360048201526024016102d1565b6001600160a01b038116158061076857506003546001600160a01b031615155b1561078657604051637dabd39960e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461081d5760405162461bcd60e51b815260206004820152603260248201527f547265617375727944656c656761746f723a5f61636365707441646d696e3a2060448201527170656e64696e672061646d696e206f6e6c7960701b60648201526084016102d1565b60018054600080546001600160a01b038082166001600160a01b031980861682179096559490911690915560408051919092168082526020820184905292917ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc910160405180910390a1600054604080516001600160a01b03808516825290921660208301527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9910161070f565b80356001600160a01b03811681146108e257600080fd5b919050565b600080604083850312156108fa57600080fd5b610903836108cb565b946020939093013593505050565b6000806000806060858703121561092757600080fd5b610930856108cb565b935060208501359250604085013567ffffffffffffffff8082111561095457600080fd5b818701915087601f83011261096857600080fd5b81358181111561097757600080fd5b88602082850101111561098957600080fd5b95989497505060200194505050565b6000602082840312156109aa57600080fd5b6109b3826108cb565b9392505050565b6000602082840312156109cc57600080fd5b5051919050565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600060208284031215610a2457600080fd5b815180151581146109b357600080fdfea26469706673582212206c0ae917d2ee40ba83749f17c15ca5e7b68c3500ec7ae50de5026c3f9d3acadb64736f6c634300080b0033",
"devdoc": {
"kind": "dev",
"methods": {
"_acceptAdmin()": {
"details": "Admin function for pending admin to accept role and update admin"
},
"_setPendingAdmin(address)": {
"details": "Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.",
"params": {
"newPendingAdmin": "New pending admin."
}
},
"initialize(address)": {
"params": {
"note_": "The address of note ERC20 contract"
}
},
"queryCantoBalance()": {
"returns": {
"_0": "treasuryCantoBalance the canto balance"
}
},
"queryNoteBalance()": {
"returns": {
"_0": "treasuryNoteBalance the note balance "
}
},
"sendFund(address,uint256,string)": {
"details": "Only the admin can call this method (Timelock contract)",
"params": {
"amount": "Amount to send",
"denom": "Denomination of fund to send ",
"recipient": "Address receiving funds"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"_acceptAdmin()": {
"notice": "Accepts transfer of admin rights. msg.sender must be pendingAdmin"
},
"_setPendingAdmin(address)": {
"notice": "Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer."
},
"initialize(address)": {
"notice": "Initializes the note contract"
},
"queryCantoBalance()": {
"notice": "Method to query current balance of CANTO in the treasury"
},
"queryNoteBalance()": {
"notice": "Method to query current balance of NOTE in the treasury "
},
"sendFund(address,uint256,string)": {
"notice": "Method to send treasury funds to recipient"
}
},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 29231,
"contract": "src/Treasury/TreasuryDelegate.sol:TreasuryDelegate",
"label": "pendingAdmin",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 29233,
"contract": "src/Treasury/TreasuryDelegate.sol:TreasuryDelegate",
"label": "admin",
"offset": 0,
"slot": "1",
"type": "t_address"
},
{
"astId": 29235,
"contract": "src/Treasury/TreasuryDelegate.sol:TreasuryDelegate",
"label": "implementation",
"offset": 0,
"slot": "2",
"type": "t_address"
},
{
"astId": 29241,
"contract": "src/Treasury/TreasuryDelegate.sol:TreasuryDelegate",
"label": "note",
"offset": 0,
"slot": "3",
"type": "t_contract(EIP20Interface)15445"
},
{
"astId": 29244,
"contract": "src/Treasury/TreasuryDelegate.sol:TreasuryDelegate",
"label": "unigov",
"offset": 0,
"slot": "4",
"type": "t_contract(IProposal)18926"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_contract(EIP20Interface)15445": {
"encoding": "inplace",
"label": "contract EIP20Interface",
"numberOfBytes": "20"
},
"t_contract(IProposal)18926": {
"encoding": "inplace",
"label": "contract IProposal",
"numberOfBytes": "20"
}
}
}
}