UNPKG

@levelk/token-price-oracles

Version:

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

582 lines 18.7 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" }, { "constant": true, "inputs": [ { "name": "token1", "type": "address" }, { "name": "token2", "type": "address" } ], "name": "tokenPairExists", "outputs": [ { "name": "", "type": "bool" } ], "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 // Returns true if the token1/token2 pair exists\n function tokenPairExists(address token1, address token2) public view returns (bool);\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": [ 640 ] }, "id": 641, "nodeType": "SourceUnit", "nodes": [ { "id": 621, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:3" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 640, "linearizedBaseContracts": [ 640 ], "name": "IExchangeAdapter", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "id": 630, "implemented": false, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getPriceForTokenPair", "nodeType": "FunctionDefinition", "parameters": { "id": 626, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 623, "name": "token1", "nodeType": "VariableDeclaration", "scope": 630, "src": "143:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 622, "name": "address", "nodeType": "ElementaryTypeName", "src": "143:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 625, "name": "token2", "nodeType": "VariableDeclaration", "scope": 630, "src": "159:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 624, "name": "address", "nodeType": "ElementaryTypeName", "src": "159:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "142:32:3" }, "payable": false, "returnParameters": { "id": 629, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 628, "name": "price", "nodeType": "VariableDeclaration", "scope": 630, "src": "196:10:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 627, "name": "uint", "nodeType": "ElementaryTypeName", "src": "196:4:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "195:12:3" }, "scope": 640, "src": "113:95:3", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": null, "documentation": null, "id": 639, "implemented": false, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "tokenPairExists", "nodeType": "FunctionDefinition", "parameters": { "id": 635, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 632, "name": "token1", "nodeType": "VariableDeclaration", "scope": 639, "src": "288:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 631, "name": "address", "nodeType": "ElementaryTypeName", "src": "288:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 634, "name": "token2", "nodeType": "VariableDeclaration", "scope": 639, "src": "304:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 633, "name": "address", "nodeType": "ElementaryTypeName", "src": "304:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "287:32:3" }, "payable": false, "returnParameters": { "id": 638, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 637, "name": "", "nodeType": "VariableDeclaration", "scope": 639, "src": "341:4:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 636, "name": "bool", "nodeType": "ElementaryTypeName", "src": "341:4:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "340:6:3" }, "scope": 640, "src": "263:84:3", "stateMutability": "view", "superFunction": null, "visibility": "public" } ], "scope": 641, "src": "27:322:3" } ], "src": "0:350:3" }, "legacyAST": { "absolutePath": "/Users/mfcalvanese/dev/eth/token-price-oracles/contracts/ExchangeAdapters/IExchangeAdapter.sol", "exportedSymbols": { "IExchangeAdapter": [ 640 ] }, "id": 641, "nodeType": "SourceUnit", "nodes": [ { "id": 621, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:3" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 640, "linearizedBaseContracts": [ 640 ], "name": "IExchangeAdapter", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "id": 630, "implemented": false, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "getPriceForTokenPair", "nodeType": "FunctionDefinition", "parameters": { "id": 626, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 623, "name": "token1", "nodeType": "VariableDeclaration", "scope": 630, "src": "143:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 622, "name": "address", "nodeType": "ElementaryTypeName", "src": "143:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 625, "name": "token2", "nodeType": "VariableDeclaration", "scope": 630, "src": "159:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 624, "name": "address", "nodeType": "ElementaryTypeName", "src": "159:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "142:32:3" }, "payable": false, "returnParameters": { "id": 629, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 628, "name": "price", "nodeType": "VariableDeclaration", "scope": 630, "src": "196:10:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 627, "name": "uint", "nodeType": "ElementaryTypeName", "src": "196:4:3", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "195:12:3" }, "scope": 640, "src": "113:95:3", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": null, "documentation": null, "id": 639, "implemented": false, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "tokenPairExists", "nodeType": "FunctionDefinition", "parameters": { "id": 635, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 632, "name": "token1", "nodeType": "VariableDeclaration", "scope": 639, "src": "288:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 631, "name": "address", "nodeType": "ElementaryTypeName", "src": "288:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 634, "name": "token2", "nodeType": "VariableDeclaration", "scope": 639, "src": "304:14:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 633, "name": "address", "nodeType": "ElementaryTypeName", "src": "304:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "287:32:3" }, "payable": false, "returnParameters": { "id": 638, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 637, "name": "", "nodeType": "VariableDeclaration", "scope": 639, "src": "341:4:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 636, "name": "bool", "nodeType": "ElementaryTypeName", "src": "341:4:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "340:6:3" }, "scope": 640, "src": "263:84:3", "stateMutability": "view", "superFunction": null, "visibility": "public" } ], "scope": 641, "src": "27:322:3" } ], "src": "0:350:3" }, "compiler": { "name": "solc", "version": "0.4.25+commit.59dbf8f1.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.2", "updatedAt": "2020-02-17T22:26:47.994Z" }