dc-protocol
Version:
Start ganache and deploy our contracts
1,005 lines • 32.8 kB
JSON
{
"contractName": "IToken",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "success",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
},
{
"name": "_spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "remaining",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"sourceMap": "",
"deployedSourceMap": "",
"source": "pragma solidity ^0.4.24;\n\ninterface IToken {\n function transfer(address _to, uint256 _value) external;\n function transferFrom(address _from, address _to, uint256 _value) external returns(bool success);\n function allowance(address _owner, address _spender) external view returns (uint256 remaining);\n function balanceOf(address _owner) external view returns (uint256 balance);\n}",
"sourcePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/interfaces/IToken.sol",
"ast": {
"absolutePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/interfaces/IToken.sol",
"exportedSymbols": {
"IToken": [
1822
]
},
"id": 1823,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1787,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:9"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 1822,
"linearizedBaseContracts": [
1822
],
"name": "IToken",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 1794,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "transfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1792,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1789,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "67:11:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1788,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "67:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1791,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "80:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1790,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "80:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "66:29:9"
},
"payable": false,
"returnParameters": {
"id": 1793,
"nodeType": "ParameterList",
"parameters": [],
"src": "104:0:9"
},
"scope": 1822,
"src": "49:56:9",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 1805,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "transferFrom",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1801,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1796,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "132:13:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1795,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "132:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1798,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "147:11:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1797,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "147:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1800,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "160:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1799,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "160:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "131:44:9"
},
"payable": false,
"returnParameters": {
"id": 1804,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1803,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "193:12:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1802,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "193:4:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "192:14:9"
},
"scope": 1822,
"src": "110:97:9",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 1814,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "allowance",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1807,
"name": "_owner",
"nodeType": "VariableDeclaration",
"scope": 1814,
"src": "231:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1806,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "231:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1809,
"name": "_spender",
"nodeType": "VariableDeclaration",
"scope": 1814,
"src": "247:16:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1808,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "247:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "230:34:9"
},
"payable": false,
"returnParameters": {
"id": 1813,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1812,
"name": "remaining",
"nodeType": "VariableDeclaration",
"scope": 1814,
"src": "288:17:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1811,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "288:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "287:19:9"
},
"scope": 1822,
"src": "212:95:9",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 1821,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "balanceOf",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1817,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1816,
"name": "_owner",
"nodeType": "VariableDeclaration",
"scope": 1821,
"src": "331:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1815,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "331:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "330:16:9"
},
"payable": false,
"returnParameters": {
"id": 1820,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1819,
"name": "balance",
"nodeType": "VariableDeclaration",
"scope": 1821,
"src": "370:15:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1818,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "370:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "369:17:9"
},
"scope": 1822,
"src": "312:75:9",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 1823,
"src": "26:363:9"
}
],
"src": "0:389:9"
},
"legacyAST": {
"absolutePath": "/Users/fanyshu/Documents/Projects/DCLabs/monorepo/packages/dc-sdk-example/dapp/contracts/interfaces/IToken.sol",
"exportedSymbols": {
"IToken": [
1822
]
},
"id": 1823,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1787,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:9"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "interface",
"documentation": null,
"fullyImplemented": false,
"id": 1822,
"linearizedBaseContracts": [
1822
],
"name": "IToken",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": null,
"documentation": null,
"id": 1794,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "transfer",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1792,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1789,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "67:11:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1788,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "67:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1791,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 1794,
"src": "80:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1790,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "80:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "66:29:9"
},
"payable": false,
"returnParameters": {
"id": 1793,
"nodeType": "ParameterList",
"parameters": [],
"src": "104:0:9"
},
"scope": 1822,
"src": "49:56:9",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 1805,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "transferFrom",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1801,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1796,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "132:13:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1795,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "132:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1798,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "147:11:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1797,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "147:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1800,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "160:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1799,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "160:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "131:44:9"
},
"payable": false,
"returnParameters": {
"id": 1804,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1803,
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 1805,
"src": "193:12:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1802,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "193:4:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "192:14:9"
},
"scope": 1822,
"src": "110:97:9",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 1814,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "allowance",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1810,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1807,
"name": "_owner",
"nodeType": "VariableDeclaration",
"scope": 1814,
"src": "231:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1806,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "231:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1809,
"name": "_spender",
"nodeType": "VariableDeclaration",
"scope": 1814,
"src": "247:16:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1808,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "247:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "230:34:9"
},
"payable": false,
"returnParameters": {
"id": 1813,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1812,
"name": "remaining",
"nodeType": "VariableDeclaration",
"scope": 1814,
"src": "288:17:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1811,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "288:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "287:19:9"
},
"scope": 1822,
"src": "212:95:9",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": null,
"documentation": null,
"id": 1821,
"implemented": false,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "balanceOf",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1817,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1816,
"name": "_owner",
"nodeType": "VariableDeclaration",
"scope": 1821,
"src": "331:14:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1815,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "331:7:9",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "330:16:9"
},
"payable": false,
"returnParameters": {
"id": 1820,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1819,
"name": "balance",
"nodeType": "VariableDeclaration",
"scope": 1821,
"src": "370:15:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1818,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "370:7:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "369:17:9"
},
"scope": 1822,
"src": "312:75:9",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 1823,
"src": "26:363:9"
}
],
"src": "0:389:9"
},
"compiler": {
"name": "solc",
"version": "0.4.25+commit.59dbf8f1.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.0-beta.0",
"updatedAt": "2018-12-04T11:48:18.073Z"
}