Files
dodo-contractV2/build-v1/contracts/ChainlinkYFIUSDCPriceOracleProxy.json
2020-11-10 18:38:34 +08:00

1573 lines
65 KiB
JSON

{
"contractName": "ChainlinkYFIUSDCPriceOracleProxy",
"abi": [
{
"inputs": [],
"name": "EthUsd",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "yfiEth",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getPrice",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"EthUsd\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"yfiEth\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkYFIUSDCPriceOracleProxy.sol\":\"ChainlinkYFIUSDCPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkYFIUSDCPriceOracleProxy.sol\":{\"keccak256\":\"0x968af1e723a96686c3835fe68dbdbe21684935743b1639a9342aa5021c2e0c88\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://e358426ab8ef57cc2647d8a7d40a876e9e8f81fc69b16b5a298659024894a808\",\"dweb:/ipfs/QmQQkhg9rajRi9Xg6rwbMV8swyC8kjT2ukb34EL2tMr3EG\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol\":{\"keccak256\":\"0x57d750628881687f826b54f60cbfd46c1a172433eed892bbb123f91869886af1\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b40bd7946010ddae9679f36630510217dcaa9cb8643824f9edc8ef52bda95717\",\"dweb:/ipfs/QmZSjpfUGyrmokZyaMc74a8h6zy2qFVECPVP8VfTvzNEFb\"]}},\"version\":1}",
"bytecode": "0x6080604052600080546001600160a01b0319908116737c5d4f8345e66f68099581db340cd65b078c41f41790915560018054909116735f4ec3df9cbd43714fe2740f5e3616155c5b841917905534801561005857600080fd5b5061030c806100686000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806328737ae51461004657806398d5fdca14610064578063f57689d514610079575b600080fd5b61004e610081565b60405161005b919061026e565b60405180910390f35b61006c610090565b60405161005b91906102cd565b61004e6101c9565b6000546001600160a01b031681565b60008054604080516350d25bcd60e01b8152905183926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100d557600080fd5b505afa1580156100e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061010d9190610256565b90506000600160009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561015f57600080fd5b505afa158015610173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101979190610256565b90506101c268056bc75e2d631000006101b6848463ffffffff6101d816565b9063ffffffff61022416565b9250505090565b6001546001600160a01b031681565b6000826101e75750600061021e565b828202828482816101f457fe5b041461021b5760405162461bcd60e51b8152600401610212906102aa565b60405180910390fd5b90505b92915050565b60008082116102455760405162461bcd60e51b815260040161021290610282565b81838161024e57fe5b049392505050565b600060208284031215610267578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b9081526020019056fea2646970667358221220ba7fbf63c00d658b8e32971f1efb1a92bbde656ec5df1ec5e928c1fe6330c26f64736f6c63430006090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806328737ae51461004657806398d5fdca14610064578063f57689d514610079575b600080fd5b61004e610081565b60405161005b919061026e565b60405180910390f35b61006c610090565b60405161005b91906102cd565b61004e6101c9565b6000546001600160a01b031681565b60008054604080516350d25bcd60e01b8152905183926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100d557600080fd5b505afa1580156100e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061010d9190610256565b90506000600160009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561015f57600080fd5b505afa158015610173573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101979190610256565b90506101c268056bc75e2d631000006101b6848463ffffffff6101d816565b9063ffffffff61022416565b9250505090565b6001546001600160a01b031681565b6000826101e75750600061021e565b828202828482816101f457fe5b041461021b5760405162461bcd60e51b8152600401610212906102aa565b60405180910390fd5b90505b92915050565b60008082116102455760405162461bcd60e51b815260040161021290610282565b81838161024e57fe5b049392505050565b600060208284031215610267578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b9081526020019056fea2646970667358221220ba7fbf63c00d658b8e32971f1efb1a92bbde656ec5df1ec5e928c1fe6330c26f64736f6c63430006090033",
"immutableReferences": {},
"sourceMap": "315:474:11:-:0;;;396:66;;;-1:-1:-1;;;;;;396:66:11;;;420:42;396:66;;;;;468;;;;;492:42;468:66;;;315:474;;;;;;;;;;;;;;;;",
"deployedSourceMap": "315:474:11:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;396:66;;;:::i;:::-;;;;;;;;;;;;;;;;541:246;;;:::i;:::-;;;;;;;;468:66;;;:::i;396:::-;;;-1:-1:-1;;;;;396:66:11;;:::o;541:246::-;584:7;636:6;;625:33;;;-1:-1:-1;;;625:33:11;;;;584:7;;-1:-1:-1;;;;;636:6:11;;625:31;;:33;;;;;;;;;;;;;;636:6;625:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;603:55;;668:19;701:6;;;;;;;;;-1:-1:-1;;;;;701:6:11;-1:-1:-1;;;;;690:31:11;;:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;668:55;-1:-1:-1;740:40:11;773:6;740:28;:11;668:55;740:28;:15;:28;:::i;:::-;:32;:40;:32;:40;:::i;:::-;733:47;;;;541:246;:::o;468:66::-;;;-1:-1:-1;;;;;468:66:11;;:::o;281:217:41:-;339:7;362:6;358:45;;-1:-1:-1;391:1:41;384:8;;358:45;425:5;;;429:1;425;:5;:1;448:5;;;;;:10;440:32;;;;-1:-1:-1;;;440:32:41;;;;;;;;;;;;;;;;;490:1;-1:-1:-1;281:217:41;;;;;:::o;504:138::-;562:7;593:1;589;:5;581:32;;;;-1:-1:-1;;;581:32:41;;;;;;;;;634:1;630;:5;;;;;;;504:138;-1:-1:-1;;;504:138:41:o;146:263:-1:-;;261:2;249:9;240:7;236:23;232:32;229:2;;;-1:-1;;267:12;229:2;-1:-1;83:13;;223:186;-1:-1;223:186;1296:222;-1:-1;;;;;2932:54;;;;487:37;;1423:2;1408:18;;1394:124;1525:416;1725:2;1739:47;;;761:2;1710:18;;;2704:19;-1:-1;;;2744:14;;;777:37;833:12;;;1696:245;1948:416;2148:2;2162:47;;;1084:1;2133:18;;;2704:19;-1:-1;;;2744:14;;;1099:32;1150:12;;;2119:245;2371:222;1247:37;;;2498:2;2483:18;;2469:124",
"source": "/*\n\n Copyright 2020 DODO ZOO.\n SPDX-License-Identifier: Apache-2.0\n\n*/\n\npragma solidity 0.6.9;\npragma experimental ABIEncoderV2;\n\nimport {SafeMath} from \"../lib/SafeMath.sol\";\n\n\ninterface IChainlink {\n function latestAnswer() external view returns (uint256);\n}\n\n\n// for YFI-USDC(decimals=6) price convert\n\ncontract ChainlinkYFIUSDCPriceOracleProxy {\n using SafeMath for uint256;\n\n address public yfiEth = 0x7c5d4F8345e66f68099581Db340cd65B078C41f4;\n address public EthUsd = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419;\n\n function getPrice() external view returns (uint256) {\n uint256 yfiEthPrice = IChainlink(yfiEth).latestAnswer();\n uint256 EthUsdPrice = IChainlink(EthUsd).latestAnswer();\n return yfiEthPrice.mul(EthUsdPrice).div(10**20);\n }\n}\n",
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkYFIUSDCPriceOracleProxy.sol",
"ast": {
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkYFIUSDCPriceOracleProxy.sol",
"exportedSymbols": {
"ChainlinkYFIUSDCPriceOracleProxy": [
1975
],
"IChainlink": [
1933
]
},
"id": 1976,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1924,
"literals": [
"solidity",
"0.6",
".9"
],
"nodeType": "PragmaDirective",
"src": "78:22:11"
},
{
"id": 1925,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "101:33:11"
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol",
"file": "../lib/SafeMath.sol",
"id": 1927,
"nodeType": "ImportDirective",
"scope": 1976,
"sourceUnit": 11624,
"src": "136:45:11",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 1926,
"name": "SafeMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "144:8:11",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 1933,
"linearizedBaseContracts": [
1933
],
"name": "IChainlink",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "50d25bcd",
"id": 1932,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "latestAnswer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1928,
"nodeType": "ParameterList",
"parameters": [],
"src": "232:2:11"
},
"returnParameters": {
"id": 1931,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1930,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1932,
"src": "258:7:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1929,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "258:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "257:9:11"
},
"scope": 1933,
"src": "211:56:11",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1976,
"src": "184:85:11"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1975,
"linearizedBaseContracts": [
1975
],
"name": "ChainlinkYFIUSDCPriceOracleProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 1936,
"libraryName": {
"contractScope": null,
"id": 1934,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11623,
"src": "369:8:11",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$11623",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "363:27:11",
"typeName": {
"id": 1935,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "382:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"functionSelector": "28737ae5",
"id": 1939,
"mutability": "mutable",
"name": "yfiEth",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "396:66:11",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1937,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "396:7:11",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307837633564344638333435653636663638303939353831446233343063643635423037384334316634",
"id": 1938,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "420:42:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0x7c5d4F8345e66f68099581Db340cd65B078C41f4"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "f57689d5",
"id": 1942,
"mutability": "mutable",
"name": "EthUsd",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "468:66:11",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1940,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "468:7:11",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307835663465433344663963626434333731344645323734306635453336313631353563356238343139",
"id": 1941,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "492:42:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
},
"visibility": "public"
},
{
"body": {
"id": 1973,
"nodeType": "Block",
"src": "593:194:11",
"statements": [
{
"assignments": [
1948
],
"declarations": [
{
"constant": false,
"id": 1948,
"mutability": "mutable",
"name": "yfiEthPrice",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1973,
"src": "603:19:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1947,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "603:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1954,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1950,
"name": "yfiEth",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1939,
"src": "636:6:11",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1949,
"name": "IChainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1933,
"src": "625:10:11",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1933_$",
"typeString": "type(contract IChainlink)"
}
},
"id": 1951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "625:18:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IChainlink_$1933",
"typeString": "contract IChainlink"
}
},
"id": 1952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "latestAnswer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1932,
"src": "625:31:11",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 1953,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "625:33:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "603:55:11"
},
{
"assignments": [
1956
],
"declarations": [
{
"constant": false,
"id": 1956,
"mutability": "mutable",
"name": "EthUsdPrice",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1973,
"src": "668:19:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1955,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "668:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1962,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1958,
"name": "EthUsd",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1942,
"src": "701:6:11",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1957,
"name": "IChainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1933,
"src": "690:10:11",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1933_$",
"typeString": "type(contract IChainlink)"
}
},
"id": 1959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "690:18:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IChainlink_$1933",
"typeString": "contract IChainlink"
}
},
"id": 1960,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "latestAnswer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1932,
"src": "690:31:11",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 1961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "690:33:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "668:55:11"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_100000000000000000000_by_1",
"typeString": "int_const 100000000000000000000"
},
"id": 1970,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "3130",
"id": 1968,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "773:2:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3230",
"id": 1969,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "777:2:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_20_by_1",
"typeString": "int_const 20"
},
"value": "20"
},
"src": "773:6:11",
"typeDescriptions": {
"typeIdentifier": "t_rational_100000000000000000000_by_1",
"typeString": "int_const 100000000000000000000"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_100000000000000000000_by_1",
"typeString": "int_const 100000000000000000000"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1965,
"name": "EthUsdPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1956,
"src": "756:11:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1963,
"name": "yfiEthPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1948,
"src": "740:11:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1964,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11478,
"src": "740:15:11",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 1966,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "740:28:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1967,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 11499,
"src": "740:32:11",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 1971,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "740:40:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1946,
"id": 1972,
"nodeType": "Return",
"src": "733:47:11"
}
]
},
"documentation": null,
"functionSelector": "98d5fdca",
"id": 1974,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getPrice",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1943,
"nodeType": "ParameterList",
"parameters": [],
"src": "558:2:11"
},
"returnParameters": {
"id": 1946,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1945,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1974,
"src": "584:7:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1944,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "584:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "583:9:11"
},
"scope": 1975,
"src": "541:246:11",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1976,
"src": "315:474:11"
}
],
"src": "78:712:11"
},
"legacyAST": {
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkYFIUSDCPriceOracleProxy.sol",
"exportedSymbols": {
"ChainlinkYFIUSDCPriceOracleProxy": [
1975
],
"IChainlink": [
1933
]
},
"id": 1976,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1924,
"literals": [
"solidity",
"0.6",
".9"
],
"nodeType": "PragmaDirective",
"src": "78:22:11"
},
{
"id": 1925,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "101:33:11"
},
{
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol",
"file": "../lib/SafeMath.sol",
"id": 1927,
"nodeType": "ImportDirective",
"scope": 1976,
"sourceUnit": 11624,
"src": "136:45:11",
"symbolAliases": [
{
"foreign": {
"argumentTypes": null,
"id": 1926,
"name": "SafeMath",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": null,
"src": "144:8:11",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
},
"local": null
}
],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 1933,
"linearizedBaseContracts": [
1933
],
"name": "IChainlink",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "50d25bcd",
"id": 1932,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "latestAnswer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1928,
"nodeType": "ParameterList",
"parameters": [],
"src": "232:2:11"
},
"returnParameters": {
"id": 1931,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1930,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1932,
"src": "258:7:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1929,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "258:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "257:9:11"
},
"scope": 1933,
"src": "211:56:11",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1976,
"src": "184:85:11"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1975,
"linearizedBaseContracts": [
1975
],
"name": "ChainlinkYFIUSDCPriceOracleProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 1936,
"libraryName": {
"contractScope": null,
"id": 1934,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 11623,
"src": "369:8:11",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$11623",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "363:27:11",
"typeName": {
"id": 1935,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "382:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"functionSelector": "28737ae5",
"id": 1939,
"mutability": "mutable",
"name": "yfiEth",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "396:66:11",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1937,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "396:7:11",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307837633564344638333435653636663638303939353831446233343063643635423037384334316634",
"id": 1938,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "420:42:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0x7c5d4F8345e66f68099581Db340cd65B078C41f4"
},
"visibility": "public"
},
{
"constant": false,
"functionSelector": "f57689d5",
"id": 1942,
"mutability": "mutable",
"name": "EthUsd",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1975,
"src": "468:66:11",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1940,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "468:7:11",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307835663465433344663963626434333731344645323734306635453336313631353563356238343139",
"id": 1941,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "492:42:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
},
"visibility": "public"
},
{
"body": {
"id": 1973,
"nodeType": "Block",
"src": "593:194:11",
"statements": [
{
"assignments": [
1948
],
"declarations": [
{
"constant": false,
"id": 1948,
"mutability": "mutable",
"name": "yfiEthPrice",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1973,
"src": "603:19:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1947,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "603:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1954,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1950,
"name": "yfiEth",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1939,
"src": "636:6:11",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1949,
"name": "IChainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1933,
"src": "625:10:11",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1933_$",
"typeString": "type(contract IChainlink)"
}
},
"id": 1951,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "625:18:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IChainlink_$1933",
"typeString": "contract IChainlink"
}
},
"id": 1952,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "latestAnswer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1932,
"src": "625:31:11",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 1953,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "625:33:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "603:55:11"
},
{
"assignments": [
1956
],
"declarations": [
{
"constant": false,
"id": 1956,
"mutability": "mutable",
"name": "EthUsdPrice",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1973,
"src": "668:19:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1955,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "668:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1962,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1958,
"name": "EthUsd",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1942,
"src": "701:6:11",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1957,
"name": "IChainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1933,
"src": "690:10:11",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1933_$",
"typeString": "type(contract IChainlink)"
}
},
"id": 1959,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "690:18:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IChainlink_$1933",
"typeString": "contract IChainlink"
}
},
"id": 1960,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "latestAnswer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1932,
"src": "690:31:11",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 1961,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "690:33:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "668:55:11"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_100000000000000000000_by_1",
"typeString": "int_const 100000000000000000000"
},
"id": 1970,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "3130",
"id": 1968,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "773:2:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3230",
"id": 1969,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "777:2:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_20_by_1",
"typeString": "int_const 20"
},
"value": "20"
},
"src": "773:6:11",
"typeDescriptions": {
"typeIdentifier": "t_rational_100000000000000000000_by_1",
"typeString": "int_const 100000000000000000000"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_100000000000000000000_by_1",
"typeString": "int_const 100000000000000000000"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1965,
"name": "EthUsdPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1956,
"src": "756:11:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 1963,
"name": "yfiEthPrice",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1948,
"src": "740:11:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1964,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mul",
"nodeType": "MemberAccess",
"referencedDeclaration": 11478,
"src": "740:15:11",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 1966,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "740:28:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1967,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 11499,
"src": "740:32:11",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 1971,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "740:40:11",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1946,
"id": 1972,
"nodeType": "Return",
"src": "733:47:11"
}
]
},
"documentation": null,
"functionSelector": "98d5fdca",
"id": 1974,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getPrice",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1943,
"nodeType": "ParameterList",
"parameters": [],
"src": "558:2:11"
},
"returnParameters": {
"id": 1946,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1945,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1974,
"src": "584:7:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1944,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "584:7:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "583:9:11"
},
"scope": 1975,
"src": "541:246:11",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1976,
"src": "315:474:11"
}
],
"src": "78:712:11"
},
"compiler": {
"name": "solc",
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.3",
"updatedAt": "2020-11-06T08:03:35.507Z",
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
}