UNPKG

@dolomite-exchange/dolomite-margin

Version:

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

1,198 lines (1,197 loc) 69.9 kB
{ "contractName": "TestUsdcUsdChainlinkAggregator", "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/TestUsdcUsdChainlinkAggregator.sol\":\"TestUsdcUsdChainlinkAggregator\"},\"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/TestUsdcUsdChainlinkAggregator.sol\":{\"keccak256\":\"0x81585e4562a29a7d80dfa7b97c4c3629eb6b1905e5bea0b3f2d02a23aa6b87b8\",\"urls\":[\"bzz-raw://64e228df7512ca4c3aefe268929a189d69aa2da125f7bee67dd3f39fb3adc3c9\",\"dweb:/ipfs/QmeFdYjcZD3iEoA4r5iy9Zg3m6HLG88SH1LVAi2J4HhJYn\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50610199806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063313ce56711610050578063313ce567146100be57806370da2f67146100dc578063feaf968c146100e457610067565b806322adbc781461006c578063245a7bfc1461008d575b600080fd5b61007461012b565b60408051601792830b90920b8252519081900360200190f35b610095610130565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100c6610134565b6040805160ff9092168252519081900360200190f35b610074610139565b6100ec610153565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b600190565b3090565b600890565b75ffffffffffffffffffffffffffffffffffffffffffff90565b60006305f5e100814281909192939456fea265627a7a7231582096d52e62b7db851e886a9bc29a32d96b9f6214144e92e34046577a53ea03b15964736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063313ce56711610050578063313ce567146100be57806370da2f67146100dc578063feaf968c146100e457610067565b806322adbc781461006c578063245a7bfc1461008d575b600080fd5b61007461012b565b60408051601792830b90920b8252519081900360200190f35b610095610130565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100c6610134565b6040805160ff9092168252519081900360200190f35b610074610139565b6100ec610153565b6040805169ffffffffffffffffffff96871681526020810195909552848101939093526060840191909152909216608082015290519081900360a00190f35b600190565b3090565b600890565b75ffffffffffffffffffffffffffffffffffffffffffff90565b60006305f5e100814281909192939456fea265627a7a7231582096d52e62b7db851e886a9bc29a32d96b9f6214144e92e34046577a53ea03b15964736f6c63430005100032", "sourceMap": "937:989:140:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;937:989:140;;;;;;;", "deployedSourceMap": "937:989:140:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;937:989:140;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1522:77;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;1043:257;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1306:75;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1387:129;;;:::i;1605:319::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1522:77;1591:1;1522:77;:::o;1043:257::-;1287:4;1043:257;:::o;1306:75::-;1373:1;1306:75;:::o;1387:129::-;1456:53;1387:129;:::o;1605:319::-;1692:14;1884:9;1692:14;1898:15;1692:14;1605:319;;;;;:::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 TestUsdcUsdChainlinkAggregator 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 8;\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 {\n // $1.00\n return (0, 100000000, 0, block.timestamp, 0);\n }\n}\n", "sourcePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestUsdcUsdChainlinkAggregator.sol", "ast": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestUsdcUsdChainlinkAggregator.sol", "exportedSymbols": { "TestUsdcUsdChainlinkAggregator": [ 36785 ] }, "id": 36786, "nodeType": "SourceUnit", "nodes": [ { "id": 36718, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:140" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol", "file": "../external/interfaces/IChainlinkAggregator.sol", "id": 36720, "nodeType": "ImportDirective", "scope": 36786, "sourceUnit": 4191, "src": "620:87:140", "symbolAliases": [ { "foreign": 36719, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAccessControlAggregator.sol", "file": "../external/interfaces/IChainlinkAccessControlAggregator.sol", "id": 36722, "nodeType": "ImportDirective", "scope": 36786, "sourceUnit": 4162, "src": "708:113:140", "symbolAliases": [ { "foreign": 36721, "local": null } ], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 36723, "name": "IChainlinkAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4190, "src": "980:20:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAggregator_$4190", "typeString": "contract IChainlinkAggregator" } }, "id": 36724, "nodeType": "InheritanceSpecifier", "src": "980:20:140" }, { "arguments": null, "baseName": { "contractScope": null, "id": 36725, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1002:33:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "id": 36726, "nodeType": "InheritanceSpecifier", "src": "1002:33:140" } ], "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": 36785, "linearizedBaseContracts": [ 36785, 4161, 4190 ], "name": "TestUsdcUsdChainlinkAggregator", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 36737, "nodeType": "Block", "src": "1123:177:140", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36733, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38419, "src": "1287:4:140", "typeDescriptions": { "typeIdentifier": "t_contract$_TestUsdcUsdChainlinkAggregator_$36785", "typeString": "contract TestUsdcUsdChainlinkAggregator" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_TestUsdcUsdChainlinkAggregator_$36785", "typeString": "contract TestUsdcUsdChainlinkAggregator" } ], "id": 36732, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1279:7:140", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 36734, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1279:13:140", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 36731, "name": "IChainlinkAccessControlAggregator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4161, "src": "1245:33:140", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlinkAccessControlAggregator_$4161_$", "typeString": "type(contract IChainlinkAccessControlAggregator)" } }, "id": 36735, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1245:48:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "functionReturnParameters": 36730, "id": 36736, "nodeType": "Return", "src": "1238:55:140" } ] }, "documentation": null, "id": 36738, "implemented": true, "kind": "function", "modifiers": [], "name": "aggregator", "nodeType": "FunctionDefinition", "parameters": { "id": 36727, "nodeType": "ParameterList", "parameters": [], "src": "1062:2:140" }, "returnParameters": { "id": 36730, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36729, "name": "", "nodeType": "VariableDeclaration", "scope": 36738, "src": "1088:33:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" }, "typeName": { "contractScope": null, "id": 36728, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1088:33:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "value": null, "visibility": "internal" } ], "src": "1087:35:140" }, "scope": 36785, "src": "1043:257:140", "stateMutability": "view", "superFunction": 4171, "visibility": "external" }, { "body": { "id": 36745, "nodeType": "Block", "src": "1356:25:140", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "38", "id": 36743, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1373:1:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, "functionReturnParameters": 36742, "id": 36744, "nodeType": "Return", "src": "1366:8:140" } ] }, "documentation": null, "id": 36746, "implemented": true, "kind": "function", "modifiers": [], "name": "decimals", "nodeType": "FunctionDefinition", "parameters": { "id": 36739, "nodeType": "ParameterList", "parameters": [], "src": "1323:2:140" }, "returnParameters": { "id": 36742, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36741, "name": "", "nodeType": "VariableDeclaration", "scope": 36746, "src": "1349:5:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 36740, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "1349:5:140", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" } ], "src": "1348:7:140" }, "scope": 36785, "src": "1306:75:140", "stateMutability": "view", "superFunction": 4176, "visibility": "external" }, { "body": { "id": 36753, "nodeType": "Block", "src": "1439:77:140", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "3935373830393731333034313138303533363437333936363839313936383934333233393736313731313935313336343735313335", "id": 36751, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1456:53:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_95780971304118053647396689196894323976171195136475135_by_1", "typeString": "int_const 9578...(45 digits omitted)...5135" }, "value": "95780971304118053647396689196894323976171195136475135" }, "functionReturnParameters": 36750, "id": 36752, "nodeType": "Return", "src": "1449:60:140" } ] }, "documentation": null, "id": 36754, "implemented": true, "kind": "function", "modifiers": [], "name": "maxAnswer", "nodeType": "FunctionDefinition", "parameters": { "id": 36747, "nodeType": "ParameterList", "parameters": [], "src": "1405:2:140" }, "returnParameters": { "id": 36750, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36749, "name": "", "nodeType": "VariableDeclaration", "scope": 36754, "src": "1431:6:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" }, "typeName": { "id": 36748, "name": "int192", "nodeType": "ElementaryTypeName", "src": "1431:6:140", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" } }, "value": null, "visibility": "internal" } ], "src": "1430:8:140" }, "scope": 36785, "src": "1387:129:140", "stateMutability": "view", "superFunction": 4160, "visibility": "external" }, { "body": { "id": 36761, "nodeType": "Block", "src": "1574:25:140", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "31", "id": 36759, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1591:1:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "functionReturnParameters": 36758, "id": 36760, "nodeType": "Return", "src": "1584:8:140" } ] }, "documentation": null, "id": 36762, "implemented": true, "kind": "function", "modifiers": [], "name": "minAnswer", "nodeType": "FunctionDefinition", "parameters": { "id": 36755, "nodeType": "ParameterList", "parameters": [], "src": "1540:2:140" }, "returnParameters": { "id": 36758, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36757, "name": "", "nodeType": "VariableDeclaration", "scope": 36762, "src": "1566:6:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" }, "typeName": { "id": 36756, "name": "int192", "nodeType": "ElementaryTypeName", "src": "1566:6:140", "typeDescriptions": { "typeIdentifier": "t_int192", "typeString": "int192" } }, "value": null, "visibility": "internal" } ], "src": "1565:8:140" }, "scope": 36785, "src": "1522:77:140", "stateMutability": "view", "superFunction": 4155, "visibility": "external" }, { "body": { "id": 36783, "nodeType": "Block", "src": "1846:78:140", "statements": [ { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "hexValue": "30", "id": 36775, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1881:1:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, { "argumentTypes": null, "hexValue": "313030303030303030", "id": 36776, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1884:9:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_100000000_by_1", "typeString": "int_const 100000000" }, "value": "100000000" }, { "argumentTypes": null, "hexValue": "30", "id": 36777, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1895:1:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 36778, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38097, "src": "1898:5:140", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 36779, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "timestamp", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1898:15:140", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "hexValue": "30", "id": 36780, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1915:1:140", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "id": 36781, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1880:37:140", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_rational_0_by_1_$_t_rational_100000000_by_1_$_t_rational_0_by_1_$_t_uint256_$_t_rational_0_by_1_$", "typeString": "tuple(int_const 0,int_const 100000000,int_const 0,uint256,int_const 0)" } }, "functionReturnParameters": 36774, "id": 36782, "nodeType": "Return", "src": "1873:44:140" } ] }, "documentation": null, "id": 36784, "implemented": true, "kind": "function", "modifiers": [], "name": "latestRoundData", "nodeType": "FunctionDefinition", "parameters": { "id": 36763, "nodeType": "ParameterList", "parameters": [], "src": "1629:2:140" }, "returnParameters": { "id": 36774, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36765, "name": "roundId", "nodeType": "VariableDeclaration", "scope": 36784, "src": "1692:14:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" }, "typeName": { "id": 36764, "name": "uint80", "nodeType": "ElementaryTypeName", "src": "1692:6:140", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 36767, "name": "answer", "nodeType": "VariableDeclaration", "scope": 36784, "src": "1720:13:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 36766, "name": "int256", "nodeType": "ElementaryTypeName", "src": "1720:6:140", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 36769, "name": "startedAt", "nodeType": "VariableDeclaration", "scope": 36784, "src": "1747:17:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 36768, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1747:7:140", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 36771, "name": "updatedAt", "nodeType": "VariableDeclaration", "scope": 36784, "src": "1778:17:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 36770, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1778:7:140", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 36773, "name": "answeredInRound", "nodeType": "VariableDeclaration", "scope": 36784, "src": "1809:22:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" }, "typeName": { "id": 36772, "name": "uint80", "nodeType": "ElementaryTypeName", "src": "1809:6:140", "typeDescriptions": { "typeIdentifier": "t_uint80", "typeString": "uint80" } }, "value": null, "visibility": "internal" } ], "src": "1678:163:140" }, "scope": 36785, "src": "1605:319:140", "stateMutability": "view", "superFunction": 4189, "visibility": "external" } ], "scope": 36786, "src": "937:989:140" } ], "src": "595:1332:140" }, "legacyAST": { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/testing/TestUsdcUsdChainlinkAggregator.sol", "exportedSymbols": { "TestUsdcUsdChainlinkAggregator": [ 36785 ] }, "id": 36786, "nodeType": "SourceUnit", "nodes": [ { "id": 36718, "literals": [ "solidity", "^", "0.5", ".7" ], "nodeType": "PragmaDirective", "src": "595:23:140" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAggregator.sol", "file": "../external/interfaces/IChainlinkAggregator.sol", "id": 36720, "nodeType": "ImportDirective", "scope": 36786, "sourceUnit": 4191, "src": "620:87:140", "symbolAliases": [ { "foreign": 36719, "local": null } ], "unitAlias": "" }, { "absolutePath": "/home/cdc218/projects/dolomite-protocol-v2/contracts/external/interfaces/IChainlinkAccessControlAggregator.sol", "file": "../external/interfaces/IChainlinkAccessControlAggregator.sol", "id": 36722, "nodeType": "ImportDirective", "scope": 36786, "sourceUnit": 4162, "src": "708:113:140", "symbolAliases": [ { "foreign": 36721, "local": null } ], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 36723, "name": "IChainlinkAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4190, "src": "980:20:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAggregator_$4190", "typeString": "contract IChainlinkAggregator" } }, "id": 36724, "nodeType": "InheritanceSpecifier", "src": "980:20:140" }, { "arguments": null, "baseName": { "contractScope": null, "id": 36725, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1002:33:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "id": 36726, "nodeType": "InheritanceSpecifier", "src": "1002:33:140" } ], "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": 36785, "linearizedBaseContracts": [ 36785, 4161, 4190 ], "name": "TestUsdcUsdChainlinkAggregator", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 36737, "nodeType": "Block", "src": "1123:177:140", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36733, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 38419, "src": "1287:4:140", "typeDescriptions": { "typeIdentifier": "t_contract$_TestUsdcUsdChainlinkAggregator_$36785", "typeString": "contract TestUsdcUsdChainlinkAggregator" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_TestUsdcUsdChainlinkAggregator_$36785", "typeString": "contract TestUsdcUsdChainlinkAggregator" } ], "id": 36732, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1279:7:140", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 36734, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1279:13:140", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 36731, "name": "IChainlinkAccessControlAggregator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4161, "src": "1245:33:140", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlinkAccessControlAggregator_$4161_$", "typeString": "type(contract IChainlinkAccessControlAggregator)" } }, "id": 36735, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1245:48:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "functionReturnParameters": 36730, "id": 36736, "nodeType": "Return", "src": "1238:55:140" } ] }, "documentation": null, "id": 36738, "implemented": true, "kind": "function", "modifiers": [], "name": "aggregator", "nodeType": "FunctionDefinition", "parameters": { "id": 36727, "nodeType": "ParameterList", "parameters": [], "src": "1062:2:140" }, "returnParameters": { "id": 36730, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 36729, "name": "", "nodeType": "VariableDeclaration", "scope": 36738, "src": "1088:33:140", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" }, "typeName": { "contractScope": null, "id": 36728, "name": "IChainlinkAccessControlAggregator", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4161, "src": "1088:33:140", "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlinkAccessControlAggregator_$4161", "typeString": "contract IChainlinkAccessControlAggregator" } }, "value": null, "visibility": "internal" } ], "src": "1087:35:140" }, "scope": 36785, "src": "1043:257:140", "stateMutability": "view", "superFunction": 4171, "visibility": "external" }, { "body": { "id": 36745, "nodeType": "Block", "src": "1356:25:140", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "38", "id": 36743, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1373:1:140",