add route test framework

This commit is contained in:
owen05
2020-11-09 14:26:38 +08:00
parent 0cf2e9e516
commit 521b0e4b16
77 changed files with 854505 additions and 10905 deletions

6
.gitignore vendored
View File

@@ -15,3 +15,9 @@ flattered/
*.swo
*.swp
node_modules
#Hardhat files
cache
artifacts

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,788 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,788 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,862 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,788 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,788 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,788 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,896 @@
{
"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

View File

@@ -0,0 +1,607 @@
{
"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": {}
}
}

5964
build-v1/contracts/DODO.json Normal file

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

View File

@@ -0,0 +1,440 @@
{
"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": {}
}
}

View File

@@ -0,0 +1,838 @@
{
"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

View File

@@ -0,0 +1,257 @@
{
"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

59141
build-v1/contracts/Math.json Normal file

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

View File

@@ -0,0 +1,835 @@
{
"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

View File

@@ -0,0 +1,648 @@
{
"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

20610
build-v1/contracts/Trader.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,181 @@
{
"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

View File

@@ -0,0 +1,36 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
import {IERC20} from "../intf/IERC20.sol";
import {SafeERC20} from "../lib/SafeERC20.sol";
import {Ownable} from "../lib/Ownable.sol";
contract SmartApprove is Ownable {
using SafeERC20 for IERC20;
address public smartSwap;
function setSmartSwap(address _smartSwap) external onlyOwner {
smartSwap = _smartSwap;
}
event Test1(uint256 amount);
function claimTokens(
IERC20 token,
address who,
address dest,
uint256 amount
) external {
require(msg.sender == smartSwap, "Not SmartSwap Address, Access restricted");
emit Test1(amount);
// token.safeTransferFrom(who, dest, amount);
}
}

View File

@@ -0,0 +1,118 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
import {Ownable} from "../lib/Ownable.sol";
import {ExternalCall} from "../lib/ExternalCall.sol";
import {IERC20} from "../intf/IERC20.sol";
import {UniversalERC20} from "../lib/UniversalERC20.sol";
import {SafeMath} from "../lib/SafeMath.sol";
import {DecimalMath} from "../lib/DecimalMath.sol";
import {ISmartApprove} from "../intf/ISmartApprove.sol";
contract SmartSwap is Ownable {
using SafeMath for uint256;
using UniversalERC20 for IERC20;
using ExternalCall for address;
ISmartApprove public smartApprove;
IERC20 constant ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
event Swapped(
IERC20 indexed fromToken,
IERC20 indexed toToken,
address indexed sender,
uint256 fromAmount,
uint256 toAmount
);
event ExternalRecord(address indexed to, address indexed sender);
constructor(address _smartApprove) public {
smartApprove = ISmartApprove(_smartApprove);
}
function dodoSwap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromTokenAmount,
uint256 minReturnAmount,
address[] memory callPairs,
bytes memory callDataConcat,
uint256[] memory starts,
uint256[] memory gasLimitsAndValues
) public payable returns (uint256 returnAmount) {
require(minReturnAmount > 0, "haha hihi Min return should be bigger then 0.");
require(callPairs.length > 0, "pairs should exists.");
// if (fromToken != ETH_ADDRESS) {
// // smartApprove.claimTokens(fromToken, msg.sender, address(this), fromTokenAmount);
// }
// for (uint256 i = 0; i < callPairs.length; i++) {
// require(callPairs[i] != address(smartApprove), "Access denied");
// require(
// callPairs[i].externalCall(
// gasLimitsAndValues[i] & ((1 << 128) - 1),
// callDataConcat,
// starts[i],
// starts[i + 1] - starts[i],
// gasLimitsAndValues[i] >> 128
// )
// );
// }
// // Return back all unswapped
// fromToken.universalTransfer(msg.sender, fromToken.universalBalanceOf(address(this)));
// returnAmount = toToken.universalBalanceOf(address(this));
// require(returnAmount >= minReturnAmount, "Return amount is not enough");
// toToken.universalTransfer(msg.sender, returnAmount);
emit Swapped(fromToken, toToken, msg.sender, fromTokenAmount, fromTokenAmount);
// emit Swapped(fromToken, toToken, msg.sender, fromTokenAmount, returnAmount);
}
function externalSwap(
IERC20 fromToken,
IERC20 toToken,
address approveTarget,
address to,
uint256 gasSwap,
uint256 fromTokenAmount,
uint256 minReturnAmount,
bytes memory callDataConcat
) public payable returns (uint256 returnAmount) {
require(minReturnAmount > 0, "Min return should be bigger then 0.");
if (fromToken != ETH_ADDRESS) {
smartApprove.claimTokens(fromToken, msg.sender, address(this), fromTokenAmount);
fromToken.approve(approveTarget, fromTokenAmount);
}
(bool success, ) = to.call{value: msg.value, gas: gasSwap}(callDataConcat);
require(success, "Contract Swap execution Failed");
// Return back all unswapped
fromToken.universalTransfer(msg.sender, fromToken.universalBalanceOf(address(this)));
returnAmount = toToken.universalBalanceOf(address(this));
require(returnAmount >= minReturnAmount, "Return amount is not enough");
toToken.universalTransfer(msg.sender, returnAmount);
emit Swapped(fromToken, toToken, msg.sender, fromTokenAmount, returnAmount);
emit ExternalRecord(to, msg.sender);
}
}

View File

@@ -0,0 +1,15 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {IERC20} from "./IERC20.sol";
interface ISmartApprove {
function claimTokens(IERC20 token,address who,address dest,uint256 amount) external;
}

View File

@@ -0,0 +1,34 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
library ExternalCall {
// Source: https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWallet.sol
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function externalCall(address destination, uint value, bytes memory data, uint dataOffset, uint dataLength, uint gasLimit) internal returns(bool result) {
// solium-disable-next-line security/no-inline-assembly
if (gasLimit == 0) {
gasLimit = gasleft() - 40000;
}
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
gasLimit,
destination,
value,
add(d, dataOffset),
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
}
}

View File

@@ -0,0 +1,75 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
import {SafeMath} from "./SafeMath.sol";
import {IERC20} from "../intf/IERC20.sol";
import {SafeERC20} from "./SafeERC20.sol";
library UniversalERC20 {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 private constant ZERO_ADDRESS = IERC20(0x0000000000000000000000000000000000000000);
IERC20 private constant ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
function universalTransfer(IERC20 token, address to, uint256 amount) internal {
universalTransfer(token, to, amount, false);
}
function universalTransfer(IERC20 token, address to, uint256 amount, bool mayFail) internal returns(bool) {
if (amount == 0) {
return true;
}
if (token == ZERO_ADDRESS || token == ETH_ADDRESS) {
if (mayFail) {
return address(uint160(to)).send(amount);
} else {
address(uint160(to)).transfer(amount);
return true;
}
} else {
token.safeTransfer(to, amount);
return true;
}
}
function universalApprove(IERC20 token, address to, uint256 amount) internal {
if (token != ZERO_ADDRESS && token != ETH_ADDRESS) {
token.safeApprove(to, amount);
}
}
function universalTransferFrom(IERC20 token, address from, address to, uint256 amount) internal {
if (amount == 0) {
return;
}
if (token == ZERO_ADDRESS || token == ETH_ADDRESS) {
require(from == msg.sender && msg.value >= amount, "msg.value is zero");
if (to != address(this)) {
address(uint160(to)).transfer(amount);
}
if (msg.value > amount) {
msg.sender.transfer(msg.value.sub(amount));
}
} else {
token.safeTransferFrom(from, to, amount);
}
}
function universalBalanceOf(IERC20 token, address who) internal view returns (uint256) {
if (token == ZERO_ADDRESS || token == ETH_ADDRESS) {
return who.balance;
} else {
return token.balanceOf(who);
}
}
}

6520
package-lock.json generated

File diff suppressed because it is too large Load Diff

171
test/Route/Route.test.ts Normal file
View File

@@ -0,0 +1,171 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
// import * as assert from 'assert';
import BigNumber from 'bignumber.js';
import { DODOContext, getDODOContext } from '../utils-v1/Context';
import { decimalStr,MAX_UINT256 } from '../utils-v1/Converter';
import { logGas } from '../utils-v1/Log';
let lp: string;
let trader: string;
async function init(ctx: DODOContext): Promise<void> {
await ctx.setOraclePrice(decimalStr("100"));
lp = ctx.spareAccounts[0];
trader = ctx.spareAccounts[1];
await ctx.approveDODO(lp);
await ctx.approveDODO(trader);
await ctx.mintTestToken(lp, decimalStr("10"), decimalStr("1000"));
await ctx.mintTestToken(trader, decimalStr("10"), decimalStr("1000"));
await ctx.DODO.methods
.depositBaseTo(lp, decimalStr("10"))
.send(ctx.sendParam(lp));
await ctx.DODO.methods
.depositQuoteTo(lp, decimalStr("1000"))
.send(ctx.sendParam(lp));
}
async function calcRoute(ctx: DODOContext) {
let fromTokenAmount = decimalStr("1");
//路径
let routes = [
{
address: ctx.BASE.options.address,
decimals: 18
},
{
address: ctx.QUOTE.options.address,
decimals: 18
}
]
//路径上交易对
let pairs = [
{
pair: ctx.DODO.options.address,
base: ctx.BASE.options.address
}
]
let callPairs: string[] = []
let datas: string = ""
let starts: number[] = []
let gAndV: number[] = []
let swapAmount = fromTokenAmount
for (let i = 0; i < pairs.length; i++) {
let curPair = pairs[i]
callPairs.push(curPair.pair)
//TODO: hardcode
let curContact =ctx.DODO;
let curData = ''
if (curPair.base === routes[i].address) {
curData = await curContact.methods.sellBaseToken(swapAmount, 0, []).encodeABI()
swapAmount = await curContact.methods.querySellBaseToken(swapAmount).call();
} else {
curData = await curContact.methods.buyBaseToken(swapAmount, 0, []).encodABI()
swapAmount = await curContact.methods.queryBuyBaseToken(swapAmount).call();
}
starts.push(datas.length)
gAndV.push(0)
datas += curData
}
let toAmount = new BigNumber(swapAmount).multipliedBy(0.99).toFixed(0, BigNumber.ROUND_DOWN)
return ctx.SmartSwap.methods.dodoSwap(
ctx.BASE.options.address,
ctx.QUOTE.options.address,
fromTokenAmount,
toAmount,
callPairs,
datas,
starts,
gAndV
)
}
describe("Trader", () => {
let snapshotId: string;
let ctx: DODOContext;
before(async () => {
ctx = await getDODOContext();
await init(ctx);
});
beforeEach(async () => {
snapshotId = await ctx.EVM.snapshot();
});
afterEach(async () => {
await ctx.EVM.reset(snapshotId);
});
describe("hit currently pair", () => {
it("base to quote", async () => {
var beforeBalance = await ctx.BASE.methods.balanceOf(trader).call()
// await ctx.BASE.methods.approve(ctx.SmartApprove.options.address,MAX_UINT256).send(ctx.sendParam(trader))
console.log("beforeBalance",beforeBalance)
await logGas(await calcRoute(ctx), ctx.sendParam(trader), "buy token")
var afterBalance = await ctx.BASE.methods.balanceOf(trader).call()
console.log("afterBalance",afterBalance)
// // trader balances
// assert.equal(
// await ctx.BASE.methods.balanceOf(trader).call(),
// decimalStr("11")
// );
// assert.equal(
// await ctx.QUOTE.methods.balanceOf(trader).call(),
// "898581839502056240973"
// );
});
});
// describe("Revert cases", () => {
// it("price limit", async () => {
// await assert.rejects(
// ctx.DODO.methods
// .buyBaseToken(decimalStr("1"), decimalStr("100"), "0x")
// .send(ctx.sendParam(trader)),
// /BUY_BASE_COST_TOO_MUCH/
// );
// await assert.rejects(
// ctx.DODO.methods
// .sellBaseToken(decimalStr("1"), decimalStr("100"), "0x")
// .send(ctx.sendParam(trader)),
// /SELL_BASE_RECEIVE_NOT_ENOUGH/
// );
// });
// it("base balance limit", async () => {
// await assert.rejects(
// ctx.DODO.methods
// .buyBaseToken(decimalStr("11"), decimalStr("10000"), "0x")
// .send(ctx.sendParam(trader)),
// /DODO_BASE_BALANCE_NOT_ENOUGH/
// );
// await ctx.DODO.methods
// .buyBaseToken(decimalStr("1"), decimalStr("200"), "0x")
// .send(ctx.sendParam(trader));
// await assert.rejects(
// ctx.DODO.methods
// .buyBaseToken(decimalStr("11"), decimalStr("10000"), "0x")
// .send(ctx.sendParam(trader)),
// /DODO_BASE_BALANCE_NOT_ENOUGH/
// );
// });
// });
});

195
test/utils-v1/Context.ts Normal file
View File

@@ -0,0 +1,195 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
import BigNumber from 'bignumber.js';
import Web3 from 'web3';
import { Contract } from 'web3-eth-contract';
import * as contracts from './Contracts';
import { decimalStr, gweiStr, MAX_UINT256 } from './Converter';
import { EVM, getDefaultWeb3 } from './EVM';
import * as log from './Log';
BigNumber.config({
EXPONENTIAL_AT: 1000,
DECIMAL_PLACES: 80,
});
export interface DODOContextInitConfig {
lpFeeRate: string;
mtFeeRate: string;
k: string;
gasPriceLimit: string;
}
/*
price curve when k=0.1
+──────────────────────+───────────────+
| purchase percentage | avg slippage |
+──────────────────────+───────────────+
| 1% | 0.1% |
| 5% | 0.5% |
| 10% | 1.1% |
| 20% | 2.5% |
| 50% | 10% |
| 70% | 23.3% |
+──────────────────────+───────────────+
*/
export let DefaultDODOContextInitConfig = {
lpFeeRate: decimalStr("0.002"),
mtFeeRate: decimalStr("0.001"),
k: decimalStr("0.1"),
gasPriceLimit: gweiStr("100"),
};
export class DODOContext {
EVM: EVM;
Web3: Web3;
DODO: Contract;
DODOZoo: Contract;
BASE: Contract;
BaseCapital: Contract;
QUOTE: Contract;
QuoteCapital: Contract;
ORACLE: Contract;
SmartSwap: Contract;
SmartApprove: Contract;
Deployer: string;
Supervisor: string;
Maintainer: string;
spareAccounts: string[];
constructor() {}
async init(config: DODOContextInitConfig) {
this.EVM = new EVM();
this.Web3 = getDefaultWeb3();
var cloneFactory = await contracts.newContract(
contracts.CLONE_FACTORY_CONTRACT_NAME
);
this.BASE = await contracts.newContract(
contracts.TEST_ERC20_CONTRACT_NAME,
["TestBase", 18]
);
this.QUOTE = await contracts.newContract(
contracts.TEST_ERC20_CONTRACT_NAME,
["TestQuote", 18]
);
this.ORACLE = await contracts.newContract(
contracts.NAIVE_ORACLE_CONTRACT_NAME
);
const allAccounts = await this.Web3.eth.getAccounts();
this.Deployer = allAccounts[0];
this.Supervisor = allAccounts[1];
this.Maintainer = allAccounts[2];
this.spareAccounts = allAccounts.slice(3, 10);
var DODOTemplate = await contracts.newContract(
contracts.DODO_CONTRACT_NAME
);
this.DODOZoo = await contracts.newContract(
contracts.DODO_ZOO_CONTRACT_NAME,
[
DODOTemplate.options.address,
cloneFactory.options.address,
this.Supervisor,
]
);
await this.DODOZoo.methods
.breedDODO(
this.Maintainer,
this.BASE.options.address,
this.QUOTE.options.address,
this.ORACLE.options.address,
config.lpFeeRate,
config.mtFeeRate,
config.k,
config.gasPriceLimit
)
.send(this.sendParam(this.Deployer));
this.DODO = contracts.getContractWithAddress(
contracts.DODO_CONTRACT_NAME,
await this.DODOZoo.methods
.getDODO(this.BASE.options.address, this.QUOTE.options.address)
.call()
);
await this.DODO.methods
.enableBaseDeposit()
.send(this.sendParam(this.Deployer));
await this.DODO.methods
.enableQuoteDeposit()
.send(this.sendParam(this.Deployer));
await this.DODO.methods.enableTrading().send(this.sendParam(this.Deployer));
this.BaseCapital = contracts.getContractWithAddress(
contracts.DODO_LP_TOKEN_CONTRACT_NAME,
await this.DODO.methods._BASE_CAPITAL_TOKEN_().call()
);
this.QuoteCapital = contracts.getContractWithAddress(
contracts.DODO_LP_TOKEN_CONTRACT_NAME,
await this.DODO.methods._QUOTE_CAPITAL_TOKEN_().call()
);
/*v1.5*/
this.SmartApprove = await contracts.newContract(
contracts.SMART_APPROVE
);
this.SmartSwap = await contracts.newContract(
contracts.SMART_SWAP,
[this.SmartApprove.options.address]
);
await this.SmartApprove.methods.setSmartSwap(this.SmartSwap.options.address).send(this.sendParam(this.Deployer));
/*****/
console.log(log.blueText("[Init dodo context]"));
}
sendParam(sender, value = "0") {
return {
from: sender,
gas: process.env["COVERAGE"] ? 10000000000 : 7000000,
gasPrice: process.env.GAS_PRICE,
value: decimalStr(value),
};
}
async setOraclePrice(price: string) {
await this.ORACLE.methods
.setPrice(price)
.send(this.sendParam(this.Deployer));
}
async mintTestToken(to: string, base: string, quote: string) {
await this.BASE.methods.mint(to, base).send(this.sendParam(this.Deployer));
await this.QUOTE.methods
.mint(to, quote)
.send(this.sendParam(this.Deployer));
}
async approveDODO(account: string) {
await this.BASE.methods
.approve(this.DODO.options.address, MAX_UINT256)
.send(this.sendParam(account));
await this.QUOTE.methods
.approve(this.DODO.options.address, MAX_UINT256)
.send(this.sendParam(account));
}
}
export async function getDODOContext(
config: DODOContextInitConfig = DefaultDODOContextInitConfig
): Promise<DODOContext> {
var context = new DODOContext();
await context.init(config);
return context;
}

118
test/utils-v1/Contracts.ts Normal file
View File

@@ -0,0 +1,118 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
var jsonPath: string = "../../build-v1/contracts/"
/*v1.5*/
var jsonPath2: string = "../../build/contracts/"
/******/
if (process.env["COVERAGE"]) {
console.log("[Coverage mode]")
jsonPath = "../../.coverage_artifacts/contracts/"
}
const CloneFactory = require(`${jsonPath}CloneFactory.json`)
const DODO = require(`${jsonPath}DODO.json`)
const DODOZoo = require(`${jsonPath}DODOZoo.json`)
const DODOEthProxy = require(`${jsonPath}DODOEthProxy.json`)
const WETH = require(`${jsonPath}WETH9.json`)
const TestERC20 = require(`${jsonPath}TestERC20.json`)
const NaiveOracle = require(`${jsonPath}NaiveOracle.json`)
const DODOLpToken = require(`${jsonPath}DODOLpToken.json`)
const Uniswap = require(`${jsonPath}UniswapV2Pair.json`)
const UniswapArbitrageur = require(`${jsonPath}UniswapArbitrageur.json`)
const DODOToken = require(`${jsonPath}DODOToken.json`)
const DODOMine = require(`${jsonPath}DODOMine.json`)
const DODOMineReader = require(`${jsonPath}DODOMineReader.json`)
const LockedTokenVault = require(`${jsonPath}LockedTokenVault.json`)
/*v1.5*/
const SmartSwap = require(`${jsonPath2}SmartSwap.json`)
const SmartApprove = require(`${jsonPath2}SmartApprove.json`)
/******/
import { getDefaultWeb3 } from './EVM';
import { Contract } from 'web3-eth-contract';
export const CLONE_FACTORY_CONTRACT_NAME = "CloneFactory"
export const DODO_CONTRACT_NAME = "DODO"
export const TEST_ERC20_CONTRACT_NAME = "TestERC20"
export const NAIVE_ORACLE_CONTRACT_NAME = "NaiveOracle"
export const DODO_LP_TOKEN_CONTRACT_NAME = "DODOLpToken"
export const DODO_ZOO_CONTRACT_NAME = "DOOZoo"
export const DODO_WILD_CONTRACT_NAME = "DOOWild"
export const DODO_ETH_PROXY_CONTRACT_NAME = "DODOEthProxy"
export const WETH_CONTRACT_NAME = "WETH"
export const UNISWAP_CONTRACT_NAME = "Uniswap"
export const UNISWAP_ARBITRAGEUR_CONTRACT_NAME = "UniswapArbitrageur"
export const DODO_TOKEN_CONTRACT_NAME = "DODOToken"
export const LOCKED_TOKEN_VAULT_CONTRACT_NAME = "LockedTokenVault"
export const DODO_MINE_NAME = "DODOMine"
export const DODO_MINE_READER_NAME = "DODOMineReader"
/*v1.5*/
export const SMART_SWAP = "SmartSwap"
export const SMART_APPROVE = "SmartApprove"
/******/
var contractMap: { [name: string]: any } = {}
contractMap[CLONE_FACTORY_CONTRACT_NAME] = CloneFactory
contractMap[DODO_CONTRACT_NAME] = DODO
contractMap[TEST_ERC20_CONTRACT_NAME] = TestERC20
contractMap[NAIVE_ORACLE_CONTRACT_NAME] = NaiveOracle
contractMap[DODO_LP_TOKEN_CONTRACT_NAME] = DODOLpToken
contractMap[DODO_ZOO_CONTRACT_NAME] = DODOZoo
contractMap[DODO_ETH_PROXY_CONTRACT_NAME] = DODOEthProxy
contractMap[WETH_CONTRACT_NAME] = WETH
contractMap[UNISWAP_CONTRACT_NAME] = Uniswap
contractMap[UNISWAP_ARBITRAGEUR_CONTRACT_NAME] = UniswapArbitrageur
contractMap[DODO_TOKEN_CONTRACT_NAME] = DODOToken
contractMap[LOCKED_TOKEN_VAULT_CONTRACT_NAME] = LockedTokenVault
contractMap[DODO_MINE_NAME] = DODOMine
contractMap[DODO_MINE_READER_NAME] = DODOMineReader
/*v1.5*/
contractMap[SMART_SWAP] = SmartSwap
contractMap[SMART_APPROVE] = SmartApprove
/******/
interface ContractJson {
abi: any;
networks: { [network: number]: any };
byteCode: string;
}
export function getContractJSON(contractName: string): ContractJson {
var info = contractMap[contractName]
return {
abi: info.abi,
networks: info.networks,
byteCode: info.bytecode
}
}
export function getContractWithAddress(contractName: string, address: string) {
var Json = getContractJSON(contractName)
var web3 = getDefaultWeb3()
return new web3.eth.Contract(Json.abi, address)
}
export function getDepolyedContract(contractName: string): Contract {
var Json = getContractJSON(contractName)
var networkId = process.env.NETWORK_ID
var deployedAddress = getContractJSON(contractName).networks[networkId].address
var web3 = getDefaultWeb3()
return new web3.eth.Contract(Json.abi, deployedAddress)
}
export async function newContract(contractName: string, args: any[] = []): Promise<Contract> {
var web3 = getDefaultWeb3()
var Json = getContractJSON(contractName)
var contract = new web3.eth.Contract(Json.abi)
var adminAccount = (await web3.eth.getAccounts())[0]
let parameter = {
from: adminAccount,
gas: process.env["COVERAGE"] ? 10000000000 : 7000000,
gasPrice: web3.utils.toHex(web3.utils.toWei('1', 'wei'))
}
return await contract.deploy({ data: Json.byteCode, arguments: args }).send(parameter)
}

View File

@@ -0,0 +1,15 @@
import BigNumber from "bignumber.js";
export const MAX_UINT256 = "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
export function decimalStr(value: string): string {
return new BigNumber(value).multipliedBy(10 ** 18).toFixed(0, BigNumber.ROUND_DOWN)
}
export function mweiStr(value: string): string {
return new BigNumber(value).multipliedBy(10 ** 6).toFixed(0, BigNumber.ROUND_DOWN)
}
export function gweiStr(gwei: string): string {
return new BigNumber(gwei).multipliedBy(10 ** 9).toFixed(0, BigNumber.ROUND_DOWN)
}

92
test/utils-v1/EVM.ts Normal file
View File

@@ -0,0 +1,92 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
// require('dotenv-flow').config();
import { JsonRpcPayload, JsonRpcResponse } from 'web3-core-helpers';
import Web3 from 'web3';
export function getDefaultWeb3() {
return new Web3(process.env.RPC_NODE_URI)
}
export class EVM {
private provider = new Web3.providers.HttpProvider(process.env.RPC_NODE_URI);
public async reset(id: string): Promise<string> {
if (!id) {
throw new Error('id must be set');
}
await this.callJsonrpcMethod('evm_revert', [id]);
return this.snapshot();
}
public async snapshot(): Promise<string> {
return this.callJsonrpcMethod('evm_snapshot');
}
public async evmRevert(id: string): Promise<string> {
return this.callJsonrpcMethod('evm_revert', [id]);
}
public async stopMining(): Promise<string> {
return this.callJsonrpcMethod('miner_stop');
}
public async startMining(): Promise<string> {
return this.callJsonrpcMethod('miner_start');
}
public async mineBlock(): Promise<string> {
return this.callJsonrpcMethod('evm_mine');
}
public async fastMove(moveBlockNum: number): Promise<string> {
var res: string
for (let i = 0; i < moveBlockNum; i++) {
res = await this.callJsonrpcMethod('evm_mine');
}
return res
}
public async increaseTime(duration: number): Promise<string> {
await this.callJsonrpcMethod('evm_increaseTime', [duration]);
return this.callJsonrpcMethod('evm_mine');
}
public async callJsonrpcMethod(method: string, params?: (any[])): Promise<string> {
const args: JsonRpcPayload = {
method,
params,
jsonrpc: '2.0',
id: new Date().getTime(),
};
const response = await this.send(args);
return response.result;
}
private async send(args: JsonRpcPayload): Promise<any> {
return new Promise((resolve, reject) => {
const callback: any = (error: Error, val: JsonRpcResponse): void => {
if (error) {
reject(error);
} else {
resolve(val);
}
};
this.provider.send(
args,
callback,
);
});
}
}

30
test/utils-v1/Log.ts Normal file
View File

@@ -0,0 +1,30 @@
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
export const blueText = x => `\x1b[36m${x}\x1b[0m`;
export const yellowText = x => `\x1b[33m${x}\x1b[0m`;
export const greenText = x => `\x1b[32m${x}\x1b[0m`;
export const redText = x => `\x1b[31m${x}\x1b[0m`;
export const numberWithCommas = x => x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
export async function logGas(funcCall: any, params: any, desc: string) {
const estimatedGas = await funcCall.estimateGas(params)
const receipt = await funcCall.send(params)
const gasUsed = receipt.gasUsed;
let colorFn;
if (gasUsed < 80000) {
colorFn = greenText;
} else if (gasUsed < 200000) {
colorFn = yellowText;
} else {
colorFn = redText;
}
console.log(("Gas estimated:" + numberWithCommas(estimatedGas)).padEnd(60, '.'), blueText(desc) + " ", colorFn(numberWithCommas(gasUsed).padStart(5)));
return receipt
}

View File

@@ -7,7 +7,7 @@
"sourceMap": true,
"declaration": true,
"downlevelIteration": true,
"noUnusedLocals": true,
// "noUnusedLocals": true,
"esModuleInterop": true,
"outDir": "dist",
"resolveJsonModule": true,

6820
yarn.lock

File diff suppressed because it is too large Load Diff