-
Notifications
You must be signed in to change notification settings - Fork 0
/
SuOracleAggregator.json
473 lines (473 loc) · 66.9 KB
/
SuOracleAggregator.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
{
"address": "0x7a1adc8340C00AA3Ecdd4Ecf36182Eed5D1BAb0B",
"abi": [
{
"inputs": [],
"name": "BadAccessControlSingleton",
"type": "error"
},
{
"inputs": [],
"name": "BadOracleId",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "NoOracleFound",
"type": "error"
},
{
"inputs": [],
"name": "NoOracleImplementation",
"type": "error"
},
{
"inputs": [],
"name": "OnlyAdminError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyAlerterError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyDAOError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyLiquidationAccessError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyMintAccessError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRewardAccessError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRoleError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyVaultAccessError",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"inputs": [],
"name": "ACCESS_CONTROL_SINGLETON",
"outputs": [
{
"internalType": "contract ISuAccessControl",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ADMIN_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ALERTER_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "DAO_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LIQUIDATION_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MINT_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "REWARD_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VAULT_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "assetToOracle",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "getFiatPrice1e18",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "hasPriceForAsset",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_authControl",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "oracleImplementations",
"outputs": [
{
"internalType": "contract ISuOracle",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "assets",
"type": "address[]"
},
{
"internalType": "uint256",
"name": "oracleId",
"type": "uint256"
}
],
"name": "setOracleIdForAssets",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "oracleId",
"type": "uint256"
},
{
"internalType": "contract ISuOracle",
"name": "oracleImplementation",
"type": "address"
}
],
"name": "setOracleImplementation",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"numDeployments": 1,
"solcInputHash": "6bdb767f00e3f0fe0de7c63e7a48801d",
"metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"BadAccessControlSingleton\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadOracleId\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"NoOracleFound\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NoOracleImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAdminError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAlerterError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyDAOError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyLiquidationAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyMintAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRewardAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRoleError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyVaultAccessError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ACCESS_CONTROL_SINGLETON\",\"outputs\":[{\"internalType\":\"contract ISuAccessControl\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ALERTER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DAO_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIQUIDATION_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"assetToOracle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getFiatPrice1e18\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"hasPriceForAsset\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_authControl\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"oracleImplementations\",\"outputs\":[{\"internalType\":\"contract ISuOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"oracleId\",\"type\":\"uint256\"}],\"name\":\"setOracleIdForAssets\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"oracleId\",\"type\":\"uint256\"},{\"internalType\":\"contract ISuOracle\",\"name\":\"oracleImplementation\",\"type\":\"address\"}],\"name\":\"setOracleImplementation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"See ISuOracleAggregator interface for full details.\",\"kind\":\"dev\",\"methods\":{\"getFiatPrice1e18(address)\":{\"params\":{\"asset\":\"- address of erc20 token contract\"},\"returns\":{\"_0\":\"usdPrice1e18 such that asset.balanceOf() * getFiatPrice1e18(asset) / 1e18 == $$ * 1e18*\"}},\"hasPriceForAsset(address)\":{\"returns\":{\"_0\":\"true if oracle is set to this asset, false otherwise*\"}},\"setOracleImplementation(uint256,address)\":{\"params\":{\"oracleId\":\"- number 0,1, etc to assign the oracle\",\"oracleImplementation\":\"- an address with ISuOracle implementation contract*\"}},\"supportsInterface(bytes4)\":{\"details\":\"Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.\"}},\"title\":\"SuChainlinkOracle\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getFiatPrice1e18(address)\":{\"notice\":\"WARNING! Read this description very carefully! function getFiatPrice1e18(address asset) returns (uint256) that: basicAmountOfAsset * getFiatPrice1e18(asset) / 1e18 === $$ * 1e18 in other words, it doesn't matter what's the erc20.decimals is, you just multiply token balance in basic units on value from oracle and get dollar amount multiplied on 1e18. different assets have different deviation threshold (errors) for wBTC it's <= 0.5%, read more https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd for other asset is can be larger based on particular oracle implementation. examples: market price of btc = $30k, for 0.1 wBTC the unit256 amount is 0.1 * 1e18 0.1 * 1e18 * (price1e18 / 1e18) == $3000 == uint256(3000*1e18) => price1e18 = 30000 * 1e18; market price of usdt = $0.97, for 1 usdt uint256 = 1 * 1e6 so 1*1e6 * price1e18 / 1e18 == $0.97 == uint256(0.97*1e18) => 1*1e6 * (price1e18 / 1e18) / (0.97*1e18) = 1 => price1e18 = 0.97 * (1e18/1e6) * 1e18 assume market price of wBTC = $31,503.77, oracle error = $158 case #1: small amount of wBTC we have 0.0,000,001 wBTC that is worth v = $0.00315 \\u00b1 $0.00001 = 0.00315*1e18 = 315*1e13 \\u00b1 1*1e13 actual balance on the asset b = wBTC.balanceOf() = 0.0000001*1e18 = 1e11 oracle should return or = oracle.getFiatPrice1e18(wBTC) <=> <=> b*or = v => v/b = 315*1e13 / 1e11 = 315*1e2 \\u00b1 1e2 error = or.error * b = 1e2 * 1e11 = 1e13 => 1e13/1e18 usd = 1e-5 = 0.00001 usd case #2: large amount of wBTC v = 2,000,000 wBTC = $31,503.77 * 2m \\u00b1 158*2m = $63,007,540,000 \\u00b1 $316,000,000 = 63,007*1e24 \\u00b1 316*1e24 for calc convenience we increase error on 0.05 and have v = 63,000*24 \\u00b1 300*1e24 = (630 \\u00b1 3)*1e26 b = 2*1e6 * 1e18 = 2*1e24 or = v/b = (630 \\u00b1 3)*1e26 / 2*1e24 = 315*1e2 \\u00b1 1.5*1e2 error = or.error * b = 1.5*100 * 2*1e24 = 3*1e26 = 3*1e8*1e18 = $300,000,000 ~ $316,000,000 assume the market price of USDT = $0.97 \\u00b1 $0.00485, case #3: little amount of USDT v = USDT amount 0.005 = 0.005*(0.97 \\u00b1 0.00485) = 0.00485*1e18 \\u00b1 0.00002425*1e18 = 485*1e13 \\u00b1 3*1e13 we rounded error up on (3000-2425)/2425 ~= +24% for calculation convenience. b = USDT.balanceOf() = 0.005*1e6 = 5*1e3 b*or = v => or = v/b = (485*1e13 \\u00b1 3*1e13) / 5*1e3 = 970*1e9 \\u00b1 6*1e9 error = 6*1e9 * 5*1e3 / 1e18 = 30*1e12/1e18 = 3*1e-5 = $0,00005 case #4: lot of USDT v = we have 100,000,000,000 USDT = $97B = 97*1e9*1e18 \\u00b1 0.5*1e9*1e18 b = USDT.balanceOf() = 1e11*1e6 = 1e17 or = v/b = (97*1e9*1e18 \\u00b1 0.5*1e9*1e18) / 1e17 = 970*1e9 \\u00b1 5*1e9 error = 5*1e9 * 1e17 = 5*1e26 = 0.5 * 1e8*1e18\"},\"setOracleIdForAssets(address[],uint256)\":{\"notice\":\"specify what oracleId should be used for each assets. Checks that oracleId has an implementation*\"},\"setOracleImplementation(uint256,address)\":{\"notice\":\"assign address of oracle implementation to the oracleId\"}},\"notice\":\"Oracle that aggregate all oracles, like router\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/contracts/oracle/SuOracleAggregator.sol\":\"SuOracleAggregator\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"contracts/periphery/contracts/access-control/SuAccessRoles.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title SuAccessRoles Library\\n * @dev SuAuthenticated and SuAccessControlSingleton need to have this constants\\n * Hierarchy:\\n * 1. DAO - can give admins and system roles\\n * 2.1. Admin - can set Alerters\\n * 2.2. System - includes Minter, Vault, Liquidation and Reward roles, don't have access to give some roles.\\n * 3. Alerter - can send alerts and trigger rate limits, don't have access to give some roles.\\n */\\nabstract contract SuAccessRoles {\\n bytes32 public constant ADMIN_ROLE = 0x00;\\n\\n bytes32 public constant DAO_ROLE = keccak256(\\\"DAO_ROLE\\\");\\n\\n bytes32 public constant ALERTER_ROLE = keccak256(\\\"ALERTER_ROLE\\\");\\n\\n // system roles\\n bytes32 public constant MINT_ACCESS_ROLE = keccak256(\\\"MINT_ACCESS_ROLE\\\");\\n bytes32 public constant VAULT_ACCESS_ROLE = keccak256(\\\"VAULT_ACCESS_ROLE\\\");\\n bytes32 public constant LIQUIDATION_ACCESS_ROLE = keccak256(\\\"LIQUIDATION_ACCESS_ROLE\\\");\\n bytes32 public constant REWARD_ACCESS_ROLE = keccak256(\\\"REWARD_ACCESS_ROLE\\\");\\n}\\n\",\"keccak256\":\"0x024209469b6b337eef6cf520501d1e6c2ba66a79f014c25220a35e407d69b02e\",\"license\":\"BSL 1.1\"},\"contracts/periphery/contracts/access-control/SuAuthenticated.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../interfaces/access-control/ISuAccessControl.sol\\\";\\nimport \\\"./SuAccessRoles.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @title SuAuthenticated\\n * @dev other contracts should inherit to be authenticated.\\n * The address of SuAccessControlSingleton should be one for all contract that inherits SuAuthenticated\\n */\\nabstract contract SuAuthenticated is Initializable, SuAccessRoles, IERC165Upgradeable {\\n ISuAccessControl public ACCESS_CONTROL_SINGLETON;\\n\\n error OnlyDAOError();\\n error OnlyAdminError();\\n error OnlyAlerterError();\\n error OnlyVaultAccessError();\\n error OnlyLiquidationAccessError();\\n error OnlyMintAccessError();\\n error OnlyRewardAccessError();\\n error OnlyRoleError();\\n error BadAccessControlSingleton();\\n\\n /**\\n * @dev should be passed in constructor\\n */\\n function __suAuthenticatedInit(address _accessControlSingleton) internal onlyInitializing {\\n ACCESS_CONTROL_SINGLETON = ISuAccessControl(_accessControlSingleton);\\n if (\\n !ISuAccessControl(_accessControlSingleton).supportsInterface(type(IAccessControlUpgradeable).interfaceId)\\n ) revert BadAccessControlSingleton();\\n }\\n\\n /** CORE ROLES */\\n\\n modifier onlyDAO() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(DAO_ROLE, msg.sender)) revert OnlyDAOError();\\n _;\\n }\\n\\n modifier onlyAdmin() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(ADMIN_ROLE, msg.sender)) revert OnlyAdminError();\\n _;\\n }\\n\\n modifier onlyAlerter() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(ALERTER_ROLE, msg.sender)) revert OnlyAlerterError();\\n _;\\n }\\n\\n /** SYSTEM ROLES */\\n\\n modifier onlyVaultAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(VAULT_ACCESS_ROLE, msg.sender)) revert OnlyVaultAccessError();\\n _;\\n }\\n\\n modifier onlyLiquidationAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(LIQUIDATION_ACCESS_ROLE, msg.sender)) revert OnlyLiquidationAccessError();\\n _;\\n }\\n\\n modifier onlyMintAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(MINT_ACCESS_ROLE, msg.sender)) revert OnlyMintAccessError();\\n _;\\n }\\n\\n modifier onlyRewardAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(REWARD_ACCESS_ROLE, msg.sender)) revert OnlyRewardAccessError();\\n _;\\n }\\n\\n // syntax sugar under ACCESS_CONTROL_SINGLETON\\n modifier onlyRole(bytes32 role) {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(role, msg.sender)) revert OnlyRoleError();\\n _;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return ACCESS_CONTROL_SINGLETON.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x3553007ac782c0c5f2ecf3ca47b8b72d74b2cae35c34ffe2d030b968938b2b0d\",\"license\":\"BSL 1.1\"},\"contracts/periphery/contracts/interfaces/access-control/ISuAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\nimport \\\"../../access-control/SuAccessRoles.sol\\\";\\n\\n/**\\n * @notice Access control for contracts\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n **/\\ninterface ISuAccessControl is IAccessControlUpgradeable, IERC165Upgradeable {\\n function setRoleAdmin(bytes32 role, bytes32 adminRole) external;\\n}\\n\",\"keccak256\":\"0x25724ac502fd6418ccd38273b276de4b2fdecd023d723c5d80c9f0a27c407bcd\",\"license\":\"MIT\"},\"contracts/periphery/contracts/interfaces/oracle/ISuOracle.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\n// solhint-disable compiler-version\\npragma solidity >=0.7.6;\\n\\ninterface ISuOracle {\\n /**\\n * @notice WARNING! Read this description very carefully!\\n * function getFiatPrice1e18(address asset) returns (uint256) that:\\n * basicAmountOfAsset * getFiatPrice1e18(asset) / 1e18 === $$ * 1e18\\n * in other words, it doesn't matter what's the erc20.decimals is,\\n * you just multiply token balance in basic units on value from oracle and get dollar amount multiplied on 1e18.\\n *\\n * different assets have different deviation threshold (errors)\\n * for wBTC it's <= 0.5%, read more https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd\\n * for other asset is can be larger based on particular oracle implementation.\\n *\\n * examples:\\n * market price of btc = $30k,\\n * for 0.1 wBTC the unit256 amount is 0.1 * 1e18\\n * 0.1 * 1e18 * (price1e18 / 1e18) == $3000 == uint256(3000*1e18)\\n * => price1e18 = 30000 * 1e18;\\n *\\n * market price of usdt = $0.97,\\n * for 1 usdt uint256 = 1 * 1e6\\n * so 1*1e6 * price1e18 / 1e18 == $0.97 == uint256(0.97*1e18)\\n * => 1*1e6 * (price1e18 / 1e18) / (0.97*1e18) = 1\\n * => price1e18 = 0.97 * (1e18/1e6) * 1e18\\n *\\n * assume market price of wBTC = $31,503.77, oracle error = $158\\n *\\n * case #1: small amount of wBTC\\n * we have 0.0,000,001 wBTC that is worth v = $0.00315 \\u00b1 $0.00001 = 0.00315*1e18 = 315*1e13 \\u00b1 1*1e13\\n * actual balance on the asset b = wBTC.balanceOf() = 0.0000001*1e18 = 1e11\\n * oracle should return or = oracle.getFiatPrice1e18(wBTC) <=>\\n * <=> b*or = v => v/b = 315*1e13 / 1e11 = 315*1e2 \\u00b1 1e2\\n * error = or.error * b = 1e2 * 1e11 = 1e13 => 1e13/1e18 usd = 1e-5 = 0.00001 usd\\n *\\n * case #2: large amount of wBTC\\n * v = 2,000,000 wBTC = $31,503.77 * 2m \\u00b1 158*2m = $63,007,540,000 \\u00b1 $316,000,000 = 63,007*1e24 \\u00b1 316*1e24\\n * for calc convenience we increase error on 0.05 and have v = 63,000*24 \\u00b1 300*1e24 = (630 \\u00b1 3)*1e26\\n * b = 2*1e6 * 1e18 = 2*1e24\\n * or = v/b = (630 \\u00b1 3)*1e26 / 2*1e24 = 315*1e2 \\u00b1 1.5*1e2\\n * error = or.error * b = 1.5*100 * 2*1e24 = 3*1e26 = 3*1e8*1e18 = $300,000,000 ~ $316,000,000\\n *\\n * assume the market price of USDT = $0.97 \\u00b1 $0.00485,\\n *\\n * case #3: little amount of USDT\\n * v = USDT amount 0.005 = 0.005*(0.97 \\u00b1 0.00485) = 0.00485*1e18 \\u00b1 0.00002425*1e18 = 485*1e13 \\u00b1 3*1e13\\n * we rounded error up on (3000-2425)/2425 ~= +24% for calculation convenience.\\n * b = USDT.balanceOf() = 0.005*1e6 = 5*1e3\\n * b*or = v => or = v/b = (485*1e13 \\u00b1 3*1e13) / 5*1e3 = 970*1e9 \\u00b1 6*1e9\\n * error = 6*1e9 * 5*1e3 / 1e18 = 30*1e12/1e18 = 3*1e-5 = $0,00005\\n *\\n * case #4: lot of USDT\\n * v = we have 100,000,000,000 USDT = $97B = 97*1e9*1e18 \\u00b1 0.5*1e9*1e18\\n * b = USDT.balanceOf() = 1e11*1e6 = 1e17\\n * or = v/b = (97*1e9*1e18 \\u00b1 0.5*1e9*1e18) / 1e17 = 970*1e9 \\u00b1 5*1e9\\n * error = 5*1e9 * 1e17 = 5*1e26 = 0.5 * 1e8*1e18\\n *\\n * @param asset - address of erc20 token contract\\n * @return usdPrice1e18 such that asset.balanceOf() * getFiatPrice1e18(asset) / 1e18 == $$ * 1e18\\n **/\\n function getFiatPrice1e18(address asset) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa56b9cc86ef5935efecc276e6a3188d518f1a99cad960083a8de35849c997687\",\"license\":\"UNLICENSED\"},\"contracts/periphery/contracts/interfaces/oracle/ISuOracleAggregator.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ISuOracle.sol\\\";\\n\\ninterface ISuOracleAggregator is ISuOracle {\\n /* ===================== ERRORS ===================== */\\n error NoOracleFound(address asset);\\n error NoOracleImplementation();\\n error BadOracleId();\\n\\n /* ====================== VARS ====================== */\\n function assetToOracle (address asset) external view returns ( uint256 );\\n function oracleImplementations (uint256 oracleId) external view returns ( ISuOracle );\\n\\n /* ==================== METHODS ==================== */\\n /**\\n * @notice assign address of oracle implementation to the oracleId\\n * @param oracleId - number 0,1, etc to assign the oracle\\n * @param oracleImplementation - an address with ISuOracle implementation contract\\n **/\\n function setOracleImplementation(uint256 oracleId, ISuOracle oracleImplementation) external;\\n\\n /**\\n * @notice specify what oracleId should be used for each assets. Checks that oracleId has an implementation\\n **/\\n function setOracleIdForAssets(address[] memory assets, uint256 oracleId) external;\\n\\n /* ==================== VIEW METHODS ==================== */\\n /**\\n * @return true if oracle is set to this asset, false otherwise\\n **/\\n function hasPriceForAsset(address asset) external view returns(bool);\\n}\\n\",\"keccak256\":\"0xaaa3a02a21ed5cbd6992c596f066043bc3bdd95333e8a0f023d82636f66b7bce\",\"license\":\"UNLICENSED\"},\"contracts/periphery/contracts/oracle/SuOracleAggregator.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity ^0.8.0;\\n\\n/*\\n OracleAggregator aggregates several oracles inside, such as: getUsdPrice asset -> id -> call to implementation\\n We have several oracle implementations of ISuOracle (they are inside this folder)\\n*/\\n\\nimport \\\"../access-control/SuAuthenticated.sol\\\";\\nimport \\\"../interfaces/oracle/ISuOracleAggregator.sol\\\";\\n\\n/**\\n * @title SuChainlinkOracle\\n * @notice Oracle that aggregate all oracles, like router\\n * @dev See ISuOracleAggregator interface for full details.\\n */\\ncontract SuOracleAggregator is ISuOracleAggregator, SuAuthenticated {\\n mapping (address => uint256) public assetToOracle;\\n mapping (uint256 => ISuOracle) public oracleImplementations;\\n\\n function initialize(address _authControl) public initializer {\\n __suAuthenticatedInit(_authControl);\\n }\\n\\n function hasPriceForAsset(address asset) public view returns (bool) {\\n return assetToOracle[asset] != 0;\\n }\\n\\n function getFiatPrice1e18(address asset) external view returns (uint256) {\\n uint256 oracleId = assetToOracle[asset];\\n if (oracleId == 0) revert NoOracleFound(asset);\\n ISuOracle oracleImplementation = oracleImplementations[oracleId];\\n if (address(oracleImplementation) == address(0)) revert NoOracleImplementation();\\n return oracleImplementation.getFiatPrice1e18(asset);\\n }\\n\\n function setOracleImplementation(uint256 oracleId, ISuOracle oracleImplementation) external onlyDAO {\\n if (oracleId == 0) revert BadOracleId();\\n if (address(oracleImplementation) == address(0)) revert NoOracleImplementation();\\n oracleImplementations[oracleId] = oracleImplementation;\\n }\\n\\n function setOracleIdForAssets(address[] memory assets, uint256 oracleId) external onlyDAO {\\n if (address(oracleImplementations[oracleId]) == address(0)) revert NoOracleImplementation();\\n for (uint256 i = 0; i < assets.length; ++i) {\\n assetToOracle[assets[i]] = oracleId;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe447abb80465b8469e6b560e66a71d6608d16764a03de99d89d8ac7589a0634d\",\"license\":\"GPL-3.0\"}},\"version\":1}",
"bytecode": "0x6080806040523461001657610a15908161001c8239f35b600080fdfe608060408181526004908136101561001657600080fd5b600092833560e01c90816301ffc9a7146108be5750806303ee9f22146108925780630827ba5b1461085f57806314c376dc146108245780632e00d245146107ec578063438280dd146107b15780636806ff2b1461061557806371d0fb41146105da57806375b238fc146105bf5780638e5313e014610584578063a780f1331461054a578063b9ac2b3814610469578063c4d66de814610245578063dc97e84e1461020a578063e9c26518146101dd5763ef54c378146100d457600080fd5b346101d957806003193601126101d9576001600160a01b036024358181169380359290918590036101d5576020604491875460101c16855192838092632474521560e21b82526000805160206109c0833981519152878301523360248301525afa9081156101cb57869161019d575b501561018f578115610181578315610173575083526002602052822080546001600160a01b031916909117905580f35b825163722dd29d60e11b8152fd5b825163f837507f60e01b8152fd5b825163599a6c3360e11b8152fd5b6101be915060203d81116101c4575b6101b6818361096e565b8101906109a7565b38610143565b503d6101ac565b84513d88823e3d90fd5b8580fd5b8280fd5b838234610206578160031936011261020657602090516000805160206109c08339815191528152f35b5080fd5b838234610206578160031936011261020657602090517f9a9aef7c1247d5fc769b0185c052913e39673da29a880317dfd20ebf86f26a498152f35b50346101d9576020908160031936011261046557610261610953565b845460ff8160081c161590818092610458575b8015610441575b156103e75760ff1981166001178755816103d6575b5085549460ff8660081c161561037f5762010000600160b01b03601084901b1662010000600160b01b031987168117885584516301ffc9a760e01b8152637965db0b60e01b8382015290938690829060249082906001600160a01b03165afa908115610375578891610358575b501561034a575061030c578480f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249893610100600160b01b0319161784555160018152a1388080808480f35b83516384d942fd60e01b8152fd5b61036f9150863d88116101c4576101b6818361096e565b386102fd565b85513d8a823e3d90fd5b835162461bcd60e51b8152908101859052602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b61ffff191661010117865538610290565b835162461bcd60e51b8152808701869052602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b15801561027b5750600160ff82161461027b565b50600160ff821610610274565b8380fd5b5082903461020657602092836003193601126101d9576001600160a01b0380610490610953565b16908185526001865283852054801561053457855260028652838520541691821561052657906024869285519485938492631735856760e31b84528301525afa92831561051b5780936104e6575b505051908152f35b909192508382813d8311610514575b6104ff818361096e565b810103126105115750519083806104de565b80fd5b503d6104f5565b8251903d90823e3d90fd5b835163722dd29d60e11b8152fd5b505060249251916305d03ee160e41b8352820152fd5b8382346102065760203660031901126102065760209181906001600160a01b03610572610953565b16815260018452205415159051908152f35b838234610206578160031936011261020657602090517fe453bacb314e78dcd5192e6b1a2b1f0e7c76e92f6b7e429a6a90f04e39db3b768152f35b83823461020657816003193601126102065751908152602090f35b838234610206578160031936011261020657602090517f880a91047114272656e533301261260c75e4d11543ac7303d6fe4204579ec7278152f35b5082346105115781600319360112610511576001600160401b039280358481116101d957366023820112156101d9578082013594851161079e5760059385851b95815192602091610668838a018661096e565b8452818401602480998301019136831161079a578901905b82821061077757505085548351632474521560e21b81526000805160206109c08339815191528782015233818b01528935956001600160a01b0393509184908290604490829060101c87165afa90811561037557889161075a575b501561074a57848752600283528184882054161561073a57865b8151811015610736578284828b1b840101511688526001845285858920556000198114610724576001016106f5565b634e487b7160e01b8852601187528988fd5b8780f35b835163722dd29d60e11b81528690fd5b835163599a6c3360e11b81528690fd5b6107719150843d86116101c4576101b6818361096e565b8a6106db565b81356001600160a01b0381168103610796578152908301908301610680565b8880fd5b8780fd5b634e487b7160e01b835260418252602483fd5b838234610206578160031936011261020657602090517f39f61ca2a1a28fee144218173ec637b649a353e4026b2738c673800e5bf1437b8152f35b8382346102065760203660031901126102065760209181906001600160a01b03610814610953565b1681526001845220549051908152f35b838234610206578160031936011261020657602090517fe965846df3dd5b1dfa65f58e31477079e90140e0908b6dd31b5aead5a57cf3658152f35b5090346101d95760203660031901126101d95735825260026020908152918190205490516001600160a01b039091168152f35b8382346102065781600319360112610206579054905160109190911c6001600160a01b03168152602090f35b9290503461046557602036600319011261046557803563ffffffff60e01b811680910361094f5784546301ffc9a760e01b8552918401526020908390602490829060101c6001600160a01b03165afa9182156109455760209392610926575b50519015158152f35b61093e919250833d81116101c4576101b6818361096e565b903861091d565b81513d85823e3d90fd5b8480fd5b600435906001600160a01b038216820361096957565b600080fd5b601f909101601f19168101906001600160401b0382119082101761099157604052565b634e487b7160e01b600052604160045260246000fd5b9081602091031261096957518015158103610969579056fe3b5d4cc60d3ec3516ee8ae083bd60934f6eb2a6c54b1229985c41bfb092b2603a264697066735822122001f678590b97ccabc5ff485eeeea2d5066aa268e2629ff09200af0b07eda4f7864736f6c63430008110033",
"deployedBytecode": "0x608060408181526004908136101561001657600080fd5b600092833560e01c90816301ffc9a7146108be5750806303ee9f22146108925780630827ba5b1461085f57806314c376dc146108245780632e00d245146107ec578063438280dd146107b15780636806ff2b1461061557806371d0fb41146105da57806375b238fc146105bf5780638e5313e014610584578063a780f1331461054a578063b9ac2b3814610469578063c4d66de814610245578063dc97e84e1461020a578063e9c26518146101dd5763ef54c378146100d457600080fd5b346101d957806003193601126101d9576001600160a01b036024358181169380359290918590036101d5576020604491875460101c16855192838092632474521560e21b82526000805160206109c0833981519152878301523360248301525afa9081156101cb57869161019d575b501561018f578115610181578315610173575083526002602052822080546001600160a01b031916909117905580f35b825163722dd29d60e11b8152fd5b825163f837507f60e01b8152fd5b825163599a6c3360e11b8152fd5b6101be915060203d81116101c4575b6101b6818361096e565b8101906109a7565b38610143565b503d6101ac565b84513d88823e3d90fd5b8580fd5b8280fd5b838234610206578160031936011261020657602090516000805160206109c08339815191528152f35b5080fd5b838234610206578160031936011261020657602090517f9a9aef7c1247d5fc769b0185c052913e39673da29a880317dfd20ebf86f26a498152f35b50346101d9576020908160031936011261046557610261610953565b845460ff8160081c161590818092610458575b8015610441575b156103e75760ff1981166001178755816103d6575b5085549460ff8660081c161561037f5762010000600160b01b03601084901b1662010000600160b01b031987168117885584516301ffc9a760e01b8152637965db0b60e01b8382015290938690829060249082906001600160a01b03165afa908115610375578891610358575b501561034a575061030c578480f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249893610100600160b01b0319161784555160018152a1388080808480f35b83516384d942fd60e01b8152fd5b61036f9150863d88116101c4576101b6818361096e565b386102fd565b85513d8a823e3d90fd5b835162461bcd60e51b8152908101859052602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b61ffff191661010117865538610290565b835162461bcd60e51b8152808701869052602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b15801561027b5750600160ff82161461027b565b50600160ff821610610274565b8380fd5b5082903461020657602092836003193601126101d9576001600160a01b0380610490610953565b16908185526001865283852054801561053457855260028652838520541691821561052657906024869285519485938492631735856760e31b84528301525afa92831561051b5780936104e6575b505051908152f35b909192508382813d8311610514575b6104ff818361096e565b810103126105115750519083806104de565b80fd5b503d6104f5565b8251903d90823e3d90fd5b835163722dd29d60e11b8152fd5b505060249251916305d03ee160e41b8352820152fd5b8382346102065760203660031901126102065760209181906001600160a01b03610572610953565b16815260018452205415159051908152f35b838234610206578160031936011261020657602090517fe453bacb314e78dcd5192e6b1a2b1f0e7c76e92f6b7e429a6a90f04e39db3b768152f35b83823461020657816003193601126102065751908152602090f35b838234610206578160031936011261020657602090517f880a91047114272656e533301261260c75e4d11543ac7303d6fe4204579ec7278152f35b5082346105115781600319360112610511576001600160401b039280358481116101d957366023820112156101d9578082013594851161079e5760059385851b95815192602091610668838a018661096e565b8452818401602480998301019136831161079a578901905b82821061077757505085548351632474521560e21b81526000805160206109c08339815191528782015233818b01528935956001600160a01b0393509184908290604490829060101c87165afa90811561037557889161075a575b501561074a57848752600283528184882054161561073a57865b8151811015610736578284828b1b840101511688526001845285858920556000198114610724576001016106f5565b634e487b7160e01b8852601187528988fd5b8780f35b835163722dd29d60e11b81528690fd5b835163599a6c3360e11b81528690fd5b6107719150843d86116101c4576101b6818361096e565b8a6106db565b81356001600160a01b0381168103610796578152908301908301610680565b8880fd5b8780fd5b634e487b7160e01b835260418252602483fd5b838234610206578160031936011261020657602090517f39f61ca2a1a28fee144218173ec637b649a353e4026b2738c673800e5bf1437b8152f35b8382346102065760203660031901126102065760209181906001600160a01b03610814610953565b1681526001845220549051908152f35b838234610206578160031936011261020657602090517fe965846df3dd5b1dfa65f58e31477079e90140e0908b6dd31b5aead5a57cf3658152f35b5090346101d95760203660031901126101d95735825260026020908152918190205490516001600160a01b039091168152f35b8382346102065781600319360112610206579054905160109190911c6001600160a01b03168152602090f35b9290503461046557602036600319011261046557803563ffffffff60e01b811680910361094f5784546301ffc9a760e01b8552918401526020908390602490829060101c6001600160a01b03165afa9182156109455760209392610926575b50519015158152f35b61093e919250833d81116101c4576101b6818361096e565b903861091d565b81513d85823e3d90fd5b8480fd5b600435906001600160a01b038216820361096957565b600080fd5b601f909101601f19168101906001600160401b0382119082101761099157604052565b634e487b7160e01b600052604160045260246000fd5b9081602091031261096957518015158103610969579056fe3b5d4cc60d3ec3516ee8ae083bd60934f6eb2a6c54b1229985c41bfb092b2603a264697066735822122001f678590b97ccabc5ff485eeeea2d5066aa268e2629ff09200af0b07eda4f7864736f6c63430008110033",
"devdoc": {
"details": "See ISuOracleAggregator interface for full details.",
"kind": "dev",
"methods": {
"getFiatPrice1e18(address)": {
"params": {
"asset": "- address of erc20 token contract"
},
"returns": {
"_0": "usdPrice1e18 such that asset.balanceOf() * getFiatPrice1e18(asset) / 1e18 == $$ * 1e18*"
}
},
"hasPriceForAsset(address)": {
"returns": {
"_0": "true if oracle is set to this asset, false otherwise*"
}
},
"setOracleImplementation(uint256,address)": {
"params": {
"oracleId": "- number 0,1, etc to assign the oracle",
"oracleImplementation": "- an address with ISuOracle implementation contract*"
}
},
"supportsInterface(bytes4)": {
"details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas."
}
},
"title": "SuChainlinkOracle",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"getFiatPrice1e18(address)": {
"notice": "WARNING! Read this description very carefully! function getFiatPrice1e18(address asset) returns (uint256) that: basicAmountOfAsset * getFiatPrice1e18(asset) / 1e18 === $$ * 1e18 in other words, it doesn't matter what's the erc20.decimals is, you just multiply token balance in basic units on value from oracle and get dollar amount multiplied on 1e18. different assets have different deviation threshold (errors) for wBTC it's <= 0.5%, read more https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd for other asset is can be larger based on particular oracle implementation. examples: market price of btc = $30k, for 0.1 wBTC the unit256 amount is 0.1 * 1e18 0.1 * 1e18 * (price1e18 / 1e18) == $3000 == uint256(3000*1e18) => price1e18 = 30000 * 1e18; market price of usdt = $0.97, for 1 usdt uint256 = 1 * 1e6 so 1*1e6 * price1e18 / 1e18 == $0.97 == uint256(0.97*1e18) => 1*1e6 * (price1e18 / 1e18) / (0.97*1e18) = 1 => price1e18 = 0.97 * (1e18/1e6) * 1e18 assume market price of wBTC = $31,503.77, oracle error = $158 case #1: small amount of wBTC we have 0.0,000,001 wBTC that is worth v = $0.00315 ± $0.00001 = 0.00315*1e18 = 315*1e13 ± 1*1e13 actual balance on the asset b = wBTC.balanceOf() = 0.0000001*1e18 = 1e11 oracle should return or = oracle.getFiatPrice1e18(wBTC) <=> <=> b*or = v => v/b = 315*1e13 / 1e11 = 315*1e2 ± 1e2 error = or.error * b = 1e2 * 1e11 = 1e13 => 1e13/1e18 usd = 1e-5 = 0.00001 usd case #2: large amount of wBTC v = 2,000,000 wBTC = $31,503.77 * 2m ± 158*2m = $63,007,540,000 ± $316,000,000 = 63,007*1e24 ± 316*1e24 for calc convenience we increase error on 0.05 and have v = 63,000*24 ± 300*1e24 = (630 ± 3)*1e26 b = 2*1e6 * 1e18 = 2*1e24 or = v/b = (630 ± 3)*1e26 / 2*1e24 = 315*1e2 ± 1.5*1e2 error = or.error * b = 1.5*100 * 2*1e24 = 3*1e26 = 3*1e8*1e18 = $300,000,000 ~ $316,000,000 assume the market price of USDT = $0.97 ± $0.00485, case #3: little amount of USDT v = USDT amount 0.005 = 0.005*(0.97 ± 0.00485) = 0.00485*1e18 ± 0.00002425*1e18 = 485*1e13 ± 3*1e13 we rounded error up on (3000-2425)/2425 ~= +24% for calculation convenience. b = USDT.balanceOf() = 0.005*1e6 = 5*1e3 b*or = v => or = v/b = (485*1e13 ± 3*1e13) / 5*1e3 = 970*1e9 ± 6*1e9 error = 6*1e9 * 5*1e3 / 1e18 = 30*1e12/1e18 = 3*1e-5 = $0,00005 case #4: lot of USDT v = we have 100,000,000,000 USDT = $97B = 97*1e9*1e18 ± 0.5*1e9*1e18 b = USDT.balanceOf() = 1e11*1e6 = 1e17 or = v/b = (97*1e9*1e18 ± 0.5*1e9*1e18) / 1e17 = 970*1e9 ± 5*1e9 error = 5*1e9 * 1e17 = 5*1e26 = 0.5 * 1e8*1e18"
},
"setOracleIdForAssets(address[],uint256)": {
"notice": "specify what oracleId should be used for each assets. Checks that oracleId has an implementation*"
},
"setOracleImplementation(uint256,address)": {
"notice": "assign address of oracle implementation to the oracleId"
}
},
"notice": "Oracle that aggregate all oracles, like router",
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 671,
"contract": "contracts/periphery/contracts/oracle/SuOracleAggregator.sol:SuOracleAggregator",
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8"
},
{
"astId": 674,
"contract": "contracts/periphery/contracts/oracle/SuOracleAggregator.sol:SuOracleAggregator",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool"
},
{
"astId": 28586,
"contract": "contracts/periphery/contracts/oracle/SuOracleAggregator.sol:SuOracleAggregator",
"label": "ACCESS_CONTROL_SINGLETON",
"offset": 2,
"slot": "0",
"type": "t_contract(ISuAccessControl)32175"
},
{
"astId": 33685,
"contract": "contracts/periphery/contracts/oracle/SuOracleAggregator.sol:SuOracleAggregator",
"label": "assetToOracle",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_uint256)"
},
{
"astId": 33690,
"contract": "contracts/periphery/contracts/oracle/SuOracleAggregator.sol:SuOracleAggregator",
"label": "oracleImplementations",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_uint256,t_contract(ISuOracle)32359)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(ISuAccessControl)32175": {
"encoding": "inplace",
"label": "contract ISuAccessControl",
"numberOfBytes": "20"
},
"t_contract(ISuOracle)32359": {
"encoding": "inplace",
"label": "contract ISuOracle",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_uint256)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => uint256)",
"numberOfBytes": "32",
"value": "t_uint256"
},
"t_mapping(t_uint256,t_contract(ISuOracle)32359)": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => contract ISuOracle)",
"numberOfBytes": "32",
"value": "t_contract(ISuOracle)32359"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"encoding": "inplace",
"label": "uint8",
"numberOfBytes": "1"
}
}
}
}