@venusprotocol/oracle 1.3.2 → 1.3.3

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 (32) hide show
  1. package/artifacts/build-info/2fde13baf96aae3a4a0595eaa19cc540.json +1 -0
  2. package/artifacts/contracts/PriceOracle.sol/PriceOracle.dbg.json +1 -1
  3. package/artifacts/contracts/PriceOracle.sol/PriceOracle.json +0 -6
  4. package/contracts/PriceOracle.sol +4 -4
  5. package/deploy/oracles.d.ts.map +1 -1
  6. package/deploy/oracles.js +19 -5
  7. package/deploy/oracles.js.map +1 -1
  8. package/package.json +2 -2
  9. package/artifacts/build-info/766f05630947fa6d366a667b66c1141b.json +0 -1
  10. package/deployments/localhost/.chainId +0 -1
  11. package/deployments/localhost/BinanceOracle.json +0 -393
  12. package/deployments/localhost/BinanceOracle_Implementation.json +0 -305
  13. package/deployments/localhost/BinanceOracle_Proxy.json +0 -241
  14. package/deployments/localhost/BoundValidator.json +0 -457
  15. package/deployments/localhost/BoundValidator_Implementation.json +0 -428
  16. package/deployments/localhost/BoundValidator_Proxy.json +0 -237
  17. package/deployments/localhost/ChainlinkOracle.json +0 -370
  18. package/deployments/localhost/ChainlinkOracle_Implementation.json +0 -273
  19. package/deployments/localhost/ChainlinkOracle_Proxy.json +0 -237
  20. package/deployments/localhost/DefaultProxyAdmin.json +0 -257
  21. package/deployments/localhost/PivotTwapOracle.json +0 -393
  22. package/deployments/localhost/PivotTwapOracle_Implementation.json +0 -304
  23. package/deployments/localhost/PivotTwapOracle_Proxy.json +0 -241
  24. package/deployments/localhost/PythOracle.json +0 -393
  25. package/deployments/localhost/PythOracle_Implementation.json +0 -309
  26. package/deployments/localhost/PythOracle_Proxy.json +0 -241
  27. package/deployments/localhost/ResilientOracle.json +0 -700
  28. package/deployments/localhost/ResilientOracle_Implementation.json +0 -746
  29. package/deployments/localhost/ResilientOracle_Proxy.json +0 -241
  30. package/deployments/localhost/solcInputs/0e89febeebc7444140de8e67c9067d2c.json +0 -78
  31. package/deployments/localhost/solcInputs/468ec7a31e2db8855c82fb8141193271.json +0 -54
  32. package/deployments/localhost/solcInputs/50629170e50dc9fec79dac585e95ac05.json +0 -138
@@ -0,0 +1 @@
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}}}}}}
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../build-info/766f05630947fa6d366a667b66c1141b.json"
3
+ "buildInfo": "../../build-info/2fde13baf96aae3a4a0595eaa19cc540.json"
4
4
  }
@@ -4,7 +4,6 @@
4
4
  "sourceName": "contracts/PriceOracle.sol",
5
5
  "abi": [
6
6
  {
7
- "constant": true,
8
7
  "inputs": [
9
8
  {
10
9
  "internalType": "address",
@@ -20,12 +19,10 @@
20
19
  "type": "uint256"
21
20
  }
22
21
  ],
23
- "payable": false,
24
22
  "stateMutability": "view",
25
23
  "type": "function"
26
24
  },
27
25
  {
28
- "constant": true,
29
26
  "inputs": [],
30
27
  "name": "isPriceOracle",
31
28
  "outputs": [
@@ -35,12 +32,10 @@
35
32
  "type": "bool"
36
33
  }
37
34
  ],
38
- "payable": false,
39
35
  "stateMutability": "view",
40
36
  "type": "function"
41
37
  },
42
38
  {
43
- "constant": false,
44
39
  "inputs": [
45
40
  {
46
41
  "internalType": "address",
@@ -50,7 +45,6 @@
50
45
  ],
51
46
  "name": "updatePrice",
52
47
  "outputs": [],
53
- "payable": false,
54
48
  "stateMutability": "nonpayable",
55
49
  "type": "function"
56
50
  }
@@ -1,6 +1,6 @@
1
- pragma solidity ^0.5.16;
1
+ pragma solidity >=0.5.16;
2
2
 
3
- contract PriceOracle {
3
+ abstract contract PriceOracle {
4
4
  /// @notice Indicator that this is a PriceOracle contract (for inspection)
5
5
  bool public constant isPriceOracle = true;
6
6
 
@@ -10,7 +10,7 @@ contract PriceOracle {
10
10
  * @return The underlying asset price mantissa (scaled by 1e18).
11
11
  * Zero means the price is unavailable.
12
12
  */
13
- function getUnderlyingPrice(address vToken) external view returns (uint256);
13
+ function getUnderlyingPrice(address vToken) external view virtual returns (uint256);
14
14
 
15
- function updatePrice(address vToken) external;
15
+ function updatePrice(address vToken) external virtual;
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oracles.d.ts","sourceRoot":"","sources":["../../deploy/oracles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,QAAA,MAAM,IAAI,EAAE,cA+FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"oracles.d.ts","sourceRoot":"","sources":["../../deploy/oracles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAgB3D,QAAA,MAAM,IAAI,EAAE,cA+FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
package/deploy/oracles.js CHANGED
@@ -13,11 +13,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const mainnet_json_1 = __importDefault(require("@venusprotocol/venus-protocol/networks/mainnet.json"));
16
+ const testnet_json_1 = __importDefault(require("@venusprotocol/venus-protocol/networks/testnet.json"));
16
17
  const hardhat_1 = __importDefault(require("hardhat"));
18
+ const ADDRESSES = {
19
+ bsctestnet: {
20
+ vBNBAddress: testnet_json_1.default.Contracts.vBNB,
21
+ pythOracleAddress: "0xd7308b14BF4008e7C7196eC35610B1427C5702EA",
22
+ binanceFeedRegistryAddress: "0x999DD49FeFdC043fDAC4FE12Bb1e4bb31cB4c47B",
23
+ },
24
+ bscmainnet: {
25
+ vBNBAddress: mainnet_json_1.default.Contracts.vBNB,
26
+ pythOracleAddress: "",
27
+ binanceFeedRegistryAddress: "",
28
+ },
29
+ };
17
30
  const func = function ({ getNamedAccounts, deployments, network }) {
18
31
  return __awaiter(this, void 0, void 0, function* () {
19
32
  const { deploy } = deployments;
20
33
  const { deployer } = yield getNamedAccounts();
34
+ const networkName = network.name === "bscmainnet" ? "bscmainnet" : "bsctestnet";
21
35
  yield deploy("BoundValidator", {
22
36
  from: deployer,
23
37
  log: true,
@@ -56,7 +70,7 @@ const func = function ({ getNamedAccounts, deployments, network }) {
56
70
  },
57
71
  },
58
72
  });
59
- const vBNBAddress = mainnet_json_1.default.Contracts.vBNB;
73
+ const vBNBAddress = ADDRESSES[networkName].vBNBAddress;
60
74
  yield deploy("PivotTwapOracle", {
61
75
  contract: network.live ? "PivotTwapOracle" : "MockTwapOracle",
62
76
  from: deployer,
@@ -70,7 +84,7 @@ const func = function ({ getNamedAccounts, deployments, network }) {
70
84
  },
71
85
  },
72
86
  });
73
- const actualPythOracleAddress = "0xd7308b14BF4008e7C7196eC35610B1427C5702EA";
87
+ const pythOracleAddress = ADDRESSES[networkName].pythOracleAddress;
74
88
  yield deploy("PythOracle", {
75
89
  contract: network.live ? "PythOracle" : "MockPythOracle",
76
90
  from: deployer,
@@ -80,11 +94,11 @@ const func = function ({ getNamedAccounts, deployments, network }) {
80
94
  proxyContract: "OptimizedTransparentProxy",
81
95
  execute: {
82
96
  methodName: "initialize",
83
- args: [actualPythOracleAddress],
97
+ args: [pythOracleAddress],
84
98
  },
85
99
  },
86
100
  });
87
- const actualBinanceFeedRegistryAddress = "0x999DD49FeFdC043fDAC4FE12Bb1e4bb31cB4c47B";
101
+ const binanceFeedRegistryAddress = ADDRESSES[networkName].binanceFeedRegistryAddress;
88
102
  yield deploy("BinanceOracle", {
89
103
  contract: network.live ? "BinanceOracle" : "MockBinanceOracle",
90
104
  from: deployer,
@@ -94,7 +108,7 @@ const func = function ({ getNamedAccounts, deployments, network }) {
94
108
  proxyContract: "OptimizedTransparentProxy",
95
109
  execute: {
96
110
  methodName: "initialize",
97
- args: [actualBinanceFeedRegistryAddress],
111
+ args: [binanceFeedRegistryAddress],
98
112
  },
99
113
  },
100
114
  });
@@ -1 +1 @@
1
- {"version":3,"file":"oracles.js","sourceRoot":"","sources":["../../deploy/oracles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,uGAA2E;AAC3E,sDAA0B;AAI1B,MAAM,IAAI,GAAmB,UAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAA6B;;QAChH,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;QAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;QAE9C,MAAM,MAAM,CAAC,gBAAgB,EAAE;YAC7B,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,IAAI;YACT,uBAAuB,EAAE,KAAK;YAC9B,KAAK,EAAE;gBACL,aAAa,EAAE,2BAA2B;gBAC1C,OAAO,EAAE;oBACP,UAAU,EAAE,YAAY;oBACxB,IAAI,EAAE,EAAE;iBACT;aACF;SACF,CAAC,CAAC;QAEH,MAAM,cAAc,GAAG,MAAM,iBAAG,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAEtE,MAAM,MAAM,CAAC,iBAAiB,EAAE;YAC9B,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,IAAI;YACT,uBAAuB,E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ol Price Oracle",
4
- "version": "1.3.2",
4
+ "version": "1.3.3",
5
5
  "author": "",
6
6
  "files": [
7
7
  "artifacts",
@@ -25,7 +25,7 @@
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 --tolerate-republish"
28
+ "publish": "yarn build && cd dist && yarn npm publish"
29
29
  },
30
30
  "dependencies": {
31
31
  "@openzeppelin/contracts": "^4.6.0",
@@ -1 +0,0 @@
1
- {"id":"766f05630947fa6d366a667b66c1141b","_format":"hh-sol-build-info-1","solcVersion":"0.5.16","solcLongVersion":"0.5.16+commit.9c3226ce","input":{"language":"Solidity","sources":{"contracts/PriceOracle.sol":{"content":"pragma solidity ^0.5.16;\n\ncontract 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 returns (uint256);\n\n function updatePrice(address vToken) external;\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":{"sources":{"contracts/PriceOracle.sol":{"ast":{"absolutePath":"contracts/PriceOracle.sol","exportedSymbols":{"PriceOracle":[17]},"id":18,"nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity","^","0.5",".16"],"nodeType":"PragmaDirective","src":"0:24:0"},{"baseContracts":[],"contractDependencies":[],"contractKind":"contract","documentation":null,"fullyImplemented":false,"id":17,"linearizedBaseContracts":[17],"name":"PriceOracle","nodeType":"ContractDefinition","nodes":[{"constant":true,"id":4,"name":"isPriceOracle","nodeType":"VariableDeclaration","scope":17,"src":"132:41:0","stateVariable":true,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":2,"name":"bool","nodeType":"ElementaryTypeName","src":"132:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"value":{"argumentTypes":null,"hexValue":"74727565","id":3,"isConstant":false,"isLValue":false,"isPure":true,"kind":"bool","lValueRequested":false,"nodeType":"Literal","src":"169:4:0","subdenomination":null,"typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"value":"true"},"visibility":"public"},{"body":null,"documentation":"@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.","id":11,"implemented":false,"kind":"function","modifiers":[],"name":"getUnderlyingPrice","nodeType":"FunctionDefinition","parameters":{"id":7,"nodeType":"ParameterList","parameters":[{"constant":false,"id":6,"name":"vToken","nodeType":"VariableDeclaration","scope":11,"src":"467:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":5,"name":"address","nodeType":"ElementaryTypeName","src":"467:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"466:16:0"},"returnParameters":{"id":10,"nodeType":"ParameterList","parameters":[{"constant":false,"id":9,"name":"","nodeType":"VariableDeclaration","scope":11,"src":"506:7:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":8,"name":"uint256","nodeType":"ElementaryTypeName","src":"506:7:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"value":null,"visibility":"internal"}],"src":"505:9:0"},"scope":17,"src":"439:76:0","stateMutability":"view","superFunction":null,"visibility":"external"},{"body":null,"documentation":null,"id":16,"implemented":false,"kind":"function","modifiers":[],"name":"updatePrice","nodeType":"FunctionDefinition","parameters":{"id":14,"nodeType":"ParameterList","parameters":[{"constant":false,"id":13,"name":"vToken","nodeType":"VariableDeclaration","scope":16,"src":"542:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":12,"name":"address","nodeType":"ElementaryTypeName","src":"542:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"value":null,"visibility":"internal"}],"src":"541:16:0"},"returnParameters":{"id":15,"nodeType":"ParameterList","parameters":[],"src":"566:0:0"},"scope":17,"src":"521:46:0","stateMutability":"nonpayable","superFunction":null,"visibility":"external"}],"scope":18,"src":"26:543:0"}],"src":"0:570:0"},"id":0}},"contracts":{"contracts/PriceOracle.sol":{"PriceOracle":{"abi":[{"constant":true,"inputs":[{"internalType":"address","name":"vToken","type":"address"}],"name":"getUnderlyingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPriceOracle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"vToken","type":"address"}],"name":"updatePrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}],"devdoc":{"methods":{"getUnderlyingPrice(address)":{"params":{"vToken":"The vToken address to get the underlying price of"},"return":"The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable."}}},"evm":{"bytecode":{"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"gasEstimates":null,"methodIdentifiers":{"getUnderlyingPrice(address)":"fc57d4df","isPriceOracle()":"66331bba","updatePrice(address)":"96e85ced"}},"metadata":"{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isPriceOracle\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"updatePrice\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"getUnderlyingPrice(address)\":{\"params\":{\"vToken\":\"The vToken address to get the underlying price of\"},\"return\":\"The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable.\"}}},\"userdoc\":{\"methods\":{\"getUnderlyingPrice(address)\":{\"notice\":\"Get the underlying price of a vToken asset\"}}}},\"settings\":{\"compilationTarget\":{\"contracts/PriceOracle.sol\":\"PriceOracle\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/PriceOracle.sol\":{\"content\":\"pragma solidity ^0.5.16;\\n\\ncontract 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 returns (uint256);\\n\\n function updatePrice(address vToken) external;\\n}\\n\",\"keccak256\":\"0x14017666d40093a9e36f1ccd77e3569a0d239285ebcb862be53457b7dd3de998\"}},\"version\":1}","storageLayout":{"storage":[],"types":null},"userdoc":{"methods":{"getUnderlyingPrice(address)":{"notice":"Get the underlying price of a vToken asset"}}}}}}}}
@@ -1 +0,0 @@
1
- 31337