{ "contractName": "ChainlinkETHUSDTPriceOracleProxy", "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/ChainlinkEthUSDTPriceOracleProxy.sol\":\"ChainlinkETHUSDTPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDTPriceOracleProxy.sol\":{\"keccak256\":\"0x31064e788bd9a65876a82a982aa8c9217fa2b9b4398fc86310479c66774a0696\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b1f319120cf0071d800b5273d5ecfb514986e81abe90aa60d711980e6ba85ce9\",\"dweb:/ipfs/QmYPmRFHtEcto2XWX6KRiyWEdrLZeA7b5gEJk7N5d9pxQk\"]}},\"version\":1}", "bytecode": "0x6080604052600080546001600160a01b03191673ee9f2375b4bdf6387aa8265dd4fb8f16512a1d4617905534801561003657600080fd5b50610187806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610148565b60405180910390f35b61006161010d565b6040516100509190610134565b60008060009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100bd57600080fd5b505afa1580156100d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f5919061011c565b69d3c21bcecceda10000008161010757fe5b04905090565b6000546001600160a01b031681565b60006020828403121561012d578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220428095be92520b1539541bd81554548f3a314c244d6918196329713135ba236164736f6c63430006090033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610148565b60405180910390f35b61006161010d565b6040516100509190610134565b60008060009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100bd57600080fd5b505afa1580156100d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f5919061011c565b69d3c21bcecceda10000008161010757fe5b04905090565b6000546001600160a01b031681565b60006020828403121561012d578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220428095be92520b1539541bd81554548f3a314c244d6918196329713135ba236164736f6c63430006090033", "immutableReferences": {}, "sourceMap": "269:247:6:-:0;;;317:69;;;-1:-1:-1;;;;;;317:69:6;344:42;317:69;;;269:247;;;;;;;;;;;;;;;;", "deployedSourceMap": "269:247:6:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;393:121;;;:::i;:::-;;;;;;;;;;;;;;;;317:69;;;:::i;:::-;;;;;;;;393:121;436:7;482:9;;;;;;;;;-1:-1:-1;;;;;482:9:6;-1:-1:-1;;;;;471:34:6;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;462:6;:45;;;;;;455:52;;393:121;:::o;317:69::-;;;-1:-1:-1;;;;;317:69:6;;:::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 WETH-USDT(decimals=6) price convert\n\ncontract ChainlinkETHUSDTPriceOracleProxy {\n address public chainlink = 0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46;\n\n function getPrice() external view returns (uint256) {\n return 10**24 / IChainlink(chainlink).latestAnswer();\n }\n}\n", "sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDTPriceOracleProxy.sol", "ast": { "absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDTPriceOracleProxy.sol", "exportedSymbols": { "ChainlinkETHUSDTPriceOracleProxy": [ 1811 ], "IChainlink": [ 1791 ] }, "id": 1812, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 1784, "literals": [ "solidity", "0.6", ".9" ], "nodeType": "PragmaDirective", "src": "78:22:6" }, { "id": 1785, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "101:33:6" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 1791, "linearizedBaseContracts": [ 1791 ], "name": "IChainlink", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "50d25bcd", "id": 1790, "implemented": false, "kind": "function", "modifiers": [], "name": "latestAnswer", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1786, "nodeType": "ParameterList", "parameters": [], "src": "185:2:6" }, "returnParameters": { "id": 1789, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1788, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1790, "src": "211:7:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1787, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "211:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "210:9:6" }, "scope": 1791, "src": "164:56:6", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1812, "src": "137:85:6" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1811, "linearizedBaseContracts": [ 1811 ], "name": "ChainlinkETHUSDTPriceOracleProxy", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "9c3feeb7", "id": 1794, "mutability": "mutable", "name": "chainlink", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1811, "src": "317:69:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1792, "name": "address", "nodeType": "ElementaryTypeName", "src": "317:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "argumentTypes": null, "hexValue": "307845653946323337356234626446363338376161383236356444344642384631363531324131643436", "id": 1793, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "344:42:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, "value": "0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46" }, "visibility": "public" }, { "body": { "id": 1809, "nodeType": "Block", "src": "445:69:6", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1807, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_rational_1000000000000000000000000_by_1", "typeString": "int_const 1000000000000000000000000" }, "id": 1801, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "hexValue": "3130", "id": 1799, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "462:2:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "argumentTypes": null, "hexValue": "3234", "id": 1800, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "466:2:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_24_by_1", "typeString": "int_const 24" }, "value": "24" }, "src": "462:6:6", "typeDescriptions": { "typeIdentifier": "t_rational_1000000000000000000000000_by_1", "typeString": "int_const 1000000000000000000000000" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1803, "name": "chainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1794, "src": "482:9:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1802, "name": "IChainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1791, "src": "471:10:6", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlink_$1791_$", "typeString": "type(contract IChainlink)" } }, "id": 1804, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "471:21:6", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlink_$1791", "typeString": "contract IChainlink" } }, "id": 1805, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "latestAnswer", "nodeType": "MemberAccess", "referencedDeclaration": 1790, "src": "471:34:6", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)" } }, "id": 1806, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "471:36:6", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "462:45:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1798, "id": 1808, "nodeType": "Return", "src": "455:52:6" } ] }, "documentation": null, "functionSelector": "98d5fdca", "id": 1810, "implemented": true, "kind": "function", "modifiers": [], "name": "getPrice", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1795, "nodeType": "ParameterList", "parameters": [], "src": "410:2:6" }, "returnParameters": { "id": 1798, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1797, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1810, "src": "436:7:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1796, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "436:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "435:9:6" }, "scope": 1811, "src": "393:121:6", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1812, "src": "269:247:6" } ], "src": "78:439:6" }, "legacyAST": { "absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDTPriceOracleProxy.sol", "exportedSymbols": { "ChainlinkETHUSDTPriceOracleProxy": [ 1811 ], "IChainlink": [ 1791 ] }, "id": 1812, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 1784, "literals": [ "solidity", "0.6", ".9" ], "nodeType": "PragmaDirective", "src": "78:22:6" }, { "id": 1785, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "101:33:6" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "interface", "documentation": null, "fullyImplemented": false, "id": 1791, "linearizedBaseContracts": [ 1791 ], "name": "IChainlink", "nodeType": "ContractDefinition", "nodes": [ { "body": null, "documentation": null, "functionSelector": "50d25bcd", "id": 1790, "implemented": false, "kind": "function", "modifiers": [], "name": "latestAnswer", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1786, "nodeType": "ParameterList", "parameters": [], "src": "185:2:6" }, "returnParameters": { "id": 1789, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1788, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1790, "src": "211:7:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1787, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "211:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "210:9:6" }, "scope": 1791, "src": "164:56:6", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1812, "src": "137:85:6" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 1811, "linearizedBaseContracts": [ 1811 ], "name": "ChainlinkETHUSDTPriceOracleProxy", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "9c3feeb7", "id": 1794, "mutability": "mutable", "name": "chainlink", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1811, "src": "317:69:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1792, "name": "address", "nodeType": "ElementaryTypeName", "src": "317:7:6", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "argumentTypes": null, "hexValue": "307845653946323337356234626446363338376161383236356444344642384631363531324131643436", "id": 1793, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "344:42:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, "value": "0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46" }, "visibility": "public" }, { "body": { "id": 1809, "nodeType": "Block", "src": "445:69:6", "statements": [ { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1807, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_rational_1000000000000000000000000_by_1", "typeString": "int_const 1000000000000000000000000" }, "id": 1801, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "hexValue": "3130", "id": 1799, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "462:2:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "nodeType": "BinaryOperation", "operator": "**", "rightExpression": { "argumentTypes": null, "hexValue": "3234", "id": 1800, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "466:2:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_24_by_1", "typeString": "int_const 24" }, "value": "24" }, "src": "462:6:6", "typeDescriptions": { "typeIdentifier": "t_rational_1000000000000000000000000_by_1", "typeString": "int_const 1000000000000000000000000" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1803, "name": "chainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1794, "src": "482:9:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1802, "name": "IChainlink", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1791, "src": "471:10:6", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IChainlink_$1791_$", "typeString": "type(contract IChainlink)" } }, "id": 1804, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "471:21:6", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_IChainlink_$1791", "typeString": "contract IChainlink" } }, "id": 1805, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "latestAnswer", "nodeType": "MemberAccess", "referencedDeclaration": 1790, "src": "471:34:6", "typeDescriptions": { "typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)" } }, "id": 1806, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "471:36:6", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "462:45:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1798, "id": 1808, "nodeType": "Return", "src": "455:52:6" } ] }, "documentation": null, "functionSelector": "98d5fdca", "id": 1810, "implemented": true, "kind": "function", "modifiers": [], "name": "getPrice", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1795, "nodeType": "ParameterList", "parameters": [], "src": "410:2:6" }, "returnParameters": { "id": 1798, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1797, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1810, "src": "436:7:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1796, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "436:7:6", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "435:9:6" }, "scope": 1811, "src": "393:121:6", "stateMutability": "view", "virtual": false, "visibility": "external" } ], "scope": 1812, "src": "269:247:6" } ], "src": "78:439:6" }, "compiler": { "name": "solc", "version": "0.6.9+commit.3e3065ac.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.3", "updatedAt": "2020-11-06T08:03:35.504Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {} } }