@venusprotocol/oracle 1.4.0 → 1.5.0

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.
Files changed (118) hide show
  1. package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.dbg.json +4 -0
  2. package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.json +138 -0
  3. package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.dbg.json +4 -0
  4. package/artifacts/{contracts → @chainlink/contracts/src/v0.8}/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.json +2 -2
  5. package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.dbg.json +4 -0
  6. package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.json +122 -0
  7. package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
  8. package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +2 -2
  9. package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
  10. package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
  11. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  12. package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +1 -1
  13. package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +2 -2
  14. package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.dbg.json +1 -1
  15. package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +1 -1
  16. package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +2 -2
  17. package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  18. package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  19. package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
  20. package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  21. package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +2 -2
  22. package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  23. package/artifacts/build-info/96c10bfc915caedc90a237abc802c96d.json +1 -0
  24. package/artifacts/contracts/PriceOracle.sol/PriceOracle.dbg.json +1 -1
  25. package/artifacts/contracts/PriceOracle.sol/PriceOracle.json +0 -13
  26. package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +1 -1
  27. package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json +33 -9
  28. package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +1 -1
  29. package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +1 -1
  30. package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +1 -1
  31. package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +1 -1
  32. package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.dbg.json +1 -1
  33. package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +1 -1
  34. package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +1 -1
  35. package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +1 -1
  36. package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +2 -2
  37. package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +1 -1
  38. package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.json +4 -17
  39. package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.dbg.json +1 -1
  40. package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.json +2 -2
  41. package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.dbg.json +1 -1
  42. package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.dbg.json +1 -1
  43. package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.json +2 -2
  44. package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +1 -1
  45. package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.json +26 -2
  46. package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +1 -1
  47. package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.json +39 -2
  48. package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +1 -1
  49. package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.json +39 -2
  50. package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +1 -1
  51. package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +39 -2
  52. package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.dbg.json +1 -1
  53. package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.json +53 -30
  54. package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.dbg.json +1 -1
  55. package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.json +2 -2
  56. package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +1 -1
  57. package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +2 -2
  58. package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.dbg.json +1 -1
  59. package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.json +2 -2
  60. package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +1 -1
  61. package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.json +2 -2
  62. package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.dbg.json +1 -1
  63. package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.json +2 -2
  64. package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.dbg.json +1 -1
  65. package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.json +2 -2
  66. package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +1 -1
  67. package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +2 -2
  68. package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.dbg.json +1 -1
  69. package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.json +2 -2
  70. package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.dbg.json +1 -1
  71. package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.json +2 -2
  72. package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.dbg.json +1 -1
  73. package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.json +3 -3
  74. package/artifacts/contracts/test/PancakePairHarness.sol/Math.dbg.json +1 -1
  75. package/artifacts/contracts/test/PancakePairHarness.sol/Math.json +2 -2
  76. package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.dbg.json +1 -1
  77. package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.json +2 -2
  78. package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.dbg.json +1 -1
  79. package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.json +2 -2
  80. package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.dbg.json +1 -1
  81. package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.json +2 -2
  82. package/contracts/PriceOracle.sol +4 -4
  83. package/contracts/ResilientOracle.sol +140 -92
  84. package/contracts/interfaces/FeedRegistryInterface.sol +7 -10
  85. package/contracts/interfaces/OracleInterface.sol +2 -3
  86. package/contracts/interfaces/PythInterface.sol +10 -13
  87. package/contracts/interfaces/VBep20Interface.sol +4 -4
  88. package/contracts/libraries/PancakeLibrary.sol +7 -20
  89. package/contracts/oracles/BinanceOracle.sol +37 -6
  90. package/contracts/oracles/BoundValidator.sol +33 -11
  91. package/contracts/oracles/ChainlinkOracle.sol +78 -44
  92. package/contracts/oracles/PythOracle.sol +51 -17
  93. package/contracts/oracles/TwapOracle.sol +113 -67
  94. package/contracts/oracles/mocks/MockBinanceFeedRegistry.sol +7 -10
  95. package/contracts/oracles/mocks/MockBinanceOracle.sol +1 -1
  96. package/contracts/oracles/mocks/MockChainlinkOracle.sol +3 -2
  97. package/contracts/oracles/mocks/MockPythOracle.sol +3 -2
  98. package/contracts/oracles/mocks/MockTwapOracle.sol +1 -1
  99. package/contracts/test/BEP20Harness.sol +3 -8
  100. package/contracts/test/MockPyth.sol +2 -2
  101. package/contracts/test/MockSimpleOracle.sol +2 -2
  102. package/contracts/test/MockV3Aggregator.sol +9 -24
  103. package/contracts/test/PancakePairHarness.sol +7 -20
  104. package/contracts/test/VBEP20Harness.sol +2 -3
  105. package/deploy/2-configure-feeds.d.ts.map +1 -1
  106. package/deploy/2-configure-feeds.js +63 -28
  107. package/deploy/2-configure-feeds.js.map +1 -1
  108. package/package.json +10 -5
  109. package/artifacts/build-info/2fde13baf96aae3a4a0595eaa19cc540.json +0 -1
  110. package/artifacts/build-info/442613ba0e31d357bb61ad07d3e9ccb5.json +0 -1
  111. package/artifacts/build-info/4d2af5803ee95a57ec9aace7ed32201c.json +0 -1
  112. package/artifacts/build-info/99d7aae43e9eacb55ec69b3cd6d3a70b.json +0 -1
  113. package/artifacts/build-info/e79aa95060bbee82bc36063535db4019.json +0 -1
  114. package/artifacts/contracts/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.dbg.json +0 -4
  115. package/artifacts/contracts/interfaces/BEP20Interface.sol/BEP20Interface.dbg.json +0 -4
  116. package/artifacts/contracts/interfaces/BEP20Interface.sol/BEP20Interface.json +0 -246
  117. package/contracts/interfaces/AggregatorV2V3Interface.sol +0 -60
  118. package/contracts/interfaces/BEP20Interface.sol +0 -97
@@ -1 +1 @@
1
- {"version":3,"file":"2-configure-feeds.js","sourceRoot":"","sources":["../../deploy/2-configure-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAAmC;AACnC,sDAA0B;AAiB1B,MAAM,MAAM,GAAW;IACrB,UAAU,EAAE;QACV,GAAG,EAAE,oEAAoE;QACzE,GAAG,EAAE,oEAAoE;KAC1E;CACF,CAAC;AAEF,MAAM,aAAa,GAAW;IAC5B,UAAU,EAAE;QACV,GAAG,EAAE,4CAA4C;KAClD;CACF,CAAC;AAEF,MAAM,MAAM,GAAW;IACrB,UAAU,EAAE;QACV,GAAG,EAAE,4CAA4C;QACjD,GAAG,EAAE,4CAA4C;KAClD;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,4CAA4C,CAAC;AAC9D,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC,MAAM,IAAI,GAAmB,UAAgB,EAAE,OAAO,EAA6B;;QACjF,MAAM,WAAW,GAAW,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;QAExF,MAAM,eAAe,GAAoB,MAAM,iBAAG,CAAC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QACzF,MAAM,UAAU,GAAe,MAAM,iBAAG,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC1E,MAAM,eAAe,GAAoB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E,KAAK,EAAE,KAAK,CAAC;SAC5C,CAAC,CAAC;QAEH,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;CAAA,CAAC;AAEF,kBAAe,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@venusprotocol/oracle",
3
3
  "description": "Venus Protocol Price Oracle",
4
- "version": "1.4.0",
4
+ "version": "1.5.0",
5
5
  "author": "",
6
6
  "files": [
7
7
  "artifacts",
@@ -14,7 +14,7 @@
14
14
  "clean": "shx rm -rf ./artifacts ./cache ./coverage ./src/types ./coverage.json",
15
15
  "commit": "git-cz",
16
16
  "compile": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile",
17
- "coverage": "yarn typechain && hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"test/**/*.ts\" && yarn typechain",
17
+ "hardhat:coverage": "hardhat coverage",
18
18
  "deploy": "hardhat deploy",
19
19
  "verify": "hardhat etherscan-verify",
20
20
  "lint": "yarn lint:sol && yarn lint:ts && yarn prettier:check",
@@ -25,13 +25,17 @@
25
25
  "test": "npm run compile && hardhat test",
26
26
  "typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain",
27
27
  "build": "rm -rf dist && tsc --declaration && hardhat compile && cp -r ./{package.json,yarn.lock,artifacts,networks,contracts,deployments} dist/",
28
- "publish": "yarn build && cd dist && yarn npm publish"
28
+ "publish": "yarn build && cd dist && yarn npm publish",
29
+ "docgen": "hardhat docgen"
29
30
  },
30
31
  "dependencies": {
32
+ "@chainlink/contracts": "^0.5.1",
33
+ "@defi-wonderland/smock": "^2.3.4",
31
34
  "@openzeppelin/contracts": "^4.6.0",
32
35
  "@openzeppelin/contracts-upgradeable": "^4.7.3",
33
36
  "@venusprotocol/venus-protocol": "0.4.1",
34
- "module-alias": "^2.2.2"
37
+ "module-alias": "^2.2.2",
38
+ "solidity-docgen": "^0.6.0-beta.29"
35
39
  },
36
40
  "devDependencies": {
37
41
  "@commitlint/cli": "^17.0.2",
@@ -71,10 +75,11 @@
71
75
  "lodash": "^4.17.21",
72
76
  "mocha": "^10.0.0",
73
77
  "prettier": "^2.6.2",
74
- "prettier-plugin-solidity": "^1.0.0-dev.21",
78
+ "prettier-plugin-solidity": "^1.0.0",
75
79
  "shelljs": "^0.8.5",
76
80
  "shx": "^0.3.4",
77
81
  "solhint": "^3.3.7",
82
+ "solhint-plugin-prettier": "^0.0.5",
78
83
  "solidity-coverage": "^0.7.21",
79
84
  "ts-generator": "^0.1.1",
80
85
  "ts-node": "^10.8.1",
@@ -1 +0,0 @@
1
- {"id":"2fde13baf96aae3a4a0595eaa19cc540","_format":"hh-sol-build-info-1","solcVersion":"0.8.13","solcLongVersion":"0.8.13+commit.abaa5c0e","input":{"language":"Solidity","sources":{"contracts/PriceOracle.sol":{"content":"pragma solidity >=0.5.16;\n\nabstract contract PriceOracle {\n /// @notice Indicator that this is a PriceOracle contract (for inspection)\n bool public constant isPriceOracle = true;\n\n /**\n * @notice Get the underlying price of a vToken asset\n * @param vToken The vToken address to get the underlying price of\n * @return The underlying asset price mantissa (scaled by 1e18).\n * Zero means the price is unavailable.\n */\n function getUnderlyingPrice(address vToken) external view virtual returns (uint256);\n\n function updatePrice(address vToken) external virtual;\n}\n"}},"settings":{"optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["storageLayout","abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","devdoc","userdoc","evm.gasEstimates"],"":["ast"]}},"metadata":{"useLiteralContent":true}}},"output":{"errors":[{"component":"general","errorCode":"1878","formattedMessage":"Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> contracts/PriceOracle.sol\n\n","message":"SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: <SPDX-License>\" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.","severity":"warning","sourceLocation":{"end":-1,"file":"contracts/PriceOracle.sol","start":-1},"type":"Warning"}],"sources":{"contracts/PriceOracle.sol":{"ast":{"absolutePath":"contracts/PriceOracle.sol","exportedSymbols":{"PriceOracle":[19]},"id":20,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.5",".16"],"nodeType":"PragmaDirective","src":"0:25:0"},{"abstract":true,"baseContracts":[],"canonicalName":"PriceOracle","contractDependencies":[],"contractKind":"contract","fullyImplemented":false,"id":19,"linearizedBaseContracts":[19],"name":"PriceOracle","nameLocation":"45:11:0","nodeType":"ContractDefinition","nodes":[{"constant":true,"documentation":{"id":2,"nodeType":"StructuredDocumentation","src":"63:74:0","text":"@notice Indicator that this is a PriceOracle contract (for inspection)"},"functionSelector":"66331bba","id":5,"mutability":"constant","name":"isPriceOracle","nameLocation":"163:13:0","nodeType":"VariableDeclaration","scope":19,"src":"142:41:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":3,"name":"bool","nodeType":"ElementaryTypeName","src":"142:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":{"hexValue":"74727565","id":4,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"179:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"visibility":"public"},{"documentation":{"id":6,"nodeType":"StructuredDocumentation","src":"190:254:0","text":" @notice Get the underlying price of a vToken asset\n @param vToken The vToken address to get the underlying price of\n @return The underlying asset price mantissa (scaled by 1e18).\n Zero means the price is unavailable."},"functionSelector":"fc57d4df","id":13,"implemented":false,"kind":"function","modifiers":[],"name":"getUnderlyingPrice","nameLocation":"458:18:0","nodeType":"FunctionDefinition","parameters":{"id":9,"nodeType":"ParameterList","parameters":[{"constant":false,"id":8,"mutability":"mutable","name":"vToken","nameLocation":"485:6:0","nodeType":"VariableDeclaration","scope":13,"src":"477:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":7,"name":"address","nodeType":"ElementaryTypeName","src":"477:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"476:16:0"},"returnParameters":{"id":12,"nodeType":"ParameterList","parameters":[{"constant":false,"id":11,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":13,"src":"524:7:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":10,"name":"uint256","nodeType":"ElementaryTypeName","src":"524:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"523:9:0"},"scope":19,"src":"449:84:0","stateMutability":"view","virtual":true,"visibility":"external"},{"functionSelector":"96e85ced","id":18,"implemented":false,"kind":"function","modifiers":[],"name":"updatePrice","nameLocation":"548:11:0","nodeType":"FunctionDefinition","parameters":{"id":16,"nodeType":"ParameterList","parameters":[{"constant":false,"id":15,"mutability":"mutable","name":"vToken","nameLocation":"568:6:0","nodeType":"VariableDeclaration","scope":18,"src":"560:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":14,"name":"address","nodeType":"ElementaryTypeName","src":"560:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"559:16:0"},"returnParameters":{"id":17,"nodeType":"ParameterList","parameters":[],"src":"592:0:0"},"scope":19,"src":"539:54:0","stateMutability":"nonpayable","virtual":true,"visibility":"external"}],"scope":20,"src":"27:568:0","usedErrors":[]}],"src":"0:596:0"},"id":0}},"contracts":{"contracts/PriceOracle.sol":{"PriceOracle":{"abi":[{"inputs":[{"internalType":"address","name":"vToken","type":"address"}],"name":"getUnderlyingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPriceOracle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"vToken","type":"address"}],"name":"updatePrice","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{"getUnderlyingPrice(address)":{"params":{"vToken":"The vToken address to get the underlying price of"},"returns":{"_0":"The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable."}}},"version":1},"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"gasEstimates":null,"methodIdentifiers":{"getUnderlyingPrice(address)":"fc57d4df","isPriceOracle()":"66331bba","updatePrice(address)":"96e85ced"}},"metadata":"{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isPriceOracle\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"updatePrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getUnderlyingPrice(address)\":{\"params\":{\"vToken\":\"The vToken address to get the underlying price of\"},\"returns\":{\"_0\":\"The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable.\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getUnderlyingPrice(address)\":{\"notice\":\"Get the underlying price of a vToken asset\"},\"isPriceOracle()\":{\"notice\":\"Indicator that this is a PriceOracle contract (for inspection)\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/PriceOracle.sol\":\"PriceOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/PriceOracle.sol\":{\"content\":\"pragma solidity >=0.5.16;\\n\\nabstract contract PriceOracle {\\n /// @notice Indicator that this is a PriceOracle contract (for inspection)\\n bool public constant isPriceOracle = true;\\n\\n /**\\n * @notice Get the underlying price of a vToken asset\\n * @param vToken The vToken address to get the underlying price of\\n * @return The underlying asset price mantissa (scaled by 1e18).\\n * Zero means the price is unavailable.\\n */\\n function getUnderlyingPrice(address vToken) external view virtual returns (uint256);\\n\\n function updatePrice(address vToken) external virtual;\\n}\\n\",\"keccak256\":\"0x31c6ebcceac600f9e86e22dbd7fac338d43a58979efdd14b0840fb9649f4b75e\"}},\"version\":1}","storageLayout":{"storage":[],"types":null},"userdoc":{"kind":"user","methods":{"getUnderlyingPrice(address)":{"notice":"Get the underlying price of a vToken asset"},"isPriceOracle()":{"notice":"Indicator that this is a PriceOracle contract (for inspection)"}},"version":1}}}}}}