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

788 lines
30 KiB
JSON

{
"contractName": "ChainlinkETHPriceOracleProxy",
"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/ChainlinkEthUSDCPriceOracleProxy.sol\":\"ChainlinkETHPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDCPriceOracleProxy.sol\":{\"keccak256\":\"0xa3d5f252b03f5a5140c36a6815612e6484ad60cf6e88846dfafc14de7c76ee05\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://92ab3dcca573ab8f5ce280c2b26e1ddd692bc20f51515e129844b4143437bbb4\",\"dweb:/ipfs/QmWShayRc3PFHWAkzyW9mMVRjEGcGRP6t2CEpHxVibpRGw\"]}},\"version\":1}",
"bytecode": "0x6080604052600080546001600160a01b031916735f4ec3df9cbd43714fe2740f5e3616155c5b841917905534801561003657600080fd5b50610173806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea26469706673582212205555b0b7c9d5fd397dcfc32dc4ba242ea35e2b5c33b9133350713a49ea552d0064736f6c63430006090033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea26469706673582212205555b0b7c9d5fd397dcfc32dc4ba242ea35e2b5c33b9133350713a49ea552d0064736f6c63430006090033",
"immutableReferences": {},
"sourceMap": "269:240:5:-:0;;;313:69;;;-1:-1:-1;;;;;;313:69:5;340:42;313:69;;;269:240;;;;;;;;;;;;;;;;",
"deployedSourceMap": "269:240:5:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;389:118;;;:::i;:::-;;;;;;;;;;;;;;;;313:69;;;:::i;:::-;;;;;;;;389:118;432:7;469:9;;458:36;;;-1:-1:-1;;;458:36:5;;;;497:3;;-1:-1:-1;;;;;469:9:5;;458:34;;:36;;;;;;;;;;;;;;469:9;458:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:42;;;;;;451:49;;389:118;:::o;313:69::-;;;-1:-1:-1;;;;;313:69:5;;:::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-USDC(decimals=6) price convert\n\ncontract ChainlinkETHPriceOracleProxy {\n address public chainlink = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419;\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/ChainlinkEthUSDCPriceOracleProxy.sol",
"ast": {
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDCPriceOracleProxy.sol",
"exportedSymbols": {
"ChainlinkETHPriceOracleProxy": [
1782
],
"IChainlink": [
1764
]
},
"id": 1783,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1757,
"literals": [
"solidity",
"0.6",
".9"
],
"nodeType": "PragmaDirective",
"src": "78:22:5"
},
{
"id": 1758,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "101:33:5"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 1764,
"linearizedBaseContracts": [
1764
],
"name": "IChainlink",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "50d25bcd",
"id": 1763,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "latestAnswer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1759,
"nodeType": "ParameterList",
"parameters": [],
"src": "185:2:5"
},
"returnParameters": {
"id": 1762,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1761,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1763,
"src": "211:7:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1760,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "211:7:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "210:9:5"
},
"scope": 1764,
"src": "164:56:5",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1783,
"src": "137:85:5"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1782,
"linearizedBaseContracts": [
1782
],
"name": "ChainlinkETHPriceOracleProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "9c3feeb7",
"id": 1767,
"mutability": "mutable",
"name": "chainlink",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1782,
"src": "313:69:5",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1765,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "313:7:5",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307835663465433344663963626434333731344645323734306635453336313631353563356238343139",
"id": 1766,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "340:42:5",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
},
"visibility": "public"
},
{
"body": {
"id": 1780,
"nodeType": "Block",
"src": "441:66:5",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1778,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1773,
"name": "chainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1767,
"src": "469:9:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1772,
"name": "IChainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1764,
"src": "458:10:5",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1764_$",
"typeString": "type(contract IChainlink)"
}
},
"id": 1774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "458:21:5",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IChainlink_$1764",
"typeString": "contract IChainlink"
}
},
"id": 1775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "latestAnswer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1763,
"src": "458:34:5",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 1776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "458:36:5",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "313030",
"id": 1777,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "497:3:5",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_100_by_1",
"typeString": "int_const 100"
},
"value": "100"
},
"src": "458:42:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1771,
"id": 1779,
"nodeType": "Return",
"src": "451:49:5"
}
]
},
"documentation": null,
"functionSelector": "98d5fdca",
"id": 1781,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getPrice",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1768,
"nodeType": "ParameterList",
"parameters": [],
"src": "406:2:5"
},
"returnParameters": {
"id": 1771,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1770,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1781,
"src": "432:7:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1769,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "432:7:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "431:9:5"
},
"scope": 1782,
"src": "389:118:5",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1783,
"src": "269:240:5"
}
],
"src": "78:432:5"
},
"legacyAST": {
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkEthUSDCPriceOracleProxy.sol",
"exportedSymbols": {
"ChainlinkETHPriceOracleProxy": [
1782
],
"IChainlink": [
1764
]
},
"id": 1783,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1757,
"literals": [
"solidity",
"0.6",
".9"
],
"nodeType": "PragmaDirective",
"src": "78:22:5"
},
{
"id": 1758,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "101:33:5"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 1764,
"linearizedBaseContracts": [
1764
],
"name": "IChainlink",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"functionSelector": "50d25bcd",
"id": 1763,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "latestAnswer",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1759,
"nodeType": "ParameterList",
"parameters": [],
"src": "185:2:5"
},
"returnParameters": {
"id": 1762,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1761,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1763,
"src": "211:7:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1760,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "211:7:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "210:9:5"
},
"scope": 1764,
"src": "164:56:5",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1783,
"src": "137:85:5"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1782,
"linearizedBaseContracts": [
1782
],
"name": "ChainlinkETHPriceOracleProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"functionSelector": "9c3feeb7",
"id": 1767,
"mutability": "mutable",
"name": "chainlink",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1782,
"src": "313:69:5",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1765,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "313:7:5",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307835663465433344663963626434333731344645323734306635453336313631353563356238343139",
"id": 1766,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "340:42:5",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"value": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
},
"visibility": "public"
},
{
"body": {
"id": 1780,
"nodeType": "Block",
"src": "441:66:5",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1778,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1773,
"name": "chainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1767,
"src": "469:9:5",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1772,
"name": "IChainlink",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1764,
"src": "458:10:5",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1764_$",
"typeString": "type(contract IChainlink)"
}
},
"id": 1774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "458:21:5",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_contract$_IChainlink_$1764",
"typeString": "contract IChainlink"
}
},
"id": 1775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "latestAnswer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1763,
"src": "458:34:5",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
"typeString": "function () view external returns (uint256)"
}
},
"id": 1776,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "458:36:5",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "313030",
"id": 1777,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "497:3:5",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_100_by_1",
"typeString": "int_const 100"
},
"value": "100"
},
"src": "458:42:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1771,
"id": 1779,
"nodeType": "Return",
"src": "451:49:5"
}
]
},
"documentation": null,
"functionSelector": "98d5fdca",
"id": 1781,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getPrice",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 1768,
"nodeType": "ParameterList",
"parameters": [],
"src": "406:2:5"
},
"returnParameters": {
"id": 1771,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1770,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 1781,
"src": "432:7:5",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1769,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "432:7:5",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "431:9:5"
},
"scope": 1782,
"src": "389:118:5",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1783,
"src": "269:240:5"
}
],
"src": "78:432:5"
},
"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": {}
}
}