UNPKG

@tokenz/tokens-smartcontract-sdk

Version:
1,038 lines 146 kB
{ "contractName": "macContract", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "object", "outputs": [ { "name": "", "type": "bytes8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "subject", "outputs": [ { "name": "", "type": "bytes8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "sub", "type": "address" }, { "indexed": true, "name": "permission", "type": "bytes8" } ], "name": "eventsubject", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "obj", "type": "bytes32" }, { "indexed": true, "name": "permission", "type": "bytes8" } ], "name": "eventobject", "type": "event" }, { "constant": true, "inputs": [ { "name": "_sub", "type": "bytes8" }, { "name": "_obj", "type": "bytes8" } ], "name": "permissionCheck", "outputs": [ { "name": "result", "type": "bool" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": false, "inputs": [ { "name": "sub", "type": "address" }, { "name": "perm", "type": "bytes8" } ], "name": "addPermissionSubject", "outputs": [ { "name": "result", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "obj", "type": "bytes32" }, { "name": "perm", "type": "bytes8" } ], "name": "addPermissionObject", "outputs": [ { "name": "result", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b50670fffffffffffffff7801000000000000000000000000000000000000000000000000026000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550610721806100ba6000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305ad145614610072578063216f1308146100ed578063635912d51461015b57806382f6f815146101e0578063ff55d8781461026d575b600080fd5b34801561007e57600080fd5b506100a160048036038101908080356000191690602001909291905050506102ed565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156100f957600080fd5b506101416004803603810190808035600019169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610325565b604051808215151515815260200191505060405180910390f35b34801561016757600080fd5b506101c6600480360381019080803577ffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff191690602001909291905050506104af565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b50610221600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104fe565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561027957600080fd5b506102d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610536565b604051808215151515815260200191505060405180910390f35b60016020528060005260406000206000915054906101000a900478010000000000000000000000000000000000000000000000000281565b60007fe6a6bdf4f80c25a08614ac1cc38f8a6866094aaae2eb1386d824a04b67b1a9f46001026103f86000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900478010000000000000000000000000000000000000000000000000260016000846000191660001916815260200190815260200160002060009054906101000a90047801000000000000000000000000000000000000000000000000026104af565b151561040357600080fd5b8277ffffffffffffffffffffffffffffffffffffffffffffffff191684600019167f57033c08f4ccc9c3a5bb387bb06164b82965c951648fa100ea9cd2b060229f6960405160405180910390a38260016000866000191660001916815260200190815260200160002060006101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550600191505092915050565b600080780100000000000000000000000000000000000000000000000002828385161877ffffffffffffffffffffffffffffffffffffffffffffffff191614156104f857600190505b92915050565b60006020528060005260406000206000915054906101000a900478010000000000000000000000000000000000000000000000000281565b60007fe2f77eda07301dcdfd75d8cb122d00e11c3c76cd1d95474354a43f0a6136e1aa6001026106096000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900478010000000000000000000000000000000000000000000000000260016000846000191660001916815260200190815260200160002060009054906101000a90047801000000000000000000000000000000000000000000000000026104af565b151561061457600080fd5b8277ffffffffffffffffffffffffffffffffffffffffffffffff19168473ffffffffffffffffffffffffffffffffffffffff167f02447c925432827c75b2c492811b3cdfbbc6b41241d69a0881d0fd38148f6d4060405160405180910390a3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff02191690837801000000000000000000000000000000000000000000000000900402179055506001915050929150505600a165627a7a72305820747b97111a584987560069815b1e4bb67a0dccad0603ec33c343dae58fa863530029", "deployedBytecode": "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305ad145614610072578063216f1308146100ed578063635912d51461015b57806382f6f815146101e0578063ff55d8781461026d575b600080fd5b34801561007e57600080fd5b506100a160048036038101908080356000191690602001909291905050506102ed565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156100f957600080fd5b506101416004803603810190808035600019169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610325565b604051808215151515815260200191505060405180910390f35b34801561016757600080fd5b506101c6600480360381019080803577ffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff191690602001909291905050506104af565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b50610221600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104fe565b604051808277ffffffffffffffffffffffffffffffffffffffffffffffff191677ffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561027957600080fd5b506102d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610536565b604051808215151515815260200191505060405180910390f35b60016020528060005260406000206000915054906101000a900478010000000000000000000000000000000000000000000000000281565b60007fe6a6bdf4f80c25a08614ac1cc38f8a6866094aaae2eb1386d824a04b67b1a9f46001026103f86000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900478010000000000000000000000000000000000000000000000000260016000846000191660001916815260200190815260200160002060009054906101000a90047801000000000000000000000000000000000000000000000000026104af565b151561040357600080fd5b8277ffffffffffffffffffffffffffffffffffffffffffffffff191684600019167f57033c08f4ccc9c3a5bb387bb06164b82965c951648fa100ea9cd2b060229f6960405160405180910390a38260016000866000191660001916815260200190815260200160002060006101000a81548167ffffffffffffffff0219169083780100000000000000000000000000000000000000000000000090040217905550600191505092915050565b600080780100000000000000000000000000000000000000000000000002828385161877ffffffffffffffffffffffffffffffffffffffffffffffff191614156104f857600190505b92915050565b60006020528060005260406000206000915054906101000a900478010000000000000000000000000000000000000000000000000281565b60007fe2f77eda07301dcdfd75d8cb122d00e11c3c76cd1d95474354a43f0a6136e1aa6001026106096000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900478010000000000000000000000000000000000000000000000000260016000846000191660001916815260200190815260200160002060009054906101000a90047801000000000000000000000000000000000000000000000000026104af565b151561061457600080fd5b8277ffffffffffffffffffffffffffffffffffffffffffffffff19168473ffffffffffffffffffffffffffffffffffffffff167f02447c925432827c75b2c492811b3cdfbbc6b41241d69a0881d0fd38148f6d4060405160405180910390a3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548167ffffffffffffffff02191690837801000000000000000000000000000000000000000000000000900402179055506001915050929150505600a165627a7a72305820747b97111a584987560069815b1e4bb67a0dccad0603ec33c343dae58fa863530029", "sourceMap": "190:2358:8:-;;;465:78;8:9:-1;5:2;;;30:1;27;20:12;5:2;465:78:8;518:18;496:40;;:7;:19;504:10;496:19;;;;;;;;;;;;;;;;:40;;;;;;;;;;;;;;;;;;;190:2358;;;;;;", "deployedSourceMap": "190:2358:8:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;416:42;;8:9:-1;5:2;;;30:1;27;20:12;5:2;416:42:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2251:295;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2251:295:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1055:176;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1055:176:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;367:43;;8:9:-1;5:2;;;30:1;27;20:12;5:2;367:43:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1589:299;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1589:299:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;416:42;;;;;;;;;;;;;;;;;;;;;;:::o;2251:295::-;2435:11;2349:66;549:126;;606:50;622:7;:19;630:10;622:19;;;;;;;;;;;;;;;;;;;;;;;;;642:6;:13;649:5;642:13;;;;;;;;;;;;;;;;;;;;;;;;;;;606:15;:50::i;:::-;598:59;;;;;;;;2483:4;2467:21;;;2479:3;2467:21;;;;;;;;;;;;;2512:4;2498:6;:11;2505:3;2498:11;;;;;;;;;;;;;;;;;;:18;;;;;;;;;;;;;;;;;;;2535:4;2526:13;;2251:295;;;;;:::o;1055:176::-;1128:12;1184:1;1157:28;;1174:4;1167;1160;:11;1159:19;1157:28;;;;1152:73;;;1210:4;1201:13;;1152:73;1055:176;;;;:::o;367:43::-;;;;;;;;;;;;;;;;;;;;;;:::o;1589:299::-;1774:11;1688:66;549:126;;606:50;622:7;:19;630:10;622:19;;;;;;;;;;;;;;;;;;;;;;;;;642:6;:13;649:5;642:13;;;;;;;;;;;;;;;;;;;;;;;;;;;606:15;:50::i;:::-;598:59;;;;;;;;1824:4;1807:22;;;1820:3;1807:22;;;;;;;;;;;;1854:4;1839:7;:12;1847:3;1839:12;;;;;;;;;;;;;;;;:19;;;;;;;;;;;;;;;;;;;1877:4;1868:13;;1589:299;;;;;:::o", "source": "pragma solidity ^0.4.25;\n\n/**\n * @title MacContract for Permissioning\n * @dev A base contract for permission management for entire system\n * @author Harsh Patel / harsh.patel54@gmail.com\n*/\ncontract macContract {\n\n event eventsubject (address indexed sub, bytes8 indexed permission );\n event eventobject (bytes32 indexed obj , bytes8 indexed permission );\n\n mapping (address => bytes8 ) public subject;\n mapping (bytes32 => bytes8 ) public object;\n\n constructor() public {\n subject[msg.sender] = 0x0FFFFFFFFFFFFFFF;\n }\n\n modifier mod_isValidPerm(bytes32 objid){\n require(permissionCheck(subject[msg.sender],object[objid]));\n _;\n }\n\n /**\n @notice permissionCheck Checks permission of subject and object\n @dev This is function pure and public with no moodifiers but other modifiers use this function\n @param _sub The bytes representing subject\n @param _obj The bytes representing object\n @return {\n \"result\": \"Returns true if permission match\"\n }\n */\n function permissionCheck(bytes8 _sub, bytes8 _obj) public pure returns ( bool result) {\n if ( ( (_sub & _obj )^_obj ) == 0) {\n result = true;\n }\n }\n\n /**\n @notice addPermissionSubject Function to alot permission to subject\n @dev This is function public with modifier mod_isValidPerm\n @param sub The address of the subject\n @param perm The bytes representing subject\n @return {\n \"result\": \"Returns true if function executed successfully\"\n }\n */\n function addPermissionSubject ( address sub , bytes8 perm )\n public\n mod_isValidPerm(0xe2f77eda07301dcdfd75d8cb122d00e11c3c76cd1d95474354a43f0a6136e1aa)\n returns ( bool result )\n {\n emit eventsubject(sub,perm);\n subject[sub] = perm;\n result = true;\n }\n\n /**\n @notice addPermissionObject Function to alot permission to object\n @dev This is function public with modifier mod_isValidPerm\n @param obj The bytes reprresenting the object\n @param perm The bytes representing object\n @return {\n \"result\": \"Returns true if function executed successfully\"\n }\n */\n function addPermissionObject ( bytes32 obj , bytes8 perm )\n public\n mod_isValidPerm(0xe6a6bdf4f80c25a08614ac1cc38f8a6866094aaae2eb1386d824a04b67b1a9f4)\n returns ( bool result)\n {\n emit eventobject(obj,perm);\n object[obj] = perm;\n result = true;\n }\n}", "sourcePath": "/contracts/governance/macContract.sol", "ast": { "absolutePath": "/contracts/governance/macContract.sol", "exportedSymbols": { "macContract": [ 1323 ] }, "id": 1324, "nodeType": "SourceUnit", "nodes": [ { "id": 1192, "literals": [ "solidity", "^", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:24:8" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title MacContract for Permissioning\n@dev A base contract for permission management for entire system\n@author Harsh Patel / harsh.patel54@gmail.com", "fullyImplemented": true, "id": 1323, "linearizedBaseContracts": [ 1323 ], "name": "macContract", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 1198, "name": "eventsubject", "nodeType": "EventDefinition", "parameters": { "id": 1197, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1194, "indexed": true, "name": "sub", "nodeType": "VariableDeclaration", "scope": 1198, "src": "238:19:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1193, "name": "address", "nodeType": "ElementaryTypeName", "src": "238:7:8", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1196, "indexed": true, "name": "permission", "nodeType": "VariableDeclaration", "scope": 1198, "src": "259:25:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, "typeName": { "id": 1195, "name": "bytes8", "nodeType": "ElementaryTypeName", "src": "259:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "value": null, "visibility": "internal" } ], "src": "237:49:8" }, "src": "218:69:8" }, { "anonymous": false, "documentation": null, "id": 1204, "name": "eventobject", "nodeType": "EventDefinition", "parameters": { "id": 1203, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1200, "indexed": true, "name": "obj", "nodeType": "VariableDeclaration", "scope": 1204, "src": "311:19:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1199, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "311:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 1202, "indexed": true, "name": "permission", "nodeType": "VariableDeclaration", "scope": 1204, "src": "333:25:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, "typeName": { "id": 1201, "name": "bytes8", "nodeType": "ElementaryTypeName", "src": "333:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "value": null, "visibility": "internal" } ], "src": "310:50:8" }, "src": "292:69:8" }, { "constant": false, "id": 1208, "name": "subject", "nodeType": "VariableDeclaration", "scope": 1323, "src": "367:43:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_bytes8_$", "typeString": "mapping(address => bytes8)" }, "typeName": { "id": 1207, "keyType": { "id": 1205, "name": "address", "nodeType": "ElementaryTypeName", "src": "376:7:8", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "367:28:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_bytes8_$", "typeString": "mapping(address => bytes8)" }, "valueType": { "id": 1206, "name": "bytes8", "nodeType": "ElementaryTypeName", "src": "387:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 1212, "name": "object", "nodeType": "VariableDeclaration", "scope": 1323, "src": "416:42:8", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes8_$", "typeString": "mapping(bytes32 => bytes8)" }, "typeName": { "id": 1211, "keyType": { "id": 1209, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "425:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "416:28:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes8_$", "typeString": "mapping(bytes32 => bytes8)" }, "valueType": { "id": 1210, "name": "bytes8", "nodeType": "ElementaryTypeName", "src": "436:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } } }, "value": null, "visibility": "public" }, { "body": { "id": 1222, "nodeType": "Block", "src": "486:57:8", "statements": [ { "expression": { "argumentTypes": null, "id": 1220, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 1215, "name": "subject", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1208, "src": "496:7:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_bytes8_$", "typeString": "mapping(address => bytes8)" } }, "id": 1218, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1216, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2396, "src": "504:3:8", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1217, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "504:10:8", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "496:19:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "307830464646464646464646464646464646", "id": 1219, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "518:18:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1152921504606846975_by_1", "typeString": "int_const 1152921504606846975" }, "value": "0x0FFFFFFFFFFFFFFF" }, "src": "496:40:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "id": 1221, "nodeType": "ExpressionStatement", "src": "496:40:8" } ] }, "documentation": null, "id": 1223, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1213, "nodeType": "ParameterList", "parameters": [], "src": "476:2:8" }, "payable": false, "returnParameters": { "id": 1214, "nodeType": "ParameterList", "parameters": [], "src": "486:0:8" }, "scope": 1323, "src": "465:78:8", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1240, "nodeType": "Block", "src": "588:87:8", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 1229, "name": "subject", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1208, "src": "622:7:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_bytes8_$", "typeString": "mapping(address => bytes8)" } }, "id": 1232, "indexExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1230, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2396, "src": "630:3:8", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1231, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "630:10:8", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "622:19:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 1233, "name": "object", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1212, "src": "642:6:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes8_$", "typeString": "mapping(bytes32 => bytes8)" } }, "id": 1235, "indexExpression": { "argumentTypes": null, "id": 1234, "name": "objid", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1225, "src": "649:5:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "642:13:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } ], "id": 1228, "name": "permissionCheck", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1266, "src": "606:15:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bytes8_$_t_bytes8_$returns$_t_bool_$", "typeString": "function (bytes8,bytes8) pure returns (bool)" } }, "id": 1236, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "606:50:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 1227, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2399, 2400 ], "referencedDeclaration": 2399, "src": "598:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 1237, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "598:59:8", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1238, "nodeType": "ExpressionStatement", "src": "598:59:8" }, { "id": 1239, "nodeType": "PlaceholderStatement", "src": "667:1:8" } ] }, "documentation": null, "id": 1241, "name": "mod_isValidPerm", "nodeType": "ModifierDefinition", "parameters": { "id": 1226, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1225, "name": "objid", "nodeType": "VariableDeclaration", "scope": 1241, "src": "574:13:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 1224, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "574:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "573:15:8" }, "src": "549:126:8", "visibility": "internal" }, { "body": { "id": 1265, "nodeType": "Block", "src": "1142:89:8", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, "id": 1258, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, "id": 1255, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, "id": 1252, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1250, "name": "_sub", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1243, "src": "1160:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "argumentTypes": null, "id": 1251, "name": "_obj", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1245, "src": "1167:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "src": "1160:11:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } } ], "id": 1253, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1159:14:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "argumentTypes": null, "id": 1254, "name": "_obj", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1245, "src": "1174:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "src": "1159:19:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } } ], "id": 1256, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "1157:23:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 1257, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1184:1:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1157:28:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 1264, "nodeType": "IfStatement", "src": "1152:73:8", "trueBody": { "id": 1263, "nodeType": "Block", "src": "1187:38:8", "statements": [ { "expression": { "argumentTypes": null, "id": 1261, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 1259, "name": "result", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1248, "src": "1201:6:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 1260, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "1210:4:8", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "1201:13:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1262, "nodeType": "ExpressionStatement", "src": "1201:13:8" } ] } } ] }, "documentation": "@notice permissionCheck Checks permission of subject and object\n@dev This is function pure and public with no moodifiers but other modifiers use this function\n@param _sub The bytes representing subject\n@param _obj The bytes representing object\n@return {\n\"result\": \"Returns true if permission match\"\n}", "id": 1266, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "permissionCheck", "nodeType": "FunctionDefinition", "parameters": { "id": 1246, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1243, "name": "_sub", "nodeType": "VariableDeclaration", "scope": 1266, "src": "1080:11:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" }, "typeName": { "id": 1242, "name": "bytes8", "nodeType": "ElementaryTypeName", "src": "1080:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes8", "typeString": "bytes8" } }, "value": null, "visibility": "int