fix dvm test context
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,3 +22,4 @@ node_modules
|
||||
#Hardhat files
|
||||
cache
|
||||
artifacts
|
||||
deploy-detail.txt
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,788 +0,0 @@
|
||||
{
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
@@ -1,788 +0,0 @@
|
||||
{
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
@@ -1,862 +0,0 @@
|
||||
{
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
@@ -1,788 +0,0 @@
|
||||
{
|
||||
"contractName": "ChainlinkLENDUSDCPriceOracleProxy",
|
||||
"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/ChainlinkLENDUSDCPriceOracleProxy.sol\":\"ChainlinkLENDUSDCPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkLENDUSDCPriceOracleProxy.sol\":{\"keccak256\":\"0xb622fdacf388c49e0ed152771f75ddc20075490003a74b8e6b57ee29e7cea681\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://43883ff1827f5dc0b05f74eabd023f792e2dc9fb6eea0e8b01b0e737fc9a243b\",\"dweb:/ipfs/QmeF8Q9hpkbA31ahu2WeT87otTfpVofGQgsc5jvi4gPx63\"]}},\"version\":1}",
|
||||
"bytecode": "0x6080604052600080546001600160a01b031916734ab81192bb75474cf203b56c36d6a13623270a6717905534801561003657600080fd5b50610173806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220e221107c0377e83c97f4957d4a167c2f3da11d089d46466b800fd1f2b7e5436564736f6c63430006090033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220e221107c0377e83c97f4957d4a167c2f3da11d089d46466b800fd1f2b7e5436564736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "269:245:7:-:0;;;318:69;;;-1:-1:-1;;;;;;318:69:7;345:42;318:69;;;269:245;;;;;;;;;;;;;;;;",
|
||||
"deployedSourceMap": "269:245:7:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;394:118;;;:::i;:::-;;;;;;;;;;;;;;;;318:69;;;:::i;:::-;;;;;;;;394:118;437:7;474:9;;463:36;;;-1:-1:-1;;;463:36:7;;;;502:3;;-1:-1:-1;;;;;474:9:7;;463:34;;:36;;;;;;;;;;;;;;474:9;463:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:42;;;;;;456:49;;394:118;:::o;318:69::-;;;-1:-1:-1;;;;;318:69:7;;:::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 LEND-USDC(decimals=6) price convert\n\ncontract ChainlinkLENDUSDCPriceOracleProxy {\n address public chainlink = 0x4aB81192BB75474Cf203B56c36D6a13623270A67;\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/ChainlinkLENDUSDCPriceOracleProxy.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkLENDUSDCPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkLENDUSDCPriceOracleProxy": [
|
||||
1838
|
||||
],
|
||||
"IChainlink": [
|
||||
1820
|
||||
]
|
||||
},
|
||||
"id": 1839,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1813,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:7"
|
||||
},
|
||||
{
|
||||
"id": 1814,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:7"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1820,
|
||||
"linearizedBaseContracts": [
|
||||
1820
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1819,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1815,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:7"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1818,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1817,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1819,
|
||||
"src": "211:7:7",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1816,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:7"
|
||||
},
|
||||
"scope": 1820,
|
||||
"src": "164:56:7",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1839,
|
||||
"src": "137:85:7"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1838,
|
||||
"linearizedBaseContracts": [
|
||||
1838
|
||||
],
|
||||
"name": "ChainlinkLENDUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1823,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1838,
|
||||
"src": "318:69:7",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1821,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "318:7:7",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307834614238313139324242373534373443663230334235366333364436613133363233323730413637",
|
||||
"id": 1822,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "345:42:7",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0x4aB81192BB75474Cf203B56c36D6a13623270A67"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1836,
|
||||
"nodeType": "Block",
|
||||
"src": "446:66:7",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1834,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1829,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1823,
|
||||
"src": "474:9:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1828,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1820,
|
||||
"src": "463:10:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1820_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1830,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:21:7",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1820",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1831,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1819,
|
||||
"src": "463:34:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1832,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:36:7",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "/",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "313030",
|
||||
"id": 1833,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "502:3:7",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100_by_1",
|
||||
"typeString": "int_const 100"
|
||||
},
|
||||
"value": "100"
|
||||
},
|
||||
"src": "463:42:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1827,
|
||||
"id": 1835,
|
||||
"nodeType": "Return",
|
||||
"src": "456:49:7"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1837,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1824,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "411:2:7"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1827,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1826,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1837,
|
||||
"src": "437:7:7",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1825,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "437:7:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "436:9:7"
|
||||
},
|
||||
"scope": 1838,
|
||||
"src": "394:118:7",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1839,
|
||||
"src": "269:245:7"
|
||||
}
|
||||
],
|
||||
"src": "78:437:7"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkLENDUSDCPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkLENDUSDCPriceOracleProxy": [
|
||||
1838
|
||||
],
|
||||
"IChainlink": [
|
||||
1820
|
||||
]
|
||||
},
|
||||
"id": 1839,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1813,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:7"
|
||||
},
|
||||
{
|
||||
"id": 1814,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:7"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1820,
|
||||
"linearizedBaseContracts": [
|
||||
1820
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1819,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1815,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:7"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1818,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1817,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1819,
|
||||
"src": "211:7:7",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1816,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:7"
|
||||
},
|
||||
"scope": 1820,
|
||||
"src": "164:56:7",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1839,
|
||||
"src": "137:85:7"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1838,
|
||||
"linearizedBaseContracts": [
|
||||
1838
|
||||
],
|
||||
"name": "ChainlinkLENDUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1823,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1838,
|
||||
"src": "318:69:7",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1821,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "318:7:7",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307834614238313139324242373534373443663230334235366333364436613133363233323730413637",
|
||||
"id": 1822,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "345:42:7",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0x4aB81192BB75474Cf203B56c36D6a13623270A67"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1836,
|
||||
"nodeType": "Block",
|
||||
"src": "446:66:7",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1834,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1829,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1823,
|
||||
"src": "474:9:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1828,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1820,
|
||||
"src": "463:10:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1820_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1830,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:21:7",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1820",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1831,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1819,
|
||||
"src": "463:34:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1832,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:36:7",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "/",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "313030",
|
||||
"id": 1833,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "502:3:7",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100_by_1",
|
||||
"typeString": "int_const 100"
|
||||
},
|
||||
"value": "100"
|
||||
},
|
||||
"src": "463:42:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1827,
|
||||
"id": 1835,
|
||||
"nodeType": "Return",
|
||||
"src": "456:49:7"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1837,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1824,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "411:2:7"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1827,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1826,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1837,
|
||||
"src": "437:7:7",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1825,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "437:7:7",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "436:9:7"
|
||||
},
|
||||
"scope": 1838,
|
||||
"src": "394:118:7",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1839,
|
||||
"src": "269:245:7"
|
||||
}
|
||||
],
|
||||
"src": "78:437:7"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.505Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
@@ -1,788 +0,0 @@
|
||||
{
|
||||
"contractName": "ChainlinkLINKUSDCPriceOracleProxy",
|
||||
"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/ChainlinkLINKUSDPriceOracleProxy.sol\":\"ChainlinkLINKUSDCPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkLINKUSDPriceOracleProxy.sol\":{\"keccak256\":\"0x3ebaa2e0e58be89c2f58b1c2c602b93f5481a9ddb6ab3a127f8b4dec90242131\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://c10dff19155faacb4b4d13d5b35cf1d342450681e1d00f17e1ec2f85da7a9227\",\"dweb:/ipfs/QmTFtLyQ6MzEMxmbChMBu9mA41RLJdgEkN9i1i881atDa2\"]}},\"version\":1}",
|
||||
"bytecode": "0x6080604052600080546001600160a01b031916732c1d072e956affc0d435cb7ac38ef18d24d9127c17905534801561003657600080fd5b50610173806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea26469706673582212206339132c62e384e50511e1d1958837d962ba2f726d20b05adaffad0b5717b33064736f6c63430006090033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea26469706673582212206339132c62e384e50511e1d1958837d962ba2f726d20b05adaffad0b5717b33064736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "269:245:8:-:0;;;318:69;;;-1:-1:-1;;;;;;318:69:8;345:42;318:69;;;269:245;;;;;;;;;;;;;;;;",
|
||||
"deployedSourceMap": "269:245:8:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;394:118;;;:::i;:::-;;;;;;;;;;;;;;;;318:69;;;:::i;:::-;;;;;;;;394:118;437:7;474:9;;463:36;;;-1:-1:-1;;;463:36:8;;;;502:3;;-1:-1:-1;;;;;474:9:8;;463:34;;:36;;;;;;;;;;;;;;474:9;463:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:42;;;;;;456:49;;394:118;:::o;318:69::-;;;-1:-1:-1;;;;;318:69:8;;:::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 LINK-USDC(decimals=6) price convert\n\ncontract ChainlinkLINKUSDCPriceOracleProxy {\n address public chainlink = 0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c;\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/ChainlinkLINKUSDPriceOracleProxy.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkLINKUSDPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkLINKUSDCPriceOracleProxy": [
|
||||
1865
|
||||
],
|
||||
"IChainlink": [
|
||||
1847
|
||||
]
|
||||
},
|
||||
"id": 1866,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1840,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:8"
|
||||
},
|
||||
{
|
||||
"id": 1841,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:8"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1847,
|
||||
"linearizedBaseContracts": [
|
||||
1847
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1846,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1842,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:8"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1845,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1844,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1846,
|
||||
"src": "211:7:8",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1843,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:8"
|
||||
},
|
||||
"scope": 1847,
|
||||
"src": "164:56:8",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1866,
|
||||
"src": "137:85:8"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1865,
|
||||
"linearizedBaseContracts": [
|
||||
1865
|
||||
],
|
||||
"name": "ChainlinkLINKUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1850,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1865,
|
||||
"src": "318:69:8",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1848,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "318:7:8",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307832633164303732653935364146464330443433354362374143333845463138643234643931323763",
|
||||
"id": 1849,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "345:42:8",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1863,
|
||||
"nodeType": "Block",
|
||||
"src": "446:66:8",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1861,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1856,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1850,
|
||||
"src": "474:9:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1855,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1847,
|
||||
"src": "463:10:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1847_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1857,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:21:8",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1847",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1858,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1846,
|
||||
"src": "463:34:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1859,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:36:8",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "/",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "313030",
|
||||
"id": 1860,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "502:3:8",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100_by_1",
|
||||
"typeString": "int_const 100"
|
||||
},
|
||||
"value": "100"
|
||||
},
|
||||
"src": "463:42:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1854,
|
||||
"id": 1862,
|
||||
"nodeType": "Return",
|
||||
"src": "456:49:8"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1864,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1851,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "411:2:8"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1854,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1853,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1864,
|
||||
"src": "437:7:8",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1852,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "437:7:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "436:9:8"
|
||||
},
|
||||
"scope": 1865,
|
||||
"src": "394:118:8",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1866,
|
||||
"src": "269:245:8"
|
||||
}
|
||||
],
|
||||
"src": "78:437:8"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkLINKUSDPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkLINKUSDCPriceOracleProxy": [
|
||||
1865
|
||||
],
|
||||
"IChainlink": [
|
||||
1847
|
||||
]
|
||||
},
|
||||
"id": 1866,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1840,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:8"
|
||||
},
|
||||
{
|
||||
"id": 1841,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:8"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1847,
|
||||
"linearizedBaseContracts": [
|
||||
1847
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1846,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1842,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:8"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1845,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1844,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1846,
|
||||
"src": "211:7:8",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1843,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:8"
|
||||
},
|
||||
"scope": 1847,
|
||||
"src": "164:56:8",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1866,
|
||||
"src": "137:85:8"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1865,
|
||||
"linearizedBaseContracts": [
|
||||
1865
|
||||
],
|
||||
"name": "ChainlinkLINKUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1850,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1865,
|
||||
"src": "318:69:8",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1848,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "318:7:8",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307832633164303732653935364146464330443433354362374143333845463138643234643931323763",
|
||||
"id": 1849,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "345:42:8",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1863,
|
||||
"nodeType": "Block",
|
||||
"src": "446:66:8",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1861,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1856,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1850,
|
||||
"src": "474:9:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1855,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1847,
|
||||
"src": "463:10:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1847_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1857,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:21:8",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1847",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1858,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1846,
|
||||
"src": "463:34:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1859,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "463:36:8",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "/",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "313030",
|
||||
"id": 1860,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "502:3:8",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100_by_1",
|
||||
"typeString": "int_const 100"
|
||||
},
|
||||
"value": "100"
|
||||
},
|
||||
"src": "463:42:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1854,
|
||||
"id": 1862,
|
||||
"nodeType": "Return",
|
||||
"src": "456:49:8"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1864,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1851,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "411:2:8"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1854,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1853,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1864,
|
||||
"src": "437:7:8",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1852,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "437:7:8",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "436:9:8"
|
||||
},
|
||||
"scope": 1865,
|
||||
"src": "394:118:8",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1866,
|
||||
"src": "269:245:8"
|
||||
}
|
||||
],
|
||||
"src": "78:437:8"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.505Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
@@ -1,788 +0,0 @@
|
||||
{
|
||||
"contractName": "ChainlinkSNXUSDCPriceOracleProxy",
|
||||
"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/ChainlinkSNXUSDPriceOracleProxy.sol\":\"ChainlinkSNXUSDCPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkSNXUSDPriceOracleProxy.sol\":{\"keccak256\":\"0x1cbd26db6ab1f8ad316681662704aedb54caaf3ce26031ef558ee3db6362ffee\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b8baf436ad553f5fb53537279c279e3de774fe134497d08a989313f6d0aec772\",\"dweb:/ipfs/QmSSrR1PfVDmsMZPYU7azYusiFc45L9DHub73PZWGtoTGd\"]}},\"version\":1}",
|
||||
"bytecode": "0x6080604052600080546001600160a01b03191673dc3ea94cd0ac27d9a86c180091e7f78c683d369917905534801561003657600080fd5b50610173806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220a43884883f019b4a79923b7b2d333ad3677db886931fbbe976b55732e82c7c0964736f6c63430006090033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b6040516100509190610134565b60405180910390f35b6100616100f9565b6040516100509190610120565b60008054604080516350d25bcd60e01b815290516064926001600160a01b0316916350d25bcd916004808301926020929190829003018186803b1580156100b457600080fd5b505afa1580156100c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ec9190610108565b816100f357fe5b04905090565b6000546001600160a01b031681565b600060208284031215610119578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220a43884883f019b4a79923b7b2d333ad3677db886931fbbe976b55732e82c7c0964736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "268:244:9:-:0;;;316:69;;;-1:-1:-1;;;;;;316:69:9;343:42;316:69;;;268:244;;;;;;;;;;;;;;;;",
|
||||
"deployedSourceMap": "268:244:9:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;392:118;;;:::i;:::-;;;;;;;;;;;;;;;;316:69;;;:::i;:::-;;;;;;;;392:118;435:7;472:9;;461:36;;;-1:-1:-1;;;461:36:9;;;;500:3;;-1:-1:-1;;;;;472:9:9;;461:34;;:36;;;;;;;;;;;;;;472:9;461:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:42;;;;;;454:49;;392:118;:::o;316:69::-;;;-1:-1:-1;;;;;316:69:9;;:::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 SNX-USDC(decimals=6) price convert\n\ncontract ChainlinkSNXUSDCPriceOracleProxy {\n address public chainlink = 0xDC3EA94CD0AC27d9A86C180091e7f78C683d3699;\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/ChainlinkSNXUSDPriceOracleProxy.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkSNXUSDPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkSNXUSDCPriceOracleProxy": [
|
||||
1892
|
||||
],
|
||||
"IChainlink": [
|
||||
1874
|
||||
]
|
||||
},
|
||||
"id": 1893,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1867,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:9"
|
||||
},
|
||||
{
|
||||
"id": 1868,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:9"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1874,
|
||||
"linearizedBaseContracts": [
|
||||
1874
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1873,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1869,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:9"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1872,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1871,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1873,
|
||||
"src": "211:7:9",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1870,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:9"
|
||||
},
|
||||
"scope": 1874,
|
||||
"src": "164:56:9",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1893,
|
||||
"src": "137:85:9"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1892,
|
||||
"linearizedBaseContracts": [
|
||||
1892
|
||||
],
|
||||
"name": "ChainlinkSNXUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1877,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1892,
|
||||
"src": "316:69:9",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1875,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "316:7:9",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307844433345413934434430414332376439413836433138303039316537663738433638336433363939",
|
||||
"id": 1876,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "343:42:9",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0xDC3EA94CD0AC27d9A86C180091e7f78C683d3699"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1890,
|
||||
"nodeType": "Block",
|
||||
"src": "444:66:9",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1888,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1883,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1877,
|
||||
"src": "472:9:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1882,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1874,
|
||||
"src": "461:10:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1874_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1884,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "461:21:9",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1874",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1885,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1873,
|
||||
"src": "461:34:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1886,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "461:36:9",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "/",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "313030",
|
||||
"id": 1887,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "500:3:9",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100_by_1",
|
||||
"typeString": "int_const 100"
|
||||
},
|
||||
"value": "100"
|
||||
},
|
||||
"src": "461:42:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1881,
|
||||
"id": 1889,
|
||||
"nodeType": "Return",
|
||||
"src": "454:49:9"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1891,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1878,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "409:2:9"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1881,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1880,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1891,
|
||||
"src": "435:7:9",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1879,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "435:7:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "434:9:9"
|
||||
},
|
||||
"scope": 1892,
|
||||
"src": "392:118:9",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1893,
|
||||
"src": "268:244:9"
|
||||
}
|
||||
],
|
||||
"src": "78:435:9"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkSNXUSDPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkSNXUSDCPriceOracleProxy": [
|
||||
1892
|
||||
],
|
||||
"IChainlink": [
|
||||
1874
|
||||
]
|
||||
},
|
||||
"id": 1893,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1867,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:9"
|
||||
},
|
||||
{
|
||||
"id": 1868,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:9"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1874,
|
||||
"linearizedBaseContracts": [
|
||||
1874
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1873,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1869,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:9"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1872,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1871,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1873,
|
||||
"src": "211:7:9",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1870,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:9"
|
||||
},
|
||||
"scope": 1874,
|
||||
"src": "164:56:9",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1893,
|
||||
"src": "137:85:9"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1892,
|
||||
"linearizedBaseContracts": [
|
||||
1892
|
||||
],
|
||||
"name": "ChainlinkSNXUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1877,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1892,
|
||||
"src": "316:69:9",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1875,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "316:7:9",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307844433345413934434430414332376439413836433138303039316537663738433638336433363939",
|
||||
"id": 1876,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "343:42:9",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0xDC3EA94CD0AC27d9A86C180091e7f78C683d3699"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1890,
|
||||
"nodeType": "Block",
|
||||
"src": "444:66:9",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1888,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1883,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1877,
|
||||
"src": "472:9:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1882,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1874,
|
||||
"src": "461:10:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1874_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1884,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "461:21:9",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1874",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1885,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1873,
|
||||
"src": "461:34:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1886,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "461:36:9",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "/",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "313030",
|
||||
"id": 1887,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "500:3:9",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100_by_1",
|
||||
"typeString": "int_const 100"
|
||||
},
|
||||
"value": "100"
|
||||
},
|
||||
"src": "461:42:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1881,
|
||||
"id": 1889,
|
||||
"nodeType": "Return",
|
||||
"src": "454:49:9"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1891,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1878,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "409:2:9"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1881,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1880,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1891,
|
||||
"src": "435:7:9",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1879,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "435:7:9",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "434:9:9"
|
||||
},
|
||||
"scope": 1892,
|
||||
"src": "392:118:9",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1893,
|
||||
"src": "268:244:9"
|
||||
}
|
||||
],
|
||||
"src": "78:435:9"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.506Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
@@ -1,896 +0,0 @@
|
||||
{
|
||||
"contractName": "ChainlinkWBTCUSDCPriceOracleProxy",
|
||||
"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/ChainlinkWBTCUSDCPriceOracleProxy.sol\":\"ChainlinkWBTCUSDCPriceOracleProxy\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkWBTCUSDCPriceOracleProxy.sol\":{\"keccak256\":\"0x4cf5f2c16709da7d57fd12d78905b2d05fb5214435f457775f7995dfad5b4b4b\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://94e2acb2295b9c87c61334eb2ea3047661deca6832a3607478222a5dcac23f02\",\"dweb:/ipfs/QmQcFeei8XdiVPHCHRhQLRpBr5zVYRT8ZyhMJtgVKUHitw\"]}},\"version\":1}",
|
||||
"bytecode": "0x6080604052600080546001600160a01b03191673f4030086522a5beea4988f8ca5b36dbc97bee88c17905534801561003657600080fd5b5061017a806100466000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b604051610050919061013b565b60405180910390f35b610061610100565b6040516100509190610127565b60008060009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100bd57600080fd5b505afa1580156100d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f5919061010f565b6305f5e10002905090565b6000546001600160a01b031681565b600060208284031215610120578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220d469809a49a9725cd835c28c7285647482061285333dd44129abfdfd87f51d7b64736f6c63430006090033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806398d5fdca1461003b5780639c3feeb714610059575b600080fd5b61004361006e565b604051610050919061013b565b60405180910390f35b610061610100565b6040516100509190610127565b60008060009054906101000a90046001600160a01b03166001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100bd57600080fd5b505afa1580156100d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100f5919061010f565b6305f5e10002905090565b6000546001600160a01b031681565b600060208284031215610120578081fd5b5051919050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220d469809a49a9725cd835c28c7285647482061285333dd44129abfdfd87f51d7b64736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "281:249:10:-:0;;;330:69;;;-1:-1:-1;;;;;;330:69:10;357:42;330:69;;;281:249;;;;;;;;;;;;;;;;",
|
||||
"deployedSourceMap": "281:249:10:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;406:122;;;:::i;:::-;;;;;;;;;;;;;;;;330:69;;;:::i;:::-;;;;;;;;406:122;449:7;486:9;;;;;;;;;-1:-1:-1;;;;;486:9:10;-1:-1:-1;;;;;475:34:10;;:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;515:5;475:46;468:53;;406:122;:::o;330:69::-;;;-1:-1:-1;;;;;330:69:10;;:::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 WBTC(decimals=8)-USDC(decimals=6) price convert\n\ncontract ChainlinkWBTCUSDCPriceOracleProxy {\n address public chainlink = 0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c;\n\n function getPrice() external view returns (uint256) {\n return IChainlink(chainlink).latestAnswer() * (10**8);\n }\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkWBTCUSDCPriceOracleProxy.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkWBTCUSDCPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkWBTCUSDCPriceOracleProxy": [
|
||||
1922
|
||||
],
|
||||
"IChainlink": [
|
||||
1901
|
||||
]
|
||||
},
|
||||
"id": 1923,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1894,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:10"
|
||||
},
|
||||
{
|
||||
"id": 1895,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:10"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1901,
|
||||
"linearizedBaseContracts": [
|
||||
1901
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1900,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1896,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:10"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1899,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1898,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1900,
|
||||
"src": "211:7:10",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1897,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:10"
|
||||
},
|
||||
"scope": 1901,
|
||||
"src": "164:56:10",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1923,
|
||||
"src": "137:85:10"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1922,
|
||||
"linearizedBaseContracts": [
|
||||
1922
|
||||
],
|
||||
"name": "ChainlinkWBTCUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1904,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1922,
|
||||
"src": "330:69:10",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1902,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "330:7:10",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307846343033303038363532326135624545613439383846386341354233366462433937426545383863",
|
||||
"id": 1903,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "357:42:10",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1920,
|
||||
"nodeType": "Block",
|
||||
"src": "458:70:10",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1918,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1910,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1904,
|
||||
"src": "486:9:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1909,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1901,
|
||||
"src": "475:10:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1901_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1911,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "475:21:10",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1901",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1912,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1900,
|
||||
"src": "475:34:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1913,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "475:36:10",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "*",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"components": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_rational_100000000_by_1",
|
||||
"typeString": "int_const 100000000"
|
||||
},
|
||||
"id": 1916,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "3130",
|
||||
"id": 1914,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "515:2:10",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_10_by_1",
|
||||
"typeString": "int_const 10"
|
||||
},
|
||||
"value": "10"
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "**",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "38",
|
||||
"id": 1915,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "519:1:10",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_8_by_1",
|
||||
"typeString": "int_const 8"
|
||||
},
|
||||
"value": "8"
|
||||
},
|
||||
"src": "515:5:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100000000_by_1",
|
||||
"typeString": "int_const 100000000"
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": 1917,
|
||||
"isConstant": false,
|
||||
"isInlineArray": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"lValueRequested": false,
|
||||
"nodeType": "TupleExpression",
|
||||
"src": "514:7:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100000000_by_1",
|
||||
"typeString": "int_const 100000000"
|
||||
}
|
||||
},
|
||||
"src": "475:46:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1908,
|
||||
"id": 1919,
|
||||
"nodeType": "Return",
|
||||
"src": "468:53:10"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1921,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1905,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "423:2:10"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1908,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1907,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1921,
|
||||
"src": "449:7:10",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1906,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "449:7:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "448:9:10"
|
||||
},
|
||||
"scope": 1922,
|
||||
"src": "406:122:10",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1923,
|
||||
"src": "281:249:10"
|
||||
}
|
||||
],
|
||||
"src": "78:453:10"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ChainlinkWBTCUSDCPriceOracleProxy.sol",
|
||||
"exportedSymbols": {
|
||||
"ChainlinkWBTCUSDCPriceOracleProxy": [
|
||||
1922
|
||||
],
|
||||
"IChainlink": [
|
||||
1901
|
||||
]
|
||||
},
|
||||
"id": 1923,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 1894,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:10"
|
||||
},
|
||||
{
|
||||
"id": 1895,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:10"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 1901,
|
||||
"linearizedBaseContracts": [
|
||||
1901
|
||||
],
|
||||
"name": "IChainlink",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "50d25bcd",
|
||||
"id": 1900,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "latestAnswer",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1896,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "185:2:10"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1899,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1898,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1900,
|
||||
"src": "211:7:10",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1897,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "211:7:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "210:9:10"
|
||||
},
|
||||
"scope": 1901,
|
||||
"src": "164:56:10",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1923,
|
||||
"src": "137:85:10"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 1922,
|
||||
"linearizedBaseContracts": [
|
||||
1922
|
||||
],
|
||||
"name": "ChainlinkWBTCUSDCPriceOracleProxy",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "9c3feeb7",
|
||||
"id": 1904,
|
||||
"mutability": "mutable",
|
||||
"name": "chainlink",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1922,
|
||||
"src": "330:69:10",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1902,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "330:7:10",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "307846343033303038363532326135624545613439383846386341354233366462433937426545383863",
|
||||
"id": 1903,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "357:42:10",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address_payable",
|
||||
"typeString": "address payable"
|
||||
},
|
||||
"value": "0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c"
|
||||
},
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 1920,
|
||||
"nodeType": "Block",
|
||||
"src": "458:70:10",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"id": 1918,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [],
|
||||
"expression": {
|
||||
"argumentTypes": [],
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 1910,
|
||||
"name": "chainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1904,
|
||||
"src": "486:9:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
],
|
||||
"id": 1909,
|
||||
"name": "IChainlink",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 1901,
|
||||
"src": "475:10:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_type$_t_contract$_IChainlink_$1901_$",
|
||||
"typeString": "type(contract IChainlink)"
|
||||
}
|
||||
},
|
||||
"id": 1911,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "typeConversion",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "475:21:10",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_IChainlink_$1901",
|
||||
"typeString": "contract IChainlink"
|
||||
}
|
||||
},
|
||||
"id": 1912,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"memberName": "latestAnswer",
|
||||
"nodeType": "MemberAccess",
|
||||
"referencedDeclaration": 1900,
|
||||
"src": "475:34:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$",
|
||||
"typeString": "function () view external returns (uint256)"
|
||||
}
|
||||
},
|
||||
"id": 1913,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "475:36:10",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "*",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"components": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"commonType": {
|
||||
"typeIdentifier": "t_rational_100000000_by_1",
|
||||
"typeString": "int_const 100000000"
|
||||
},
|
||||
"id": 1916,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"lValueRequested": false,
|
||||
"leftExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "3130",
|
||||
"id": 1914,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "515:2:10",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_10_by_1",
|
||||
"typeString": "int_const 10"
|
||||
},
|
||||
"value": "10"
|
||||
},
|
||||
"nodeType": "BinaryOperation",
|
||||
"operator": "**",
|
||||
"rightExpression": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "38",
|
||||
"id": 1915,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "number",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "519:1:10",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_8_by_1",
|
||||
"typeString": "int_const 8"
|
||||
},
|
||||
"value": "8"
|
||||
},
|
||||
"src": "515:5:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100000000_by_1",
|
||||
"typeString": "int_const 100000000"
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": 1917,
|
||||
"isConstant": false,
|
||||
"isInlineArray": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"lValueRequested": false,
|
||||
"nodeType": "TupleExpression",
|
||||
"src": "514:7:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_rational_100000000_by_1",
|
||||
"typeString": "int_const 100000000"
|
||||
}
|
||||
},
|
||||
"src": "475:46:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 1908,
|
||||
"id": 1919,
|
||||
"nodeType": "Return",
|
||||
"src": "468:53:10"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 1921,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 1905,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "423:2:10"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 1908,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 1907,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 1921,
|
||||
"src": "449:7:10",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 1906,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "449:7:10",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "448:9:10"
|
||||
},
|
||||
"scope": 1922,
|
||||
"src": "406:122:10",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 1923,
|
||||
"src": "281:249:10"
|
||||
}
|
||||
],
|
||||
"src": "78:453:10"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.506Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,607 +0,0 @@
|
||||
{
|
||||
"contractName": "ConstOracle",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "_price",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "tokenPrice",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"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\":[{\"internalType\":\"uint256\",\"name\":\"_price\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenPrice\",\"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/ConstOracle.sol\":\"ConstOracle\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ConstOracle.sol\":{\"keccak256\":\"0x135f4a8c2768de7c0889f1ec0040ccef60cc9366c7174adb28ce23f1105d0b84\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d584bbc06b0b4b06d139ca5169ce0a11e137f89606aa76c0dd6f7ef0c2b7a809\",\"dweb:/ipfs/QmfEvU1dvU6j7brDDEVLXBwoP5gwxjr6kfazGvXocBTXTR\"]}},\"version\":1}",
|
||||
"bytecode": "0x608060405234801561001057600080fd5b506040516100ff3803806100ff83398101604081905261002f91610037565b60005561004f565b600060208284031215610048578081fd5b5051919050565b60a28061005d6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80637ff9b59614603757806398d5fdca146051575b600080fd5b603d6057565b604051604891906063565b60405180910390f35b603d605d565b60005481565b60005490565b9081526020019056fea2646970667358221220983b3926be425c261897fcc5f62f15dd5763108fb7819b19ba891e32c578a13464736f6c63430006090033",
|
||||
"deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c80637ff9b59614603757806398d5fdca146051575b600080fd5b603d6057565b604051604891906063565b60405180910390f35b603d605d565b60005481565b60005490565b9081526020019056fea2646970667358221220983b3926be425c261897fcc5f62f15dd5763108fb7819b19ba891e32c578a13464736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "137:224:13:-:0;;;196:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;241:10;:19;137:224;;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;;137:224:13;;;;;;",
|
||||
"deployedSourceMap": "137:224:13:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;164:25;;;:::i;:::-;;;;;;;;;;;;;;;;273:86;;;:::i;164:25::-;;;;:::o;273:86::-;316:7;342:10;273:86;:::o;125:222:-1:-;76:37;;;252:2;237:18;;223: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\ncontract ConstOracle {\n uint256 public tokenPrice;\n\n constructor(uint256 _price) public {\n tokenPrice = _price;\n }\n\n function getPrice() external view returns (uint256) {\n return tokenPrice;\n }\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ConstOracle.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ConstOracle.sol",
|
||||
"exportedSymbols": {
|
||||
"ConstOracle": [
|
||||
2032
|
||||
]
|
||||
},
|
||||
"id": 2033,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 2010,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:13"
|
||||
},
|
||||
{
|
||||
"id": 2011,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:13"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 2032,
|
||||
"linearizedBaseContracts": [
|
||||
2032
|
||||
],
|
||||
"name": "ConstOracle",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "7ff9b596",
|
||||
"id": 2013,
|
||||
"mutability": "mutable",
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 2032,
|
||||
"src": "164:25:13",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 2012,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "164:7:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 2022,
|
||||
"nodeType": "Block",
|
||||
"src": "231:36:13",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 2020,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 2018,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 2013,
|
||||
"src": "241:10:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 2019,
|
||||
"name": "_price",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 2015,
|
||||
"src": "254:6:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"src": "241:19:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"id": 2021,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "241:19:13"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"id": 2023,
|
||||
"implemented": true,
|
||||
"kind": "constructor",
|
||||
"modifiers": [],
|
||||
"name": "",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 2016,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 2015,
|
||||
"mutability": "mutable",
|
||||
"name": "_price",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 2023,
|
||||
"src": "208:14:13",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 2014,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "208:7:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "207:16:13"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 2017,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "231:0:13"
|
||||
},
|
||||
"scope": 2032,
|
||||
"src": "196:71:13",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 2030,
|
||||
"nodeType": "Block",
|
||||
"src": "325:34:13",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 2028,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 2013,
|
||||
"src": "342:10:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 2027,
|
||||
"id": 2029,
|
||||
"nodeType": "Return",
|
||||
"src": "335:17:13"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 2031,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 2024,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "290:2:13"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 2027,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 2026,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 2031,
|
||||
"src": "316:7:13",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 2025,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "316:7:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "315:9:13"
|
||||
},
|
||||
"scope": 2032,
|
||||
"src": "273:86:13",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 2033,
|
||||
"src": "137:224:13"
|
||||
}
|
||||
],
|
||||
"src": "78:284:13"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/ConstOracle.sol",
|
||||
"exportedSymbols": {
|
||||
"ConstOracle": [
|
||||
2032
|
||||
]
|
||||
},
|
||||
"id": 2033,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 2010,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:13"
|
||||
},
|
||||
{
|
||||
"id": 2011,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:13"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 2032,
|
||||
"linearizedBaseContracts": [
|
||||
2032
|
||||
],
|
||||
"name": "ConstOracle",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "7ff9b596",
|
||||
"id": 2013,
|
||||
"mutability": "mutable",
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 2032,
|
||||
"src": "164:25:13",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 2012,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "164:7:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 2022,
|
||||
"nodeType": "Block",
|
||||
"src": "231:36:13",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 2020,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 2018,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 2013,
|
||||
"src": "241:10:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 2019,
|
||||
"name": "_price",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 2015,
|
||||
"src": "254:6:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"src": "241:19:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"id": 2021,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "241:19:13"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"id": 2023,
|
||||
"implemented": true,
|
||||
"kind": "constructor",
|
||||
"modifiers": [],
|
||||
"name": "",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 2016,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 2015,
|
||||
"mutability": "mutable",
|
||||
"name": "_price",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 2023,
|
||||
"src": "208:14:13",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 2014,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "208:7:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "207:16:13"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 2017,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "231:0:13"
|
||||
},
|
||||
"scope": 2032,
|
||||
"src": "196:71:13",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 2030,
|
||||
"nodeType": "Block",
|
||||
"src": "325:34:13",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 2028,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 2013,
|
||||
"src": "342:10:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 2027,
|
||||
"id": 2029,
|
||||
"nodeType": "Return",
|
||||
"src": "335:17:13"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 2031,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 2024,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "290:2:13"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 2027,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 2026,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 2031,
|
||||
"src": "316:7:13",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 2025,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "316:7:13",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "315:9:13"
|
||||
},
|
||||
"scope": 2032,
|
||||
"src": "273:86:13",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 2033,
|
||||
"src": "137:224:13"
|
||||
}
|
||||
],
|
||||
"src": "78:284:13"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.509Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,440 +0,0 @@
|
||||
{
|
||||
"contractName": "IDODOCallee",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "bool",
|
||||
"name": "isBuyBaseToken",
|
||||
"type": "bool"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "baseAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "quoteAmount",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"internalType": "bytes",
|
||||
"name": "data",
|
||||
"type": "bytes"
|
||||
}
|
||||
],
|
||||
"name": "dodoCall",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"isBuyBaseToken\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"baseAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quoteAmount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"dodoCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOCallee.sol\":\"IDODOCallee\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOCallee.sol\":{\"keccak256\":\"0x229c6157d9f467f52d98634966a88fce7c7d68d1b7ee5c4897957b3bc33ee2c5\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://d9ca56838de93c5727da081665c37fb7e4448cc584e3ff72f5d9867775c0ee5f\",\"dweb:/ipfs/QmTVeQ8EJqnrSYsu4GU4jhaUzW9FC45fAoXKHniBNXNaZs\"]}},\"version\":1}",
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "",
|
||||
"deployedSourceMap": "",
|
||||
"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\ninterface IDODOCallee {\n function dodoCall(\n bool isBuyBaseToken,\n uint256 baseAmount,\n uint256 quoteAmount,\n bytes calldata data\n ) external;\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOCallee.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOCallee.sol",
|
||||
"exportedSymbols": {
|
||||
"IDODOCallee": [
|
||||
10506
|
||||
]
|
||||
},
|
||||
"id": 10507,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 10493,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:30"
|
||||
},
|
||||
{
|
||||
"id": 10494,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:30"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 10506,
|
||||
"linearizedBaseContracts": [
|
||||
10506
|
||||
],
|
||||
"name": "IDODOCallee",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "60378cea",
|
||||
"id": 10505,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "dodoCall",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10503,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10496,
|
||||
"mutability": "mutable",
|
||||
"name": "isBuyBaseToken",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "191:19:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10495,
|
||||
"name": "bool",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "191:4:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10498,
|
||||
"mutability": "mutable",
|
||||
"name": "baseAmount",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "220:18:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10497,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "220:7:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10500,
|
||||
"mutability": "mutable",
|
||||
"name": "quoteAmount",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "248:19:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10499,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "248:7:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10502,
|
||||
"mutability": "mutable",
|
||||
"name": "data",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "277:19:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "calldata",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bytes_calldata_ptr",
|
||||
"typeString": "bytes"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10501,
|
||||
"name": "bytes",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "277:5:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bytes_storage_ptr",
|
||||
"typeString": "bytes"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "181:121:30"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10504,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "311:0:30"
|
||||
},
|
||||
"scope": 10506,
|
||||
"src": "164:148:30",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 10507,
|
||||
"src": "136:178:30"
|
||||
}
|
||||
],
|
||||
"src": "78:237:30"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOCallee.sol",
|
||||
"exportedSymbols": {
|
||||
"IDODOCallee": [
|
||||
10506
|
||||
]
|
||||
},
|
||||
"id": 10507,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 10493,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:30"
|
||||
},
|
||||
{
|
||||
"id": 10494,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:30"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 10506,
|
||||
"linearizedBaseContracts": [
|
||||
10506
|
||||
],
|
||||
"name": "IDODOCallee",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "60378cea",
|
||||
"id": 10505,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "dodoCall",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10503,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10496,
|
||||
"mutability": "mutable",
|
||||
"name": "isBuyBaseToken",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "191:19:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10495,
|
||||
"name": "bool",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "191:4:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10498,
|
||||
"mutability": "mutable",
|
||||
"name": "baseAmount",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "220:18:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10497,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "220:7:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10500,
|
||||
"mutability": "mutable",
|
||||
"name": "quoteAmount",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "248:19:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10499,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "248:7:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10502,
|
||||
"mutability": "mutable",
|
||||
"name": "data",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10505,
|
||||
"src": "277:19:30",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "calldata",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bytes_calldata_ptr",
|
||||
"typeString": "bytes"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10501,
|
||||
"name": "bytes",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "277:5:30",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bytes_storage_ptr",
|
||||
"typeString": "bytes"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "181:121:30"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10504,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "311:0:30"
|
||||
},
|
||||
"scope": 10506,
|
||||
"src": "164:148:30",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 10507,
|
||||
"src": "136:178:30"
|
||||
}
|
||||
],
|
||||
"src": "78:237:30"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.714Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
@@ -1,838 +0,0 @@
|
||||
{
|
||||
"contractName": "IDODOLpToken",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "mint",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "value",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "burn",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "owner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "balanceOf",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "totalSupply",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOLpToken.sol\":\"IDODOLpToken\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOLpToken.sol\":{\"keccak256\":\"0x2183977c7a3cf5aa8d2f56d2167bf59515e34a8e4ebd2402efa85b612631955f\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://61766578f8d1bef7f51912a5327e8d4e95e3d9adb509e9486b4e2c8cf179f5e6\",\"dweb:/ipfs/QmXJRK4JKMrJkdn7BFVueoNRixsu26shnX3Dxeb5T9JKK4\"]}},\"version\":1}",
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "",
|
||||
"deployedSourceMap": "",
|
||||
"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 IDODOLpToken {\n function mint(address user, uint256 value) external;\n\n function burn(address user, uint256 value) external;\n\n function balanceOf(address owner) external view returns (uint256);\n\n function totalSupply() external view returns (uint256);\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOLpToken.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOLpToken.sol",
|
||||
"exportedSymbols": {
|
||||
"IDODOLpToken": [
|
||||
10536
|
||||
]
|
||||
},
|
||||
"id": 10537,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 10508,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"^",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:23:31"
|
||||
},
|
||||
{
|
||||
"id": 10509,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "102:33:31"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 10536,
|
||||
"linearizedBaseContracts": [
|
||||
10536
|
||||
],
|
||||
"name": "IDODOLpToken",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "40c10f19",
|
||||
"id": 10516,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "mint",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10514,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10511,
|
||||
"mutability": "mutable",
|
||||
"name": "user",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10516,
|
||||
"src": "181:12:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10510,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "181:7:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10513,
|
||||
"mutability": "mutable",
|
||||
"name": "value",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10516,
|
||||
"src": "195:13:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10512,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "195:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "180:29:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10515,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "218:0:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "167:52:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "9dc29fac",
|
||||
"id": 10523,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "burn",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10521,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10518,
|
||||
"mutability": "mutable",
|
||||
"name": "user",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10523,
|
||||
"src": "239:12:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10517,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "239:7:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10520,
|
||||
"mutability": "mutable",
|
||||
"name": "value",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10523,
|
||||
"src": "253:13:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10519,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "253:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "238:29:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10522,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "276:0:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "225:52:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "70a08231",
|
||||
"id": 10530,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "balanceOf",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10526,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10525,
|
||||
"mutability": "mutable",
|
||||
"name": "owner",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10530,
|
||||
"src": "302:13:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10524,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "302:7:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "301:15:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10529,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10528,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10530,
|
||||
"src": "340:7:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10527,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "340:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "339:9:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "283:66:31",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "18160ddd",
|
||||
"id": 10535,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "totalSupply",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10531,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "375:2:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10534,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10533,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10535,
|
||||
"src": "401:7:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10532,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "401:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "400:9:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "355:55:31",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 10537,
|
||||
"src": "138:274:31"
|
||||
}
|
||||
],
|
||||
"src": "78:335:31"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IDODOLpToken.sol",
|
||||
"exportedSymbols": {
|
||||
"IDODOLpToken": [
|
||||
10536
|
||||
]
|
||||
},
|
||||
"id": 10537,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 10508,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"^",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:23:31"
|
||||
},
|
||||
{
|
||||
"id": 10509,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "102:33:31"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 10536,
|
||||
"linearizedBaseContracts": [
|
||||
10536
|
||||
],
|
||||
"name": "IDODOLpToken",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "40c10f19",
|
||||
"id": 10516,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "mint",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10514,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10511,
|
||||
"mutability": "mutable",
|
||||
"name": "user",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10516,
|
||||
"src": "181:12:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10510,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "181:7:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10513,
|
||||
"mutability": "mutable",
|
||||
"name": "value",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10516,
|
||||
"src": "195:13:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10512,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "195:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "180:29:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10515,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "218:0:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "167:52:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "9dc29fac",
|
||||
"id": 10523,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "burn",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10521,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10518,
|
||||
"mutability": "mutable",
|
||||
"name": "user",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10523,
|
||||
"src": "239:12:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10517,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "239:7:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10520,
|
||||
"mutability": "mutable",
|
||||
"name": "value",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10523,
|
||||
"src": "253:13:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10519,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "253:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "238:29:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10522,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "276:0:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "225:52:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "70a08231",
|
||||
"id": 10530,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "balanceOf",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10526,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10525,
|
||||
"mutability": "mutable",
|
||||
"name": "owner",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10530,
|
||||
"src": "302:13:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10524,
|
||||
"name": "address",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "302:7:31",
|
||||
"stateMutability": "nonpayable",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_address",
|
||||
"typeString": "address"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "301:15:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10529,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10528,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10530,
|
||||
"src": "340:7:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10527,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "340:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "339:9:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "283:66:31",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "18160ddd",
|
||||
"id": 10535,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "totalSupply",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10531,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "375:2:31"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10534,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10533,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10535,
|
||||
"src": "401:7:31",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10532,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "401:7:31",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "400:9:31"
|
||||
},
|
||||
"scope": 10536,
|
||||
"src": "355:55:31",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 10537,
|
||||
"src": "138:274:31"
|
||||
}
|
||||
],
|
||||
"src": "78:335:31"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.714Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,257 +0,0 @@
|
||||
{
|
||||
"contractName": "IOracle",
|
||||
"abi": [
|
||||
{
|
||||
"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\":\"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/intf/IOracle.sol\":\"IOracle\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IOracle.sol\":{\"keccak256\":\"0xed4a31155c30a764366aba2244e42406269e59618088f93c02f1b4c9fec9e53c\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://bd3d50110c9120d942f7713e1cfced848ba7721ea336b2d9c4a87a6eb2a82ca9\",\"dweb:/ipfs/QmTYFeDcAyA2JpfoL1LsGLgj4TeRJxNV1rM27vdcaZSwpF\"]}},\"version\":1}",
|
||||
"bytecode": "0x",
|
||||
"deployedBytecode": "0x",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "",
|
||||
"deployedSourceMap": "",
|
||||
"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 IOracle {\n function getPrice() external view returns (uint256);\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IOracle.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IOracle.sol",
|
||||
"exportedSymbols": {
|
||||
"IOracle": [
|
||||
10616
|
||||
]
|
||||
},
|
||||
"id": 10617,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 10609,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:33"
|
||||
},
|
||||
{
|
||||
"id": 10610,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:33"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 10616,
|
||||
"linearizedBaseContracts": [
|
||||
10616
|
||||
],
|
||||
"name": "IOracle",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 10615,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10611,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "178:2:33"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10614,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10613,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10615,
|
||||
"src": "204:7:33",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10612,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "204:7:33",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "203:9:33"
|
||||
},
|
||||
"scope": 10616,
|
||||
"src": "161:52:33",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 10617,
|
||||
"src": "137:78:33"
|
||||
}
|
||||
],
|
||||
"src": "78:138:33"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/intf/IOracle.sol",
|
||||
"exportedSymbols": {
|
||||
"IOracle": [
|
||||
10616
|
||||
]
|
||||
},
|
||||
"id": 10617,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 10609,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:33"
|
||||
},
|
||||
{
|
||||
"id": 10610,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:33"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "interface",
|
||||
"documentation": null,
|
||||
"fullyImplemented": false,
|
||||
"id": 10616,
|
||||
"linearizedBaseContracts": [
|
||||
10616
|
||||
],
|
||||
"name": "IOracle",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"body": null,
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 10615,
|
||||
"implemented": false,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 10611,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "178:2:33"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 10614,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 10613,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 10615,
|
||||
"src": "204:7:33",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 10612,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "204:7:33",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "203:9:33"
|
||||
},
|
||||
"scope": 10616,
|
||||
"src": "161:52:33",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 10617,
|
||||
"src": "137:78:33"
|
||||
}
|
||||
],
|
||||
"src": "78:138:33"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.714Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,835 +0,0 @@
|
||||
{
|
||||
"contractName": "NaiveOracle",
|
||||
"abi": [
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "previousOwner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipTransferPrepared",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "previousOwner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipTransferred",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "_NEW_OWNER_",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "_OWNER_",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "claimOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "tokenPrice",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferOwnership",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "newPrice",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "setPrice",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"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\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferPrepared\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_NEW_OWNER_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_OWNER_\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"claimOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newPrice\",\"type\":\"uint256\"}],\"name\":\"setPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tokenPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/NaiveOracle.sol\":\"NaiveOracle\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/NaiveOracle.sol\":{\"keccak256\":\"0x32518fb42af0c68be8e7473f8afe6f6528e3ae7dfd232ba45d64f44d4bcaaf3e\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://e921f3e064f4c641a93a266d398434a9956b8a93f92d3465117fc30051424077\",\"dweb:/ipfs/QmPCsEvxRdXh1wpAdhKdmq5Qk4i1JKoQbxt6g2p89iBHw1\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Ownable.sol\":{\"keccak256\":\"0xb7a2ca6570834e4784e86d19fd5a4b6b1eff22a4586dc240659943396a365aa5\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://5855a493c78e787d7effd87d9c661acbcd19ca1e1ba72dbeaa91c3c8db29cbb4\",\"dweb:/ipfs/QmSddEexZ5okMatgoQ5JZRoJqe7BwsJwwWA2o1kKx7vbTH\"]}},\"version\":1}",
|
||||
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633178082556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a361039a806100696000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80638456db151161005b5780638456db15146100bf57806391b7f5ed146100c757806398d5fdca146100da578063f2fde38b146100e25761007d565b806316048bc4146100825780634e71e0c8146100a05780637ff9b596146100aa575b600080fd5b61008a6100f5565b60405161009791906102d6565b60405180910390f35b6100a8610104565b005b6100b261019b565b604051610097919061035b565b61008a6101a1565b6100a86100d53660046102be565b6101b0565b6100b26101df565b6100a86100f0366004610290565b6101e5565b6000546001600160a01b031681565b6001546001600160a01b031633146101375760405162461bcd60e51b815260040161012e906102ea565b60405180910390fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60025481565b6001546001600160a01b031681565b6000546001600160a01b031633146101da5760405162461bcd60e51b815260040161012e90610338565b600255565b60025490565b6000546001600160a01b0316331461020f5760405162461bcd60e51b815260040161012e90610338565b6001600160a01b0381166102355760405162461bcd60e51b815260040161012e90610311565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000602082840312156102a1578081fd5b81356001600160a01b03811681146102b7578182fd5b9392505050565b6000602082840312156102cf578081fd5b5035919050565b6001600160a01b0391909116815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b9081526020019056fea2646970667358221220e2351ef8fdb9b0d64fa4d0ceb202d1c149b0081b555f4c9e3d8b25d28074b54664736f6c63430006090033",
|
||||
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638456db151161005b5780638456db15146100bf57806391b7f5ed146100c757806398d5fdca146100da578063f2fde38b146100e25761007d565b806316048bc4146100825780634e71e0c8146100a05780637ff9b596146100aa575b600080fd5b61008a6100f5565b60405161009791906102d6565b60405180910390f35b6100a8610104565b005b6100b261019b565b604051610097919061035b565b61008a6101a1565b6100a86100d53660046102be565b6101b0565b6100b26101df565b6100a86100f0366004610290565b6101e5565b6000546001600160a01b031681565b6001546001600160a01b031633146101375760405162461bcd60e51b815260040161012e906102ea565b60405180910390fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60025481565b6001546001600160a01b031681565b6000546001600160a01b031633146101da5760405162461bcd60e51b815260040161012e90610338565b600255565b60025490565b6000546001600160a01b0316331461020f5760405162461bcd60e51b815260040161012e90610338565b6001600160a01b0381166102355760405162461bcd60e51b815260040161012e90610311565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000602082840312156102a1578081fd5b81356001600160a01b03811681146102b7578182fd5b9392505050565b6000602082840312156102cf578081fd5b5035919050565b6001600160a01b0391909116815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b9081526020019056fea2646970667358221220e2351ef8fdb9b0d64fa4d0ceb202d1c149b0081b555f4c9e3d8b25d28074b54664736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "206:257:17:-:0;;;;;;;;;;;;-1:-1:-1;757:7:38;:20;;-1:-1:-1;;;;;;757:20:38;767:10;757:20;;;;792:41;;-1:-1:-1;;;;;825:7:38;;;;;757;792:41;;757:7;;792:41;206:257:17;;;;;;",
|
||||
"deployedSourceMap": "206:257:17:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;251:22:38;;;:::i;:::-;;;;;;;;;;;;;;;;1072:225;;;:::i;:::-;;244:25:17;;;:::i;:::-;;;;;;;;279:26:38;;;:::i;276:93:17:-;;;;;;;;;:::i;375:86::-;;;:::i;846:220:38:-;;;;;;;;;:::i;251:22::-;;;-1:-1:-1;;;;;251:22:38;;:::o;1072:225::-;1139:11;;-1:-1:-1;;;;;1139:11:38;1125:10;:25;1117:51;;;;-1:-1:-1;;;1117:51:38;;;;;;;;;;;;;;;;;1213:11;;;1204:7;;1183:42;;-1:-1:-1;;;;;1213:11:38;;;;1204:7;;;;1183:42;;;1245:11;;;;1235:21;;-1:-1:-1;;;;;;1235:21:38;;;-1:-1:-1;;;;;1245:11:38;;1235:21;;;;1266:24;;;1072:225::o;244:25:17:-;;;;:::o;279:26:38:-;;;-1:-1:-1;;;;;279:26:38;;:::o;276:93:17:-;635:7:38;;-1:-1:-1;;;;;635:7:38;621:10;:21;613:43;;;;-1:-1:-1;;;613:43:38;;;;;;;;;341:10:17::1;:21:::0;276:93::o;375:86::-;444:10;;375:86;:::o;846:220:38:-;635:7;;-1:-1:-1;;;;;635:7:38;621:10;:21;613:43;;;;-1:-1:-1;;;613:43:38;;;;;;;;;-1:-1:-1;;;;;928:22:38;::::1;920:48;;;;-1:-1:-1::0;;;920:48:38::1;;;;;;;;;1009:7;::::0;;983:44:::1;::::0;-1:-1:-1;;;;;983:44:38;;::::1;::::0;1009:7;::::1;::::0;983:44:::1;::::0;::::1;1037:11;:22:::0;;-1:-1:-1;;;;;;1037:22:38::1;-1:-1:-1::0;;;;;1037:22:38;;;::::1;::::0;;;::::1;::::0;;846:220::o;279:241:-1:-;;383:2;371:9;362:7;358:23;354:32;351:2;;;-1:-1;;389:12;351:2;72:20;;-1:-1;;;;;4035:54;;4239:35;;4229:2;;-1:-1;;4278:12;4229:2;441:63;345:175;-1:-1;;;345:175;527:241;;631:2;619:9;610:7;606:23;602:32;599:2;;;-1:-1;;637:12;599:2;-1:-1;209:20;;593:175;-1:-1;593:175;1976:222;-1:-1;;;;;4035:54;;;;846:37;;2103:2;2088:18;;2074:124;2205:416;2405:2;2419:47;;;1120:2;2390:18;;;3807:19;-1:-1;;;3847:14;;;1136:36;1191:12;;;2376:245;2628:416;2828:2;2842:47;;;1442:2;2813:18;;;3807:19;-1:-1;;;3847:14;;;1458:36;1513:12;;;2799:245;3051:416;3251:2;3265:47;;;1764:1;3236:18;;;3807:19;-1:-1;;;3847:14;;;1779:32;1830:12;;;3222:245;3474:222;1927:37;;;3601:2;3586:18;;3572: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 {Ownable} from \"../lib/Ownable.sol\";\n\n\n// Oracle only for test\ncontract NaiveOracle is Ownable {\n uint256 public tokenPrice;\n\n function setPrice(uint256 newPrice) external onlyOwner {\n tokenPrice = newPrice;\n }\n\n function getPrice() external view returns (uint256) {\n return tokenPrice;\n }\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/NaiveOracle.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/NaiveOracle.sol",
|
||||
"exportedSymbols": {
|
||||
"NaiveOracle": [
|
||||
3415
|
||||
]
|
||||
},
|
||||
"id": 3416,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 3387,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:17"
|
||||
},
|
||||
{
|
||||
"id": 3388,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:17"
|
||||
},
|
||||
{
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Ownable.sol",
|
||||
"file": "../lib/Ownable.sol",
|
||||
"id": 3390,
|
||||
"nodeType": "ImportDirective",
|
||||
"scope": 3416,
|
||||
"sourceUnit": 11272,
|
||||
"src": "136:43:17",
|
||||
"symbolAliases": [
|
||||
{
|
||||
"foreign": {
|
||||
"argumentTypes": null,
|
||||
"id": 3389,
|
||||
"name": "Ownable",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": null,
|
||||
"src": "144:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": null,
|
||||
"typeString": null
|
||||
}
|
||||
},
|
||||
"local": null
|
||||
}
|
||||
],
|
||||
"unitAlias": ""
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [
|
||||
{
|
||||
"arguments": null,
|
||||
"baseName": {
|
||||
"contractScope": null,
|
||||
"id": 3391,
|
||||
"name": "Ownable",
|
||||
"nodeType": "UserDefinedTypeName",
|
||||
"referencedDeclaration": 11271,
|
||||
"src": "230:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_Ownable_$11271",
|
||||
"typeString": "contract Ownable"
|
||||
}
|
||||
},
|
||||
"id": 3392,
|
||||
"nodeType": "InheritanceSpecifier",
|
||||
"src": "230:7:17"
|
||||
}
|
||||
],
|
||||
"contractDependencies": [
|
||||
11271
|
||||
],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 3415,
|
||||
"linearizedBaseContracts": [
|
||||
3415,
|
||||
11271
|
||||
],
|
||||
"name": "NaiveOracle",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "7ff9b596",
|
||||
"id": 3394,
|
||||
"mutability": "mutable",
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 3415,
|
||||
"src": "244:25:17",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 3393,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "244:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 3405,
|
||||
"nodeType": "Block",
|
||||
"src": "331:38:17",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 3403,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 3401,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 3394,
|
||||
"src": "341:10:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 3402,
|
||||
"name": "newPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 3396,
|
||||
"src": "354:8:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"src": "341:21:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"id": 3404,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "341:21:17"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "91b7f5ed",
|
||||
"id": 3406,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [
|
||||
{
|
||||
"arguments": null,
|
||||
"id": 3399,
|
||||
"modifierName": {
|
||||
"argumentTypes": null,
|
||||
"id": 3398,
|
||||
"name": "onlyOwner",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11198,
|
||||
"src": "321:9:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_modifier$__$",
|
||||
"typeString": "modifier ()"
|
||||
}
|
||||
},
|
||||
"nodeType": "ModifierInvocation",
|
||||
"src": "321:9:17"
|
||||
}
|
||||
],
|
||||
"name": "setPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 3397,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 3396,
|
||||
"mutability": "mutable",
|
||||
"name": "newPrice",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 3406,
|
||||
"src": "294:16:17",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 3395,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "294:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "293:18:17"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 3400,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "331:0:17"
|
||||
},
|
||||
"scope": 3415,
|
||||
"src": "276:93:17",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 3413,
|
||||
"nodeType": "Block",
|
||||
"src": "427:34:17",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 3411,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 3394,
|
||||
"src": "444:10:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 3410,
|
||||
"id": 3412,
|
||||
"nodeType": "Return",
|
||||
"src": "437:17:17"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 3414,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 3407,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "392:2:17"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 3410,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 3409,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 3414,
|
||||
"src": "418:7:17",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 3408,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "418:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "417:9:17"
|
||||
},
|
||||
"scope": 3415,
|
||||
"src": "375:86:17",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 3416,
|
||||
"src": "206:257:17"
|
||||
}
|
||||
],
|
||||
"src": "78:386:17"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/helper/NaiveOracle.sol",
|
||||
"exportedSymbols": {
|
||||
"NaiveOracle": [
|
||||
3415
|
||||
]
|
||||
},
|
||||
"id": 3416,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 3387,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:17"
|
||||
},
|
||||
{
|
||||
"id": 3388,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:17"
|
||||
},
|
||||
{
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Ownable.sol",
|
||||
"file": "../lib/Ownable.sol",
|
||||
"id": 3390,
|
||||
"nodeType": "ImportDirective",
|
||||
"scope": 3416,
|
||||
"sourceUnit": 11272,
|
||||
"src": "136:43:17",
|
||||
"symbolAliases": [
|
||||
{
|
||||
"foreign": {
|
||||
"argumentTypes": null,
|
||||
"id": 3389,
|
||||
"name": "Ownable",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": null,
|
||||
"src": "144:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": null,
|
||||
"typeString": null
|
||||
}
|
||||
},
|
||||
"local": null
|
||||
}
|
||||
],
|
||||
"unitAlias": ""
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [
|
||||
{
|
||||
"arguments": null,
|
||||
"baseName": {
|
||||
"contractScope": null,
|
||||
"id": 3391,
|
||||
"name": "Ownable",
|
||||
"nodeType": "UserDefinedTypeName",
|
||||
"referencedDeclaration": 11271,
|
||||
"src": "230:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_contract$_Ownable_$11271",
|
||||
"typeString": "contract Ownable"
|
||||
}
|
||||
},
|
||||
"id": 3392,
|
||||
"nodeType": "InheritanceSpecifier",
|
||||
"src": "230:7:17"
|
||||
}
|
||||
],
|
||||
"contractDependencies": [
|
||||
11271
|
||||
],
|
||||
"contractKind": "contract",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 3415,
|
||||
"linearizedBaseContracts": [
|
||||
3415,
|
||||
11271
|
||||
],
|
||||
"name": "NaiveOracle",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"functionSelector": "7ff9b596",
|
||||
"id": 3394,
|
||||
"mutability": "mutable",
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 3415,
|
||||
"src": "244:25:17",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 3393,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "244:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "public"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 3405,
|
||||
"nodeType": "Block",
|
||||
"src": "331:38:17",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 3403,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 3401,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 3394,
|
||||
"src": "341:10:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 3402,
|
||||
"name": "newPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 3396,
|
||||
"src": "354:8:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"src": "341:21:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"id": 3404,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "341:21:17"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "91b7f5ed",
|
||||
"id": 3406,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [
|
||||
{
|
||||
"arguments": null,
|
||||
"id": 3399,
|
||||
"modifierName": {
|
||||
"argumentTypes": null,
|
||||
"id": 3398,
|
||||
"name": "onlyOwner",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11198,
|
||||
"src": "321:9:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_modifier$__$",
|
||||
"typeString": "modifier ()"
|
||||
}
|
||||
},
|
||||
"nodeType": "ModifierInvocation",
|
||||
"src": "321:9:17"
|
||||
}
|
||||
],
|
||||
"name": "setPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 3397,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 3396,
|
||||
"mutability": "mutable",
|
||||
"name": "newPrice",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 3406,
|
||||
"src": "294:16:17",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 3395,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "294:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "293:18:17"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 3400,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "331:0:17"
|
||||
},
|
||||
"scope": 3415,
|
||||
"src": "276:93:17",
|
||||
"stateMutability": "nonpayable",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 3413,
|
||||
"nodeType": "Block",
|
||||
"src": "427:34:17",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 3411,
|
||||
"name": "tokenPrice",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 3394,
|
||||
"src": "444:10:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"functionReturnParameters": 3410,
|
||||
"id": 3412,
|
||||
"nodeType": "Return",
|
||||
"src": "437:17:17"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"functionSelector": "98d5fdca",
|
||||
"id": 3414,
|
||||
"implemented": true,
|
||||
"kind": "function",
|
||||
"modifiers": [],
|
||||
"name": "getPrice",
|
||||
"nodeType": "FunctionDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 3407,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "392:2:17"
|
||||
},
|
||||
"returnParameters": {
|
||||
"id": 3410,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 3409,
|
||||
"mutability": "mutable",
|
||||
"name": "",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 3414,
|
||||
"src": "418:7:17",
|
||||
"stateVariable": false,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 3408,
|
||||
"name": "uint256",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "418:7:17",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_uint256",
|
||||
"typeString": "uint256"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"src": "417:9:17"
|
||||
},
|
||||
"scope": 3415,
|
||||
"src": "375:86:17",
|
||||
"stateMutability": "view",
|
||||
"virtual": false,
|
||||
"visibility": "external"
|
||||
}
|
||||
],
|
||||
"scope": 3416,
|
||||
"src": "206:257:17"
|
||||
}
|
||||
],
|
||||
"src": "78:386:17"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.522Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,648 +0,0 @@
|
||||
{
|
||||
"contractName": "ReentrancyGuard",
|
||||
"abi": [],
|
||||
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"DODO Breeder\",\"methods\":{},\"title\":\"ReentrancyGuard\"},\"userdoc\":{\"methods\":{},\"notice\":\"Protect functions from Reentrancy Attack\"}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/ReentrancyGuard.sol\":\"ReentrancyGuard\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/ReentrancyGuard.sol\":{\"keccak256\":\"0xc9c3fc946350fd72083a9d5b1327ff923533ef37b054bc7b6007562b20b0faaf\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://fc140417457139fb240427629673bfaf970c5d4568ad1cfe582764c6e4855bbb\",\"dweb:/ipfs/Qmd7ESYe5kyM6NYiSzeFE74f1YGGPXzpdVd5qnYg2AvgH8\"]}},\"version\":1}",
|
||||
"bytecode": "0x6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212209469d56347db7a53cb85062c49206c7bbc51a24fa41c5e625c5289740992784964736f6c63430006090033",
|
||||
"deployedBytecode": "0x6080604052600080fdfea26469706673582212209469d56347db7a53cb85062c49206c7bbc51a24fa41c5e625c5289740992784964736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "249:362:39:-:0;;;;;;;;;;;;;;;;;;;",
|
||||
"deployedSourceMap": "249:362:39:-:0;;;;;",
|
||||
"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/**\n * @title ReentrancyGuard\n * @author DODO Breeder\n *\n * @notice Protect functions from Reentrancy Attack\n */\ncontract ReentrancyGuard {\n // https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations\n // zero-state of _ENTERED_ is false\n bool private _ENTERED_;\n\n modifier preventReentrant() {\n require(!_ENTERED_, \"REENTRANT\");\n _ENTERED_ = true;\n _;\n _ENTERED_ = false;\n }\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/ReentrancyGuard.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/ReentrancyGuard.sol",
|
||||
"exportedSymbols": {
|
||||
"ReentrancyGuard": [
|
||||
11296
|
||||
]
|
||||
},
|
||||
"id": 11297,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 11273,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:39"
|
||||
},
|
||||
{
|
||||
"id": 11274,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:39"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": {
|
||||
"id": 11275,
|
||||
"nodeType": "StructuredDocumentation",
|
||||
"src": "136:112:39",
|
||||
"text": " @title ReentrancyGuard\n @author DODO Breeder\n @notice Protect functions from Reentrancy Attack"
|
||||
},
|
||||
"fullyImplemented": true,
|
||||
"id": 11296,
|
||||
"linearizedBaseContracts": [
|
||||
11296
|
||||
],
|
||||
"name": "ReentrancyGuard",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 11277,
|
||||
"mutability": "mutable",
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 11296,
|
||||
"src": "439:22:39",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 11276,
|
||||
"name": "bool",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "439:4:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 11294,
|
||||
"nodeType": "Block",
|
||||
"src": "496:113:39",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 11281,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"nodeType": "UnaryOperation",
|
||||
"operator": "!",
|
||||
"prefix": true,
|
||||
"src": "514:10:39",
|
||||
"subExpression": {
|
||||
"argumentTypes": null,
|
||||
"id": 11280,
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11277,
|
||||
"src": "515:9:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"hexValue": "5245454e5452414e54",
|
||||
"id": 11282,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "string",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "526:11:39",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_stringliteral_40d1ed539991cf8f0c0e2cf9c325da6c7b687870b5825a46b3a1bc60970fec73",
|
||||
"typeString": "literal_string \"REENTRANT\""
|
||||
},
|
||||
"value": "REENTRANT"
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
{
|
||||
"typeIdentifier": "t_stringliteral_40d1ed539991cf8f0c0e2cf9c325da6c7b687870b5825a46b3a1bc60970fec73",
|
||||
"typeString": "literal_string \"REENTRANT\""
|
||||
}
|
||||
],
|
||||
"id": 11279,
|
||||
"name": "require",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [
|
||||
-18,
|
||||
-18
|
||||
],
|
||||
"referencedDeclaration": -18,
|
||||
"src": "506:7:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
|
||||
"typeString": "function (bool,string memory) pure"
|
||||
}
|
||||
},
|
||||
"id": 11283,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "506:32:39",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_tuple$__$",
|
||||
"typeString": "tuple()"
|
||||
}
|
||||
},
|
||||
"id": 11284,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "506:32:39"
|
||||
},
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 11287,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 11285,
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11277,
|
||||
"src": "548:9:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "74727565",
|
||||
"id": 11286,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "bool",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "560:4:39",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"value": "true"
|
||||
},
|
||||
"src": "548:16:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"id": 11288,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "548:16:39"
|
||||
},
|
||||
{
|
||||
"id": 11289,
|
||||
"nodeType": "PlaceholderStatement",
|
||||
"src": "574:1:39"
|
||||
},
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 11292,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 11290,
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11277,
|
||||
"src": "585:9:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "66616c7365",
|
||||
"id": 11291,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "bool",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "597:5:39",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"value": "false"
|
||||
},
|
||||
"src": "585:17:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"id": 11293,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "585:17:39"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"id": 11295,
|
||||
"name": "preventReentrant",
|
||||
"nodeType": "ModifierDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 11278,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "493:2:39"
|
||||
},
|
||||
"src": "468:141:39",
|
||||
"virtual": false,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"scope": 11297,
|
||||
"src": "249:362:39"
|
||||
}
|
||||
],
|
||||
"src": "78:534:39"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/ReentrancyGuard.sol",
|
||||
"exportedSymbols": {
|
||||
"ReentrancyGuard": [
|
||||
11296
|
||||
]
|
||||
},
|
||||
"id": 11297,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 11273,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:39"
|
||||
},
|
||||
{
|
||||
"id": 11274,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:39"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "contract",
|
||||
"documentation": {
|
||||
"id": 11275,
|
||||
"nodeType": "StructuredDocumentation",
|
||||
"src": "136:112:39",
|
||||
"text": " @title ReentrancyGuard\n @author DODO Breeder\n @notice Protect functions from Reentrancy Attack"
|
||||
},
|
||||
"fullyImplemented": true,
|
||||
"id": 11296,
|
||||
"linearizedBaseContracts": [
|
||||
11296
|
||||
],
|
||||
"name": "ReentrancyGuard",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"constant": false,
|
||||
"id": 11277,
|
||||
"mutability": "mutable",
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "VariableDeclaration",
|
||||
"overrides": null,
|
||||
"scope": 11296,
|
||||
"src": "439:22:39",
|
||||
"stateVariable": true,
|
||||
"storageLocation": "default",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"typeName": {
|
||||
"id": 11276,
|
||||
"name": "bool",
|
||||
"nodeType": "ElementaryTypeName",
|
||||
"src": "439:4:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"value": null,
|
||||
"visibility": "private"
|
||||
},
|
||||
{
|
||||
"body": {
|
||||
"id": 11294,
|
||||
"nodeType": "Block",
|
||||
"src": "496:113:39",
|
||||
"statements": [
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"arguments": [
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"id": 11281,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"nodeType": "UnaryOperation",
|
||||
"operator": "!",
|
||||
"prefix": true,
|
||||
"src": "514:10:39",
|
||||
"subExpression": {
|
||||
"argumentTypes": null,
|
||||
"id": 11280,
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11277,
|
||||
"src": "515:9:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"argumentTypes": null,
|
||||
"hexValue": "5245454e5452414e54",
|
||||
"id": 11282,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "string",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "526:11:39",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_stringliteral_40d1ed539991cf8f0c0e2cf9c325da6c7b687870b5825a46b3a1bc60970fec73",
|
||||
"typeString": "literal_string \"REENTRANT\""
|
||||
},
|
||||
"value": "REENTRANT"
|
||||
}
|
||||
],
|
||||
"expression": {
|
||||
"argumentTypes": [
|
||||
{
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
{
|
||||
"typeIdentifier": "t_stringliteral_40d1ed539991cf8f0c0e2cf9c325da6c7b687870b5825a46b3a1bc60970fec73",
|
||||
"typeString": "literal_string \"REENTRANT\""
|
||||
}
|
||||
],
|
||||
"id": 11279,
|
||||
"name": "require",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [
|
||||
-18,
|
||||
-18
|
||||
],
|
||||
"referencedDeclaration": -18,
|
||||
"src": "506:7:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
|
||||
"typeString": "function (bool,string memory) pure"
|
||||
}
|
||||
},
|
||||
"id": 11283,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"kind": "functionCall",
|
||||
"lValueRequested": false,
|
||||
"names": [],
|
||||
"nodeType": "FunctionCall",
|
||||
"src": "506:32:39",
|
||||
"tryCall": false,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_tuple$__$",
|
||||
"typeString": "tuple()"
|
||||
}
|
||||
},
|
||||
"id": 11284,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "506:32:39"
|
||||
},
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 11287,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 11285,
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11277,
|
||||
"src": "548:9:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "74727565",
|
||||
"id": 11286,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "bool",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "560:4:39",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"value": "true"
|
||||
},
|
||||
"src": "548:16:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"id": 11288,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "548:16:39"
|
||||
},
|
||||
{
|
||||
"id": 11289,
|
||||
"nodeType": "PlaceholderStatement",
|
||||
"src": "574:1:39"
|
||||
},
|
||||
{
|
||||
"expression": {
|
||||
"argumentTypes": null,
|
||||
"id": 11292,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": false,
|
||||
"lValueRequested": false,
|
||||
"leftHandSide": {
|
||||
"argumentTypes": null,
|
||||
"id": 11290,
|
||||
"name": "_ENTERED_",
|
||||
"nodeType": "Identifier",
|
||||
"overloadedDeclarations": [],
|
||||
"referencedDeclaration": 11277,
|
||||
"src": "585:9:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"nodeType": "Assignment",
|
||||
"operator": "=",
|
||||
"rightHandSide": {
|
||||
"argumentTypes": null,
|
||||
"hexValue": "66616c7365",
|
||||
"id": 11291,
|
||||
"isConstant": false,
|
||||
"isLValue": false,
|
||||
"isPure": true,
|
||||
"kind": "bool",
|
||||
"lValueRequested": false,
|
||||
"nodeType": "Literal",
|
||||
"src": "597:5:39",
|
||||
"subdenomination": null,
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
},
|
||||
"value": "false"
|
||||
},
|
||||
"src": "585:17:39",
|
||||
"typeDescriptions": {
|
||||
"typeIdentifier": "t_bool",
|
||||
"typeString": "bool"
|
||||
}
|
||||
},
|
||||
"id": 11293,
|
||||
"nodeType": "ExpressionStatement",
|
||||
"src": "585:17:39"
|
||||
}
|
||||
]
|
||||
},
|
||||
"documentation": null,
|
||||
"id": 11295,
|
||||
"name": "preventReentrant",
|
||||
"nodeType": "ModifierDefinition",
|
||||
"overrides": null,
|
||||
"parameters": {
|
||||
"id": 11278,
|
||||
"nodeType": "ParameterList",
|
||||
"parameters": [],
|
||||
"src": "493:2:39"
|
||||
},
|
||||
"src": "468:141:39",
|
||||
"virtual": false,
|
||||
"visibility": "internal"
|
||||
}
|
||||
],
|
||||
"scope": 11297,
|
||||
"src": "249:362:39"
|
||||
}
|
||||
],
|
||||
"src": "78:534:39"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.723Z",
|
||||
"devdoc": {
|
||||
"author": "DODO Breeder",
|
||||
"methods": {},
|
||||
"title": "ReentrancyGuard"
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {},
|
||||
"notice": "Protect functions from Reentrancy Attack"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,181 +0,0 @@
|
||||
{
|
||||
"contractName": "Types",
|
||||
"abi": [],
|
||||
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol\":\"Types\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol\":{\"keccak256\":\"0x0aebcc897b4de833e87e46a11e5a70d2b6e1d2fd99ebdf9e32e6421924f18b15\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://a1098dace4f0664b0e3f5c3b6ce535ad2aba52e68fb6d1ea94b09debc06ed33c\",\"dweb:/ipfs/QmRbiq7M3Y8utAXaPWmVooGmoYF27N5dKVn6QYTaDFwqdP\"]}},\"version\":1}",
|
||||
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a71f81235df80e66b7c695f71deaa53b9a7cc588efc7c5b3bed7e3ab5f96472564736f6c63430006090033",
|
||||
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a71f81235df80e66b7c695f71deaa53b9a7cc588efc7c5b3bed7e3ab5f96472564736f6c63430006090033",
|
||||
"immutableReferences": {},
|
||||
"sourceMap": "136:62:42:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
|
||||
"deployedSourceMap": "136:62:42:-:0;;;;;;;;",
|
||||
"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\nlibrary Types {\n enum RStatus {ONE, ABOVE_ONE, BELOW_ONE}\n}\n",
|
||||
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol",
|
||||
"ast": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol",
|
||||
"exportedSymbols": {
|
||||
"Types": [
|
||||
11631
|
||||
]
|
||||
},
|
||||
"id": 11632,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 11625,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:42"
|
||||
},
|
||||
{
|
||||
"id": 11626,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:42"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "library",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 11631,
|
||||
"linearizedBaseContracts": [
|
||||
11631
|
||||
],
|
||||
"name": "Types",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"canonicalName": "Types.RStatus",
|
||||
"id": 11630,
|
||||
"members": [
|
||||
{
|
||||
"id": 11627,
|
||||
"name": "ONE",
|
||||
"nodeType": "EnumValue",
|
||||
"src": "170:3:42"
|
||||
},
|
||||
{
|
||||
"id": 11628,
|
||||
"name": "ABOVE_ONE",
|
||||
"nodeType": "EnumValue",
|
||||
"src": "175:9:42"
|
||||
},
|
||||
{
|
||||
"id": 11629,
|
||||
"name": "BELOW_ONE",
|
||||
"nodeType": "EnumValue",
|
||||
"src": "186:9:42"
|
||||
}
|
||||
],
|
||||
"name": "RStatus",
|
||||
"nodeType": "EnumDefinition",
|
||||
"src": "156:40:42"
|
||||
}
|
||||
],
|
||||
"scope": 11632,
|
||||
"src": "136:62:42"
|
||||
}
|
||||
],
|
||||
"src": "78:121:42"
|
||||
},
|
||||
"legacyAST": {
|
||||
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/Types.sol",
|
||||
"exportedSymbols": {
|
||||
"Types": [
|
||||
11631
|
||||
]
|
||||
},
|
||||
"id": 11632,
|
||||
"license": "Apache-2.0",
|
||||
"nodeType": "SourceUnit",
|
||||
"nodes": [
|
||||
{
|
||||
"id": 11625,
|
||||
"literals": [
|
||||
"solidity",
|
||||
"0.6",
|
||||
".9"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "78:22:42"
|
||||
},
|
||||
{
|
||||
"id": 11626,
|
||||
"literals": [
|
||||
"experimental",
|
||||
"ABIEncoderV2"
|
||||
],
|
||||
"nodeType": "PragmaDirective",
|
||||
"src": "101:33:42"
|
||||
},
|
||||
{
|
||||
"abstract": false,
|
||||
"baseContracts": [],
|
||||
"contractDependencies": [],
|
||||
"contractKind": "library",
|
||||
"documentation": null,
|
||||
"fullyImplemented": true,
|
||||
"id": 11631,
|
||||
"linearizedBaseContracts": [
|
||||
11631
|
||||
],
|
||||
"name": "Types",
|
||||
"nodeType": "ContractDefinition",
|
||||
"nodes": [
|
||||
{
|
||||
"canonicalName": "Types.RStatus",
|
||||
"id": 11630,
|
||||
"members": [
|
||||
{
|
||||
"id": 11627,
|
||||
"name": "ONE",
|
||||
"nodeType": "EnumValue",
|
||||
"src": "170:3:42"
|
||||
},
|
||||
{
|
||||
"id": 11628,
|
||||
"name": "ABOVE_ONE",
|
||||
"nodeType": "EnumValue",
|
||||
"src": "175:9:42"
|
||||
},
|
||||
{
|
||||
"id": 11629,
|
||||
"name": "BELOW_ONE",
|
||||
"nodeType": "EnumValue",
|
||||
"src": "186:9:42"
|
||||
}
|
||||
],
|
||||
"name": "RStatus",
|
||||
"nodeType": "EnumDefinition",
|
||||
"src": "156:40:42"
|
||||
}
|
||||
],
|
||||
"scope": 11632,
|
||||
"src": "136:62:42"
|
||||
}
|
||||
],
|
||||
"src": "78:121:42"
|
||||
},
|
||||
"compiler": {
|
||||
"name": "solc",
|
||||
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
||||
},
|
||||
"networks": {},
|
||||
"schemaVersion": "3.2.3",
|
||||
"updatedAt": "2020-11-06T08:03:35.725Z",
|
||||
"devdoc": {
|
||||
"methods": {}
|
||||
},
|
||||
"userdoc": {
|
||||
"methods": {}
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@ import {IPermissionManager} from "../../lib/PermissionManager.sol";
|
||||
import {IExternalValue} from "../../lib/ExternalValue.sol";
|
||||
import {IFeeRateModel} from "../../intf/IFeeRateModel.sol";
|
||||
import {IERC20} from "../../intf/IERC20.sol";
|
||||
import {RState} from "../../lib/PMMPricing.sol";
|
||||
import {PMMPricing} from "../../lib/PMMPricing.sol";
|
||||
|
||||
/**
|
||||
* @title Storage
|
||||
@@ -49,7 +49,7 @@ contract DPPStorage is InitializableOwnable, ReentrancyGuard {
|
||||
uint256 public _QUOTE_RESERVE_;
|
||||
uint256 public _BASE_TARGET_;
|
||||
uint256 public _QUOTE_TARGET_;
|
||||
RState public _RState_;
|
||||
PMMPricing.RState public _RState_;
|
||||
|
||||
// ============ Variables for Pricing ============
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ pragma experimental ABIEncoderV2;
|
||||
import {DPPVault} from "./DPPVault.sol";
|
||||
import {SafeMath} from "../../lib/SafeMath.sol";
|
||||
import {DecimalMath} from "../../lib/DecimalMath.sol";
|
||||
import {RState, PMMState, PMMPricing} from "../../lib/PMMPricing.sol";
|
||||
import {PMMPricing} from "../../lib/PMMPricing.sol";
|
||||
import {IDODOCallee} from "../../intf/IDODOCallee.sol";
|
||||
|
||||
contract DPPTrader is DPPVault {
|
||||
@@ -49,7 +49,7 @@ contract DPPTrader is DPPVault {
|
||||
uint256 baseInput = getBaseInput();
|
||||
uint256 mtFee;
|
||||
uint256 newBaseTarget;
|
||||
RState newRState;
|
||||
PMMPricing.RState newRState;
|
||||
(receiveQuoteAmount, mtFee, newRState, newBaseTarget) = querySellBase(tx.origin, baseInput);
|
||||
|
||||
_transferQuoteOut(to, receiveQuoteAmount);
|
||||
@@ -76,7 +76,7 @@ contract DPPTrader is DPPVault {
|
||||
uint256 quoteInput = getQuoteInput();
|
||||
uint256 mtFee;
|
||||
uint256 newQuoteTarget;
|
||||
RState newRState;
|
||||
PMMPricing.RState newRState;
|
||||
(receiveBaseAmount, mtFee, newRState, newQuoteTarget) = querySellQuote(
|
||||
tx.origin,
|
||||
quoteInput
|
||||
@@ -125,7 +125,7 @@ contract DPPTrader is DPPVault {
|
||||
(
|
||||
uint256 receiveBaseAmount,
|
||||
uint256 mtFee,
|
||||
RState newRState,
|
||||
PMMPricing.RState newRState,
|
||||
uint256 newQuoteTarget
|
||||
) = querySellQuote(tx.origin, quoteBalance.sub(_QUOTE_RESERVE_)); // revert if quoteBalance<quoteReserve
|
||||
|
||||
@@ -146,7 +146,7 @@ contract DPPTrader is DPPVault {
|
||||
(
|
||||
uint256 receiveQuoteAmount,
|
||||
uint256 mtFee,
|
||||
RState newRState,
|
||||
PMMPricing.RState newRState,
|
||||
uint256 newBaseTarget
|
||||
) = querySellBase(tx.origin, baseBalance.sub(_BASE_RESERVE_)); // revert if baseBalance<baseReserve
|
||||
|
||||
@@ -170,11 +170,11 @@ contract DPPTrader is DPPVault {
|
||||
returns (
|
||||
uint256 receiveQuoteAmount,
|
||||
uint256 mtFee,
|
||||
RState newRState,
|
||||
PMMPricing.RState newRState,
|
||||
uint256 newBaseTarget
|
||||
)
|
||||
{
|
||||
PMMState memory state = getPMMState();
|
||||
PMMPricing.PMMState memory state = getPMMState();
|
||||
(receiveQuoteAmount, newRState) = PMMPricing.sellBaseToken(state, payBaseAmount);
|
||||
|
||||
uint256 lpFeeRate = _LP_FEE_RATE_MODEL_.getFeeRate(trader);
|
||||
@@ -194,11 +194,11 @@ contract DPPTrader is DPPVault {
|
||||
returns (
|
||||
uint256 receiveBaseAmount,
|
||||
uint256 mtFee,
|
||||
RState newRState,
|
||||
PMMPricing.RState newRState,
|
||||
uint256 newQuoteTarget
|
||||
)
|
||||
{
|
||||
PMMState memory state = getPMMState();
|
||||
PMMPricing.PMMState memory state = getPMMState();
|
||||
(receiveBaseAmount, newRState) = PMMPricing.sellQuoteToken(state, payQuoteAmount);
|
||||
|
||||
uint256 lpFeeRate = _LP_FEE_RATE_MODEL_.getFeeRate(trader);
|
||||
@@ -213,7 +213,7 @@ contract DPPTrader is DPPVault {
|
||||
|
||||
// ============ Helper Functions ============
|
||||
|
||||
function getPMMState() public view returns (PMMState memory state) {
|
||||
function getPMMState() public view returns (PMMPricing.PMMState memory state) {
|
||||
state.i = _I_.get();
|
||||
state.K = _K_.get();
|
||||
state.B = _BASE_RESERVE_;
|
||||
|
||||
@@ -13,7 +13,7 @@ import {SafeMath} from "../../lib/SafeMath.sol";
|
||||
import {DecimalMath} from "../../lib/DecimalMath.sol";
|
||||
import {DODOMath} from "../../lib/DODOMath.sol";
|
||||
import {IDODOCallee} from "../../intf/IDODOCallee.sol";
|
||||
import {RState, PMMState, PMMPricing} from "../../lib/PMMPricing.sol";
|
||||
import {PMMPricing} from "../../lib/PMMPricing.sol";
|
||||
|
||||
contract DVMTrader is DVMVault {
|
||||
using SafeMath for uint256;
|
||||
@@ -210,14 +210,14 @@ contract DVMTrader is DVMVault {
|
||||
|
||||
// ============ Helper Functions ============
|
||||
|
||||
function getPMMState() public view returns (PMMState memory state) {
|
||||
function getPMMState() public view returns (PMMPricing.PMMState memory state) {
|
||||
state.i = _I_;
|
||||
state.K = _K_;
|
||||
state.B = _BASE_RESERVE_;
|
||||
state.Q = _QUOTE_RESERVE_;
|
||||
state.B0 = calculateBase0(state.B, state.Q);
|
||||
state.Q0 = 0;
|
||||
state.R = RState.ABOVE_ONE;
|
||||
state.R = PMMPricing.RState.ABOVE_ONE;
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,16 @@ interface IDVM {
|
||||
uint256 i,
|
||||
uint256 k
|
||||
) external;
|
||||
|
||||
function _BASE_TOKEN_() external returns (address);
|
||||
|
||||
function _QUOTE_TOKEN_() external returns (address);
|
||||
|
||||
function getVaultReserve() external returns (uint256 baseReserve, uint256 quoteReserve);
|
||||
|
||||
function sellBase(address to) external returns (uint256);
|
||||
|
||||
function sellQuote(address to) external returns (uint256);
|
||||
|
||||
function buyShares(address to) external returns (uint256);
|
||||
}
|
||||
@@ -11,7 +11,7 @@ pragma experimental ABIEncoderV2;
|
||||
import {Ownable} from "../lib/Ownable.sol";
|
||||
import {ICloneFactory} from "../lib/CloneFactory.sol";
|
||||
import {IConstFeeRateModel} from "../lib/ConstFeeRateModel.sol";
|
||||
import {IDVM} from "../DODOVendorMachine/intf/IDVM.sol";
|
||||
import {IDVM} from "../DODOVendingMachine/intf/IDVM.sol";
|
||||
import {IPermissionManager} from "../lib/PermissionManager.sol";
|
||||
|
||||
contract DVMFactory is Ownable {
|
||||
@@ -39,7 +39,7 @@ contract DVMFactory is Ownable {
|
||||
_DEFAULT_GAS_PRICE_SOURCE_ = defaultGasPriceSource;
|
||||
}
|
||||
|
||||
function createStandardDODOVendorMachine(
|
||||
function createStandardDODOVendingMachine(
|
||||
address baseToken,
|
||||
address quoteToken,
|
||||
uint256 lpFeeRate,
|
||||
|
||||
@@ -7,15 +7,13 @@
|
||||
|
||||
pragma solidity 0.6.9;
|
||||
|
||||
import {Ownable} from "../lib/Ownable.sol";
|
||||
import {DVM} from "../DODOVendorMachine/impl/DVM.sol";
|
||||
import {DVMVault} from "../DODOVendorMachine/impl/DVMVault.sol";
|
||||
import {IDVM} from "../DODOVendingMachine/intf/IDVM.sol";
|
||||
import {IERC20} from "../intf/IERC20.sol";
|
||||
import {SafeERC20} from "../lib/SafeERC20.sol";
|
||||
import {SafeMath} from "../lib/SafeMath.sol";
|
||||
import {DecimalMath} from "../lib/DecimalMath.sol";
|
||||
|
||||
contract SmartRoute is Ownable {
|
||||
contract DVMProxy {
|
||||
using SafeMath for uint256;
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
@@ -25,8 +23,12 @@ contract SmartRoute is Ownable {
|
||||
uint256 baseAmount,
|
||||
uint256 minReceive
|
||||
) public returns (uint256 receiveAmount) {
|
||||
IERC20(DVM(DVMAddress)._BASE_TOKEN_()).safeTransferFrom(msg.sender, DVMAddress, baseAmount);
|
||||
receiveAmount = DVM(DVMAddress).sellBase(to);
|
||||
IERC20(IDVM(DVMAddress)._BASE_TOKEN_()).safeTransferFrom(
|
||||
msg.sender,
|
||||
DVMAddress,
|
||||
baseAmount
|
||||
);
|
||||
receiveAmount = IDVM(DVMAddress).sellBase(to);
|
||||
require(receiveAmount >= minReceive, "RECEIVE_NOT_ENOUGH");
|
||||
return receiveAmount;
|
||||
}
|
||||
@@ -37,12 +39,12 @@ contract SmartRoute is Ownable {
|
||||
uint256 quoteAmount,
|
||||
uint256 minReceive
|
||||
) public returns (uint256 receiveAmount) {
|
||||
IERC20(DVM(DVMAddress)._QUOTE_TOKEN_()).safeTransferFrom(
|
||||
IERC20(IDVM(DVMAddress)._QUOTE_TOKEN_()).safeTransferFrom(
|
||||
msg.sender,
|
||||
DVMAddress,
|
||||
quoteAmount
|
||||
);
|
||||
receiveAmount = DVM(DVMAddress).sellQuote(to);
|
||||
receiveAmount = IDVM(DVMAddress).sellQuote(to);
|
||||
require(receiveAmount >= minReceive, "RECEIVE_NOT_ENOUGU");
|
||||
return receiveAmount;
|
||||
}
|
||||
@@ -53,10 +55,9 @@ contract SmartRoute is Ownable {
|
||||
uint256 baseAmount,
|
||||
uint256 quoteAmount
|
||||
) public returns (uint256 shares) {
|
||||
address vault = DVMAddress;
|
||||
uint256 adjustedBaseAmount;
|
||||
uint256 adjustedQuoteAmount;
|
||||
(uint256 baseReserve, uint256 quoteReserve) = DVM(DVMAddress).getVaultReserve();
|
||||
(uint256 baseReserve, uint256 quoteReserve) = IDVM(DVMAddress).getVaultReserve();
|
||||
|
||||
if (quoteReserve == 0 && baseReserve == 0) {
|
||||
adjustedBaseAmount = baseAmount;
|
||||
@@ -80,18 +81,18 @@ contract SmartRoute is Ownable {
|
||||
}
|
||||
}
|
||||
|
||||
IERC20(DVM(DVMAddress)._BASE_TOKEN_()).safeTransferFrom(
|
||||
IERC20(IDVM(DVMAddress)._BASE_TOKEN_()).safeTransferFrom(
|
||||
msg.sender,
|
||||
vault,
|
||||
DVMAddress,
|
||||
adjustedBaseAmount
|
||||
);
|
||||
IERC20(DVM(DVMAddress)._QUOTE_TOKEN_()).safeTransferFrom(
|
||||
IERC20(IDVM(DVMAddress)._QUOTE_TOKEN_()).safeTransferFrom(
|
||||
msg.sender,
|
||||
vault,
|
||||
DVMAddress,
|
||||
adjustedQuoteAmount
|
||||
);
|
||||
|
||||
shares = DVM(DVMAddress).buyShares(to);
|
||||
shares = IDVM(DVMAddress).buyShares(to);
|
||||
|
||||
return shares;
|
||||
}
|
||||
@@ -9,6 +9,7 @@ pragma solidity 0.6.9;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import {Ownable} from "./Ownable.sol";
|
||||
import {InitializableOwnable} from "./InitializableOwnable.sol";
|
||||
|
||||
interface IExternalValue {
|
||||
function set(uint256) external;
|
||||
@@ -16,10 +17,10 @@ interface IExternalValue {
|
||||
function get() external view returns (uint256);
|
||||
}
|
||||
|
||||
contract ExternalValue is IExternalValue, Ownable {
|
||||
contract ExternalValue is IExternalValue, InitializableOwnable {
|
||||
uint256 public _VALUE_;
|
||||
|
||||
function set(uint256 value) external override {
|
||||
function set(uint256 value) external override onlyOwner {
|
||||
_VALUE_ = value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
|
||||
Copyright 2020 DODO ZOO.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity 0.6.9;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import {Ownable} from "./Ownable.sol";
|
||||
|
||||
interface IGasPriceSource {
|
||||
function setGasPrice(uint256) external;
|
||||
|
||||
function getGasPrice() external view returns (uint256);
|
||||
}
|
||||
|
||||
contract GasPriceSource is IGasPriceSource, Ownable {
|
||||
uint256 public _GAS_PRICE_;
|
||||
|
||||
function setGasPrice(uint256 gasPrice) external override {
|
||||
_GAS_PRICE_ = gasPrice;
|
||||
}
|
||||
|
||||
function getGasPrice() external override view returns (uint256) {
|
||||
return _GAS_PRICE_;
|
||||
}
|
||||
}
|
||||
@@ -19,23 +19,23 @@ import {DODOMath} from "../lib/DODOMath.sol";
|
||||
* @notice DODO Pricing model
|
||||
*/
|
||||
|
||||
enum RState {ONE, ABOVE_ONE, BELOW_ONE}
|
||||
|
||||
struct PMMState {
|
||||
uint256 i;
|
||||
uint256 K;
|
||||
uint256 B;
|
||||
uint256 Q;
|
||||
uint256 B0;
|
||||
uint256 Q0;
|
||||
RState R;
|
||||
}
|
||||
|
||||
library PMMPricing {
|
||||
using SafeMath for uint256;
|
||||
|
||||
enum RState {ONE, ABOVE_ONE, BELOW_ONE}
|
||||
|
||||
struct PMMState {
|
||||
uint256 i;
|
||||
uint256 K;
|
||||
uint256 B;
|
||||
uint256 Q;
|
||||
uint256 B0;
|
||||
uint256 Q0;
|
||||
RState R;
|
||||
}
|
||||
|
||||
function sellBaseToken(PMMState memory state, uint256 payBaseAmount)
|
||||
public
|
||||
internal
|
||||
pure
|
||||
returns (uint256 receiveQuoteAmount, RState newR)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ library PMMPricing {
|
||||
}
|
||||
|
||||
function sellQuoteToken(PMMState memory state, uint256 payQuoteAmount)
|
||||
public
|
||||
internal
|
||||
pure
|
||||
returns (uint256 receiveBaseAmount, RState newR)
|
||||
{
|
||||
@@ -214,7 +214,7 @@ library PMMPricing {
|
||||
// ============ Helper functions ============
|
||||
|
||||
// todo 我不确定这个函数是不是能改state的状态
|
||||
function adjustedTarget(PMMState memory state) public pure {
|
||||
function adjustedTarget(PMMState memory state) internal pure {
|
||||
if (state.R == RState.BELOW_ONE) {
|
||||
uint256 fairAmount = DecimalMath.mulFloor(state.B.sub(state.B0), state.i);
|
||||
state.Q0 = DODOMath._SolveQuadraticFunctionForTarget(state.B, state.K, fairAmount);
|
||||
@@ -224,7 +224,7 @@ library PMMPricing {
|
||||
}
|
||||
}
|
||||
|
||||
function getMidPrice(PMMState memory state) public pure returns (uint256 midPrice) {
|
||||
function getMidPrice(PMMState memory state) internal pure returns (uint256 midPrice) {
|
||||
if (state.R == RState.BELOW_ONE) {
|
||||
uint256 R = DecimalMath.divFloor(state.Q0.mul(state.Q0).div(state.Q), state.Q);
|
||||
R = DecimalMath.ONE.sub(state.K).add(DecimalMath.mul(state.K, R));
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
====================================================
|
||||
network type: live
|
||||
Deploy time: 2020/11/16 上午10:26:34
|
||||
Deploy type: Smart Route
|
||||
SmartApprove Address: 0xe380Ad3181A69BF92133D2feb609867c4adC61eA
|
||||
DODOSellHelper Address: 0x533da777aedce766ceae696bf90f8541a4ba80eb
|
||||
SmartSwap Address: 0xcD8392A57ED2fBD6440037E52F176c26dEFc0ba4
|
||||
SmartApprovce setSmartSwap tx: 0x35eccc657ee0d473b6e58324123d3da568ce12389fedff914a8dada563b35b3a
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Migrations = artifacts.require("Migrations");
|
||||
|
||||
module.exports = function (deployer) {
|
||||
// deployer.deploy(Migrations);
|
||||
deployer.deploy(Migrations);
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@ let trader: string;
|
||||
async function init(ctx: DVMContext): Promise<void> {
|
||||
lp = ctx.SpareAccounts[0];
|
||||
trader = ctx.SpareAccounts[1];
|
||||
await ctx.approveRoute(lp);
|
||||
await ctx.approveRoute(trader);
|
||||
await ctx.approveProxy(lp);
|
||||
await ctx.approveProxy(trader);
|
||||
|
||||
await ctx.mintTestToken(lp, decimalStr("10"), decimalStr("1000"));
|
||||
await ctx.mintTestToken(trader, decimalStr("10"), decimalStr("1000"));
|
||||
@@ -47,7 +47,7 @@ describe("Funding", () => {
|
||||
|
||||
it("buy shares from init states", async () => {
|
||||
|
||||
await logGas(ctx.Route.methods
|
||||
await logGas(ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("0"))
|
||||
, ctx.sendParam(lp), "buy shares");
|
||||
|
||||
@@ -74,7 +74,7 @@ describe("Funding", () => {
|
||||
});
|
||||
|
||||
it("buy shares from init states with quote != 0", async () => {
|
||||
await ctx.Route.methods
|
||||
await ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("100"))
|
||||
.send(ctx.sendParam(lp));
|
||||
assert.equal(await ctx.Vault.methods.balanceOf(lp).call(), decimalStr("10"))
|
||||
@@ -82,16 +82,16 @@ describe("Funding", () => {
|
||||
})
|
||||
|
||||
it("buy shares with balanced input", async () => {
|
||||
await ctx.Route.methods
|
||||
await ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("0"))
|
||||
.send(ctx.sendParam(lp));
|
||||
await ctx.Route.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")).send(ctx.sendParam(trader))
|
||||
await ctx.DVMProxy.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")).send(ctx.sendParam(trader))
|
||||
|
||||
var vaultBaseBalance = new BigNumber(await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call())
|
||||
var vaultQuoteBalance = new BigNumber(await ctx.QUOTE.methods.balanceOf(ctx.Vault.options.address).call())
|
||||
var increaseRatio = new BigNumber("0.1")
|
||||
|
||||
await ctx.Route.methods.depositToDVM(ctx.DVM.options.address, trader, vaultBaseBalance.multipliedBy(increaseRatio).toFixed(0), vaultQuoteBalance.multipliedBy(increaseRatio).toFixed(0)).send(ctx.sendParam(trader))
|
||||
await ctx.DVMProxy.methods.depositToDVM(ctx.DVM.options.address, trader, vaultBaseBalance.multipliedBy(increaseRatio).toFixed(0), vaultQuoteBalance.multipliedBy(increaseRatio).toFixed(0)).send(ctx.sendParam(trader))
|
||||
|
||||
assert.equal(
|
||||
await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
@@ -106,15 +106,15 @@ describe("Funding", () => {
|
||||
})
|
||||
|
||||
it("buy shares with unbalanced input (less quote)", async () => {
|
||||
await ctx.Route.methods
|
||||
await ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("0"))
|
||||
.send(ctx.sendParam(lp));
|
||||
await ctx.Route.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")).send(ctx.sendParam(trader))
|
||||
await ctx.DVMProxy.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")).send(ctx.sendParam(trader))
|
||||
|
||||
var vaultBaseBalance = new BigNumber(await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call())
|
||||
var vaultQuoteBalance = new BigNumber(await ctx.QUOTE.methods.balanceOf(ctx.Vault.options.address).call())
|
||||
var increaseRatio = new BigNumber("0.1")
|
||||
await ctx.Route.methods.depositToDVM(
|
||||
await ctx.DVMProxy.methods.depositToDVM(
|
||||
ctx.DVM.options.address,
|
||||
trader,
|
||||
vaultBaseBalance.multipliedBy(increaseRatio).toFixed(0),
|
||||
@@ -124,15 +124,15 @@ describe("Funding", () => {
|
||||
})
|
||||
|
||||
it("buy shares with unbalanced input (less base)", async () => {
|
||||
await ctx.Route.methods
|
||||
await ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("0"))
|
||||
.send(ctx.sendParam(lp));
|
||||
await ctx.Route.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")).send(ctx.sendParam(trader))
|
||||
await ctx.DVMProxy.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")).send(ctx.sendParam(trader))
|
||||
|
||||
var vaultBaseBalance = new BigNumber(await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call())
|
||||
var vaultQuoteBalance = new BigNumber(await ctx.QUOTE.methods.balanceOf(ctx.Vault.options.address).call())
|
||||
var increaseRatio = new BigNumber("0.1")
|
||||
await ctx.Route.methods.depositToDVM(
|
||||
await ctx.DVMProxy.methods.depositToDVM(
|
||||
ctx.DVM.options.address,
|
||||
trader,
|
||||
vaultBaseBalance.multipliedBy(increaseRatio).div(2).toFixed(0),
|
||||
@@ -144,7 +144,7 @@ describe("Funding", () => {
|
||||
|
||||
describe("sell shares", () => {
|
||||
it.only("sell shares", async () => {
|
||||
await ctx.Route.methods
|
||||
await ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("100"))
|
||||
.send(ctx.sendParam(lp));
|
||||
var vaultShares = await ctx.Vault.methods.balanceOf(lp).call()
|
||||
|
||||
@@ -18,18 +18,16 @@ let trader: string;
|
||||
async function init(ctx: DVMContext): Promise<void> {
|
||||
lp = ctx.SpareAccounts[0];
|
||||
trader = ctx.SpareAccounts[1];
|
||||
await ctx.approveRoute(lp);
|
||||
await ctx.approveRoute(trader);
|
||||
await ctx.approveProxy(lp);
|
||||
await ctx.approveProxy(trader);
|
||||
|
||||
await ctx.mintTestToken(lp, decimalStr("10"), decimalStr("1000"));
|
||||
await ctx.mintTestToken(trader, decimalStr("10"), decimalStr("1000"));
|
||||
|
||||
await ctx.Route.methods
|
||||
await ctx.DVMProxy.methods
|
||||
.depositToDVM(ctx.DVM.options.address, lp, decimalStr("10"), decimalStr("0"))
|
||||
.send(ctx.sendParam(lp));
|
||||
|
||||
console.log(await ctx.Vault.methods.getVaultBalance().call())
|
||||
|
||||
console.log("deposit")
|
||||
}
|
||||
|
||||
@@ -51,12 +49,16 @@ describe("Trader", () => {
|
||||
});
|
||||
|
||||
describe("trade", () => {
|
||||
it.only("basic check", async () => {
|
||||
console.log(await ctx.DVM.methods.getPMMState().call())
|
||||
console.log(await ctx.DVM.methods.querySellQuote(ctx.Deployer, decimalStr("200")).call())
|
||||
})
|
||||
it("buy & sell", async () => {
|
||||
|
||||
console.log("BASE0 before buy", await ctx.DVM.methods.getBase0().call())
|
||||
|
||||
// buy
|
||||
await logGas(ctx.Route.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")), ctx.sendParam(trader), "buy base token")
|
||||
await logGas(ctx.DVMProxy.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")), ctx.sendParam(trader), "buy base token")
|
||||
console.log("BASE0 after buy", await ctx.DVM.methods.getBase0().call())
|
||||
// trader balances
|
||||
assert.equal(
|
||||
@@ -69,11 +71,11 @@ describe("Trader", () => {
|
||||
);
|
||||
// vault balances
|
||||
assert.equal(
|
||||
await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
await ctx.BASE.methods.balanceOf(ctx.DVM.options.address).call(),
|
||||
"8051283784161162863"
|
||||
);
|
||||
assert.equal(
|
||||
await ctx.QUOTE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
await ctx.QUOTE.methods.balanceOf(ctx.DVM.options.address).call(),
|
||||
decimalStr("200")
|
||||
);
|
||||
// maintainer balances
|
||||
@@ -87,7 +89,7 @@ describe("Trader", () => {
|
||||
);
|
||||
|
||||
// sell
|
||||
await logGas(ctx.Route.methods.sellBaseOnDVM(ctx.DVM.options.address, trader, decimalStr("1"), decimalStr("100")), ctx.sendParam(trader), "sell base token")
|
||||
await logGas(ctx.DVMProxy.methods.sellBaseOnDVM(ctx.DVM.options.address, trader, decimalStr("1"), decimalStr("100")), ctx.sendParam(trader), "sell base token")
|
||||
console.log("BASE0 after sell", await ctx.DVM.methods.getBase0().call())
|
||||
// trader balances
|
||||
assert.equal(
|
||||
@@ -100,11 +102,11 @@ describe("Trader", () => {
|
||||
);
|
||||
// vault balances
|
||||
assert.equal(
|
||||
await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
await ctx.BASE.methods.balanceOf(ctx.DVM.options.address).call(),
|
||||
"9051283784161162863"
|
||||
);
|
||||
assert.equal(
|
||||
await ctx.QUOTE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
await ctx.QUOTE.methods.balanceOf(ctx.DVM.options.address).call(),
|
||||
"96474456349930717298"
|
||||
);
|
||||
// maintainer balances
|
||||
@@ -118,7 +120,7 @@ describe("Trader", () => {
|
||||
);
|
||||
|
||||
// buy when quoet is not 0
|
||||
await logGas(ctx.Route.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")), ctx.sendParam(trader), "buy base token")
|
||||
await logGas(ctx.DVMProxy.methods.sellQuoteOnDVM(ctx.DVM.options.address, trader, decimalStr("200"), decimalStr("1")), ctx.sendParam(trader), "buy base token")
|
||||
console.log("BASE0 after second buy", await ctx.DVM.methods.getBase0().call())
|
||||
// trader balances
|
||||
console.log(
|
||||
@@ -131,11 +133,11 @@ describe("Trader", () => {
|
||||
);
|
||||
// vault balances
|
||||
console.log(
|
||||
await ctx.BASE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
await ctx.BASE.methods.balanceOf(ctx.DVM.options.address).call(),
|
||||
"7158622099620899913"
|
||||
);
|
||||
console.log(
|
||||
await ctx.QUOTE.methods.balanceOf(ctx.Vault.options.address).call(),
|
||||
await ctx.QUOTE.methods.balanceOf(ctx.DVM.options.address).call(),
|
||||
"296474456349930717298"
|
||||
);
|
||||
// maintainer balances
|
||||
|
||||
@@ -31,10 +31,10 @@ export const DODO_MINE_READER_NAME = "DODOMineReader"
|
||||
export const DVM_VAULT_NAME = "DVMVault"
|
||||
export const DVM_NAME = "DVM"
|
||||
export const DVM_FACTORY_NAME = "DVMFactory"
|
||||
export const SMART_ROUTE_NAME = "SmartRoute"
|
||||
export const DVM_PROXY_NAME = "DVMProxy"
|
||||
export const CONST_FEE_RATE_MODEL_NAME = "ConstFeeRateModel"
|
||||
export const PERMISSION_MANAGER_NAME = "PermissionManager"
|
||||
export const GAS_PRICE_SOURCE_NAME = "GasPriceSource"
|
||||
export const EXTERNAL_VALUE_NAME = "ExternalValue"
|
||||
|
||||
interface ContractJson {
|
||||
abi: any;
|
||||
|
||||
@@ -49,10 +49,9 @@ export let DefaultDVMContextInitConfig = {
|
||||
export class DVMContext {
|
||||
EVM: EVM;
|
||||
Web3: Web3;
|
||||
Route: Contract;
|
||||
DVMProxy: Contract;
|
||||
DVMFactory: Contract;
|
||||
DVM: Contract;
|
||||
Vault: Contract;
|
||||
BASE: Contract;
|
||||
QUOTE: Contract;
|
||||
Deployer: string;
|
||||
@@ -64,20 +63,18 @@ export class DVMContext {
|
||||
async init(config: DVMContextInitConfig) {
|
||||
this.EVM = new EVM();
|
||||
this.Web3 = getDefaultWeb3();
|
||||
this.Route = await contracts.newContract(contracts.SMART_ROUTE_NAME)
|
||||
this.DVMProxy = await contracts.newContract(contracts.DVM_PROXY_NAME)
|
||||
|
||||
var cloneFactory = await contracts.newContract(
|
||||
contracts.CLONE_FACTORY_CONTRACT_NAME
|
||||
);
|
||||
var vaultTemplate = await contracts.newContract(contracts.DVM_VAULT_NAME)
|
||||
var dvmTemplate = await contracts.newContract(contracts.DVM_NAME)
|
||||
var feeRateModelTemplate = await contracts.newContract(contracts.CONST_FEE_RATE_MODEL_NAME)
|
||||
var permissionManagerTemplate = await contracts.newContract(contracts.PERMISSION_MANAGER_NAME)
|
||||
var gasPriceSource = await contracts.newContract(contracts.GAS_PRICE_SOURCE_NAME)
|
||||
var gasPriceSource = await contracts.newContract(contracts.EXTERNAL_VALUE_NAME)
|
||||
|
||||
this.DVMFactory = await contracts.newContract(contracts.DVM_FACTORY_NAME,
|
||||
[cloneFactory.options.address,
|
||||
vaultTemplate.options.address,
|
||||
dvmTemplate.options.address,
|
||||
feeRateModelTemplate.options.address,
|
||||
permissionManagerTemplate.options.address,
|
||||
@@ -98,7 +95,7 @@ export class DVMContext {
|
||||
this.Maintainer = allAccounts[1];
|
||||
this.SpareAccounts = allAccounts.slice(2, 10);
|
||||
|
||||
await this.DVMFactory.methods.createStandardDODOVendorMachine(
|
||||
await this.DVMFactory.methods.createStandardDODOVendingMachine(
|
||||
this.BASE.options.address,
|
||||
this.QUOTE.options.address,
|
||||
config.lpFeeRate,
|
||||
@@ -109,10 +106,10 @@ export class DVMContext {
|
||||
|
||||
var vendorMachines = await this.DVMFactory.methods.getVendorMachine(this.BASE.options.address, this.QUOTE.options.address).call()
|
||||
this.DVM = contracts.getContractWithAddress(contracts.DVM_NAME, vendorMachines[0])
|
||||
this.Vault = contracts.getContractWithAddress(contracts.DVM_VAULT_NAME, await this.DVM.methods._VAULT_().call())
|
||||
|
||||
await this.DVM.methods.setMaintainer(this.Maintainer).send(this.sendParam(this.Deployer))
|
||||
await gasPriceSource.methods.setGasPrice(MAX_UINT256).send(this.sendParam(this.Deployer))
|
||||
await gasPriceSource.methods.initOwner(this.Deployer).send(this.sendParam(this.Deployer))
|
||||
await gasPriceSource.methods.set(MAX_UINT256).send(this.sendParam(this.Deployer))
|
||||
|
||||
console.log(log.blueText("[Init DVM context]"));
|
||||
}
|
||||
@@ -133,12 +130,12 @@ export class DVMContext {
|
||||
.send(this.sendParam(this.Deployer));
|
||||
}
|
||||
|
||||
async approveRoute(account: string) {
|
||||
async approveProxy(account: string) {
|
||||
await this.BASE.methods
|
||||
.approve(this.Route.options.address, MAX_UINT256)
|
||||
.approve(this.DVMProxy.options.address, MAX_UINT256)
|
||||
.send(this.sendParam(account));
|
||||
await this.QUOTE.methods
|
||||
.approve(this.Route.options.address, MAX_UINT256)
|
||||
.approve(this.DVMProxy.options.address, MAX_UINT256)
|
||||
.send(this.sendParam(account));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user