UNPKG

token-price-oracles

Version:

tools for creating token price data feeds and oracles that integrate with on-chain dex's

341 lines 10.6 kB
{ "contractName": "IExchangeAdapter", "abi": [ { "constant": true, "inputs": [ { "name": "token1", "type": "address" }, { "name": "token2", "type": "address" } ], "name": "getPriceForTokenPair", "outputs": [ { "name": "price", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity >=0.4.24;\n\ninterface IExchangeAdapter {\n // Gets the current price for the token1/token2 pair\n function getPriceForTokenPair(address token1, address token2) public view returns (uint price);\n}\n", "sourcePath": "/Users/mfcalvanese/dev/eth/token-price-oracles/contracts/ExchangeAdapters/IExchangeAdapter.sol", "ast": { "absolutePath": "/Users/mfcalvanese/dev/eth/token-price-oracles/contracts/ExchangeAdapters/IExchangeAdapter.sol", "exportedSymbols": { "IExchangeAdapter": [ 494 ] }, "id": 495, "nodeType": "SourceUnit", "nodes": [ { "id": 484, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:2" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 494, "linearizedBaseContracts": [ 494 ], "name": "IExchangeAdapter", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "id": 493, "implemented": false, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getPriceForTokenPair", "nodeType": "FunctionDefinition", "parameters": { "id": 489, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 486, "name": "token1", "nodeType": "VariableDeclaration", "scope": 493, "src": "143:14:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 485, "name": "address", "nodeType": "ElementaryTypeName", "src": "143:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 488, "name": "token2", "nodeType": "VariableDeclaration", "scope": 493, "src": "159:14:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 487, "name": "address", "nodeType": "ElementaryTypeName", "src": "159:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "142:32:2" }, "payable": false, "returnParameters": { "id": 492, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 491, "name": "price", "nodeType": "VariableDeclaration", "scope": 493, "src": "196:10:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 490, "name": "uint", "nodeType": "ElementaryTypeName", "src": "196:4:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "195:12:2" }, "scope": 494, "src": "113:95:2", "stateMutability": "view", "superFunction": null, "visibility": "public" } ], "scope": 495, "src": "27:183:2" } ], "src": "0:211:2" }, "legacyAST": { "absolutePath": "/Users/mfcalvanese/dev/eth/token-price-oracles/contracts/ExchangeAdapters/IExchangeAdapter.sol", "exportedSymbols": { "IExchangeAdapter": [ 494 ] }, "id": 495, "nodeType": "SourceUnit", "nodes": [ { "id": 484, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:2" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 494, "linearizedBaseContracts": [ 494 ], "name": "IExchangeAdapter", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "id": 493, "implemented": false, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getPriceForTokenPair", "nodeType": "FunctionDefinition", "parameters": { "id": 489, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 486, "name": "token1", "nodeType": "VariableDeclaration", "scope": 493, "src": "143:14:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 485, "name": "address", "nodeType": "ElementaryTypeName", "src": "143:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 488, "name": "token2", "nodeType": "VariableDeclaration", "scope": 493, "src": "159:14:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 487, "name": "address", "nodeType": "ElementaryTypeName", "src": "159:7:2", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "142:32:2" }, "payable": false, "returnParameters": { "id": 492, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 491, "name": "price", "nodeType": "VariableDeclaration", "scope": 493, "src": "196:10:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 490, "name": "uint", "nodeType": "ElementaryTypeName", "src": "196:4:2", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "195:12:2" }, "scope": 494, "src": "113:95:2", "stateMutability": "view", "superFunction": null, "visibility": "public" } ], "scope": 495, "src": "27:183:2" } ], "src": "0:211:2" }, "compiler": { "name": "solc", "version": "0.4.25+commit.59dbf8f1.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.2", "updatedAt": "2019-07-23T19:08:33.530Z" }