{ "contractName": "ChainlinkCOMPUSDCPriceOracleProxy", "abi": [ { "inputs": [], "name": "chainlink", "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\":\"chainlink\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkCOMPUSDCPriceOracleProxy.sol\":\"ChainlinkCOMPUSDCPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkCOMPUSDCPriceOracleProxy.sol\":{\"keccak256\":\"0x877cd3a97cdaa00539540a42f82bcc0f31052691f6b1b9d0ac1c95e17553bc7f\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://c7521a6fffeeda9c1dec37693b3feb632f15c33f403fee934c9cf9f823b5b099\",\"dweb:/ipfs/QmQMcqmV4u7wPwE4DZPWwckJhbQWcxz7Ds4nscGTGLCHKJ\"]}},\"version\":1}", "bytecode": "0x6080604052600080546001600160a01b03191673dbd020caef83efd542f4de03e3cf0c28a4428bd517905534801561003657600080fd5b50610173806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea264697066735822122086c588800adb33f879ded9ec8d3bcd8fdbd92571643d10bb8946fe873f76629b64736f6c63430006090033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea264697066735822122086c588800adb33f879ded9ec8d3bcd8fdbd92571643d10bb8946fe873f76629b64736f6c63430006090033", "immutableReferences": {}, "sourceMap": "269:245:4:-:0;;;318:69;;;-1:-1:-1;;;;;;318:69:4;345:42;318:69;;;269:245;;;;;;;;;;;;;;;;", "deployedSourceMap": "269:245:4:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;394:118;;;:::i;:::-;;;;;;;;;;;;;;;;318:69;;;:::i;:::-;;;;;;;;394:118;437:7;474:9;;463:36;;;-1:-1:-1;;;463:36:4;;;;502:3;;-1:-1:-1;;;;;474:9:4;;463:34;;:36;;;;;;;;;;;;;;474:9;463:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:42;;;;;;456:49;;394:118;:::o;318:69::-;;;-1:-1:-1;;;;;318:69:4;;:::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;656:222;-1:-1;;;;;1274:54;;;;487:37;;783:2;768:18;;754:124;885:222;607:37;;;1012:2;997:18;;983: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\n\ninterface IChainlink {\n function latestAnswer() external view returns (uint256);\n}\n\n\n// for COMP-USDC(decimals=6) price convert\n\ncontract ChainlinkCOMPUSDCPriceOracleProxy {\n address public chainlink = 0xdbd020CAeF83eFd542f4De03e3cF0C28A4428bd5;\n\n function getPrice() external view returns (uint256) {\n return IChainlink(chainlink).latestAnswer() / 100;\n }\n}\n", "sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkCOMPUSDCPriceOracleProxy.sol", "ast": { "absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkCOMPUSDCPriceOracleProxy.sol", "exportedSymbols": { "ChainlinkCOMPUSDCPriceOracleProxy": [ 1755 ], "IChainlink": [ 1737 ] }, "id": 1756, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 1730, "literals": [ "solidity", "0.6", ".9" ], "nodeType": "PragmaDirective", "src": "78:22:4" }, { "id": 1731, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "101:33:4" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 1737, "linearizedBaseContracts": [ 1737 ], "name": "IChainlink", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "50d25bcd", "id": 1736, "implemented": false, "kind": "function", "modifiers": [], "name": "latestAnswer", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1732, "nodeType": "ParameterList", "parameters": [], "src": "185:2:4" }, "returnParameters": { "id": 1735, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1734, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1736, "src": "211:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1733, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "211:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "210:9:4" }, "scope": 1737, "src": "164:56:4", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1756, "src": "137:85:4" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1755, "linearizedBaseContracts": [ 1755 ], "name": "ChainlinkCOMPUSDCPriceOracleProxy", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "9c3feeb7", "id": 1740, "mutability": "mutable", "name": "chainlink", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1755, "src": "318:69:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1738, "name": "address", "nodeType": "ElementaryTypeName", "src": "318:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "argumentTypes": null, "hexValue": "307864626430323043416546383365466435343266344465303365336346304332384134343238626435", "id": 1739, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "345:42:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, "value": "0xdbd020CAeF83eFd542f4De03e3cF0C28A4428bd5" }, "visibility": "public" }, { "body": { "id": 1753, "nodeType": "Block", "src": "446:66:4", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1751, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1746, "name": "chainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1740, "src": "474:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1745, "name": "IChainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1737, "src": "463:10:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlink_$1737_$", "typeString": "type(contract IChainlink)" } }, "id": 1747, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "463:21:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlink_$1737", "typeString": "contract IChainlink" } }, "id": 1748, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "latestAnswer", "nodeType": "MemberAccess", "referencedDeclaration": 1736, "src": "463:34:4", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)" } }, "id": 1749, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "463:36:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "hexValue": "313030", "id": 1750, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "502:3:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" }, "value": "100" }, "src": "463:42:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1744, "id": 1752, "nodeType": "Return", "src": "456:49:4" } ] }, "documentation": null, "functionSelector": "98d5fdca", "id": 1754, "implemented": true, "kind": "function", "modifiers": [], "name": "getPrice", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1741, "nodeType": "ParameterList", "parameters": [], "src": "411:2:4" }, "returnParameters": { "id": 1744, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1743, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1754, "src": "437:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1742, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "437:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "436:9:4" }, "scope": 1755, "src": "394:118:4", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1756, "src": "269:245:4" } ], "src": "78:437:4" }, "legacyAST": { "absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkCOMPUSDCPriceOracleProxy.sol", "exportedSymbols": { "ChainlinkCOMPUSDCPriceOracleProxy": [ 1755 ], "IChainlink": [ 1737 ] }, "id": 1756, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 1730, "literals": [ "solidity", "0.6", ".9" ], "nodeType": "PragmaDirective", "src": "78:22:4" }, { "id": 1731, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "101:33:4" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 1737, "linearizedBaseContracts": [ 1737 ], "name": "IChainlink", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "50d25bcd", "id": 1736, "implemented": false, "kind": "function", "modifiers": [], "name": "latestAnswer", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1732, "nodeType": "ParameterList", "parameters": [], "src": "185:2:4" }, "returnParameters": { "id": 1735, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1734, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1736, "src": "211:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1733, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "211:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "210:9:4" }, "scope": 1737, "src": "164:56:4", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1756, "src": "137:85:4" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1755, "linearizedBaseContracts": [ 1755 ], "name": "ChainlinkCOMPUSDCPriceOracleProxy", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "9c3feeb7", "id": 1740, "mutability": "mutable", "name": "chainlink", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1755, "src": "318:69:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1738, "name": "address", "nodeType": "ElementaryTypeName", "src": "318:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "argumentTypes": null, "hexValue": "307864626430323043416546383365466435343266344465303365336346304332384134343238626435", "id": 1739, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "345:42:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, "value": "0xdbd020CAeF83eFd542f4De03e3cF0C28A4428bd5" }, "visibility": "public" }, { "body": { "id": 1753, "nodeType": "Block", "src": "446:66:4", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1751, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1746, "name": "chainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1740, "src": "474:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1745, "name": "IChainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1737, "src": "463:10:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlink_$1737_$", "typeString": "type(contract IChainlink)" } }, "id": 1747, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "463:21:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlink_$1737", "typeString": "contract IChainlink" } }, "id": 1748, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "latestAnswer", "nodeType": "MemberAccess", "referencedDeclaration": 1736, "src": "463:34:4", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)" } }, "id": 1749, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "463:36:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "hexValue": "313030", "id": 1750, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "502:3:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_100_by_1", "typeString": "int_const 100" }, "value": "100" }, "src": "463:42:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1744, "id": 1752, "nodeType": "Return", "src": "456:49:4" } ] }, "documentation": null, "functionSelector": "98d5fdca", "id": 1754, "implemented": true, "kind": "function", "modifiers": [], "name": "getPrice", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1741, "nodeType": "ParameterList", "parameters": [], "src": "411:2:4" }, "returnParameters": { "id": 1744, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1743, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1754, "src": "437:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1742, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "437:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "436:9:4" }, "scope": 1755, "src": "394:118:4", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1756, "src": "269:245:4" } ], "src": "78:437:4" }, "compiler": { "name": "solc", "version": "0.6.9+commit.3e3065ac.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.3", "updatedAt": "2020-11-06T08:03:35.492Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }