UNPKG

@dolomite-exchange/dolomite-margin

Version:

Ethereum Smart Contracts and TypeScript library used for the DolomiteMargin trading protocol

1,198 lines (1,197 loc) 70 kB
{ "contractName": "TestLrcEthChainlinkAggregator", "abi": [ { "constant": true, "inputs": [], "name": "aggregator", "outputs": [ { "internalType": "contract IChainlinkAccessControlAggregator", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "decimals", "outputs": [ { "internalType": "uint8", "name": "", "type": "uint8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maxAnswer", "outputs": [ { "internalType": "int192", "name": "", "type": "int192" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "minAnswer", "outputs": [ { "internalType": "int192", "name": "", "type": "int192" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "latestRoundData", "outputs": [ { "internalType": "uint80", "name": "roundId", "type": "uint80" }, { "internalType": "int256", "name": "answer", "type": "int256" }, { "internalType": "uint256", "name": "startedAt", "type": "uint256" }, { "internalType": "uint256", "name": "updatedAt", "type": "uint256" }, { "internalType": "uint80", "name": "answeredInRound", "type": "uint80" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"aggregator\",\"outputs\":[{\"internalType\":\"contract IChainlinkAccessControlAggregator\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"latestRoundData\",\"outputs\":[{\"internalType\":\"uint80\",\"name\":\"roundId\",\"type\":\"uint80\"},{\"internalType\":\"int256\",\"name\":\"answer\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"startedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"updatedAt\",\"type\":\"uint256\"},{\"internalType\":\"uint80\",\"name\":\"answeredInRound\",\"type\":\"uint80\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxAnswer\",\"outputs\":[{\"internalType\":\"int192\",\"name\":\"\",\"type\":\"int192\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"minAnswer\",\"outputs\":[{\"internalType\":\"int192\",\"name\":\"\",\"type\":\"int192\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Gets the latest price from the Chainlink Oracle Network. Amount of decimals depends on the base.\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestLrcEthChainlinkAggregator.sol\":\"TestLrcEthChainlinkAggregator\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAccessControlAggregator.sol\":{\"keccak256\":\"0xbb94dc91633d6fb20e1d7e2b5ce1f11346e89a6bfc8c3ac5d163c35a3e4ad60a\",\"urls\":[\"bzz-raw://264c7c039caf44b1866769feb237010651730d546b54bb6f2b7bc77cf3b6c9c9\",\"dweb:/ipfs/QmX8TTF8E2G8TT1yig6qHC8amWDwaq1GG6iaKYTTHsYsjo\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol\":{\"keccak256\":\"0x0209c9f35dbe82857a6441d8d61f271baeb5098549eabf5fc6d33503d0d3e073\",\"urls\":[\"bzz-raw://2f6af7b5198548a9a5e3d8a30203d7cd003eae93cca22b8466c10e0dcfcbc367\",\"dweb:/ipfs/Qme3bQ58ZoQLYDoJQHnvEeQZqgqyWTFBYBmMoiem7LPXmz\"]},\"/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestLrcEthChainlinkAggregator.sol\":{\"keccak256\":\"0x44141071f9faba2706c82e0d9b1a20a6620194dab29d1fb5b07531ee237489a6\",\"urls\":[\"bzz-raw://c54ac9069feaf07ab8bee2b5b00764a68fb7b731919c3be0aa0cb88ee1c13c56\",\"dweb:/ipfs/QmPZmJtVRmz6vsPbb4RcPxAE4gjQLU3baC8gvwwim3EVAi\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5061019b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063313ce56711610050578063313ce567146100be57806370da2f67146100dc578063feaf968c146100e457610067565b806322adbc781461006c578063245a7bfc1461008d575b600080fd5b61007461012b565b60408051601792830b90920b8252519081900360200190f35b610095610130565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100c6610134565b6040805160ff9092168252519081900360200190f35b610074610139565b6100ec610153565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b600190565b3090565b601290565b75ffffffffffffffffffffffffffffffffffffffffffff90565b600065a9854dbd5c00814281909192939456fea265627a7a72315820fb980cf24729d1794815cbf9e37ce97799552522bd209d9f8a578e02ebef8c4864736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063313ce56711610050578063313ce567146100be57806370da2f67146100dc578063feaf968c146100e457610067565b806322adbc781461006c578063245a7bfc1461008d575b600080fd5b61007461012b565b60408051601792830b90920b8252519081900360200190f35b610095610130565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100c6610134565b6040805160ff9092168252519081900360200190f35b610074610139565b6100ec610153565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b600190565b3090565b601290565b75ffffffffffffffffffffffffffffffffffffffffffff90565b600065a9854dbd5c00814281909192939456fea265627a7a72315820fb980cf24729d1794815cbf9e37ce97799552522bd209d9f8a578e02ebef8c4864736f6c63430005100032", "sourceMap": "937:954:129:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;937:954:129;;;;;;;", "deployedSourceMap": "937:954:129:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;937:954:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1522:77;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;1042:257;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1305:76;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1387:129;;;:::i;1605:284::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1522:77;1591:1;1522:77;:::o;1042:257::-;1286:4;1042:257;:::o;1305:76::-;1372:2;1305:76;:::o;1387:129::-;1456:53;1387:129;:::o;1605:284::-;1676:14;1827:15;1676:14;1847:15;1676:14;1605:284;;;;;:::o", "source": "/*\n\n Copyright 2020 Dolomite.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n*/\n\npragma solidity ^0.5.7;\n\nimport { IChainlinkAggregator } from \"../external/interfaces/IChainlinkAggregator.sol\";\nimport { IChainlinkAccessControlAggregator } from \"../external/interfaces/IChainlinkAccessControlAggregator.sol\";\n\n\n/**\n * @dev Gets the latest price from the Chainlink Oracle Network. Amount of decimals depends on the base.\n */\ncontract TestLrcEthChainlinkAggregator is IChainlinkAggregator, IChainlinkAccessControlAggregator {\n\n function aggregator() external view returns (IChainlinkAccessControlAggregator) {\n // For the sake of simplicity, we implement the IChainlinkAccessControlAggregator interface here\n return IChainlinkAccessControlAggregator(address(this));\n }\n\n function decimals() external view returns (uint8) {\n return 18;\n }\n\n function maxAnswer() external view returns (int192) {\n return 95780971304118053647396689196894323976171195136475135;\n }\n\n function minAnswer() external view returns (int192) {\n return 1;\n }\n\n function latestRoundData()\n external\n view\n returns (\n uint80 roundId,\n int256 answer,\n uint256 startedAt,\n uint256 updatedAt,\n uint80 answeredInRound\n ) {\n return (0, 186390000000000, 0, block.timestamp, 0); // Ξ0.00018639\n }\n}\n", "sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestLrcEthChainlinkAggregator.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestLrcEthChainlinkAggregator.sol", "exportedSymbols": { "TestLrcEthChainlinkAggregator": [ 35679 ] }, "id": 35680, "nodeType": "SourceUnit", "nodes": [ { "id": 35612, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:129" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol", "file": "../external/interfaces/IChainlinkAggregator.sol", "id": 35614, "nodeType": "ImportDirective", "scope": 35680, "sourceUnit": 4191, "src": "620:87:129", "symbolAliases": [ { "foreign": 35613, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAccessControlAggregator.sol", "file": "../external/interfaces/IChainlinkAccessControlAggregator.sol", "id": 35616, "nodeType": "ImportDirective", "scope": 35680, "sourceUnit": 4162, "src": "708:113:129", "symbolAliases": [ { "foreign": 35615, "local": null } ], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 35617, "name": "IChainlinkAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4190, "src": "979:20:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAggregator_$4190", "typeString": "contract IChainlinkAggregator" } }, "id": 35618, "nodeType": "InheritanceSpecifier", "src": "979:20:129" }, { "arguments": null, "baseName": { "contractScope": null, "id": 35619, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1001:33:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "id": 35620, "nodeType": "InheritanceSpecifier", "src": "1001:33:129" } ], "contractDependencies": [ 4161, 4190 ], "contractKind": "contract", "documentation": "@dev Gets the latest price from the Chainlink Oracle Network. Amount of decimals depends on the base.", "fullyImplemented": true, "id": 35679, "linearizedBaseContracts": [ 35679, 4161, 4190 ], "name": "TestLrcEthChainlinkAggregator", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 35631, "nodeType": "Block", "src": "1122:177:129", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 35627, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38401, "src": "1286:4:129", "typeDescriptions": { "typeIdentifier": "t_contract$_TestLrcEthChainlinkAggregator_$35679", "typeString": "contract TestLrcEthChainlinkAggregator" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_TestLrcEthChainlinkAggregator_$35679", "typeString": "contract TestLrcEthChainlinkAggregator" } ], "id": 35626, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1278:7:129", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 35628, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1278:13:129", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 35625, "name": "IChainlinkAccessControlAggregator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4161, "src": "1244:33:129", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlinkAccessControlAggregator_$4161_$", "typeString": "type(contract IChainlinkAccessControlAggregator)" } }, "id": 35629, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1244:48:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "functionReturnParameters": 35624, "id": 35630, "nodeType": "Return", "src": "1237:55:129" } ] }, "documentation": null, "id": 35632, "implemented": true, "kind": "function", "modifiers": [], "name": "aggregator", "nodeType": "FunctionDefinition", "parameters": { "id": 35621, "nodeType": "ParameterList", "parameters": [], "src": "1061:2:129" }, "returnParameters": { "id": 35624, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35623, "name": "", "nodeType": "VariableDeclaration", "scope": 35632, "src": "1087:33:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" }, "typeName": { "contractScope": null, "id": 35622, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1087:33:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "value": null, "visibility": "internal" } ], "src": "1086:35:129" }, "scope": 35679, "src": "1042:257:129", "stateMutability": "view", "superFunction": 4171, "visibility": "external" }, { "body": { "id": 35639, "nodeType": "Block", "src": "1355:26:129", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "3138", "id": 35637, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1372:2:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_18_by_1", "typeString": "int_const 18" }, "value": "18" }, "functionReturnParameters": 35636, "id": 35638, "nodeType": "Return", "src": "1365:9:129" } ] }, "documentation": null, "id": 35640, "implemented": true, "kind": "function", "modifiers": [], "name": "decimals", "nodeType": "FunctionDefinition", "parameters": { "id": 35633, "nodeType": "ParameterList", "parameters": [], "src": "1322:2:129" }, "returnParameters": { "id": 35636, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35635, "name": "", "nodeType": "VariableDeclaration", "scope": 35640, "src": "1348:5:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 35634, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1348:5:129", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "src": "1347:7:129" }, "scope": 35679, "src": "1305:76:129", "stateMutability": "view", "superFunction": 4176, "visibility": "external" }, { "body": { "id": 35647, "nodeType": "Block", "src": "1439:77:129", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "3935373830393731333034313138303533363437333936363839313936383934333233393736313731313935313336343735313335", "id": 35645, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1456:53:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_95780971304118053647396689196894323976171195136475135_by_1", "typeString": "int_const 9578...(45 digits omitted)...5135" }, "value": "95780971304118053647396689196894323976171195136475135" }, "functionReturnParameters": 35644, "id": 35646, "nodeType": "Return", "src": "1449:60:129" } ] }, "documentation": null, "id": 35648, "implemented": true, "kind": "function", "modifiers": [], "name": "maxAnswer", "nodeType": "FunctionDefinition", "parameters": { "id": 35641, "nodeType": "ParameterList", "parameters": [], "src": "1405:2:129" }, "returnParameters": { "id": 35644, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35643, "name": "", "nodeType": "VariableDeclaration", "scope": 35648, "src": "1431:6:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" }, "typeName": { "id": 35642, "name": "int192", "nodeType": "ElementaryTypeName", "src": "1431:6:129", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" } }, "value": null, "visibility": "internal" } ], "src": "1430:8:129" }, "scope": 35679, "src": "1387:129:129", "stateMutability": "view", "superFunction": 4160, "visibility": "external" }, { "body": { "id": 35655, "nodeType": "Block", "src": "1574:25:129", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "31", "id": 35653, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1591:1:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "functionReturnParameters": 35652, "id": 35654, "nodeType": "Return", "src": "1584:8:129" } ] }, "documentation": null, "id": 35656, "implemented": true, "kind": "function", "modifiers": [], "name": "minAnswer", "nodeType": "FunctionDefinition", "parameters": { "id": 35649, "nodeType": "ParameterList", "parameters": [], "src": "1540:2:129" }, "returnParameters": { "id": 35652, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35651, "name": "", "nodeType": "VariableDeclaration", "scope": 35656, "src": "1566:6:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" }, "typeName": { "id": 35650, "name": "int192", "nodeType": "ElementaryTypeName", "src": "1566:6:129", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" } }, "value": null, "visibility": "internal" } ], "src": "1565:8:129" }, "scope": 35679, "src": "1522:77:129", "stateMutability": "view", "superFunction": 4155, "visibility": "external" }, { "body": { "id": 35677, "nodeType": "Block", "src": "1806:83:129", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "hexValue": "30", "id": 35669, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1824:1:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, { "argumentTypes": null, "hexValue": "313836333930303030303030303030", "id": 35670, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1827:15:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_186390000000000_by_1", "typeString": "int_const 186390000000000" }, "value": "186390000000000" }, { "argumentTypes": null, "hexValue": "30", "id": 35671, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1844:1:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 35672, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38097, "src": "1847:5:129", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 35673, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "timestamp", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1847:15:129", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "30", "id": 35674, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1864:1:129", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 35675, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1823:43:129", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_rational_0_by_1_$_t_rational_186390000000000_by_1_$_t_rational_0_by_1_$_t_uint256_$_t_rational_0_by_1_$", "typeString": "tuple(int_const 0,int_const 186390000000000,int_const 0,uint256,int_const 0)" } }, "functionReturnParameters": 35668, "id": 35676, "nodeType": "Return", "src": "1816:50:129" } ] }, "documentation": null, "id": 35678, "implemented": true, "kind": "function", "modifiers": [], "name": "latestRoundData", "nodeType": "FunctionDefinition", "parameters": { "id": 35657, "nodeType": "ParameterList", "parameters": [], "src": "1629:2:129" }, "returnParameters": { "id": 35668, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35659, "name": "roundId", "nodeType": "VariableDeclaration", "scope": 35678, "src": "1676:14:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" }, "typeName": { "id": 35658, "name": "uint80", "nodeType": "ElementaryTypeName", "src": "1676:6:129", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 35661, "name": "answer", "nodeType": "VariableDeclaration", "scope": 35678, "src": "1700:13:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 35660, "name": "int256", "nodeType": "ElementaryTypeName", "src": "1700:6:129", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 35663, "name": "startedAt", "nodeType": "VariableDeclaration", "scope": 35678, "src": "1723:17:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 35662, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1723:7:129", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 35665, "name": "updatedAt", "nodeType": "VariableDeclaration", "scope": 35678, "src": "1750:17:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 35664, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1750:7:129", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 35667, "name": "answeredInRound", "nodeType": "VariableDeclaration", "scope": 35678, "src": "1777:22:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" }, "typeName": { "id": 35666, "name": "uint80", "nodeType": "ElementaryTypeName", "src": "1777:6:129", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" } }, "value": null, "visibility": "internal" } ], "src": "1666:139:129" }, "scope": 35679, "src": "1605:284:129", "stateMutability": "view", "superFunction": 4189, "visibility": "external" } ], "scope": 35680, "src": "937:954:129" } ], "src": "595:1297:129" }, "legacyAST": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestLrcEthChainlinkAggregator.sol", "exportedSymbols": { "TestLrcEthChainlinkAggregator": [ 35679 ] }, "id": 35680, "nodeType": "SourceUnit", "nodes": [ { "id": 35612, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:129" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol", "file": "../external/interfaces/IChainlinkAggregator.sol", "id": 35614, "nodeType": "ImportDirective", "scope": 35680, "sourceUnit": 4191, "src": "620:87:129", "symbolAliases": [ { "foreign": 35613, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAccessControlAggregator.sol", "file": "../external/interfaces/IChainlinkAccessControlAggregator.sol", "id": 35616, "nodeType": "ImportDirective", "scope": 35680, "sourceUnit": 4162, "src": "708:113:129", "symbolAliases": [ { "foreign": 35615, "local": null } ], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 35617, "name": "IChainlinkAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4190, "src": "979:20:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAggregator_$4190", "typeString": "contract IChainlinkAggregator" } }, "id": 35618, "nodeType": "InheritanceSpecifier", "src": "979:20:129" }, { "arguments": null, "baseName": { "contractScope": null, "id": 35619, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1001:33:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "id": 35620, "nodeType": "InheritanceSpecifier", "src": "1001:33:129" } ], "contractDependencies": [ 4161, 4190 ], "contractKind": "contract", "documentation": "@dev Gets the latest price from the Chainlink Oracle Network. Amount of decimals depends on the base.", "fullyImplemented": true, "id": 35679, "linearizedBaseContracts": [ 35679, 4161, 4190 ], "name": "TestLrcEthChainlinkAggregator", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 35631, "nodeType": "Block", "src": "1122:177:129", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 35627, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38401, "src": "1286:4:129", "typeDescriptions": { "typeIdentifier": "t_contract$_TestLrcEthChainlinkAggregator_$35679", "typeString": "contract TestLrcEthChainlinkAggregator" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_TestLrcEthChainlinkAggregator_$35679", "typeString": "contract TestLrcEthChainlinkAggregator" } ], "id": 35626, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1278:7:129", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 35628, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1278:13:129", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 35625, "name": "IChainlinkAccessControlAggregator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4161, "src": "1244:33:129", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlinkAccessControlAggregator_$4161_$", "typeString": "type(contract IChainlinkAccessControlAggregator)" } }, "id": 35629, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1244:48:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "functionReturnParameters": 35624, "id": 35630, "nodeType": "Return", "src": "1237:55:129" } ] }, "documentation": null, "id": 35632, "implemented": true, "kind": "function", "modifiers": [], "name": "aggregator", "nodeType": "FunctionDefinition", "parameters": { "id": 35621, "nodeType": "ParameterList", "parameters": [], "src": "1061:2:129" }, "returnParameters": { "id": 35624, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 35623, "name": "", "nodeType": "VariableDeclaration", "scope": 35632, "src": "1087:33:129", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" }, "typeName": { "contractScope": null, "id": 35622, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1087:33:129", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "value": null, "visibility": "internal" } ], "src": "1086:35:129" }, "scope": 35679, "src": "1042:257:129", "stateMutability": "view", "superFunction": 4171, "visibility": "external" }, { "body": { "id": 35639, "nodeType": "Block", "src": "1355:26:129", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "3138", "id": 35637, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1372:2:129",