@venusprotocol/oracle 1.6.10 → 1.6.11-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +11 -0
- package/README.md +117 -0
- package/contracts/ResilientOracle.sol +45 -37
- package/contracts/interfaces/PythInterface.sol +4 -1
- package/contracts/oracles/BinanceOracle.sol +65 -24
- package/contracts/oracles/BoundValidator.sol +51 -54
- package/contracts/oracles/ChainlinkOracle.sol +54 -54
- package/contracts/oracles/PythOracle.sol +48 -47
- package/contracts/oracles/TwapOracle.sol +85 -83
- package/contracts/oracles/mocks/MockBinanceFeedRegistry.sol +1 -1
- package/contracts/oracles/mocks/MockBinanceOracle.sol +1 -7
- package/contracts/oracles/mocks/MockPythOracle.sol +1 -1
- package/contracts/oracles/mocks/MockTwapOracle.sol +1 -1
- package/contracts/test/AccessControlManager.sol +6 -0
- package/contracts/test/BEP20Harness.sol +4 -0
- package/contracts/test/MockPyth.sol +9 -2
- package/deployments/bscmainnet/.chainId +1 -0
- package/deployments/bscmainnet/BinanceOracle.json +571 -0
- package/deployments/bscmainnet/BinanceOracle_Implementation.json +629 -0
- package/deployments/bscmainnet/BinanceOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/BoundValidator.json +621 -0
- package/deployments/bscmainnet/BoundValidator_Implementation.json +706 -0
- package/deployments/bscmainnet/BoundValidator_Proxy.json +251 -0
- package/deployments/bscmainnet/ChainlinkOracle.json +691 -0
- package/deployments/bscmainnet/ChainlinkOracle_Implementation.json +820 -0
- package/deployments/bscmainnet/ChainlinkOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/DefaultProxyAdmin.json +257 -0
- package/deployments/bscmainnet/PythOracle.json +688 -0
- package/deployments/bscmainnet/PythOracle_Implementation.json +804 -0
- package/deployments/bscmainnet/PythOracle_Proxy.json +265 -0
- package/deployments/bscmainnet/ResilientOracle.json +841 -0
- package/deployments/bscmainnet/ResilientOracle_Implementation.json +1044 -0
- package/deployments/bscmainnet/ResilientOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/TwapOracle.json +887 -0
- package/deployments/bscmainnet/TwapOracle_Implementation.json +1111 -0
- package/deployments/bscmainnet/TwapOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json +78 -0
- package/deployments/bscmainnet/solcInputs/aae9f1601b873a5a4704ede73ede10cb.json +135 -0
- package/deployments/bsctestnet/BinanceOracle.json +273 -31
- package/deployments/bsctestnet/BinanceOracle_Implementation.json +398 -28
- package/deployments/bsctestnet/BinanceOracle_Proxy.json +52 -28
- package/deployments/bsctestnet/BoundValidator.json +40 -40
- package/deployments/bsctestnet/BoundValidator_Implementation.json +43 -51
- package/deployments/bsctestnet/BoundValidator_Proxy.json +35 -35
- package/deployments/bsctestnet/ChainlinkOracle.json +57 -49
- package/deployments/bsctestnet/ChainlinkOracle_Implementation.json +46 -52
- package/deployments/bsctestnet/ChainlinkOracle_Proxy.json +50 -36
- package/deployments/bsctestnet/DefaultProxyAdmin.json +18 -18
- package/deployments/bsctestnet/PythOracle.json +52 -45
- package/deployments/bsctestnet/PythOracle_Implementation.json +53 -47
- package/deployments/bsctestnet/PythOracle_Proxy.json +41 -40
- package/deployments/bsctestnet/ResilientOracle.json +51 -42
- package/deployments/bsctestnet/ResilientOracle_Implementation.json +65 -68
- package/deployments/bsctestnet/ResilientOracle_Proxy.json +48 -34
- package/deployments/bsctestnet/TwapOracle.json +70 -83
- package/deployments/bsctestnet/TwapOracle_Implementation.json +84 -97
- package/deployments/bsctestnet/TwapOracle_Proxy.json +46 -46
- package/deployments/bsctestnet/solcInputs/131f58942628e21632de19506977a910.json +120 -0
- package/deployments/bsctestnet/solcInputs/144b49e8aec3add79553ba273ea32d00.json +72 -0
- package/deployments/bsctestnet/solcInputs/503f2e4e766f3be923fadf8030a5470f.json +78 -0
- package/deployments/bsctestnet/solcInputs/b39d33092f7dd383ae3a042566194132.json +75 -0
- package/dist/deploy/1-deploy-oracles.d.ts +5 -0
- package/dist/deploy/1-deploy-oracles.d.ts.map +1 -0
- package/{deploy → dist/deploy}/1-deploy-oracles.js +66 -24
- package/dist/deploy/1-deploy-oracles.js.map +1 -0
- package/dist/deploy/2-configure-feeds.d.ts +15 -0
- package/dist/deploy/2-configure-feeds.d.ts.map +1 -0
- package/{deploy → dist/deploy}/2-configure-feeds.js +139 -16
- package/dist/deploy/2-configure-feeds.js.map +1 -0
- package/dist/hardhat.config.d.ts +13 -0
- package/dist/hardhat.config.d.ts.map +1 -0
- package/dist/hardhat.config.js +158 -0
- package/dist/hardhat.config.js.map +1 -0
- package/package.json +26 -19
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.dbg.json +0 -4
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.json +0 -138
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.dbg.json +0 -4
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.json +0 -249
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.dbg.json +0 -4
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.json +0 -122
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +0 -215
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +0 -183
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +0 -297
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json +0 -194
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.json +0 -233
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +0 -30
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +0 -30
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +0 -10
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +0 -115
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +0 -76
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +0 -24
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.json +0 -63
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +0 -10
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +0 -24
- package/artifacts/build-info/a47a69a8f108d3e7113faf89771988ff.json +0 -1
- package/artifacts/build-info/cc300b55b814df48229058e829c7c3c6.json +0 -1
- package/artifacts/build-info/de79b2637546f6f7d38c8f655549d9e2.json +0 -1
- package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +0 -4
- package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +0 -369
- package/artifacts/contracts/Governance/AccessControlled.sol/AccessControlled.dbg.json +0 -4
- package/artifacts/contracts/Governance/AccessControlled.sol/AccessControlled.json +0 -181
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.dbg.json +0 -4
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.json +0 -282
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.dbg.json +0 -4
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.json +0 -43
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +0 -4
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json +0 -617
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.json +0 -79
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.json +0 -40
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.json +0 -30
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.json +0 -43
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.json +0 -49
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.json +0 -30
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.json +0 -545
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.json +0 -446
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +0 -10
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.json +0 -30
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.json +0 -246
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.dbg.json +0 -4
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.json +0 -10
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.dbg.json +0 -4
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.json +0 -60
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.dbg.json +0 -4
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.json +0 -10
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.json +0 -124
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +0 -4
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.json +0 -392
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.json +0 -468
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +0 -439
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.json +0 -676
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.json +0 -116
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +0 -163
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.json +0 -144
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.json +0 -163
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.json +0 -163
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.dbg.json +0 -4
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.json +0 -315
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +0 -4
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +0 -684
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.dbg.json +0 -4
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.json +0 -95
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.dbg.json +0 -4
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.json +0 -72
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.dbg.json +0 -4
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.json +0 -306
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.dbg.json +0 -4
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.json +0 -10
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.dbg.json +0 -4
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.json +0 -158
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.dbg.json +0 -4
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.json +0 -10
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.dbg.json +0 -4
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.json +0 -333
- package/contracts/Governance/AccessControlManager.sol +0 -99
- package/contracts/Governance/AccessControlled.sol +0 -75
- package/contracts/Governance/IAccessControlManager.sol +0 -22
- package/contracts/PriceOracle.sol +0 -16
- package/deploy/1-deploy-oracles.d.ts +0 -2
- package/deploy/1-deploy-oracles.d.ts.map +0 -1
- package/deploy/1-deploy-oracles.js.map +0 -1
- package/deploy/2-configure-feeds.d.ts +0 -2
- package/deploy/2-configure-feeds.d.ts.map +0 -1
- package/deploy/2-configure-feeds.js.map +0 -1
- package/deployments/bsctestnet/AccessControlManager.json +0 -563
- package/deployments/bsctestnet/solcInputs/30f2cb3e89e183b8669f05bddf9426d9.json +0 -183
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "0xA65d9c3593B8ca0EF4C475E16Eb93f92Ca81F98B",
|
|
3
3
|
"abi": [
|
|
4
4
|
{
|
|
5
5
|
"inputs": [
|
|
@@ -208,12 +208,12 @@
|
|
|
208
208
|
},
|
|
209
209
|
{
|
|
210
210
|
"inputs": [],
|
|
211
|
-
"name": "
|
|
211
|
+
"name": "BNB_BASE_UNIT",
|
|
212
212
|
"outputs": [
|
|
213
213
|
{
|
|
214
|
-
"internalType": "
|
|
214
|
+
"internalType": "uint256",
|
|
215
215
|
"name": "",
|
|
216
|
-
"type": "
|
|
216
|
+
"type": "uint256"
|
|
217
217
|
}
|
|
218
218
|
],
|
|
219
219
|
"stateMutability": "view",
|
|
@@ -221,19 +221,12 @@
|
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
"inputs": [],
|
|
224
|
-
"name": "
|
|
225
|
-
"outputs": [],
|
|
226
|
-
"stateMutability": "nonpayable",
|
|
227
|
-
"type": "function"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"inputs": [],
|
|
231
|
-
"name": "accessControlManager",
|
|
224
|
+
"name": "BUSD_BASE_UNIT",
|
|
232
225
|
"outputs": [
|
|
233
226
|
{
|
|
234
|
-
"internalType": "
|
|
227
|
+
"internalType": "uint256",
|
|
235
228
|
"name": "",
|
|
236
|
-
"type": "
|
|
229
|
+
"type": "uint256"
|
|
237
230
|
}
|
|
238
231
|
],
|
|
239
232
|
"stateMutability": "view",
|
|
@@ -241,12 +234,12 @@
|
|
|
241
234
|
},
|
|
242
235
|
{
|
|
243
236
|
"inputs": [],
|
|
244
|
-
"name": "
|
|
237
|
+
"name": "WBNB",
|
|
245
238
|
"outputs": [
|
|
246
239
|
{
|
|
247
|
-
"internalType": "
|
|
240
|
+
"internalType": "address",
|
|
248
241
|
"name": "",
|
|
249
|
-
"type": "
|
|
242
|
+
"type": "address"
|
|
250
243
|
}
|
|
251
244
|
],
|
|
252
245
|
"stateMutability": "view",
|
|
@@ -254,12 +247,19 @@
|
|
|
254
247
|
},
|
|
255
248
|
{
|
|
256
249
|
"inputs": [],
|
|
257
|
-
"name": "
|
|
250
|
+
"name": "acceptOwnership",
|
|
251
|
+
"outputs": [],
|
|
252
|
+
"stateMutability": "nonpayable",
|
|
253
|
+
"type": "function"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"inputs": [],
|
|
257
|
+
"name": "accessControlManager",
|
|
258
258
|
"outputs": [
|
|
259
259
|
{
|
|
260
|
-
"internalType": "
|
|
260
|
+
"internalType": "contract IAccessControlManagerV8",
|
|
261
261
|
"name": "",
|
|
262
|
-
"type": "
|
|
262
|
+
"type": "address"
|
|
263
263
|
}
|
|
264
264
|
],
|
|
265
265
|
"stateMutability": "view",
|
|
@@ -300,7 +300,7 @@
|
|
|
300
300
|
"type": "uint256"
|
|
301
301
|
}
|
|
302
302
|
],
|
|
303
|
-
"internalType": "struct TokenConfig",
|
|
303
|
+
"internalType": "struct TwapOracle.TokenConfig",
|
|
304
304
|
"name": "config",
|
|
305
305
|
"type": "tuple"
|
|
306
306
|
}
|
|
@@ -316,19 +316,6 @@
|
|
|
316
316
|
"stateMutability": "view",
|
|
317
317
|
"type": "function"
|
|
318
318
|
},
|
|
319
|
-
{
|
|
320
|
-
"inputs": [],
|
|
321
|
-
"name": "expScale",
|
|
322
|
-
"outputs": [
|
|
323
|
-
{
|
|
324
|
-
"internalType": "uint256",
|
|
325
|
-
"name": "",
|
|
326
|
-
"type": "uint256"
|
|
327
|
-
}
|
|
328
|
-
],
|
|
329
|
-
"stateMutability": "view",
|
|
330
|
-
"type": "function"
|
|
331
|
-
},
|
|
332
319
|
{
|
|
333
320
|
"inputs": [
|
|
334
321
|
{
|
|
@@ -490,7 +477,7 @@
|
|
|
490
477
|
"type": "uint256"
|
|
491
478
|
}
|
|
492
479
|
],
|
|
493
|
-
"internalType": "struct TokenConfig",
|
|
480
|
+
"internalType": "struct TwapOracle.TokenConfig",
|
|
494
481
|
"name": "config",
|
|
495
482
|
"type": "tuple"
|
|
496
483
|
}
|
|
@@ -535,7 +522,7 @@
|
|
|
535
522
|
"type": "uint256"
|
|
536
523
|
}
|
|
537
524
|
],
|
|
538
|
-
"internalType": "struct TokenConfig[]",
|
|
525
|
+
"internalType": "struct TwapOracle.TokenConfig[]",
|
|
539
526
|
"name": "configs",
|
|
540
527
|
"type": "tuple[]"
|
|
541
528
|
}
|
|
@@ -667,30 +654,30 @@
|
|
|
667
654
|
"type": "function"
|
|
668
655
|
}
|
|
669
656
|
],
|
|
670
|
-
"transactionHash": "
|
|
657
|
+
"transactionHash": "0x402d32b0ce7fd96d402fe76dfd89593d262af764f6eb8117abf10f1db61021a4",
|
|
671
658
|
"receipt": {
|
|
672
659
|
"to": null,
|
|
673
660
|
"from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1",
|
|
674
|
-
"contractAddress": "
|
|
675
|
-
"transactionIndex":
|
|
676
|
-
"gasUsed": "
|
|
677
|
-
"logsBloom": "
|
|
678
|
-
"blockHash": "
|
|
679
|
-
"transactionHash": "
|
|
661
|
+
"contractAddress": "0xA65d9c3593B8ca0EF4C475E16Eb93f92Ca81F98B",
|
|
662
|
+
"transactionIndex": 1,
|
|
663
|
+
"gasUsed": "1815984",
|
|
664
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000",
|
|
665
|
+
"blockHash": "0x15c971ec2e16b7b425a7f6c7e35333a9d510beb014b0dceba7b63d5d0b1d6475",
|
|
666
|
+
"transactionHash": "0x402d32b0ce7fd96d402fe76dfd89593d262af764f6eb8117abf10f1db61021a4",
|
|
680
667
|
"logs": [
|
|
681
668
|
{
|
|
682
|
-
"transactionIndex":
|
|
683
|
-
"blockNumber":
|
|
684
|
-
"transactionHash": "
|
|
685
|
-
"address": "
|
|
669
|
+
"transactionIndex": 1,
|
|
670
|
+
"blockNumber": 30137622,
|
|
671
|
+
"transactionHash": "0x402d32b0ce7fd96d402fe76dfd89593d262af764f6eb8117abf10f1db61021a4",
|
|
672
|
+
"address": "0xA65d9c3593B8ca0EF4C475E16Eb93f92Ca81F98B",
|
|
686
673
|
"topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"],
|
|
687
674
|
"data": "0x00000000000000000000000000000000000000000000000000000000000000ff",
|
|
688
|
-
"logIndex":
|
|
689
|
-
"blockHash": "
|
|
675
|
+
"logIndex": 1,
|
|
676
|
+
"blockHash": "0x15c971ec2e16b7b425a7f6c7e35333a9d510beb014b0dceba7b63d5d0b1d6475"
|
|
690
677
|
}
|
|
691
678
|
],
|
|
692
|
-
"blockNumber":
|
|
693
|
-
"cumulativeGasUsed": "
|
|
679
|
+
"blockNumber": 30137622,
|
|
680
|
+
"cumulativeGasUsed": "1868910",
|
|
694
681
|
"status": 1,
|
|
695
682
|
"byzantium": true
|
|
696
683
|
},
|
|
@@ -700,10 +687,10 @@
|
|
|
700
687
|
"0x5fFbE5302BadED40941A403228E6AD03f93752d9"
|
|
701
688
|
],
|
|
702
689
|
"numDeployments": 1,
|
|
703
|
-
"solcInputHash": "
|
|
704
|
-
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vBnbAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wBnbAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"name\":\"AnchorPriceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"name\":\"TokenConfigAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldAcc\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newAcc\",\"type\":\"uint256\"}],\"name\":\"TwapWindowUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"WBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManager\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bnbBaseUnit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"busdBaseUnit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"currentCumulativePrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"expScale\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"acc\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"prices\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"internalType\":\"struct TokenConfig[]\",\"name\":\"configs\",\"type\":\"tuple[]\"}],\"name\":\"setTokenConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenConfigs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"updateTwap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vBnb\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vai\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"windowStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"vBnbAddress\":\"The address of the VBNB\",\"vaiAddress\":\"The address of the WBNB\",\"wBnbAddress\":\"The address of the WBNB\"}},\"currentCumulativePrice((address,uint256,address,bool,bool,uint256))\":{\"returns\":{\"_0\":\"cumulative price of target token regardless of pair order\"}},\"getUnderlyingPrice(address)\":{\"custom:error\":\"Missing error is thrown if the token config does not existRange error is thrown if TWAP price is not greater than zero\",\"params\":{\"vToken\":\"vToken address\"},\"returns\":{\"_0\":\"price Underlying price in USD\"}},\"initialize(address)\":{\"params\":{\"accessControlManager_\":\"Address of the access control manager contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setTokenConfig((address,uint256,address,bool,bool,uint256))\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"Range error is thrown if anchor period is not greater than zeroRange error is thrown if base unit is not greater than zeroValue error is thrown if base unit decimals is not the same as asset decimalsNotNullAddress error is thrown if address of asset is nullNotNullAddress error is thrown if PancakeSwap pool address is null\",\"custom:event\":\"Emits TokenConfigAdded event if new token config are added with asset address, PancakePool address, anchor period address\",\"params\":{\"config\":\"token config struct\"}},\"setTokenConfigs((address,uint256,address,bool,bool,uint256)[])\":{\"custom:error\":\"Zero length error thrown, if length of the config array is 0\",\"params\":{\"configs\":\"Config array\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateTwap(address)\":{\"custom:error\":\"Missing error is thrown if token config does not exist\",\"returns\":{\"_0\":\"anchorPrice anchor price of the underlying asset of the vToken\"}}},\"stateVariables\":{\"WBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vBnb\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vai\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"version\":1},\"userdoc\":{\"errors\":{\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}]},\"events\":{\"AnchorPriceUpdated(address,uint256,uint256,uint256)\":{\"notice\":\"Emit this event when TWAP price is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"TokenConfigAdded(address,address,uint256)\":{\"notice\":\"Emit this event when new token configs are added\"},\"TwapWindowUpdated(address,uint256,uint256,uint256,uint256)\":{\"notice\":\"Emit this event when TWAP window is updated\"}},\"kind\":\"user\",\"methods\":{\"WBNB()\":{\"notice\":\"WBNB address\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"bnbBaseUnit()\":{\"notice\":\"the base unit of WBNB and BUSD, which are the paired tokens for all assets\"},\"constructor\":{\"notice\":\"Constructor for the implementation contract. Sets immutable variables.\"},\"currentCumulativePrice((address,uint256,address,bool,bool,uint256))\":{\"notice\":\"Fetches the current token/WBNB and token/BUSD price accumulator from PancakeSwap.\"},\"getUnderlyingPrice(address)\":{\"notice\":\"Get the underlying TWAP price for the given vToken\"},\"initialize(address)\":{\"notice\":\"Initializes the owner of the contract\"},\"observations(address,uint256)\":{\"notice\":\"Keeps a record of token observations mapped by address, updated on every updateTwap invocation.\"},\"prices(address)\":{\"notice\":\"Stored price by token\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setTokenConfig((address,uint256,address,bool,bool,uint256))\":{\"notice\":\"Adds a single token config\"},\"setTokenConfigs((address,uint256,address,bool,bool,uint256)[])\":{\"notice\":\"Adds multiple token configs at the same time\"},\"tokenConfigs(address)\":{\"notice\":\"Configs by token\"},\"updateTwap(address)\":{\"notice\":\"Updates the current token/BUSD price from PancakeSwap, with 18 decimals of precision.\"},\"vBnb()\":{\"notice\":\"vBNB address\"},\"vai()\":{\"notice\":\"VAI address\"},\"windowStart(address)\":{\"notice\":\"Observation array index which probably falls in current anchor period mapped by asset address\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/TwapOracle.sol\":\"TwapOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() external {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xd712fb45b3ea0ab49679164e3895037adc26ce12879d5184feb040e01c1c07a9\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.1) (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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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\":\"0x037c334add4b033ad3493038c25be1682d78c00992e1acb0e2795caff3925271\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.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 *\\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://diligence.consensys.net/posts/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.5.11/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(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) 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 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\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.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 IAccessControl {\\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\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"contracts/Governance/AccessControlled.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManager.sol\\\";\\n\\nabstract contract AccessControlled is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManager private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManager) {\\n return _accessControlManager;\\n }\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManager(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe33ff93b01b61b8e0f330b6f54351a0d566f2c429148acd1195be133a8bcba82\",\"license\":\"BSD-3-Clause\"},\"contracts/Governance/IAccessControlManager.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\ninterface IAccessControlManager is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x1fbf610bfa135da099b27e601ff9add0bd518888d0d3a72a1b8804f02351b760\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address vToken) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address vToken,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x8ac0bda5d5789c320bf219dc6691eef0e6617e9653bc0e24f407a44e4281edda\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"contracts/libraries/PancakeLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IPancakePair {\\n function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\\n\\n function price0CumulativeLast() external view returns (uint256);\\n\\n function price1CumulativeLast() external view returns (uint256);\\n}\\n\\nlibrary FixedPoint {\\n // range: [0, 2**112 - 1]\\n // resolution: 1 / 2**112\\n struct uq112x112 {\\n uint224 _x;\\n }\\n\\n // returns a uq112x112 which represents the ratio of the numerator to the denominator\\n // equivalent to encode(numerator).div(denominator)\\n function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {\\n require(denominator > 0, \\\"FixedPoint: DIV_BY_ZERO\\\");\\n return uq112x112((uint224(numerator) << 112) / denominator);\\n }\\n\\n // decode a uq112x112 into a uint with 18 decimals of precision\\n function decode112with18(uq112x112 memory self) internal pure returns (uint256) {\\n // we only have 256 - 224 = 32 bits to spare, so scaling up by ~60 bits is dangerous\\n // instead, get close to:\\n // (x * 1e18) >> 112\\n // without risk of overflowing, e.g.:\\n // (x) / 2 ** (112 - lg(1e18))\\n return uint256(self._x) / 5192296858534827;\\n }\\n}\\n\\n// library with helper methods for oracles that are concerned with computing average prices\\nlibrary PancakeOracleLibrary {\\n using FixedPoint for *;\\n\\n // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]\\n function currentBlockTimestamp() internal view returns (uint32) {\\n return uint32(block.timestamp % 2 ** 32);\\n }\\n\\n // produces the cumulative price using counterfactuals to save gas and avoid a call to sync.\\n function currentCumulativePrices(\\n address pair\\n ) internal view returns (uint256 price0Cumulative, uint256 price1Cumulative, uint32 blockTimestamp) {\\n blockTimestamp = currentBlockTimestamp();\\n price0Cumulative = IPancakePair(pair).price0CumulativeLast();\\n price1Cumulative = IPancakePair(pair).price1CumulativeLast();\\n\\n // if time has elapsed since the last update on the pair, mock the accumulated price values\\n (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IPancakePair(pair).getReserves();\\n if (blockTimestampLast != blockTimestamp) {\\n unchecked {\\n // subtraction overflow is desired\\n uint32 timeElapsed = blockTimestamp - blockTimestampLast;\\n // addition overflow is desired\\n // counterfactual\\n price0Cumulative += uint256(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;\\n // counterfactual\\n price1Cumulative += uint256(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2c8179ebad223998514d6f25ebd90f80ecb294b562d9fbc4a42bf6710486c25b\",\"license\":\"BSD-3-Clause\"},\"contracts/oracles/TwapOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"../libraries/PancakeLibrary.sol\\\";\\nimport \\\"../interfaces/OracleInterface.sol\\\";\\nimport \\\"../interfaces/VBep20Interface.sol\\\";\\nimport \\\"../Governance/AccessControlled.sol\\\";\\n\\nstruct Observation {\\n uint256 timestamp;\\n uint256 acc;\\n}\\n\\nstruct TokenConfig {\\n /// @notice Asset address, which can't be zero address and can be used for existance check\\n address asset;\\n /// @notice Decimals of underlying asset\\n uint256 baseUnit;\\n /// @notice The address of Pancake pair\\n address pancakePool;\\n /// @notice Whether the token is paired with WBNB\\n bool isBnbBased;\\n /// @notice A flag identifies whether the Pancake pair is reversed\\n /// e.g. XVS-WBNB is not reversed, while WBNB-XVS is.\\n bool isReversedPool;\\n /// @notice The minimum window in seconds required between TWAP updates\\n uint256 anchorPeriod;\\n}\\n\\ncontract TwapOracle is AccessControlled, TwapInterface {\\n using FixedPoint for *;\\n\\n /// @notice WBNB address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable WBNB;\\n\\n /// @notice vBNB address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vBnb;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice the base unit of WBNB and BUSD, which are the paired tokens for all assets\\n uint256 public constant bnbBaseUnit = 1e18;\\n uint256 public constant busdBaseUnit = 1e18;\\n\\n uint256 public constant expScale = 1e18;\\n\\n /// @notice Configs by token\\n mapping(address => TokenConfig) public tokenConfigs;\\n\\n /// @notice Stored price by token\\n mapping(address => uint256) public prices;\\n\\n /// @notice Keeps a record of token observations mapped by address, updated on every updateTwap invocation.\\n mapping(address => Observation[]) public observations;\\n\\n /// @notice Observation array index which probably falls in current anchor period mapped by asset address\\n mapping(address => uint256) public windowStart;\\n\\n /// @notice Emit this event when TWAP window is updated\\n event TwapWindowUpdated(\\n address indexed asset,\\n uint256 oldTimestamp,\\n uint256 oldAcc,\\n uint256 newTimestamp,\\n uint256 newAcc\\n );\\n\\n /// @notice Emit this event when TWAP price is updated\\n event AnchorPriceUpdated(address indexed asset, uint256 price, uint256 oldTimestamp, uint256 newTimestamp);\\n\\n /// @notice Emit this event when new token configs are added\\n event TokenConfigAdded(address indexed asset, address indexed pancakePool, uint256 indexed anchorPeriod);\\n\\n modifier notNullAddress(address someone) {\\n require(someone != address(0), \\\"can't be zero address\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @param vBnbAddress The address of the VBNB\\n /// @param wBnbAddress The address of the WBNB\\n /// @param vaiAddress The address of the WBNB\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address vBnbAddress,\\n address wBnbAddress,\\n address vaiAddress\\n ) notNullAddress(vBnbAddress) notNullAddress(wBnbAddress) notNullAddress(vaiAddress) {\\n vBnb = vBnbAddress;\\n WBNB = wBnbAddress;\\n vai = vaiAddress;\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Adds multiple token configs at the same time\\n * @param configs Config array\\n * @custom:error Zero length error thrown, if length of the config array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory configs) external onlyOwner {\\n _checkAccessAllowed(\\\"setTokenConfigsTokenConfig[])\\\");\\n require(configs.length > 0, \\\"length can't be 0\\\");\\n uint256 numTokenConfigs = configs.length;\\n for (uint256 i; i < numTokenConfigs; ++i) {\\n setTokenConfig(configs[i]);\\n }\\n }\\n\\n /**\\n * @notice Get the underlying TWAP price for the given vToken\\n * @param vToken vToken address\\n * @return price Underlying price in USD\\n * @custom:error Missing error is thrown if the token config does not exist\\n * @custom:error Range error is thrown if TWAP price is not greater than zero\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n address asset = _getUnderlyingAsset(vToken);\\n\\n require(tokenConfigs[asset].asset != address(0), \\\"asset not exist\\\");\\n uint256 price = prices[asset];\\n\\n // if price is 0, it means the price hasn't been updated yet and it's meaningless, revert\\n require(price > 0, \\\"TWAP price must be positive\\\");\\n return (price * (10 ** (18 - IERC20Metadata(asset).decimals())));\\n }\\n\\n /**\\n * @notice Initializes the owner of the contract\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) public initializer {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n /**\\n * @notice Adds a single token config\\n * @param config token config struct\\n * @custom:access Only Governance\\n * @custom:error Range error is thrown if anchor period is not greater than zero\\n * @custom:error Range error is thrown if base unit is not greater than zero\\n * @custom:error Value error is thrown if base unit decimals is not the same as asset decimals\\n * @custom:error NotNullAddress error is thrown if address of asset is null\\n * @custom:error NotNullAddress error is thrown if PancakeSwap pool address is null\\n * @custom:event Emits TokenConfigAdded event if new token config are added with\\n * asset address, PancakePool address, anchor period address\\n */\\n function setTokenConfig(\\n TokenConfig memory config\\n ) public notNullAddress(config.asset) notNullAddress(config.pancakePool) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n require(config.anchorPeriod > 0, \\\"anchor period must be positive\\\");\\n require(config.baseUnit > 0, \\\"base unit must be positive\\\");\\n require(\\n config.baseUnit == 10 ** IERC20Metadata(config.asset).decimals(),\\n \\\"base unit decimals must be same as asset decimals\\\"\\n );\\n\\n uint256 cumulativePrice = currentCumulativePrice(config);\\n\\n // Initialize observation data\\n observations[config.asset].push(Observation(block.timestamp, cumulativePrice));\\n tokenConfigs[config.asset] = config;\\n emit TokenConfigAdded(config.asset, config.pancakePool, config.anchorPeriod);\\n }\\n\\n /**\\n * @notice Updates the current token/BUSD price from PancakeSwap, with 18 decimals of precision.\\n * @return anchorPrice anchor price of the underlying asset of the vToken\\n * @custom:error Missing error is thrown if token config does not exist\\n */\\n function updateTwap(address vToken) public returns (uint256) {\\n address asset = _getUnderlyingAsset(vToken);\\n\\n require(tokenConfigs[asset].asset != address(0), \\\"asset not exist\\\");\\n // Update & fetch WBNB price first, so we can calculate the price of WBNB paired token\\n if (asset != WBNB && tokenConfigs[asset].isBnbBased) {\\n require(tokenConfigs[WBNB].asset != address(0), \\\"WBNB not exist\\\");\\n _updateTwapInternal(tokenConfigs[WBNB]);\\n }\\n return _updateTwapInternal(tokenConfigs[asset]);\\n }\\n\\n /**\\n * @notice Fetches the current token/WBNB and token/BUSD price accumulator from PancakeSwap.\\n * @return cumulative price of target token regardless of pair order\\n */\\n function currentCumulativePrice(TokenConfig memory config) public view returns (uint256) {\\n (uint256 price0, uint256 price1, ) = PancakeOracleLibrary.currentCumulativePrices(config.pancakePool);\\n if (config.isReversedPool) {\\n return price1;\\n } else {\\n return price0;\\n }\\n }\\n\\n /**\\n * @notice Fetches the current token/BUSD price from PancakeSwap, with 18 decimals of precision.\\n * @return price Underlying price in USD, with 18 decimals\\n * @custom:error Timing error is thrown if current time is not greater than old observation timestamp\\n * @custom:error Zero price error is thrown if token is BNB based and price is zero\\n * @custom:error Zero price error is thrown if fetched anchorPriceMantissa is zero\\n * @custom:event Emits AnchorPriceUpdated event on successful update of observation with assset address,\\n * AnchorPrice, old observation timestamp and current timestamp\\n */\\n function _updateTwapInternal(TokenConfig memory config) internal virtual returns (uint256) {\\n // pokeWindowValues already handled reversed pool cases,\\n // priceAverage will always be Token/BNB or Token/BUSD *twap** price.\\n (uint256 nowCumulativePrice, uint256 oldCumulativePrice, uint256 oldTimestamp) = pokeWindowValues(config);\\n\\n // This should be impossible, but better safe than sorry\\n require(block.timestamp > oldTimestamp, \\\"now must come after before\\\");\\n uint256 timeElapsed = block.timestamp - oldTimestamp;\\n\\n // Calculate Pancakge *twap**\\n FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(\\n uint224((nowCumulativePrice - oldCumulativePrice) / timeElapsed)\\n );\\n // *twap** price with 1e18 decimal mantissa\\n uint256 priceAverageMantissa = priceAverage.decode112with18();\\n\\n // To cancel the decimals in cumulative price, we need to mulitply the average price with\\n // tokenBaseUnit / (wbnbBaseUnit or busdBaseUnit, which is 1e18)\\n uint256 pairedTokenBaseUnit = config.isBnbBased ? bnbBaseUnit : busdBaseUnit;\\n uint256 anchorPriceMantissa = (priceAverageMantissa * config.baseUnit) / pairedTokenBaseUnit;\\n\\n // if this token is paired with BNB, convert its price to USD\\n if (config.isBnbBased) {\\n uint256 bnbPrice = prices[WBNB];\\n require(bnbPrice != 0, \\\"bnb price is invalid\\\");\\n anchorPriceMantissa = (anchorPriceMantissa * bnbPrice) / bnbBaseUnit;\\n }\\n\\n require(anchorPriceMantissa != 0, \\\"twap price cannot be 0\\\");\\n\\n emit AnchorPriceUpdated(config.asset, anchorPriceMantissa, oldTimestamp, block.timestamp);\\n\\n // save anchor price, which is 1e18 decimals\\n prices[config.asset] = anchorPriceMantissa;\\n\\n return anchorPriceMantissa;\\n }\\n\\n /**\\n * @notice Appends current observation and pick an observation with a timestamp equal\\n * or just greater than the window start timestamp. If one is not available,\\n * then pick the last availableobservation. The window start index is updated in both the cases.\\n * Only the current observation is saved, prior observations are deleted during this operation.\\n * @return Tuple of cumulative price, old observation and timestamp\\n * @custom:event Emits TwapWindowUpdated on successful calculation of cumulative price with asset address,\\n * new observation timestamp, current timestamp, new observation price and cumulative price\\n */\\n function pokeWindowValues(\\n TokenConfig memory config\\n ) internal returns (uint256, uint256 startCumulativePrice, uint256 startCumulativeTimestamp) {\\n uint256 cumulativePrice = currentCumulativePrice(config);\\n uint256 currentTimestamp = block.timestamp;\\n uint256 windowStartTimestamp = currentTimestamp - config.anchorPeriod;\\n Observation[] memory storedObservations = observations[config.asset];\\n\\n uint256 storedObservationsLength = storedObservations.length;\\n for (\\n uint256 windowStartIndex = windowStart[config.asset];\\n windowStartIndex < storedObservationsLength;\\n ++windowStartIndex\\n ) {\\n if (\\n (storedObservations[windowStartIndex].timestamp >= windowStartTimestamp) ||\\n (windowStartIndex == storedObservationsLength - 1)\\n ) {\\n startCumulativePrice = storedObservations[windowStartIndex].acc;\\n startCumulativeTimestamp = storedObservations[windowStartIndex].timestamp;\\n windowStart[config.asset] = windowStartIndex;\\n break;\\n } else {\\n delete observations[config.asset][windowStartIndex];\\n }\\n }\\n\\n observations[config.asset].push(Observation(currentTimestamp, cumulativePrice));\\n emit TwapWindowUpdated(\\n config.asset,\\n startCumulativeTimestamp,\\n startCumulativePrice,\\n block.timestamp,\\n cumulativePrice\\n );\\n return (cumulativePrice, startCumulativePrice, startCumulativeTimestamp);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) internal view returns (address asset) {\\n if (address(vToken) == vBnb) {\\n asset = WBNB;\\n } else if (address(vToken) == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xaeaf4cc8ccb1f9c2880cc39646c5a989575de6a25f9a1e633aac0ab9da793408\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
705
|
-
"bytecode": "0x60e06040523480156200001157600080fd5b50604051620022b4380380620022b483398101604081905262000034916200021b565b826001600160a01b038116620000805760405162461bcd60e51b815260206004820152601560248201526000805160206200229483398151915260448201526064015b60405180910390fd5b826001600160a01b038116620000c85760405162461bcd60e51b8152602060048201526015602482015260008051602062002294833981519152604482015260640162000077565b826001600160a01b038116620001105760405162461bcd60e51b8152602060048201526015602482015260008051602062002294833981519152604482015260640162000077565b6001600160a01b0380871660a052858116608052841660c052620001336200013f565b50505050505062000265565b600054610100900460ff1615620001a95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840162000077565b60005460ff9081161015620001fc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146200021657600080fd5b919050565b6000806000606084860312156200023157600080fd5b6200023c84620001fe565b92506200024c60208501620001fe565b91506200025c60408501620001fe565b90509250925092565b60805160a05160c051611fc7620002cd600039600081816103410152818161125e015261129801526000818161028701526111fe015260008181610309015281816105b1015281816106220152818161069a01528181611238015261142e0152611fc76000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c806379ba5097116100c3578063c4d66de81161007c578063c4d66de814610363578063cbf6791914610376578063cfed246b14610389578063e30c3978146103a9578063f2fde38b146103ba578063fc57d4df146103cd57600080fd5b806379ba5097146102eb5780638da5cb5b146102f35780638dd9500214610304578063b4a0bdf31461032b578063b62e4c921461033c578063b8a8a626146102c157600080fd5b80633334ecc5116101155780633334ecc5146102625780635ba3792d14610282578063609f0f36146102c157806369aa3ac6146102c1578063715018a6146102d0578063725068a5146102d857600080fd5b806302459966146101525780630e32cb861461017f5780631b69dc5f14610194578063234a34461461022e5780632b9d9dea14610241575b600080fd5b6101656101603660046119c8565b6103e0565b604080519283526020830191909152015b60405180910390f35b61019261018d3660046119f4565b61041c565b005b6101ec6101a23660046119f4565b60c96020526000908152604090208054600182015460028301546003909301546001600160a01b0392831693919282169160ff600160a01b8204811692600160a81b909204169086565b604080516001600160a01b03978816815260208101969096529390951692840192909252151560608301521515608082015260a081019190915260c001610176565b61019261023c366004611b02565b610430565b61025461024f366004611bb2565b610504565b604051908152602001610176565b6102546102703660046119f4565b60cc6020526000908152604090205481565b6102a97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610176565b610254670de0b6b3a764000081565b610192610533565b6102546102e63660046119f4565b610547565b6101926107b1565b6033546001600160a01b03166102a9565b6102a97f000000000000000000000000000000000000000000000000000000000000000081565b6097546001600160a01b03166102a9565b6102a97f000000000000000000000000000000000000000000000000000000000000000081565b6101926103713660046119f4565b610828565b610192610384366004611bb2565b610944565b6102546103973660046119f4565b60ca6020526000908152604090205481565b6065546001600160a01b03166102a9565b6101926103c83660046119f4565b610cbe565b6102546103db3660046119f4565b610d2f565b60cb60205281600052604060002081815481106103fc57600080fd5b600091825260209091206002909102018054600190910154909250905082565b610424610e87565b61042d81610ee1565b50565b610438610e87565b6104766040518060400160405280601d81526020017f736574546f6b656e436f6e66696773546f6b656e436f6e6669675b5d29000000815250610f9f565b60008151116104c05760405162461bcd60e51b815260206004820152601160248201527006c656e6774682063616e2774206265203607c1b60448201526064015b60405180910390fd5b805160005b818110156104ff576104ef8382815181106104e2576104e2611bce565b6020026020010151610944565b6104f881611bfa565b90506104c5565b505050565b60008060006105168460400151611039565b509150915083608001511561052c579392505050565b5092915050565b61053b610e87565b61054560006111e1565b565b600080610553836111fa565b6001600160a01b03808216600090815260c96020526040902054919250166105af5760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b60448201526064016104b7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03161415801561061357506001600160a01b038116600090815260c96020526040902060020154600160a01b900460ff165b1561072e576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020526040902054166106905760405162461bcd60e51b815260206004820152600e60248201526d15d09390881b9bdd08195e1a5cdd60921b60448201526064016104b7565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a082015261072c90611326565b505b6001600160a01b03808216600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a08201526107aa90611326565b9392505050565b60655433906001600160a01b0316811461081f5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016104b7565b61042d816111e1565b600054610100900460ff16158080156108485750600054600160ff909116105b806108625750303b158015610862575060005460ff166001145b6108c55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104b7565b6000805460ff1916600117905580156108e8576000805461ff0019166101001790555b6108f0611584565b6108f9826115b3565b8015610940576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050565b80516001600160a01b0381166109945760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b60448201526064016104b7565b60408201516001600160a01b0381166109e75760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b60448201526064016104b7565b610a256040518060400160405280601b81526020017f736574546f6b656e436f6e66696728546f6b656e436f6e666967290000000000815250610f9f565b60008360a0015111610a795760405162461bcd60e51b815260206004820152601e60248201527f616e63686f7220706572696f64206d75737420626520706f736974697665000060448201526064016104b7565b6000836020015111610acd5760405162461bcd60e51b815260206004820152601a60248201527f6261736520756e6974206d75737420626520706f73697469766500000000000060448201526064016104b7565b82600001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611c13565b610b3e90600a611d1a565b836020015114610baa5760405162461bcd60e51b815260206004820152603160248201527f6261736520756e697420646563696d616c73206d7573742062652073616d6520604482015270617320617373657420646563696d616c7360781b60648201526084016104b7565b6000610bb584610504565b84516001600160a01b03908116600090815260cb6020908152604080832081518083018352428152808401878152825460018181018555938752858720925160029182029093019283559051918301919091558a518616855260c984528285208b5181549088166001600160a01b031990911681178255948c015192810192909255828b0151908201805460608d015160808e01511515600160a81b0260ff60a81b19911515600160a01b026001600160a81b03199093169490991693841791909117169690961790955560a08a0151600390910181905590519495509390917f3cc8d9cb9370a23a8b9ffa75efa24cecb65c4693980e58260841adc474983c5f91a450505050565b610cc6610e87565b606580546001600160a01b0383166001600160a01b03199091168117909155610cf76033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080610d3b836111fa565b6001600160a01b03808216600090815260c9602052604090205491925016610d975760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b60448201526064016104b7565b6001600160a01b038116600090815260ca602052604090205480610dfd5760405162461bcd60e51b815260206004820152601b60248201527f54574150207072696365206d75737420626520706f736974697665000000000060448201526064016104b7565b816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5f9190611c13565b610e6a906012611d29565b610e7590600a611d1a565b610e7f9082611d4c565b949350505050565b6033546001600160a01b031633146105455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b7565b6001600160a01b038116610f455760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b60648201526084016104b7565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610937565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab90610fd29033908690600401611db8565b602060405180830381865afa158015610fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110139190611ddc565b90508061094057333083604051634a3fa29360e01b81526004016104b793929190611df9565b60008060006110466115da565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b8152600401602060405180830381865afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190611e2e565b9250836001600160a01b0316635a3d54936040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110e9190611e2e565b91506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111779190611e5e565b9250925092508363ffffffff168163ffffffff16146111d75780840363ffffffff81166111a484866115f0565b516001600160e01b031602969096019563ffffffff81166111c585856115f0565b516001600160e01b0316029590950194505b5050509193909250565b606580546001600160a01b031916905561042d816116a2565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361125c57507f0000000000000000000000000000000000000000000000000000000000000000919050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316036112bc57507f0000000000000000000000000000000000000000000000000000000000000000919050565b816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131e9190611eae565b90505b919050565b600080600080611335856116f4565b92509250925080421161138a5760405162461bcd60e51b815260206004820152601a60248201527f6e6f77206d75737420636f6d65206166746572206265666f726500000000000060448201526064016104b7565b60006113968242611ecb565b9050600060405180602001604052808386886113b29190611ecb565b6113bc9190611ef8565b6001600160e01b03169052905060006113d482611963565b9050600088606001516113ef57670de0b6b3a76400006113f9565b670de0b6b3a76400005b90506000818a602001518461140e9190611d4c565b6114189190611ef8565b90508960600151156114c5576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016600090815260ca6020526040812054908190036114a45760405162461bcd60e51b8152602060048201526014602482015273189b98881c1c9a58d9481a5cc81a5b9d985b1a5960621b60448201526064016104b7565b670de0b6b3a76400006114b78284611d4c565b6114c19190611ef8565b9150505b8060000361150e5760405162461bcd60e51b81526020600482015260166024820152750747761702070726963652063616e6e6f7420626520360541b60448201526064016104b7565b89516040805183815260208101899052428183015290516001600160a01b03909216917f7d881580fb2bb7844e8ecf8df26510247c4bbea2735d40bf0d9ac33c0d9acd819181900360600190a298516001600160a01b0316600090815260ca602052604090208990555096979650505050505050565b600054610100900460ff166115ab5760405162461bcd60e51b81526004016104b790611f0c565b610545611983565b600054610100900460ff166104245760405162461bcd60e51b81526004016104b790611f0c565b60006115eb64010000000042611f57565b905090565b6040805160208101909152600081526000826001600160701b0316116116585760405162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f00000000000000000060448201526064016104b7565b60408051602081019091528061168e6001600160701b0385166dffffffffffffffffffffffffffff60701b607088901b16611f6b565b6001600160e01b0316905290505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060008061170385610504565b60a0860151909150429060009061171a9083611ecb565b87516001600160a01b0316600090815260cb6020908152604080832080548251818502810185019093528083529495509293909291849084015b8282101561179a57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611754565b505082518b516001600160a01b0316600090815260cc6020526040902054939450929150505b818110156118b657838382815181106117db576117db611bce565b6020026020010151600001511015806117fd57506117fa600183611ecb565b81145b156118655782818151811061181457611814611bce565b602002602001015160200151975082818151811061183457611834611bce565b602090810291909101810151518b516001600160a01b0316600090815260cc909252604090912082905596506118b6565b89516001600160a01b0316600090815260cb6020526040902080548290811061189057611890611bce565b600091825260208220600290910201818155600101556118af81611bfa565b90506117c0565b5088516001600160a01b03908116600090815260cb60209081526040808320815180830183528981528084018b81528254600180820185559387529585902091516002909602909101948555519301929092558b5182518a81529182018b90524292820192909252606081018890529116907f87208a84ec7402c933c70c261e53b733a9f1c893d73e941a152435d58177a2649060800160405180910390a2509295505050509193909250565b805160009061131e906612725dd1d243ab906001600160e01b0316611ef8565b600054610100900460ff166119aa5760405162461bcd60e51b81526004016104b790611f0c565b610545336111e1565b6001600160a01b038116811461042d57600080fd5b600080604083850312156119db57600080fd5b82356119e6816119b3565b946020939093013593505050565b600060208284031215611a0657600080fd5b81356107aa816119b3565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611a5057611a50611a11565b604052919050565b801515811461042d57600080fd5b600060c08284031215611a7857600080fd5b60405160c0810181811067ffffffffffffffff82111715611a9b57611a9b611a11565b6040529050808235611aac816119b3565b8152602083810135908201526040830135611ac6816119b3565b60408201526060830135611ad981611a58565b60608201526080830135611aec81611a58565b608082015260a092830135920191909152919050565b60006020808385031215611b1557600080fd5b823567ffffffffffffffff80821115611b2d57600080fd5b818501915085601f830112611b4157600080fd5b813581811115611b5357611b53611a11565b611b61848260051b01611a27565b818152848101925060c0918202840185019188831115611b8057600080fd5b938501935b82851015611ba657611b978986611a66565b84529384019392850192611b85565b50979650505050505050565b600060c08284031215611bc457600080fd5b6107aa8383611a66565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c0c57611c0c611be4565b5060010190565b600060208284031215611c2557600080fd5b815160ff811681146107aa57600080fd5b600181815b80851115611c71578160001904821115611c5757611c57611be4565b80851615611c6457918102915b93841c9390800290611c3b565b509250929050565b600082611c885750600161169c565b81611c955750600061169c565b8160018114611cab5760028114611cb557611cd1565b600191505061169c565b60ff841115611cc657611cc6611be4565b50506001821b61169c565b5060208310610133831016604e8410600b8410161715611cf4575081810a61169c565b611cfe8383611c36565b8060001904821115611d1257611d12611be4565b029392505050565b60006107aa60ff841683611c79565b600060ff821660ff841680821015611d4357611d43611be4565b90039392505050565b6000816000190483118215151615611d6657611d66611be4565b500290565b6000815180845260005b81811015611d9157602081850181015186830182015201611d75565b81811115611da3576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090610e7f90830184611d6b565b600060208284031215611dee57600080fd5b81516107aa81611a58565b6001600160a01b03848116825283166020820152606060408201819052600090611e2590830184611d6b565b95945050505050565b600060208284031215611e4057600080fd5b5051919050565b80516001600160701b038116811461132157600080fd5b600080600060608486031215611e7357600080fd5b611e7c84611e47565b9250611e8a60208501611e47565b9150604084015163ffffffff81168114611ea357600080fd5b809150509250925092565b600060208284031215611ec057600080fd5b81516107aa816119b3565b600082821015611edd57611edd611be4565b500390565b634e487b7160e01b600052601260045260246000fd5b600082611f0757611f07611ee2565b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082611f6657611f66611ee2565b500690565b60006001600160e01b0383811680611f8557611f85611ee2565b9216919091049291505056fea2646970667358221220e2356362d262a176c6425d938c0fb706747e869da6f1723e53ce334e453b3bc664736f6c634300080d003363616e2774206265207a65726f20616464726573730000000000000000000000",
|
|
706
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806379ba5097116100c3578063c4d66de81161007c578063c4d66de814610363578063cbf6791914610376578063cfed246b14610389578063e30c3978146103a9578063f2fde38b146103ba578063fc57d4df146103cd57600080fd5b806379ba5097146102eb5780638da5cb5b146102f35780638dd9500214610304578063b4a0bdf31461032b578063b62e4c921461033c578063b8a8a626146102c157600080fd5b80633334ecc5116101155780633334ecc5146102625780635ba3792d14610282578063609f0f36146102c157806369aa3ac6146102c1578063715018a6146102d0578063725068a5146102d857600080fd5b806302459966146101525780630e32cb861461017f5780631b69dc5f14610194578063234a34461461022e5780632b9d9dea14610241575b600080fd5b6101656101603660046119c8565b6103e0565b604080519283526020830191909152015b60405180910390f35b61019261018d3660046119f4565b61041c565b005b6101ec6101a23660046119f4565b60c96020526000908152604090208054600182015460028301546003909301546001600160a01b0392831693919282169160ff600160a01b8204811692600160a81b909204169086565b604080516001600160a01b03978816815260208101969096529390951692840192909252151560608301521515608082015260a081019190915260c001610176565b61019261023c366004611b02565b610430565b61025461024f366004611bb2565b610504565b604051908152602001610176565b6102546102703660046119f4565b60cc6020526000908152604090205481565b6102a97f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610176565b610254670de0b6b3a764000081565b610192610533565b6102546102e63660046119f4565b610547565b6101926107b1565b6033546001600160a01b03166102a9565b6102a97f000000000000000000000000000000000000000000000000000000000000000081565b6097546001600160a01b03166102a9565b6102a97f000000000000000000000000000000000000000000000000000000000000000081565b6101926103713660046119f4565b610828565b610192610384366004611bb2565b610944565b6102546103973660046119f4565b60ca6020526000908152604090205481565b6065546001600160a01b03166102a9565b6101926103c83660046119f4565b610cbe565b6102546103db3660046119f4565b610d2f565b60cb60205281600052604060002081815481106103fc57600080fd5b600091825260209091206002909102018054600190910154909250905082565b610424610e87565b61042d81610ee1565b50565b610438610e87565b6104766040518060400160405280601d81526020017f736574546f6b656e436f6e66696773546f6b656e436f6e6669675b5d29000000815250610f9f565b60008151116104c05760405162461bcd60e51b815260206004820152601160248201527006c656e6774682063616e2774206265203607c1b60448201526064015b60405180910390fd5b805160005b818110156104ff576104ef8382815181106104e2576104e2611bce565b6020026020010151610944565b6104f881611bfa565b90506104c5565b505050565b60008060006105168460400151611039565b509150915083608001511561052c579392505050565b5092915050565b61053b610e87565b61054560006111e1565b565b600080610553836111fa565b6001600160a01b03808216600090815260c96020526040902054919250166105af5760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b60448201526064016104b7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03161415801561061357506001600160a01b038116600090815260c96020526040902060020154600160a01b900460ff165b1561072e576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020526040902054166106905760405162461bcd60e51b815260206004820152600e60248201526d15d09390881b9bdd08195e1a5cdd60921b60448201526064016104b7565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a082015261072c90611326565b505b6001600160a01b03808216600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a08201526107aa90611326565b9392505050565b60655433906001600160a01b0316811461081f5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084016104b7565b61042d816111e1565b600054610100900460ff16158080156108485750600054600160ff909116105b806108625750303b158015610862575060005460ff166001145b6108c55760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016104b7565b6000805460ff1916600117905580156108e8576000805461ff0019166101001790555b6108f0611584565b6108f9826115b3565b8015610940576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050565b80516001600160a01b0381166109945760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b60448201526064016104b7565b60408201516001600160a01b0381166109e75760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b60448201526064016104b7565b610a256040518060400160405280601b81526020017f736574546f6b656e436f6e66696728546f6b656e436f6e666967290000000000815250610f9f565b60008360a0015111610a795760405162461bcd60e51b815260206004820152601e60248201527f616e63686f7220706572696f64206d75737420626520706f736974697665000060448201526064016104b7565b6000836020015111610acd5760405162461bcd60e51b815260206004820152601a60248201527f6261736520756e6974206d75737420626520706f73697469766500000000000060448201526064016104b7565b82600001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611c13565b610b3e90600a611d1a565b836020015114610baa5760405162461bcd60e51b815260206004820152603160248201527f6261736520756e697420646563696d616c73206d7573742062652073616d6520604482015270617320617373657420646563696d616c7360781b60648201526084016104b7565b6000610bb584610504565b84516001600160a01b03908116600090815260cb6020908152604080832081518083018352428152808401878152825460018181018555938752858720925160029182029093019283559051918301919091558a518616855260c984528285208b5181549088166001600160a01b031990911681178255948c015192810192909255828b0151908201805460608d015160808e01511515600160a81b0260ff60a81b19911515600160a01b026001600160a81b03199093169490991693841791909117169690961790955560a08a0151600390910181905590519495509390917f3cc8d9cb9370a23a8b9ffa75efa24cecb65c4693980e58260841adc474983c5f91a450505050565b610cc6610e87565b606580546001600160a01b0383166001600160a01b03199091168117909155610cf76033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080610d3b836111fa565b6001600160a01b03808216600090815260c9602052604090205491925016610d975760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b60448201526064016104b7565b6001600160a01b038116600090815260ca602052604090205480610dfd5760405162461bcd60e51b815260206004820152601b60248201527f54574150207072696365206d75737420626520706f736974697665000000000060448201526064016104b7565b816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5f9190611c13565b610e6a906012611d29565b610e7590600a611d1a565b610e7f9082611d4c565b949350505050565b6033546001600160a01b031633146105455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b7565b6001600160a01b038116610f455760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b60648201526084016104b7565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa09101610937565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab90610fd29033908690600401611db8565b602060405180830381865afa158015610fef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110139190611ddc565b90508061094057333083604051634a3fa29360e01b81526004016104b793929190611df9565b60008060006110466115da565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b8152600401602060405180830381865afa158015611086573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110aa9190611e2e565b9250836001600160a01b0316635a3d54936040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110e9190611e2e565b91506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111779190611e5e565b9250925092508363ffffffff168163ffffffff16146111d75780840363ffffffff81166111a484866115f0565b516001600160e01b031602969096019563ffffffff81166111c585856115f0565b516001600160e01b0316029590950194505b5050509193909250565b606580546001600160a01b031916905561042d816116a2565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361125c57507f0000000000000000000000000000000000000000000000000000000000000000919050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316036112bc57507f0000000000000000000000000000000000000000000000000000000000000000919050565b816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131e9190611eae565b90505b919050565b600080600080611335856116f4565b92509250925080421161138a5760405162461bcd60e51b815260206004820152601a60248201527f6e6f77206d75737420636f6d65206166746572206265666f726500000000000060448201526064016104b7565b60006113968242611ecb565b9050600060405180602001604052808386886113b29190611ecb565b6113bc9190611ef8565b6001600160e01b03169052905060006113d482611963565b9050600088606001516113ef57670de0b6b3a76400006113f9565b670de0b6b3a76400005b90506000818a602001518461140e9190611d4c565b6114189190611ef8565b90508960600151156114c5576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016600090815260ca6020526040812054908190036114a45760405162461bcd60e51b8152602060048201526014602482015273189b98881c1c9a58d9481a5cc81a5b9d985b1a5960621b60448201526064016104b7565b670de0b6b3a76400006114b78284611d4c565b6114c19190611ef8565b9150505b8060000361150e5760405162461bcd60e51b81526020600482015260166024820152750747761702070726963652063616e6e6f7420626520360541b60448201526064016104b7565b89516040805183815260208101899052428183015290516001600160a01b03909216917f7d881580fb2bb7844e8ecf8df26510247c4bbea2735d40bf0d9ac33c0d9acd819181900360600190a298516001600160a01b0316600090815260ca602052604090208990555096979650505050505050565b600054610100900460ff166115ab5760405162461bcd60e51b81526004016104b790611f0c565b610545611983565b600054610100900460ff166104245760405162461bcd60e51b81526004016104b790611f0c565b60006115eb64010000000042611f57565b905090565b6040805160208101909152600081526000826001600160701b0316116116585760405162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f00000000000000000060448201526064016104b7565b60408051602081019091528061168e6001600160701b0385166dffffffffffffffffffffffffffff60701b607088901b16611f6b565b6001600160e01b0316905290505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060008061170385610504565b60a0860151909150429060009061171a9083611ecb565b87516001600160a01b0316600090815260cb6020908152604080832080548251818502810185019093528083529495509293909291849084015b8282101561179a57838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190611754565b505082518b516001600160a01b0316600090815260cc6020526040902054939450929150505b818110156118b657838382815181106117db576117db611bce565b6020026020010151600001511015806117fd57506117fa600183611ecb565b81145b156118655782818151811061181457611814611bce565b602002602001015160200151975082818151811061183457611834611bce565b602090810291909101810151518b516001600160a01b0316600090815260cc909252604090912082905596506118b6565b89516001600160a01b0316600090815260cb6020526040902080548290811061189057611890611bce565b600091825260208220600290910201818155600101556118af81611bfa565b90506117c0565b5088516001600160a01b03908116600090815260cb60209081526040808320815180830183528981528084018b81528254600180820185559387529585902091516002909602909101948555519301929092558b5182518a81529182018b90524292820192909252606081018890529116907f87208a84ec7402c933c70c261e53b733a9f1c893d73e941a152435d58177a2649060800160405180910390a2509295505050509193909250565b805160009061131e906612725dd1d243ab906001600160e01b0316611ef8565b600054610100900460ff166119aa5760405162461bcd60e51b81526004016104b790611f0c565b610545336111e1565b6001600160a01b038116811461042d57600080fd5b600080604083850312156119db57600080fd5b82356119e6816119b3565b946020939093013593505050565b600060208284031215611a0657600080fd5b81356107aa816119b3565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611a5057611a50611a11565b604052919050565b801515811461042d57600080fd5b600060c08284031215611a7857600080fd5b60405160c0810181811067ffffffffffffffff82111715611a9b57611a9b611a11565b6040529050808235611aac816119b3565b8152602083810135908201526040830135611ac6816119b3565b60408201526060830135611ad981611a58565b60608201526080830135611aec81611a58565b608082015260a092830135920191909152919050565b60006020808385031215611b1557600080fd5b823567ffffffffffffffff80821115611b2d57600080fd5b818501915085601f830112611b4157600080fd5b813581811115611b5357611b53611a11565b611b61848260051b01611a27565b818152848101925060c0918202840185019188831115611b8057600080fd5b938501935b82851015611ba657611b978986611a66565b84529384019392850192611b85565b50979650505050505050565b600060c08284031215611bc457600080fd5b6107aa8383611a66565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c0c57611c0c611be4565b5060010190565b600060208284031215611c2557600080fd5b815160ff811681146107aa57600080fd5b600181815b80851115611c71578160001904821115611c5757611c57611be4565b80851615611c6457918102915b93841c9390800290611c3b565b509250929050565b600082611c885750600161169c565b81611c955750600061169c565b8160018114611cab5760028114611cb557611cd1565b600191505061169c565b60ff841115611cc657611cc6611be4565b50506001821b61169c565b5060208310610133831016604e8410600b8410161715611cf4575081810a61169c565b611cfe8383611c36565b8060001904821115611d1257611d12611be4565b029392505050565b60006107aa60ff841683611c79565b600060ff821660ff841680821015611d4357611d43611be4565b90039392505050565b6000816000190483118215151615611d6657611d66611be4565b500290565b6000815180845260005b81811015611d9157602081850181015186830182015201611d75565b81811115611da3576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090610e7f90830184611d6b565b600060208284031215611dee57600080fd5b81516107aa81611a58565b6001600160a01b03848116825283166020820152606060408201819052600090611e2590830184611d6b565b95945050505050565b600060208284031215611e4057600080fd5b5051919050565b80516001600160701b038116811461132157600080fd5b600080600060608486031215611e7357600080fd5b611e7c84611e47565b9250611e8a60208501611e47565b9150604084015163ffffffff81168114611ea357600080fd5b809150509250925092565b600060208284031215611ec057600080fd5b81516107aa816119b3565b600082821015611edd57611edd611be4565b500390565b634e487b7160e01b600052601260045260246000fd5b600082611f0757611f07611ee2565b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600082611f6657611f66611ee2565b500690565b60006001600160e01b0383811680611f8557611f85611ee2565b9216919091049291505056fea2646970667358221220e2356362d262a176c6425d938c0fb706747e869da6f1723e53ce334e453b3bc664736f6c634300080d0033",
|
|
690
|
+
"solcInputHash": "131f58942628e21632de19506977a910",
|
|
691
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vBnbAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wBnbAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"price\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTimestamp\",\"type\":\"uint256\"}],\"name\":\"AnchorPriceUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"name\":\"TokenConfigAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldAcc\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newTimestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newAcc\",\"type\":\"uint256\"}],\"name\":\"TwapWindowUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BNB_BASE_UNIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BUSD_BASE_UNIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"internalType\":\"struct TwapOracle.TokenConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"currentCumulativePrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"acc\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"prices\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"internalType\":\"struct TwapOracle.TokenConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setTokenConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"internalType\":\"struct TwapOracle.TokenConfig[]\",\"name\":\"configs\",\"type\":\"tuple[]\"}],\"name\":\"setTokenConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenConfigs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"baseUnit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pancakePool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isBnbBased\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"isReversedPool\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"anchorPeriod\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"updateTwap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vBnb\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vai\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"windowStart\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"vBnbAddress\":\"The address of the VBNB\",\"vaiAddress\":\"The address of the WBNB\",\"wBnbAddress\":\"The address of the WBNB\"}},\"currentCumulativePrice((address,uint256,address,bool,bool,uint256))\":{\"returns\":{\"_0\":\"cumulative price of target token regardless of pair order\"}},\"getUnderlyingPrice(address)\":{\"custom:error\":\"Missing error is thrown if the token config does not existRange error is thrown if TWAP price is not greater than zero\",\"params\":{\"vToken\":\"vToken address\"},\"returns\":{\"_0\":\"price Underlying price in USD\"}},\"initialize(address)\":{\"params\":{\"accessControlManager_\":\"Address of the access control manager contract\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setTokenConfig((address,uint256,address,bool,bool,uint256))\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"Range error is thrown if anchor period is not greater than zeroRange error is thrown if base unit is not greater than zeroValue error is thrown if base unit decimals is not the same as asset decimalsNotNullAddress error is thrown if address of asset is nullNotNullAddress error is thrown if PancakeSwap pool address is null\",\"custom:event\":\"Emits TokenConfigAdded event if new token config are added with asset address, PancakePool address, anchor period address\",\"params\":{\"config\":\"token config struct\"}},\"setTokenConfigs((address,uint256,address,bool,bool,uint256)[])\":{\"custom:error\":\"Zero length error thrown, if length of the config array is 0\",\"params\":{\"configs\":\"Config array\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateTwap(address)\":{\"custom:error\":\"Missing error is thrown if token config does not exist\",\"returns\":{\"_0\":\"anchorPrice anchor price of the underlying asset of the vToken\"}}},\"stateVariables\":{\"WBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vBnb\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vai\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"version\":1},\"userdoc\":{\"errors\":{\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}]},\"events\":{\"AnchorPriceUpdated(address,uint256,uint256,uint256)\":{\"notice\":\"Emit this event when TWAP price is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"TokenConfigAdded(address,address,uint256)\":{\"notice\":\"Emit this event when new token configs are added\"},\"TwapWindowUpdated(address,uint256,uint256,uint256,uint256)\":{\"notice\":\"Emit this event when TWAP window is updated\"}},\"kind\":\"user\",\"methods\":{\"BNB_BASE_UNIT()\":{\"notice\":\"the base unit of WBNB and BUSD, which are the paired tokens for all assets\"},\"WBNB()\":{\"notice\":\"WBNB address\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"constructor\":{\"notice\":\"Constructor for the implementation contract. Sets immutable variables.\"},\"currentCumulativePrice((address,uint256,address,bool,bool,uint256))\":{\"notice\":\"Fetches the current token/WBNB and token/BUSD price accumulator from PancakeSwap.\"},\"getUnderlyingPrice(address)\":{\"notice\":\"Get the underlying TWAP price for the given vToken\"},\"initialize(address)\":{\"notice\":\"Initializes the owner of the contract\"},\"observations(address,uint256)\":{\"notice\":\"Keeps a record of token observations mapped by address, updated on every updateTwap invocation.\"},\"prices(address)\":{\"notice\":\"Stored price by token\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setTokenConfig((address,uint256,address,bool,bool,uint256))\":{\"notice\":\"Adds a single token config\"},\"setTokenConfigs((address,uint256,address,bool,bool,uint256)[])\":{\"notice\":\"Adds multiple token configs at the same time\"},\"tokenConfigs(address)\":{\"notice\":\"Configs by token\"},\"updateTwap(address)\":{\"notice\":\"Updates the current token/BUSD price from PancakeSwap, with 18 decimals of precision.\"},\"vBnb()\":{\"notice\":\"vBNB address\"},\"vai()\":{\"notice\":\"VAI address\"},\"windowStart(address)\":{\"notice\":\"Observation array index which probably falls in current anchor period mapped by asset address\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/TwapOracle.sol\":\"TwapOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() external {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xd712fb45b3ea0ab49679164e3895037adc26ce12879d5184feb040e01c1c07a9\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.1) (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 * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\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\":\"0x037c334add4b033ad3493038c25be1682d78c00992e1acb0e2795caff3925271\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.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 *\\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://diligence.consensys.net/posts/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.5.11/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(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) 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 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\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.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 IAccessControl {\\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\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title Venus Access Control Contract.\\n * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract\\n * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.\\n * The contract allows the owner to set an AccessControlManager contract address.\\n * It can restrict method calls based on the sender's role and the method's signature.\\n */\\n\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x618d942756b93e02340a42f3c80aa99fc56be1a96861f5464dc23a76bf30b3a5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x41deef84d1839590b243b66506691fde2fb938da01eabde53e82d3b8316fdaf9\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address vToken) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address vToken,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x8ac0bda5d5789c320bf219dc6691eef0e6617e9653bc0e24f407a44e4281edda\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"contracts/libraries/PancakeLibrary.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IPancakePair {\\n function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\\n\\n function price0CumulativeLast() external view returns (uint256);\\n\\n function price1CumulativeLast() external view returns (uint256);\\n}\\n\\nlibrary FixedPoint {\\n // range: [0, 2**112 - 1]\\n // resolution: 1 / 2**112\\n struct uq112x112 {\\n uint224 _x;\\n }\\n\\n // returns a uq112x112 which represents the ratio of the numerator to the denominator\\n // equivalent to encode(numerator).div(denominator)\\n function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {\\n require(denominator > 0, \\\"FixedPoint: DIV_BY_ZERO\\\");\\n return uq112x112((uint224(numerator) << 112) / denominator);\\n }\\n\\n // decode a uq112x112 into a uint with 18 decimals of precision\\n function decode112with18(uq112x112 memory self) internal pure returns (uint256) {\\n // we only have 256 - 224 = 32 bits to spare, so scaling up by ~60 bits is dangerous\\n // instead, get close to:\\n // (x * 1e18) >> 112\\n // without risk of overflowing, e.g.:\\n // (x) / 2 ** (112 - lg(1e18))\\n return uint256(self._x) / 5192296858534827;\\n }\\n}\\n\\n// library with helper methods for oracles that are concerned with computing average prices\\nlibrary PancakeOracleLibrary {\\n using FixedPoint for *;\\n\\n // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1]\\n function currentBlockTimestamp() internal view returns (uint32) {\\n return uint32(block.timestamp % 2 ** 32);\\n }\\n\\n // produces the cumulative price using counterfactuals to save gas and avoid a call to sync.\\n function currentCumulativePrices(\\n address pair\\n ) internal view returns (uint256 price0Cumulative, uint256 price1Cumulative, uint32 blockTimestamp) {\\n blockTimestamp = currentBlockTimestamp();\\n price0Cumulative = IPancakePair(pair).price0CumulativeLast();\\n price1Cumulative = IPancakePair(pair).price1CumulativeLast();\\n\\n // if time has elapsed since the last update on the pair, mock the accumulated price values\\n (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IPancakePair(pair).getReserves();\\n if (blockTimestampLast != blockTimestamp) {\\n unchecked {\\n // subtraction overflow is desired\\n uint32 timeElapsed = blockTimestamp - blockTimestampLast;\\n // addition overflow is desired\\n // counterfactual\\n price0Cumulative += uint256(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;\\n // counterfactual\\n price1Cumulative += uint256(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2c8179ebad223998514d6f25ebd90f80ecb294b562d9fbc4a42bf6710486c25b\",\"license\":\"BSD-3-Clause\"},\"contracts/oracles/TwapOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"../libraries/PancakeLibrary.sol\\\";\\nimport \\\"../interfaces/OracleInterface.sol\\\";\\nimport \\\"../interfaces/VBep20Interface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\ncontract TwapOracle is AccessControlledV8, TwapInterface {\\n using FixedPoint for *;\\n\\n struct Observation {\\n uint256 timestamp;\\n uint256 acc;\\n }\\n\\n struct TokenConfig {\\n /// @notice Asset address, which can't be zero address and can be used for existance check\\n address asset;\\n /// @notice Decimals of underlying asset respresented as 1e{decimals}\\n uint256 baseUnit;\\n /// @notice The address of Pancake pair\\n address pancakePool;\\n /// @notice Whether the token is paired with WBNB\\n bool isBnbBased;\\n /// @notice A flag identifies whether the Pancake pair is reversed\\n /// e.g. XVS-WBNB is reversed, while WBNB-XVS is not.\\n bool isReversedPool;\\n /// @notice The minimum window in seconds required between TWAP updates\\n uint256 anchorPeriod;\\n }\\n\\n /// @notice WBNB address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable WBNB;\\n\\n /// @notice vBNB address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vBnb;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice the base unit of WBNB and BUSD, which are the paired tokens for all assets\\n uint256 public constant BNB_BASE_UNIT = 1e18;\\n uint256 public constant BUSD_BASE_UNIT = 1e18;\\n\\n /// @notice Configs by token\\n mapping(address => TokenConfig) public tokenConfigs;\\n\\n /// @notice Stored price by token\\n mapping(address => uint256) public prices;\\n\\n /// @notice Keeps a record of token observations mapped by address, updated on every updateTwap invocation.\\n mapping(address => Observation[]) public observations;\\n\\n /// @notice Observation array index which probably falls in current anchor period mapped by asset address\\n mapping(address => uint256) public windowStart;\\n\\n /// @notice Emit this event when TWAP window is updated\\n event TwapWindowUpdated(\\n address indexed asset,\\n uint256 oldTimestamp,\\n uint256 oldAcc,\\n uint256 newTimestamp,\\n uint256 newAcc\\n );\\n\\n /// @notice Emit this event when TWAP price is updated\\n event AnchorPriceUpdated(address indexed asset, uint256 price, uint256 oldTimestamp, uint256 newTimestamp);\\n\\n /// @notice Emit this event when new token configs are added\\n event TokenConfigAdded(address indexed asset, address indexed pancakePool, uint256 indexed anchorPeriod);\\n\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @param vBnbAddress The address of the VBNB\\n /// @param wBnbAddress The address of the WBNB\\n /// @param vaiAddress The address of the WBNB\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address vBnbAddress,\\n address wBnbAddress,\\n address vaiAddress\\n ) notNullAddress(vBnbAddress) notNullAddress(wBnbAddress) notNullAddress(vaiAddress) {\\n vBnb = vBnbAddress;\\n WBNB = wBnbAddress;\\n vai = vaiAddress;\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Adds multiple token configs at the same time\\n * @param configs Config array\\n * @custom:error Zero length error thrown, if length of the config array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory configs) external {\\n if (configs.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = configs.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(configs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Initializes the owner of the contract\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n }\\n\\n /**\\n * @notice Updates the current token/BUSD price from PancakeSwap, with 18 decimals of precision.\\n * @return anchorPrice anchor price of the underlying asset of the vToken\\n * @custom:error Missing error is thrown if token config does not exist\\n */\\n function updateTwap(address vToken) external returns (uint256) {\\n address asset = _getUnderlyingAsset(vToken);\\n\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"asset not exist\\\");\\n // Update & fetch WBNB price first, so we can calculate the price of WBNB paired token\\n if (asset != WBNB && tokenConfigs[asset].isBnbBased) {\\n if (tokenConfigs[WBNB].asset == address(0)) revert(\\\"WBNB not exist\\\");\\n _updateTwapInternal(tokenConfigs[WBNB]);\\n }\\n return _updateTwapInternal(tokenConfigs[asset]);\\n }\\n\\n /**\\n * @notice Get the underlying TWAP price for the given vToken\\n * @param vToken vToken address\\n * @return price Underlying price in USD\\n * @custom:error Missing error is thrown if the token config does not exist\\n * @custom:error Range error is thrown if TWAP price is not greater than zero\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n address asset = _getUnderlyingAsset(vToken);\\n\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"asset not exist\\\");\\n uint256 price = prices[asset];\\n\\n // if price is 0, it means the price hasn't been updated yet and it's meaningless, revert\\n if (price == 0) revert(\\\"TWAP price must be positive\\\");\\n return (price * (10 ** (18 - IERC20Metadata(asset).decimals())));\\n }\\n\\n /**\\n * @notice Adds a single token config\\n * @param config token config struct\\n * @custom:access Only Governance\\n * @custom:error Range error is thrown if anchor period is not greater than zero\\n * @custom:error Range error is thrown if base unit is not greater than zero\\n * @custom:error Value error is thrown if base unit decimals is not the same as asset decimals\\n * @custom:error NotNullAddress error is thrown if address of asset is null\\n * @custom:error NotNullAddress error is thrown if PancakeSwap pool address is null\\n * @custom:event Emits TokenConfigAdded event if new token config are added with\\n * asset address, PancakePool address, anchor period address\\n */\\n function setTokenConfig(\\n TokenConfig memory config\\n ) public notNullAddress(config.asset) notNullAddress(config.pancakePool) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n if (config.anchorPeriod == 0) revert(\\\"anchor period must be positive\\\");\\n if (config.baseUnit != 10 ** IERC20Metadata(config.asset).decimals())\\n revert(\\\"base unit decimals must be same as asset decimals\\\");\\n\\n uint256 cumulativePrice = currentCumulativePrice(config);\\n\\n // Initialize observation data\\n observations[config.asset].push(Observation(block.timestamp, cumulativePrice));\\n tokenConfigs[config.asset] = config;\\n emit TokenConfigAdded(config.asset, config.pancakePool, config.anchorPeriod);\\n }\\n\\n /**\\n * @notice Fetches the current token/WBNB and token/BUSD price accumulator from PancakeSwap.\\n * @return cumulative price of target token regardless of pair order\\n */\\n function currentCumulativePrice(TokenConfig memory config) public view returns (uint256) {\\n (uint256 price0, uint256 price1, ) = PancakeOracleLibrary.currentCumulativePrices(config.pancakePool);\\n if (config.isReversedPool) {\\n return price1;\\n } else {\\n return price0;\\n }\\n }\\n\\n /**\\n * @notice Fetches the current token/BUSD price from PancakeSwap, with 18 decimals of precision.\\n * @return price Underlying price in USD, with 18 decimals\\n * @custom:error Timing error is thrown if current time is not greater than old observation timestamp\\n * @custom:error Zero price error is thrown if token is BNB based and price is zero\\n * @custom:error Zero price error is thrown if fetched anchorPriceMantissa is zero\\n * @custom:event Emits AnchorPriceUpdated event on successful update of observation with assset address,\\n * AnchorPrice, old observation timestamp and current timestamp\\n */\\n function _updateTwapInternal(TokenConfig memory config) private returns (uint256) {\\n // pokeWindowValues already handled reversed pool cases,\\n // priceAverage will always be Token/BNB or Token/BUSD *twap** price.\\n (uint256 nowCumulativePrice, uint256 oldCumulativePrice, uint256 oldTimestamp) = pokeWindowValues(config);\\n\\n if (block.timestamp == oldTimestamp) return prices[config.asset];\\n\\n // This should be impossible, but better safe than sorry\\n if (block.timestamp < oldTimestamp) revert(\\\"now must come after before\\\");\\n\\n uint256 timeElapsed;\\n unchecked {\\n timeElapsed = block.timestamp - oldTimestamp;\\n }\\n\\n // Calculate Pancake *twap**\\n FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(\\n uint224((nowCumulativePrice - oldCumulativePrice) / timeElapsed)\\n );\\n // *twap** price with 1e18 decimal mantissa\\n uint256 priceAverageMantissa = priceAverage.decode112with18();\\n\\n // To cancel the decimals in cumulative price, we need to mulitply the average price with\\n // tokenBaseUnit / (BNB_BASE_UNIT or BUSD_BASE_UNIT, which is 1e18)\\n uint256 pairedTokenBaseUnit = config.isBnbBased ? BNB_BASE_UNIT : BUSD_BASE_UNIT;\\n uint256 anchorPriceMantissa = (priceAverageMantissa * config.baseUnit) / pairedTokenBaseUnit;\\n\\n // if this token is paired with BNB, convert its price to USD\\n if (config.isBnbBased) {\\n uint256 bnbPrice = prices[WBNB];\\n if (bnbPrice == 0) revert(\\\"bnb price is invalid\\\");\\n anchorPriceMantissa = (anchorPriceMantissa * bnbPrice) / BNB_BASE_UNIT;\\n }\\n\\n if (anchorPriceMantissa == 0) revert(\\\"twap price cannot be 0\\\");\\n\\n emit AnchorPriceUpdated(config.asset, anchorPriceMantissa, oldTimestamp, block.timestamp);\\n\\n // save anchor price, which is 1e18 decimals\\n prices[config.asset] = anchorPriceMantissa;\\n\\n return anchorPriceMantissa;\\n }\\n\\n /**\\n * @notice Appends current observation and pick an observation with a timestamp equal\\n * or just greater than the window start timestamp. If one is not available,\\n * then pick the last availableobservation. The window start index is updated in both the cases.\\n * Only the current observation is saved, prior observations are deleted during this operation.\\n * @return Tuple of cumulative price, old observation and timestamp\\n * @custom:event Emits TwapWindowUpdated on successful calculation of cumulative price with asset address,\\n * new observation timestamp, current timestamp, new observation price and cumulative price\\n */\\n function pokeWindowValues(\\n TokenConfig memory config\\n ) private returns (uint256, uint256 startCumulativePrice, uint256 startCumulativeTimestamp) {\\n uint256 cumulativePrice = currentCumulativePrice(config);\\n uint256 currentTimestamp = block.timestamp;\\n uint256 windowStartTimestamp = currentTimestamp - config.anchorPeriod;\\n Observation[] memory storedObservations = observations[config.asset];\\n\\n uint256 storedObservationsLength = storedObservations.length;\\n for (uint256 windowStartIndex = windowStart[config.asset]; windowStartIndex < storedObservationsLength; ) {\\n if (\\n (storedObservations[windowStartIndex].timestamp >= windowStartTimestamp) ||\\n (windowStartIndex == storedObservationsLength - 1)\\n ) {\\n startCumulativePrice = storedObservations[windowStartIndex].acc;\\n startCumulativeTimestamp = storedObservations[windowStartIndex].timestamp;\\n windowStart[config.asset] = windowStartIndex;\\n break;\\n } else {\\n delete observations[config.asset][windowStartIndex];\\n }\\n\\n unchecked {\\n ++windowStartIndex;\\n }\\n }\\n\\n observations[config.asset].push(Observation(currentTimestamp, cumulativePrice));\\n emit TwapWindowUpdated(\\n config.asset,\\n startCumulativeTimestamp,\\n startCumulativePrice,\\n block.timestamp,\\n cumulativePrice\\n );\\n return (cumulativePrice, startCumulativePrice, startCumulativeTimestamp);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view returns (address asset) {\\n if (vToken == vBnb) {\\n asset = WBNB;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc6fc865649b9b47c0a76916d13469c88fc33220f7413173273f304def04bb9a3\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
692
|
+
"bytecode": "0x60e06040523480156200001157600080fd5b506040516200223c3803806200223c83398101604081905262000034916200021b565b826001600160a01b038116620000805760405162461bcd60e51b815260206004820152601560248201526000805160206200221c83398151915260448201526064015b60405180910390fd5b826001600160a01b038116620000c85760405162461bcd60e51b815260206004820152601560248201526000805160206200221c833981519152604482015260640162000077565b826001600160a01b038116620001105760405162461bcd60e51b815260206004820152601560248201526000805160206200221c833981519152604482015260640162000077565b6001600160a01b0380871660a052858116608052841660c052620001336200013f565b50505050505062000265565b600054610100900460ff1615620001a95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840162000077565b60005460ff9081161015620001fc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146200021657600080fd5b919050565b6000806000606084860312156200023157600080fd5b6200023c84620001fe565b92506200024c60208501620001fe565b91506200025c60408501620001fe565b90509250925092565b60805160a05160c051611f4f620002cd6000396000818161033601528181611112015261114c01526000818161028b01526110b20152600081816102fe01528181610558015281816105c901528181610641015281816110ec01526113050152611f4f6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638da5cb5b116100b8578063cbf679191161007c578063cbf679191461036b578063cfed246b1461037e578063e24343ff14610257578063e30c39781461039e578063f2fde38b146103af578063fc57d4df146103c257600080fd5b80638da5cb5b146102e85780638dd95002146102f9578063b4a0bdf314610320578063b62e4c9214610331578063c4d66de81461035857600080fd5b80633125d3c81161010a5780633125d3c8146102575780633334ecc5146102665780635ba3792d14610286578063715018a6146102c5578063725068a5146102cd57806379ba5097146102e057600080fd5b806302459966146101475780630e32cb86146101745780631b69dc5f14610189578063234a3446146102235780632b9d9dea14610236575b600080fd5b61015a610155366004611969565b6103d5565b604080519283526020830191909152015b60405180910390f35b610187610182366004611995565b610411565b005b6101e1610197366004611995565b60c96020526000908152604090208054600182015460028301546003909301546001600160a01b0392831693919282169160ff600160a01b8204811692600160a81b909204169086565b604080516001600160a01b03978816815260208101969096529390951692840192909252151560608301521515608082015260a081019190915260c00161016b565b610187610231366004611aa3565b610425565b610249610244366004611b53565b6104ab565b60405190815260200161016b565b610249670de0b6b3a764000081565b610249610274366004611995565b60cc6020526000908152604090205481565b6102ad7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161016b565b6101876104da565b6102496102db366004611995565b6104ee565b610187610758565b6033546001600160a01b03166102ad565b6102ad7f000000000000000000000000000000000000000000000000000000000000000081565b6097546001600160a01b03166102ad565b6102ad7f000000000000000000000000000000000000000000000000000000000000000081565b610187610366366004611995565b6107cf565b610187610379366004611b53565b6108e3565b61024961038c366004611995565b60ca6020526000908152604090205481565b6065546001600160a01b03166102ad565b6101876103bd366004611995565b610c09565b6102496103d0366004611995565b610c7a565b60cb60205281600052604060002081815481106103f157600080fd5b600091825260209091206002909102018054600190910154909250905082565b610419610dd5565b61042281610e2f565b50565b805160000361046f5760405162461bcd60e51b815260206004820152601160248201527006c656e6774682063616e2774206265203607c1b60448201526064015b60405180910390fd5b805160005b818110156104a65761049e83828151811061049157610491611b6f565b60200260200101516108e3565b600101610474565b505050565b60008060006104bd8460400151610eed565b50915091508360800151156104d3579392505050565b5092915050565b6104e2610dd5565b6104ec6000611095565b565b6000806104fa836110ae565b6001600160a01b03808216600090815260c96020526040902054919250166105565760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b6044820152606401610466565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316141580156105ba57506001600160a01b038116600090815260c96020526040902060020154600160a01b900460ff165b156106d5576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020526040902054166106375760405162461bcd60e51b815260206004820152600e60248201526d15d09390881b9bdd08195e1a5cdd60921b6044820152606401610466565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a08201526106d3906111da565b505b6001600160a01b03808216600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a0820152610751906111da565b9392505050565b60655433906001600160a01b031681146107c65760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610466565b61042281611095565b600054610100900460ff16158080156107ef5750600054600160ff909116105b806108095750303b158015610809575060005460ff166001145b61086c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610466565b6000805460ff19166001179055801561088f576000805461ff0019166101001790555b6108988261145b565b80156108df576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050565b80516001600160a01b0381166109335760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b6044820152606401610466565b60408201516001600160a01b0381166109865760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b6044820152606401610466565b6109c46040518060400160405280601b81526020017f736574546f6b656e436f6e66696728546f6b656e436f6e666967290000000000815250611493565b8260a00151600003610a185760405162461bcd60e51b815260206004820152601e60248201527f616e63686f7220706572696f64206d75737420626520706f73697469766500006044820152606401610466565b82600001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190611b85565b610a8990600a611ca2565b836020015114610af55760405162461bcd60e51b815260206004820152603160248201527f6261736520756e697420646563696d616c73206d7573742062652073616d6520604482015270617320617373657420646563696d616c7360781b6064820152608401610466565b6000610b00846104ab565b84516001600160a01b03908116600090815260cb6020908152604080832081518083018352428152808401878152825460018181018555938752858720925160029182029093019283559051918301919091558a518616855260c984528285208b5181549088166001600160a01b031990911681178255948c015192810192909255828b0151908201805460608d015160808e01511515600160a81b0260ff60a81b19911515600160a01b026001600160a81b03199093169490991693841791909117169690961790955560a08a0151600390910181905590519495509390917f3cc8d9cb9370a23a8b9ffa75efa24cecb65c4693980e58260841adc474983c5f91a450505050565b610c11610dd5565b606580546001600160a01b0383166001600160a01b03199091168117909155610c426033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080610c86836110ae565b6001600160a01b03808216600090815260c9602052604090205491925016610ce25760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b6044820152606401610466565b6001600160a01b038116600090815260ca602052604081205490819003610d4b5760405162461bcd60e51b815260206004820152601b60248201527f54574150207072696365206d75737420626520706f73697469766500000000006044820152606401610466565b816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dad9190611b85565b610db8906012611cb1565b610dc390600a611ca2565b610dcd9082611cd4565b949350505050565b6033546001600160a01b031633146104ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b6001600160a01b038116610e935760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b6064820152608401610466565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091016108d6565b6000806000610efa61152d565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611cf3565b9250836001600160a01b0316635a3d54936040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc29190611cf3565b91506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190611d23565b9250925092508363ffffffff168163ffffffff161461108b5780840363ffffffff81166110588486611543565b516001600160e01b031602969096019563ffffffff81166110798585611543565b516001600160e01b0316029590950194505b5050509193909250565b606580546001600160a01b0319169055610422816115f5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361111057507f0000000000000000000000000000000000000000000000000000000000000000919050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361117057507f0000000000000000000000000000000000000000000000000000000000000000919050565b816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d29190611d73565b90505b919050565b6000806000806111e985611647565b92509250925080420361121857505091516001600160a01b0316600090815260ca602052604090205492915050565b804210156112685760405162461bcd60e51b815260206004820152601a60248201527f6e6f77206d75737420636f6d65206166746572206265666f72650000000000006044820152606401610466565b60008142039050600060405180602001604052808386886112899190611d90565b6112939190611dbd565b6001600160e01b03169052905060006112ab826118ae565b9050600088606001516112c657670de0b6b3a76400006112d0565b670de0b6b3a76400005b90506000818a60200151846112e59190611cd4565b6112ef9190611dbd565b905089606001511561139c576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016600090815260ca60205260408120549081900361137b5760405162461bcd60e51b8152602060048201526014602482015273189b98881c1c9a58d9481a5cc81a5b9d985b1a5960621b6044820152606401610466565b670de0b6b3a764000061138e8284611cd4565b6113989190611dbd565b9150505b806000036113e55760405162461bcd60e51b81526020600482015260166024820152750747761702070726963652063616e6e6f7420626520360541b6044820152606401610466565b89516040805183815260208101899052428183015290516001600160a01b03909216917f7d881580fb2bb7844e8ecf8df26510247c4bbea2735d40bf0d9ac33c0d9acd819181900360600190a298516001600160a01b0316600090815260ca602052604090208990555096979650505050505050565b600054610100900460ff166114825760405162461bcd60e51b815260040161046690611dd1565b61148a6118ce565b610422816118fd565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab906114c69033908690600401611e69565b602060405180830381865afa1580156114e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115079190611e8d565b9050806108df57333083604051634a3fa29360e01b815260040161046693929190611eaa565b600061153e64010000000042611edf565b905090565b6040805160208101909152600081526000826001600160701b0316116115ab5760405162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f0000000000000000006044820152606401610466565b6040805160208101909152806115e16001600160701b0385166dffffffffffffffffffffffffffff60701b607088901b16611ef3565b6001600160e01b0316905290505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600080611656856104ab565b60a0860151909150429060009061166d9083611d90565b87516001600160a01b0316600090815260cb6020908152604080832080548251818502810185019093528083529495509293909291849084015b828210156116ed578382906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050815260200190600101906116a7565b505082518b516001600160a01b0316600090815260cc6020526040902054939450929150505b81811015611801578383828151811061172e5761172e611b6f565b602002602001015160000151101580611750575061174d600183611d90565b81145b156117b85782818151811061176757611767611b6f565b602002602001015160200151975082818151811061178757611787611b6f565b602090810291909101810151518b516001600160a01b0316600090815260cc90925260409091208290559650611801565b89516001600160a01b0316600090815260cb602052604090208054829081106117e3576117e3611b6f565b60009182526020822060029091020181815560010155600101611713565b5088516001600160a01b03908116600090815260cb60209081526040808320815180830183528981528084018b81528254600180820185559387529585902091516002909602909101948555519301929092558b5182518a81529182018b90524292820192909252606081018890529116907f87208a84ec7402c933c70c261e53b733a9f1c893d73e941a152435d58177a2649060800160405180910390a2509295505050509193909250565b80516000906111d2906612725dd1d243ab906001600160e01b0316611dbd565b600054610100900460ff166118f55760405162461bcd60e51b815260040161046690611dd1565b6104ec611924565b600054610100900460ff166104195760405162461bcd60e51b815260040161046690611dd1565b600054610100900460ff1661194b5760405162461bcd60e51b815260040161046690611dd1565b6104ec33611095565b6001600160a01b038116811461042257600080fd5b6000806040838503121561197c57600080fd5b823561198781611954565b946020939093013593505050565b6000602082840312156119a757600080fd5b813561075181611954565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156119f1576119f16119b2565b604052919050565b801515811461042257600080fd5b600060c08284031215611a1957600080fd5b60405160c0810181811067ffffffffffffffff82111715611a3c57611a3c6119b2565b6040529050808235611a4d81611954565b8152602083810135908201526040830135611a6781611954565b60408201526060830135611a7a816119f9565b60608201526080830135611a8d816119f9565b608082015260a092830135920191909152919050565b60006020808385031215611ab657600080fd5b823567ffffffffffffffff80821115611ace57600080fd5b818501915085601f830112611ae257600080fd5b813581811115611af457611af46119b2565b611b02848260051b016119c8565b818152848101925060c0918202840185019188831115611b2157600080fd5b938501935b82851015611b4757611b388986611a07565b84529384019392850192611b26565b50979650505050505050565b600060c08284031215611b6557600080fd5b6107518383611a07565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611b9757600080fd5b815160ff8116811461075157600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611bf9578160001904821115611bdf57611bdf611ba8565b80851615611bec57918102915b93841c9390800290611bc3565b509250929050565b600082611c10575060016115ef565b81611c1d575060006115ef565b8160018114611c335760028114611c3d57611c59565b60019150506115ef565b60ff841115611c4e57611c4e611ba8565b50506001821b6115ef565b5060208310610133831016604e8410600b8410161715611c7c575081810a6115ef565b611c868383611bbe565b8060001904821115611c9a57611c9a611ba8565b029392505050565b600061075160ff841683611c01565b600060ff821660ff841680821015611ccb57611ccb611ba8565b90039392505050565b6000816000190483118215151615611cee57611cee611ba8565b500290565b600060208284031215611d0557600080fd5b5051919050565b80516001600160701b03811681146111d557600080fd5b600080600060608486031215611d3857600080fd5b611d4184611d0c565b9250611d4f60208501611d0c565b9150604084015163ffffffff81168114611d6857600080fd5b809150509250925092565b600060208284031215611d8557600080fd5b815161075181611954565b600082821015611da257611da2611ba8565b500390565b634e487b7160e01b600052601260045260246000fd5b600082611dcc57611dcc611da7565b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000815180845260005b81811015611e4257602081850181015186830182015201611e26565b81811115611e54576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090610dcd90830184611e1c565b600060208284031215611e9f57600080fd5b8151610751816119f9565b6001600160a01b03848116825283166020820152606060408201819052600090611ed690830184611e1c565b95945050505050565b600082611eee57611eee611da7565b500690565b60006001600160e01b0383811680611f0d57611f0d611da7565b9216919091049291505056fea2646970667358221220822f4f52e46661c73eda90cf732d8be4a901c69712c3f13bb4702f1bf5d18dd964736f6c634300080d003363616e2774206265207a65726f20616464726573730000000000000000000000",
|
|
693
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638da5cb5b116100b8578063cbf679191161007c578063cbf679191461036b578063cfed246b1461037e578063e24343ff14610257578063e30c39781461039e578063f2fde38b146103af578063fc57d4df146103c257600080fd5b80638da5cb5b146102e85780638dd95002146102f9578063b4a0bdf314610320578063b62e4c9214610331578063c4d66de81461035857600080fd5b80633125d3c81161010a5780633125d3c8146102575780633334ecc5146102665780635ba3792d14610286578063715018a6146102c5578063725068a5146102cd57806379ba5097146102e057600080fd5b806302459966146101475780630e32cb86146101745780631b69dc5f14610189578063234a3446146102235780632b9d9dea14610236575b600080fd5b61015a610155366004611969565b6103d5565b604080519283526020830191909152015b60405180910390f35b610187610182366004611995565b610411565b005b6101e1610197366004611995565b60c96020526000908152604090208054600182015460028301546003909301546001600160a01b0392831693919282169160ff600160a01b8204811692600160a81b909204169086565b604080516001600160a01b03978816815260208101969096529390951692840192909252151560608301521515608082015260a081019190915260c00161016b565b610187610231366004611aa3565b610425565b610249610244366004611b53565b6104ab565b60405190815260200161016b565b610249670de0b6b3a764000081565b610249610274366004611995565b60cc6020526000908152604090205481565b6102ad7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161016b565b6101876104da565b6102496102db366004611995565b6104ee565b610187610758565b6033546001600160a01b03166102ad565b6102ad7f000000000000000000000000000000000000000000000000000000000000000081565b6097546001600160a01b03166102ad565b6102ad7f000000000000000000000000000000000000000000000000000000000000000081565b610187610366366004611995565b6107cf565b610187610379366004611b53565b6108e3565b61024961038c366004611995565b60ca6020526000908152604090205481565b6065546001600160a01b03166102ad565b6101876103bd366004611995565b610c09565b6102496103d0366004611995565b610c7a565b60cb60205281600052604060002081815481106103f157600080fd5b600091825260209091206002909102018054600190910154909250905082565b610419610dd5565b61042281610e2f565b50565b805160000361046f5760405162461bcd60e51b815260206004820152601160248201527006c656e6774682063616e2774206265203607c1b60448201526064015b60405180910390fd5b805160005b818110156104a65761049e83828151811061049157610491611b6f565b60200260200101516108e3565b600101610474565b505050565b60008060006104bd8460400151610eed565b50915091508360800151156104d3579392505050565b5092915050565b6104e2610dd5565b6104ec6000611095565b565b6000806104fa836110ae565b6001600160a01b03808216600090815260c96020526040902054919250166105565760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b6044820152606401610466565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316141580156105ba57506001600160a01b038116600090815260c96020526040902060020154600160a01b900460ff165b156106d5576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020526040902054166106375760405162461bcd60e51b815260206004820152600e60248201526d15d09390881b9bdd08195e1a5cdd60921b6044820152606401610466565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a08201526106d3906111da565b505b6001600160a01b03808216600090815260c96020908152604091829020825160c08101845281548516815260018201549281019290925260028101549384169282019290925260ff600160a01b8404811615156060830152600160a81b909304909216151560808301526003015460a0820152610751906111da565b9392505050565b60655433906001600160a01b031681146107c65760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610466565b61042281611095565b600054610100900460ff16158080156107ef5750600054600160ff909116105b806108095750303b158015610809575060005460ff166001145b61086c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610466565b6000805460ff19166001179055801561088f576000805461ff0019166101001790555b6108988261145b565b80156108df576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b5050565b80516001600160a01b0381166109335760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b6044820152606401610466565b60408201516001600160a01b0381166109865760405162461bcd60e51b815260206004820152601560248201527463616e2774206265207a65726f206164647265737360581b6044820152606401610466565b6109c46040518060400160405280601b81526020017f736574546f6b656e436f6e66696728546f6b656e436f6e666967290000000000815250611493565b8260a00151600003610a185760405162461bcd60e51b815260206004820152601e60248201527f616e63686f7220706572696f64206d75737420626520706f73697469766500006044820152606401610466565b82600001516001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190611b85565b610a8990600a611ca2565b836020015114610af55760405162461bcd60e51b815260206004820152603160248201527f6261736520756e697420646563696d616c73206d7573742062652073616d6520604482015270617320617373657420646563696d616c7360781b6064820152608401610466565b6000610b00846104ab565b84516001600160a01b03908116600090815260cb6020908152604080832081518083018352428152808401878152825460018181018555938752858720925160029182029093019283559051918301919091558a518616855260c984528285208b5181549088166001600160a01b031990911681178255948c015192810192909255828b0151908201805460608d015160808e01511515600160a81b0260ff60a81b19911515600160a01b026001600160a81b03199093169490991693841791909117169690961790955560a08a0151600390910181905590519495509390917f3cc8d9cb9370a23a8b9ffa75efa24cecb65c4693980e58260841adc474983c5f91a450505050565b610c11610dd5565b606580546001600160a01b0383166001600160a01b03199091168117909155610c426033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080610c86836110ae565b6001600160a01b03808216600090815260c9602052604090205491925016610ce25760405162461bcd60e51b815260206004820152600f60248201526e185cdcd95d081b9bdd08195e1a5cdd608a1b6044820152606401610466565b6001600160a01b038116600090815260ca602052604081205490819003610d4b5760405162461bcd60e51b815260206004820152601b60248201527f54574150207072696365206d75737420626520706f73697469766500000000006044820152606401610466565b816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dad9190611b85565b610db8906012611cb1565b610dc390600a611ca2565b610dcd9082611cd4565b949350505050565b6033546001600160a01b031633146104ec5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b6001600160a01b038116610e935760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e61676572206164604482015264647265737360d81b6064820152608401610466565b609780546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091016108d6565b6000806000610efa61152d565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5e9190611cf3565b9250836001600160a01b0316635a3d54936040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc29190611cf3565b91506000806000866001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190611d23565b9250925092508363ffffffff168163ffffffff161461108b5780840363ffffffff81166110588486611543565b516001600160e01b031602969096019563ffffffff81166110798585611543565b516001600160e01b0316029590950194505b5050509193909250565b606580546001600160a01b0319169055610422816115f5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361111057507f0000000000000000000000000000000000000000000000000000000000000000919050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03160361117057507f0000000000000000000000000000000000000000000000000000000000000000919050565b816001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d29190611d73565b90505b919050565b6000806000806111e985611647565b92509250925080420361121857505091516001600160a01b0316600090815260ca602052604090205492915050565b804210156112685760405162461bcd60e51b815260206004820152601a60248201527f6e6f77206d75737420636f6d65206166746572206265666f72650000000000006044820152606401610466565b60008142039050600060405180602001604052808386886112899190611d90565b6112939190611dbd565b6001600160e01b03169052905060006112ab826118ae565b9050600088606001516112c657670de0b6b3a76400006112d0565b670de0b6b3a76400005b90506000818a60200151846112e59190611cd4565b6112ef9190611dbd565b905089606001511561139c576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016600090815260ca60205260408120549081900361137b5760405162461bcd60e51b8152602060048201526014602482015273189b98881c1c9a58d9481a5cc81a5b9d985b1a5960621b6044820152606401610466565b670de0b6b3a764000061138e8284611cd4565b6113989190611dbd565b9150505b806000036113e55760405162461bcd60e51b81526020600482015260166024820152750747761702070726963652063616e6e6f7420626520360541b6044820152606401610466565b89516040805183815260208101899052428183015290516001600160a01b03909216917f7d881580fb2bb7844e8ecf8df26510247c4bbea2735d40bf0d9ac33c0d9acd819181900360600190a298516001600160a01b0316600090815260ca602052604090208990555096979650505050505050565b600054610100900460ff166114825760405162461bcd60e51b815260040161046690611dd1565b61148a6118ce565b610422816118fd565b6097546040516318c5e8ab60e01b81526000916001600160a01b0316906318c5e8ab906114c69033908690600401611e69565b602060405180830381865afa1580156114e3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115079190611e8d565b9050806108df57333083604051634a3fa29360e01b815260040161046693929190611eaa565b600061153e64010000000042611edf565b905090565b6040805160208101909152600081526000826001600160701b0316116115ab5760405162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f0000000000000000006044820152606401610466565b6040805160208101909152806115e16001600160701b0385166dffffffffffffffffffffffffffff60701b607088901b16611ef3565b6001600160e01b0316905290505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600080611656856104ab565b60a0860151909150429060009061166d9083611d90565b87516001600160a01b0316600090815260cb6020908152604080832080548251818502810185019093528083529495509293909291849084015b828210156116ed578382906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050815260200190600101906116a7565b505082518b516001600160a01b0316600090815260cc6020526040902054939450929150505b81811015611801578383828151811061172e5761172e611b6f565b602002602001015160000151101580611750575061174d600183611d90565b81145b156117b85782818151811061176757611767611b6f565b602002602001015160200151975082818151811061178757611787611b6f565b602090810291909101810151518b516001600160a01b0316600090815260cc90925260409091208290559650611801565b89516001600160a01b0316600090815260cb602052604090208054829081106117e3576117e3611b6f565b60009182526020822060029091020181815560010155600101611713565b5088516001600160a01b03908116600090815260cb60209081526040808320815180830183528981528084018b81528254600180820185559387529585902091516002909602909101948555519301929092558b5182518a81529182018b90524292820192909252606081018890529116907f87208a84ec7402c933c70c261e53b733a9f1c893d73e941a152435d58177a2649060800160405180910390a2509295505050509193909250565b80516000906111d2906612725dd1d243ab906001600160e01b0316611dbd565b600054610100900460ff166118f55760405162461bcd60e51b815260040161046690611dd1565b6104ec611924565b600054610100900460ff166104195760405162461bcd60e51b815260040161046690611dd1565b600054610100900460ff1661194b5760405162461bcd60e51b815260040161046690611dd1565b6104ec33611095565b6001600160a01b038116811461042257600080fd5b6000806040838503121561197c57600080fd5b823561198781611954565b946020939093013593505050565b6000602082840312156119a757600080fd5b813561075181611954565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156119f1576119f16119b2565b604052919050565b801515811461042257600080fd5b600060c08284031215611a1957600080fd5b60405160c0810181811067ffffffffffffffff82111715611a3c57611a3c6119b2565b6040529050808235611a4d81611954565b8152602083810135908201526040830135611a6781611954565b60408201526060830135611a7a816119f9565b60608201526080830135611a8d816119f9565b608082015260a092830135920191909152919050565b60006020808385031215611ab657600080fd5b823567ffffffffffffffff80821115611ace57600080fd5b818501915085601f830112611ae257600080fd5b813581811115611af457611af46119b2565b611b02848260051b016119c8565b818152848101925060c0918202840185019188831115611b2157600080fd5b938501935b82851015611b4757611b388986611a07565b84529384019392850192611b26565b50979650505050505050565b600060c08284031215611b6557600080fd5b6107518383611a07565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611b9757600080fd5b815160ff8116811461075157600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611bf9578160001904821115611bdf57611bdf611ba8565b80851615611bec57918102915b93841c9390800290611bc3565b509250929050565b600082611c10575060016115ef565b81611c1d575060006115ef565b8160018114611c335760028114611c3d57611c59565b60019150506115ef565b60ff841115611c4e57611c4e611ba8565b50506001821b6115ef565b5060208310610133831016604e8410600b8410161715611c7c575081810a6115ef565b611c868383611bbe565b8060001904821115611c9a57611c9a611ba8565b029392505050565b600061075160ff841683611c01565b600060ff821660ff841680821015611ccb57611ccb611ba8565b90039392505050565b6000816000190483118215151615611cee57611cee611ba8565b500290565b600060208284031215611d0557600080fd5b5051919050565b80516001600160701b03811681146111d557600080fd5b600080600060608486031215611d3857600080fd5b611d4184611d0c565b9250611d4f60208501611d0c565b9150604084015163ffffffff81168114611d6857600080fd5b809150509250925092565b600060208284031215611d8557600080fd5b815161075181611954565b600082821015611da257611da2611ba8565b500390565b634e487b7160e01b600052601260045260246000fd5b600082611dcc57611dcc611da7565b500490565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000815180845260005b81811015611e4257602081850181015186830182015201611e26565b81811115611e54576000602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0383168152604060208201819052600090610dcd90830184611e1c565b600060208284031215611e9f57600080fd5b8151610751816119f9565b6001600160a01b03848116825283166020820152606060408201819052600090611ed690830184611e1c565b95945050505050565b600082611eee57611eee611da7565b500690565b60006001600160e01b0383811680611f0d57611f0d611da7565b9216919091049291505056fea2646970667358221220822f4f52e46661c73eda90cf732d8be4a901c69712c3f13bb4702f1bf5d18dd964736f6c634300080d0033",
|
|
707
694
|
"devdoc": {
|
|
708
695
|
"kind": "dev",
|
|
709
696
|
"methods": {
|
|
@@ -815,15 +802,15 @@
|
|
|
815
802
|
},
|
|
816
803
|
"kind": "user",
|
|
817
804
|
"methods": {
|
|
805
|
+
"BNB_BASE_UNIT()": {
|
|
806
|
+
"notice": "the base unit of WBNB and BUSD, which are the paired tokens for all assets"
|
|
807
|
+
},
|
|
818
808
|
"WBNB()": {
|
|
819
809
|
"notice": "WBNB address"
|
|
820
810
|
},
|
|
821
811
|
"accessControlManager()": {
|
|
822
812
|
"notice": "Returns the address of the access control manager contract"
|
|
823
813
|
},
|
|
824
|
-
"bnbBaseUnit()": {
|
|
825
|
-
"notice": "the base unit of WBNB and BUSD, which are the paired tokens for all assets"
|
|
826
|
-
},
|
|
827
814
|
"constructor": {
|
|
828
815
|
"notice": "Constructor for the implementation contract. Sets immutable variables."
|
|
829
816
|
},
|
|
@@ -872,7 +859,7 @@
|
|
|
872
859
|
"storageLayout": {
|
|
873
860
|
"storage": [
|
|
874
861
|
{
|
|
875
|
-
"astId":
|
|
862
|
+
"astId": 290,
|
|
876
863
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
877
864
|
"label": "_initialized",
|
|
878
865
|
"offset": 0,
|
|
@@ -880,7 +867,7 @@
|
|
|
880
867
|
"type": "t_uint8"
|
|
881
868
|
},
|
|
882
869
|
{
|
|
883
|
-
"astId":
|
|
870
|
+
"astId": 293,
|
|
884
871
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
885
872
|
"label": "_initializing",
|
|
886
873
|
"offset": 1,
|
|
@@ -888,7 +875,7 @@
|
|
|
888
875
|
"type": "t_bool"
|
|
889
876
|
},
|
|
890
877
|
{
|
|
891
|
-
"astId":
|
|
878
|
+
"astId": 904,
|
|
892
879
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
893
880
|
"label": "__gap",
|
|
894
881
|
"offset": 0,
|
|
@@ -896,7 +883,7 @@
|
|
|
896
883
|
"type": "t_array(t_uint256)50_storage"
|
|
897
884
|
},
|
|
898
885
|
{
|
|
899
|
-
"astId":
|
|
886
|
+
"astId": 162,
|
|
900
887
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
901
888
|
"label": "_owner",
|
|
902
889
|
"offset": 0,
|
|
@@ -904,7 +891,7 @@
|
|
|
904
891
|
"type": "t_address"
|
|
905
892
|
},
|
|
906
893
|
{
|
|
907
|
-
"astId":
|
|
894
|
+
"astId": 282,
|
|
908
895
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
909
896
|
"label": "__gap",
|
|
910
897
|
"offset": 0,
|
|
@@ -912,7 +899,7 @@
|
|
|
912
899
|
"type": "t_array(t_uint256)49_storage"
|
|
913
900
|
},
|
|
914
901
|
{
|
|
915
|
-
"astId":
|
|
902
|
+
"astId": 71,
|
|
916
903
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
917
904
|
"label": "_pendingOwner",
|
|
918
905
|
"offset": 0,
|
|
@@ -920,7 +907,7 @@
|
|
|
920
907
|
"type": "t_address"
|
|
921
908
|
},
|
|
922
909
|
{
|
|
923
|
-
"astId":
|
|
910
|
+
"astId": 150,
|
|
924
911
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
925
912
|
"label": "__gap",
|
|
926
913
|
"offset": 0,
|
|
@@ -928,15 +915,15 @@
|
|
|
928
915
|
"type": "t_array(t_uint256)49_storage"
|
|
929
916
|
},
|
|
930
917
|
{
|
|
931
|
-
"astId":
|
|
918
|
+
"astId": 2741,
|
|
932
919
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
933
920
|
"label": "_accessControlManager",
|
|
934
921
|
"offset": 0,
|
|
935
922
|
"slot": "151",
|
|
936
|
-
"type": "t_contract(
|
|
923
|
+
"type": "t_contract(IAccessControlManagerV8)2925"
|
|
937
924
|
},
|
|
938
925
|
{
|
|
939
|
-
"astId":
|
|
926
|
+
"astId": 2746,
|
|
940
927
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
941
928
|
"label": "__gap",
|
|
942
929
|
"offset": 0,
|
|
@@ -944,15 +931,15 @@
|
|
|
944
931
|
"type": "t_array(t_uint256)49_storage"
|
|
945
932
|
},
|
|
946
933
|
{
|
|
947
|
-
"astId":
|
|
934
|
+
"astId": 6159,
|
|
948
935
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
949
936
|
"label": "tokenConfigs",
|
|
950
937
|
"offset": 0,
|
|
951
938
|
"slot": "201",
|
|
952
|
-
"type": "t_mapping(t_address,t_struct(TokenConfig)
|
|
939
|
+
"type": "t_mapping(t_address,t_struct(TokenConfig)6137_storage)"
|
|
953
940
|
},
|
|
954
941
|
{
|
|
955
|
-
"astId":
|
|
942
|
+
"astId": 6164,
|
|
956
943
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
957
944
|
"label": "prices",
|
|
958
945
|
"offset": 0,
|
|
@@ -960,15 +947,15 @@
|
|
|
960
947
|
"type": "t_mapping(t_address,t_uint256)"
|
|
961
948
|
},
|
|
962
949
|
{
|
|
963
|
-
"astId":
|
|
950
|
+
"astId": 6171,
|
|
964
951
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
965
952
|
"label": "observations",
|
|
966
953
|
"offset": 0,
|
|
967
954
|
"slot": "203",
|
|
968
|
-
"type": "t_mapping(t_address,t_array(t_struct(Observation)
|
|
955
|
+
"type": "t_mapping(t_address,t_array(t_struct(Observation)6118_storage)dyn_storage)"
|
|
969
956
|
},
|
|
970
957
|
{
|
|
971
|
-
"astId":
|
|
958
|
+
"astId": 6176,
|
|
972
959
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
973
960
|
"label": "windowStart",
|
|
974
961
|
"offset": 0,
|
|
@@ -982,10 +969,10 @@
|
|
|
982
969
|
"label": "address",
|
|
983
970
|
"numberOfBytes": "20"
|
|
984
971
|
},
|
|
985
|
-
"t_array(t_struct(Observation)
|
|
986
|
-
"base": "t_struct(Observation)
|
|
972
|
+
"t_array(t_struct(Observation)6118_storage)dyn_storage": {
|
|
973
|
+
"base": "t_struct(Observation)6118_storage",
|
|
987
974
|
"encoding": "dynamic_array",
|
|
988
|
-
"label": "struct Observation[]",
|
|
975
|
+
"label": "struct TwapOracle.Observation[]",
|
|
989
976
|
"numberOfBytes": "32"
|
|
990
977
|
},
|
|
991
978
|
"t_array(t_uint256)49_storage": {
|
|
@@ -1005,24 +992,24 @@
|
|
|
1005
992
|
"label": "bool",
|
|
1006
993
|
"numberOfBytes": "1"
|
|
1007
994
|
},
|
|
1008
|
-
"t_contract(
|
|
995
|
+
"t_contract(IAccessControlManagerV8)2925": {
|
|
1009
996
|
"encoding": "inplace",
|
|
1010
|
-
"label": "contract
|
|
997
|
+
"label": "contract IAccessControlManagerV8",
|
|
1011
998
|
"numberOfBytes": "20"
|
|
1012
999
|
},
|
|
1013
|
-
"t_mapping(t_address,t_array(t_struct(Observation)
|
|
1000
|
+
"t_mapping(t_address,t_array(t_struct(Observation)6118_storage)dyn_storage)": {
|
|
1014
1001
|
"encoding": "mapping",
|
|
1015
1002
|
"key": "t_address",
|
|
1016
|
-
"label": "mapping(address => struct Observation[])",
|
|
1003
|
+
"label": "mapping(address => struct TwapOracle.Observation[])",
|
|
1017
1004
|
"numberOfBytes": "32",
|
|
1018
|
-
"value": "t_array(t_struct(Observation)
|
|
1005
|
+
"value": "t_array(t_struct(Observation)6118_storage)dyn_storage"
|
|
1019
1006
|
},
|
|
1020
|
-
"t_mapping(t_address,t_struct(TokenConfig)
|
|
1007
|
+
"t_mapping(t_address,t_struct(TokenConfig)6137_storage)": {
|
|
1021
1008
|
"encoding": "mapping",
|
|
1022
1009
|
"key": "t_address",
|
|
1023
|
-
"label": "mapping(address => struct TokenConfig)",
|
|
1010
|
+
"label": "mapping(address => struct TwapOracle.TokenConfig)",
|
|
1024
1011
|
"numberOfBytes": "32",
|
|
1025
|
-
"value": "t_struct(TokenConfig)
|
|
1012
|
+
"value": "t_struct(TokenConfig)6137_storage"
|
|
1026
1013
|
},
|
|
1027
1014
|
"t_mapping(t_address,t_uint256)": {
|
|
1028
1015
|
"encoding": "mapping",
|
|
@@ -1031,12 +1018,12 @@
|
|
|
1031
1018
|
"numberOfBytes": "32",
|
|
1032
1019
|
"value": "t_uint256"
|
|
1033
1020
|
},
|
|
1034
|
-
"t_struct(Observation)
|
|
1021
|
+
"t_struct(Observation)6118_storage": {
|
|
1035
1022
|
"encoding": "inplace",
|
|
1036
|
-
"label": "struct Observation",
|
|
1023
|
+
"label": "struct TwapOracle.Observation",
|
|
1037
1024
|
"members": [
|
|
1038
1025
|
{
|
|
1039
|
-
"astId":
|
|
1026
|
+
"astId": 6115,
|
|
1040
1027
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1041
1028
|
"label": "timestamp",
|
|
1042
1029
|
"offset": 0,
|
|
@@ -1044,7 +1031,7 @@
|
|
|
1044
1031
|
"type": "t_uint256"
|
|
1045
1032
|
},
|
|
1046
1033
|
{
|
|
1047
|
-
"astId":
|
|
1034
|
+
"astId": 6117,
|
|
1048
1035
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1049
1036
|
"label": "acc",
|
|
1050
1037
|
"offset": 0,
|
|
@@ -1054,12 +1041,12 @@
|
|
|
1054
1041
|
],
|
|
1055
1042
|
"numberOfBytes": "64"
|
|
1056
1043
|
},
|
|
1057
|
-
"t_struct(TokenConfig)
|
|
1044
|
+
"t_struct(TokenConfig)6137_storage": {
|
|
1058
1045
|
"encoding": "inplace",
|
|
1059
|
-
"label": "struct TokenConfig",
|
|
1046
|
+
"label": "struct TwapOracle.TokenConfig",
|
|
1060
1047
|
"members": [
|
|
1061
1048
|
{
|
|
1062
|
-
"astId":
|
|
1049
|
+
"astId": 6121,
|
|
1063
1050
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1064
1051
|
"label": "asset",
|
|
1065
1052
|
"offset": 0,
|
|
@@ -1067,7 +1054,7 @@
|
|
|
1067
1054
|
"type": "t_address"
|
|
1068
1055
|
},
|
|
1069
1056
|
{
|
|
1070
|
-
"astId":
|
|
1057
|
+
"astId": 6124,
|
|
1071
1058
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1072
1059
|
"label": "baseUnit",
|
|
1073
1060
|
"offset": 0,
|
|
@@ -1075,7 +1062,7 @@
|
|
|
1075
1062
|
"type": "t_uint256"
|
|
1076
1063
|
},
|
|
1077
1064
|
{
|
|
1078
|
-
"astId":
|
|
1065
|
+
"astId": 6127,
|
|
1079
1066
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1080
1067
|
"label": "pancakePool",
|
|
1081
1068
|
"offset": 0,
|
|
@@ -1083,7 +1070,7 @@
|
|
|
1083
1070
|
"type": "t_address"
|
|
1084
1071
|
},
|
|
1085
1072
|
{
|
|
1086
|
-
"astId":
|
|
1073
|
+
"astId": 6130,
|
|
1087
1074
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1088
1075
|
"label": "isBnbBased",
|
|
1089
1076
|
"offset": 20,
|
|
@@ -1091,7 +1078,7 @@
|
|
|
1091
1078
|
"type": "t_bool"
|
|
1092
1079
|
},
|
|
1093
1080
|
{
|
|
1094
|
-
"astId":
|
|
1081
|
+
"astId": 6133,
|
|
1095
1082
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1096
1083
|
"label": "isReversedPool",
|
|
1097
1084
|
"offset": 21,
|
|
@@ -1099,7 +1086,7 @@
|
|
|
1099
1086
|
"type": "t_bool"
|
|
1100
1087
|
},
|
|
1101
1088
|
{
|
|
1102
|
-
"astId":
|
|
1089
|
+
"astId": 6136,
|
|
1103
1090
|
"contract": "contracts/oracles/TwapOracle.sol:TwapOracle",
|
|
1104
1091
|
"label": "anchorPeriod",
|
|
1105
1092
|
"offset": 0,
|