UNPKG

jcc-solidity-utils

Version:
1,123 lines (1,122 loc) 349 kB
{ "contractName": "AlarmList", "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/AlarmList.sol\":\"AlarmList\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/list/AlarmList.sol\":{\"keccak256\":\"0x2f63a437b679cf16f84d1e92c14432fd29fb4a3a4990d393abb928b7b8641fc8\",\"urls\":[\"bzzr://7b44df42b6b1bca22f8c9e5bb7197e78871a34246089d6aa0a5a31eb8fc95ef0\"]},\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x239546071316c89d3bbc9e61b2ccae270a4493bbd2f7c240052f533807d50ab7\",\"urls\":[\"bzzr://267bf48e0a30f7b671aa3c98a6b27ffe7bc64efd6533f49e54188b520baa94c5\"]}},\"version\":1}", "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058202fc136656b2a8d9e9cbe1616cd239df1c6daf005f2008652e6d9368a07589b820029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058202fc136656b2a8d9e9cbe1616cd239df1c6daf005f2008652e6d9368a07589b820029", "sourceMap": "94:2893:12:-;;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:2893:12:-;;;;;;;;", "source": "pragma solidity >=0.4.24;\n\nimport \"../math/SafeMath.sol\";\n\n/**\n * @dev 定时任务列表\n */\nlibrary AlarmList {\n using SafeMath for uint256;\n\n // 定时任务定义\n struct element {\n // 合约地址\n address contractAddr;\n // 创建者地址\n address creatorAddr;\n // 索引id\n uint256 idx;\n // 类型:0:一次性, 1:周期性\n uint256 alarmType;\n // 起始时间\n uint256 begin;\n // 周期\n uint256 peroid;\n }\n struct alarmMap {\n mapping(address => uint256) mapList;\n element[] list;\n }\n\n function exist(alarmMap storage self, address _addr)\n internal\n view\n returns (bool)\n {\n if (self.list.length == 0) return false;\n return (self.list[self.mapList[_addr]].contractAddr == _addr);\n }\n\n /**\n @dev 增加新定时定义,重复的地址返回失败\n */\n function insert(\n alarmMap storage self,\n address _addr,\n address _creator,\n uint256 _type,\n uint256 _begin,\n uint256 _peroid\n ) internal returns (bool) {\n if (exist(self, _addr)) {\n return false;\n }\n\n element memory e =\n element({\n contractAddr: _addr,\n creatorAddr: _creator,\n idx: self.list.length,\n alarmType: _type,\n begin: _begin,\n peroid: _peroid\n });\n self.list.push(e);\n self.mapList[_addr] = e.idx;\n return true;\n }\n\n /**\n @dev 删除地址,相应的下标索引数组自动缩减\n */\n function remove(alarmMap storage self, address _addr)\n internal\n returns (bool)\n {\n if (!exist(self, _addr)) {\n return false;\n }\n\n uint256 row2Del = self.mapList[_addr];\n element storage keyToMove = self.list[self.list.length.sub(1)];\n self.list[row2Del] = keyToMove;\n self.mapList[keyToMove.contractAddr] = row2Del;\n self.list.length = self.list.length.sub(1);\n\n return true;\n }\n\n function count(alarmMap storage self) internal view returns (uint256) {\n return self.list.length;\n }\n\n function get(alarmMap storage self, uint256 index)\n internal\n view\n returns (AlarmList.element)\n {\n require(index < self.list.length, \"index must small than current count\");\n return self.list[index];\n }\n\n function getByAddr(alarmMap storage self, address _addr)\n internal\n view\n returns (AlarmList.element)\n {\n require(exist(self, _addr), \"alarm must exist\");\n return self.list[self.mapList[_addr]];\n }\n\n /**\n @dev 从指定位置返回多条(不多于count)地址记录,如果不足则空缺\n */\n function getList(\n alarmMap storage self,\n uint256 from,\n uint256 _count\n ) internal view returns (AlarmList.element[] memory) {\n uint256 _idx = 0;\n require(_count > 0, \"return number must bigger than 0\");\n AlarmList.element[] memory res = new AlarmList.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/AlarmList.sol", "ast": { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/list/AlarmList.sol", "exportedSymbols": { "AlarmList": [ 1884 ] }, "id": 1885, "nodeType": "SourceUnit", "nodes": [ { "id": 1565, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:12" }, { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/math/SafeMath.sol", "file": "../math/SafeMath.sol", "id": 1566, "nodeType": "ImportDirective", "scope": 1885, "sourceUnit": 5658, "src": "27:30:12", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@dev 定时任务列表", "fullyImplemented": true, "id": 1884, "linearizedBaseContracts": [ 1884 ], "name": "AlarmList", "nodeType": "ContractDefinition", "nodes": [ { "id": 1569, "libraryName": { "contractScope": null, "id": 1567, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5657, "src": "122:8:12", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$5657", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "116:27:12", "typeName": { "id": 1568, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "135:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "canonicalName": "AlarmList.element", "id": 1582, "members": [ { "constant": false, "id": 1571, "name": "contractAddr", "nodeType": "VariableDeclaration", "scope": 1582, "src": "212:20:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1570, "name": "address", "nodeType": "ElementaryTypeName", "src": "212:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1573, "name": "creatorAddr", "nodeType": "VariableDeclaration", "scope": 1582, "src": "261:19:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1572, "name": "address", "nodeType": "ElementaryTypeName", "src": "261:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1575, "name": "idx", "nodeType": "VariableDeclaration", "scope": 1582, "src": "302:11:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1574, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "302:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1577, "name": "alarmType", "nodeType": "VariableDeclaration", "scope": 1582, "src": "360:17:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1576, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "360:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1579, "name": "begin", "nodeType": "VariableDeclaration", "scope": 1582, "src": "403:13:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1578, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "403:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1581, "name": "peroid", "nodeType": "VariableDeclaration", "scope": 1582, "src": "436:14:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1580, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "436:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "name": "element", "nodeType": "StructDefinition", "scope": 1884, "src": "171:284:12", "visibility": "public" }, { "canonicalName": "AlarmList.alarmMap", "id": 1590, "members": [ { "constant": false, "id": 1586, "name": "mapList", "nodeType": "VariableDeclaration", "scope": 1590, "src": "480:35:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 1585, "keyType": { "id": 1583, "name": "address", "nodeType": "ElementaryTypeName", "src": "488:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "480:27:12", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 1584, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "499:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1589, "name": "list", "nodeType": "VariableDeclaration", "scope": 1590, "src": "521:14:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_element_$1582_storage_$dyn_storage_ptr", "typeString": "struct AlarmList.element[]" }, "typeName": { "baseType": { "contractScope": null, "id": 1587, "name": "element", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1582, "src": "521:7:12", "typeDescriptions": { "typeIdentifier": "t_struct$_element_$1582_storage_ptr", "typeString": "struct AlarmList.element" } }, "id": 1588, "length": null, "nodeType": "ArrayTypeName", "src": "521:9:12", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_element_$1582_storage_$dyn_storage_ptr", "typeString": "struct AlarmList.element[]" } }, "value": null, "visibility": "internal" } ], "name": "alarmMap", "nodeType": "StructDefinition", "scope": 1884, "src": "458:82:12", "visibility": "public" }, { "body": { "id": 1619, "nodeType": "Block", "src": "640:117:12", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 1603, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1599, "name": "self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1592, "src": "650:4:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" } }, "id": 1600, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "list", "nodeType": "MemberAccess", "referencedDeclaration": 1589, "src": "650:9:12", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_element_$1582_storage_$dyn_storage", "typeString": "struct AlarmList.element storage ref[] storage ref" } }, "id": 1601, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "650:16:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1602, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "670:1:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "650:21:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 1606, "nodeType": "IfStatement", "src": "646:39:12", "trueBody": { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 1604, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "680:5:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 1598, "id": 1605, "nodeType": "Return", "src": "673:12:12" } }, { "expression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 1616, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1607, "name": "self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1592, "src": "699:4:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" } }, "id": 1608, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "list", "nodeType": "MemberAccess", "referencedDeclaration": 1589, "src": "699:9:12", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_element_$1582_storage_$dyn_storage", "typeString": "struct AlarmList.element storage ref[] storage ref" } }, "id": 1613, "indexExpression": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1609, "name": "self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1592, "src": "709:4:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" } }, "id": 1610, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "mapList", "nodeType": "MemberAccess", "referencedDeclaration": 1586, "src": "709:12:12", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" } }, "id": 1612, "indexExpression": { "argumentTypes": null, "id": 1611, "name": "_addr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1594, "src": "722:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "709:19:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "699:30:12", "typeDescriptions": { "typeIdentifier": "t_struct$_element_$1582_storage", "typeString": "struct AlarmList.element storage ref" } }, "id": 1614, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "contractAddr", "nodeType": "MemberAccess", "referencedDeclaration": 1571, "src": "699:43:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 1615, "name": "_addr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1594, "src": "746:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "699:52:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "id": 1617, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "698:54:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 1598, "id": 1618, "nodeType": "Return", "src": "691:61:12" } ] }, "documentation": null, "id": 1620, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "exist", "nodeType": "FunctionDefinition", "parameters": { "id": 1595, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1592, "name": "self", "nodeType": "VariableDeclaration", "scope": 1620, "src": "559:21:12", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap" }, "typeName": { "contractScope": null, "id": 1591, "name": "alarmMap", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1590, "src": "559:8:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1594, "name": "_addr", "nodeType": "VariableDeclaration", "scope": 1620, "src": "582:13:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1593, "name": "address", "nodeType": "ElementaryTypeName", "src": "582:7:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "558:38:12" }, "payable": false, "returnParameters": { "id": 1598, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1597, "name": "", "nodeType": "VariableDeclaration", "scope": 1620, "src": "632:4:12", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1596, "name": "bool", "nodeType": "ElementaryTypeName", "src": "632:4:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "631:6:12" }, "scope": 1884, "src": "544:213:12", "stateMutability": "view", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1677, "nodeType": "Block", "src": "1004:348:12", "statements": [ { "condition": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1638, "name": "self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1622, "src": "1020:4:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" } }, { "argumentTypes": null, "id": 1639, "name": "_addr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1624, "src": "1026:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" }, { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1637, "name": "exist", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1620, "src": "1014:5:12", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_alarmMap_$1590_storage_ptr_$_t_address_$returns$_t_bool_$", "typeString": "function (struct AlarmList.alarmMap storage pointer,address) view returns (bool)" } }, "id": 1640, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1014:18:12", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 1644, "nodeType": "IfStatement", "src": "1010:51:12", "trueBody": { "id": 1643, "nodeType": "Block", "src": "1034:27:12", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 1641, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1049:5:12", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 1636, "id": 1642, "nodeType": "Return", "src": "1042:12:12" } ] } }, { "assignments": [ 1646 ], "declarations": [ { "constant": false, "id": 1646, "name": "e", "nodeType": "VariableDeclaration", "scope": 1678, "src": "1067:16:12", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_element_$1582_memory_ptr", "typeString": "struct AlarmList.element" }, "typeName": { "contractScope": null, "id": 1645, "name": "element", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1582, "src": "1067:7:12", "typeDescriptions": { "typeIdentifier": "t_struct$_element_$1582_storage_ptr", "typeString": "struct AlarmList.element" } }, "value": null, "visibility": "internal" } ], "id": 1657, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1648, "name": "_addr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1624, "src": "1124:5:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 1649, "name": "_creator", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1626, "src": "1152:8:12", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1650, "name": "self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1622, "src": "1175:4:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" } }, "id": 1651, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "list", "nodeType": "MemberAccess", "referencedDeclaration": 1589, "src": "1175:9:12", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_element_$1582_storage_$dyn_storage", "typeString": "struct AlarmList.element storage ref[] storage ref" } }, "id": 1652, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1175:16:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1653, "name": "_type", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1628, "src": "1212:5:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1654, "name": "_begin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1630, "src": "1234:6:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 1655, "name": "_peroid", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1632, "src": "1258:7:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": null, "id": 1647, "name": "element", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1582, "src": "1092:7:12", "typeDescriptions": { "typeIdentifier": "t_type$_t_struct$_element_$1582_storage_ptr_$", "typeString": "type(struct AlarmList.element storage pointer)" } }, "id": 1656, "isConstant": false, "isLValue": false, "isPure": false, "kind": "structConstructorCall", "lValueRequested": false, "names": [ "contractAddr", "creatorAddr", "idx", "alarmType", "begin", "peroid" ], "nodeType": "FunctionCall", "src": "1092:182:12", "typeDescriptions": { "typeIdentifier": "t_struct$_element_$1582_memory", "typeString": "struct AlarmList.element memory" } }, "nodeType": "VariableDeclarationStatement", "src": "1067:207:12" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1663, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1646, "src": "1295:1:12", "typeDescriptions": { "typeIdentifier": "t_struct$_element_$1582_memory_ptr", "typeString": "struct AlarmList.element memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_struct$_element_$1582_memory_ptr", "typeString": "struct AlarmList.element memory" } ], "expression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1658, "name": "self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1622, "src": "1280:4:12", "typeDescriptions": { "typeIdentifier": "t_struct$_alarmMap_$1590_storage_ptr", "typeString": "struct AlarmList.alarmMap storage pointer" } }, "id": 1661, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "list", "nodeType": "MemberAccess", "referencedDeclaration": 1589, "src": "1280:9:12", "typeDescriptions": { "typeIdentifier": "t_array$_t_struct$_element_$1582_storage_$dyn_storage", "typeString": "struct AlarmList.element storage ref[] storage ref" } }, "id": 1662, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "push", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1280:14:12", "typeDescriptions": { "typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_element_$1582_storage_$returns$_t_uint256_$", "typeString": "function (struct AlarmList.element storage ref) returns (uint256)" } }, "id": 1664, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1280:17:12", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 1665, "nodeType": "ExpressionStatement", "src": "1280:17:12"