jcc-solidity-utils
Version:
jcc solidity utils
1,136 lines (1,135 loc) • 345 kB
JSON
{
"contractName": "TransferList",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.4.24+commit.e67f0147\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/list/TransferList.sol\":\"TransferList\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/list/TransferList.sol\":{\"keccak256\":\"0xa727d843e9e080cfb18db56d3743b43976e6088611fe9410116979c3445ba307\",\"urls\":[\"bzzr://85a66c643474d182af350b259820260ef87a94eeda0c3128209a42437452bc83\"]},\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x239546071316c89d3bbc9e61b2ccae270a4493bbd2f7c240052f533807d50ab7\",\"urls\":[\"bzzr://267bf48e0a30f7b671aa3c98a6b27ffe7bc64efd6533f49e54188b520baa94c5\"]}},\"version\":1}",
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820f51c935f380f89eec8ae0dc343b00acd05dbd2dc13e5c9b61c86bf3066afa7c00029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820f51c935f380f89eec8ae0dc343b00acd05dbd2dc13e5c9b61c86bf3066afa7c00029",
"sourceMap": "94:2998:18:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
"deployedSourceMap": "94:2998:18:-;;;;;;;;",
"source": "pragma solidity >=0.4.24;\n\nimport \"../math/SafeMath.sol\";\n\n/**\n * @dev 通证列表处理\n */\nlibrary TransferList {\n using SafeMath for uint256;\n\n // 通证定义\n struct element {\n // 发起地址\n address from;\n // chainid+issuer计算的hash, chainid遵循BIP44,issuer遵守TokenList中规定\n bytes32 tokenHash;\n // 数量,ERC20需要注意decimals\n uint256 amount;\n // 在数组中的索引\n uint256 idx;\n // 目的地址\n string to;\n }\n\n struct transferMap {\n // element hash => index\n mapping(bytes32 => uint256) map;\n // data array 单向增加\n element[] list;\n }\n\n function getHash(element e) internal pure returns (bytes32) {\n return\n keccak256(abi.encodePacked(e.from, e.tokenHash, e.amount, e.idx, e.to));\n }\n\n function existByIdx(transferMap storage self, uint256 _idx)\n internal\n view\n returns (bool)\n {\n if (_idx >= self.list.length) return false;\n return true;\n }\n\n function existByHash(transferMap storage self, bytes32 _hash)\n internal\n view\n returns (bool)\n {\n /**\n 如果没有这个长度判断,在第一次操作时会导致invalid opcode\n */\n if (self.list.length == 0) return false;\n element storage e = self.list[self.map[_hash]];\n return _hash == getHash(e);\n }\n\n // 增加跨链转账指令内容\n function insert(\n transferMap storage self,\n address _from,\n bytes32 _tokenHash,\n uint256 _amount,\n string _to\n ) internal returns (bytes32) {\n element memory e =\n element({\n from: _from,\n tokenHash: _tokenHash,\n amount: _amount,\n idx: self.list.length,\n to: _to\n });\n\n bytes32 _hash = getHash(e);\n require(!existByHash(self, _hash), \"same transfer data exist\");\n\n self.list.push(e);\n self.map[_hash] = e.idx;\n\n return _hash;\n }\n\n function count(transferMap storage self) internal view returns (uint256) {\n return self.list.length;\n }\n\n function getByIdx(transferMap storage self, uint256 _idx)\n internal\n view\n returns (TransferList.element)\n {\n require(existByIdx(self, _idx), \"index must small than current count\");\n return self.list[_idx];\n }\n\n function getByHash(transferMap storage self, bytes32 _hash)\n internal\n view\n returns (TransferList.element)\n {\n require(existByHash(self, _hash), \"hash does not exist\");\n return self.list[self.map[_hash]];\n }\n\n /**\n @dev 从指定位置返回多条(不多于count)地址记录,如果不足则空缺\n */\n function getList(\n transferMap storage self,\n uint256 from,\n uint256 _count\n ) internal view returns (TransferList.element[] memory) {\n uint256 _idx = 0;\n require(from >= self.list.length, \"from must small than count\");\n require(_count > 0, \"return number must bigger than 0\");\n\n TransferList.element[] memory res = new TransferList.element[](_count);\n\n for (uint256 i = from; i < self.list.length; i++) {\n if (_idx == _count) {\n break;\n }\n\n res[_idx] = self.list[i];\n _idx = _idx.add(1);\n }\n\n return res;\n }\n}\n",
"sourcePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/list/TransferList.sol",
"ast": {
"absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/list/TransferList.sol",
"exportedSymbols": {
"TransferList": [
5282
]
},
"id": 5283,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 4975,
"literals": [
"solidity",
">=",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:25:18"
},
{
"absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/math/SafeMath.sol",
"file": "../math/SafeMath.sol",
"id": 4976,
"nodeType": "ImportDirective",
"scope": 5283,
"sourceUnit": 5658,
"src": "27:30:18",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@dev 通证列表处理",
"fullyImplemented": true,
"id": 5282,
"linearizedBaseContracts": [
5282
],
"name": "TransferList",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 4979,
"libraryName": {
"contractScope": null,
"id": 4977,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5657,
"src": "125:8:18",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$5657",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "119:27:18",
"typeName": {
"id": 4978,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "138:7:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"canonicalName": "TransferList.element",
"id": 4990,
"members": [
{
"constant": false,
"id": 4981,
"name": "from",
"nodeType": "VariableDeclaration",
"scope": 4990,
"src": "209:12:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4980,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "209:7:18",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4983,
"name": "tokenHash",
"nodeType": "VariableDeclaration",
"scope": 4990,
"src": "313:17:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 4982,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "313:7:18",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4985,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 4990,
"src": "378:14:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4984,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "378:7:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4987,
"name": "idx",
"nodeType": "VariableDeclaration",
"scope": 4990,
"src": "427:11:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4986,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "427:7:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4989,
"name": "to",
"nodeType": "VariableDeclaration",
"scope": 4990,
"src": "464:9:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
},
"typeName": {
"id": 4988,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "464:6:18",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "element",
"nodeType": "StructDefinition",
"scope": 5282,
"src": "168:310:18",
"visibility": "public"
},
{
"canonicalName": "TransferList.transferMap",
"id": 4998,
"members": [
{
"constant": false,
"id": 4994,
"name": "map",
"nodeType": "VariableDeclaration",
"scope": 4998,
"src": "536:31:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
},
"typeName": {
"id": 4993,
"keyType": {
"id": 4991,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "544:7:18",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Mapping",
"src": "536:27:18",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
},
"valueType": {
"id": 4992,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "555:7:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 4997,
"name": "list",
"nodeType": "VariableDeclaration",
"scope": 4998,
"src": "604:14:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_element_$4990_storage_$dyn_storage_ptr",
"typeString": "struct TransferList.element[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 4995,
"name": "element",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4990,
"src": "604:7:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_storage_ptr",
"typeString": "struct TransferList.element"
}
},
"id": 4996,
"length": null,
"nodeType": "ArrayTypeName",
"src": "604:9:18",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_element_$4990_storage_$dyn_storage_ptr",
"typeString": "struct TransferList.element[]"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "transferMap",
"nodeType": "StructDefinition",
"scope": 5282,
"src": "482:141:18",
"visibility": "public"
},
{
"body": {
"id": 5021,
"nodeType": "Block",
"src": "687:95:18",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5008,
"name": "e",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5000,
"src": "733:1:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_memory_ptr",
"typeString": "struct TransferList.element memory"
}
},
"id": 5009,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "from",
"nodeType": "MemberAccess",
"referencedDeclaration": 4981,
"src": "733:6:18",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5010,
"name": "e",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5000,
"src": "741:1:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_memory_ptr",
"typeString": "struct TransferList.element memory"
}
},
"id": 5011,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "tokenHash",
"nodeType": "MemberAccess",
"referencedDeclaration": 4983,
"src": "741:11:18",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5012,
"name": "e",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5000,
"src": "754:1:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_memory_ptr",
"typeString": "struct TransferList.element memory"
}
},
"id": 5013,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "amount",
"nodeType": "MemberAccess",
"referencedDeclaration": 4985,
"src": "754:8:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5014,
"name": "e",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5000,
"src": "764:1:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_memory_ptr",
"typeString": "struct TransferList.element memory"
}
},
"id": 5015,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "idx",
"nodeType": "MemberAccess",
"referencedDeclaration": 4987,
"src": "764:5:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5016,
"name": "e",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5000,
"src": "771:1:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_memory_ptr",
"typeString": "struct TransferList.element memory"
}
},
"id": 5017,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "to",
"nodeType": "MemberAccess",
"referencedDeclaration": 4989,
"src": "771:4:18",
"typeDescriptions": {
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_string_memory",
"typeString": "string memory"
}
],
"expression": {
"argumentTypes": null,
"id": 5006,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9028,
"src": "716:3:18",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 5007,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "716:16:18",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 5018,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "716:60:18",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 5005,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9035,
"src": "706:9:18",
"typeDescriptions": {
"typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$",
"typeString": "function () pure returns (bytes32)"
}
},
"id": 5019,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "706:71:18",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"functionReturnParameters": 5004,
"id": 5020,
"nodeType": "Return",
"src": "693:84:18"
}
]
},
"documentation": null,
"id": 5022,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getHash",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5001,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5000,
"name": "e",
"nodeType": "VariableDeclaration",
"scope": 5022,
"src": "644:9:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_memory_ptr",
"typeString": "struct TransferList.element"
},
"typeName": {
"contractScope": null,
"id": 4999,
"name": "element",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4990,
"src": "644:7:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_storage_ptr",
"typeString": "struct TransferList.element"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "643:11:18"
},
"payable": false,
"returnParameters": {
"id": 5004,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5003,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5022,
"src": "678:7:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 5002,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "678:7:18",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "677:9:18"
},
"scope": 5282,
"src": "627:155:18",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 5041,
"nodeType": "Block",
"src": "889:70:18",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 5031,
"name": "_idx",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5026,
"src": "899:4:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5032,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5024,
"src": "907:4:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_transferMap_$4998_storage_ptr",
"typeString": "struct TransferList.transferMap storage pointer"
}
},
"id": 5033,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "list",
"nodeType": "MemberAccess",
"referencedDeclaration": 4997,
"src": "907:9:18",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_element_$4990_storage_$dyn_storage",
"typeString": "struct TransferList.element storage ref[] storage ref"
}
},
"id": 5034,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "907:16:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "899:24:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 5038,
"nodeType": "IfStatement",
"src": "895:42:18",
"trueBody": {
"expression": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 5036,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "932:5:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 5030,
"id": 5037,
"nodeType": "Return",
"src": "925:12:18"
}
},
{
"expression": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 5039,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "950:4:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"functionReturnParameters": 5030,
"id": 5040,
"nodeType": "Return",
"src": "943:11:18"
}
]
},
"documentation": null,
"id": 5042,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "existByIdx",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5027,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5024,
"name": "self",
"nodeType": "VariableDeclaration",
"scope": 5042,
"src": "806:24:18",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_transferMap_$4998_storage_ptr",
"typeString": "struct TransferList.transferMap"
},
"typeName": {
"contractScope": null,
"id": 5023,
"name": "transferMap",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4998,
"src": "806:11:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_transferMap_$4998_storage_ptr",
"typeString": "struct TransferList.transferMap"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5026,
"name": "_idx",
"nodeType": "VariableDeclaration",
"scope": 5042,
"src": "832:12:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5025,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "832:7:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "805:40:18"
},
"payable": false,
"returnParameters": {
"id": 5030,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5029,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5042,
"src": "881:4:18",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 5028,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "881:4:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "880:6:18"
},
"scope": 5282,
"src": "786:173:18",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 5075,
"nodeType": "Block",
"src": "1068:232:18",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5055,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5051,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5044,
"src": "1176:4:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_transferMap_$4998_storage_ptr",
"typeString": "struct TransferList.transferMap storage pointer"
}
},
"id": 5052,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "list",
"nodeType": "MemberAccess",
"referencedDeclaration": 4997,
"src": "1176:9:18",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_element_$4990_storage_$dyn_storage",
"typeString": "struct TransferList.element storage ref[] storage ref"
}
},
"id": 5053,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1176:16:18",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 5054,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1196:1:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1176:21:18",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 5058,
"nodeType": "IfStatement",
"src": "1172:39:18",
"trueBody": {
"expression": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 5056,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1206:5:18",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 5050,
"id": 5057,
"nodeType": "Return",
"src": "1199:12:18"
}
},
{
"assignments": [
5060
],
"declarations": [
{
"constant": false,
"id": 5060,
"name": "e",
"nodeType": "VariableDeclaration",
"scope": 5076,
"src": "1217:17:18",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_storage_ptr",
"typeString": "struct TransferList.element"
},
"typeName": {
"contractScope": null,
"id": 5059,
"name": "element",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 4990,
"src": "1217:7:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_element_$4990_storage_ptr",
"typeString": "struct TransferList.element"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 5068,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5061,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5044,
"src": "1237:4:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_transferMap_$4998_storage_ptr",
"typeString": "struct TransferList.transferMap storage pointer"
}
},
"id": 5062,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "list",
"nodeType": "MemberAccess",
"referencedDeclaration": 4997,
"src": "1237:9:18",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_element_$4990_storage_$dyn_storage",
"typeString": "struct TransferList.element storage ref[] storage ref"
}
},
"id": 5067,
"indexExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5063,
"name": "self",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5044,
"src": "1247:4:18",
"typeDescriptions": {
"typeIdentifier": "t_struct$_transferMap_$4998_storage_ptr",
"typeString": "struct TransferList.transferMap storage pointer"
}
},
"id": 5064,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "map",
"nodeType": "MemberAccess",
"referencedDeclaration": 4994,
"src": "1247:8:18",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
"typeString": "mapping(bytes32 => uint256)"
}
},
"id": 5066,
"indexExpression": {
"argumentTypes": null,
"id": 5065,
"name": "_hash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5046,