UNPKG

@etherisc/gif-contracts

Version:

This repository holds the GIF core contracts and tools to develop, test and deploy GIF instances.

1,600 lines 648 kB
{ "abi": [ { "inputs": [ { "internalType": "bytes32", "name": "fakeProductName", "type": "bytes32" }, { "internalType": "address", "name": "tokenAddress", "type": "address" }, { "internalType": "uint256", "name": "fakeComponentId", "type": "uint256" }, { "internalType": "uint256", "name": "fakeRiskpoolId", "type": "uint256" }, { "internalType": "address", "name": "registryAddress", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "bytes32", "name": "componentName", "type": "bytes32" }, { "indexed": false, "internalType": "enum IComponent.ComponentType", "name": "componentType", "type": "uint8" }, { "indexed": false, "internalType": "address", "name": "componentAddress", "type": "address" }, { "indexed": false, "internalType": "address", "name": "registryAddress", "type": "address" } ], "name": "LogComponentCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "componentId", "type": "uint256" } ], "name": "LogProductApproved", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "productAddress", "type": "address" } ], "name": "LogProductCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "componentId", "type": "uint256" } ], "name": "LogProductDeclined", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "componentId", "type": "uint256" } ], "name": "LogProductProposed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [], "name": "FAKE_STATE", "outputs": [ { "internalType": "enum IComponent.ComponentState", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "POLICY_FLOW", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "premium", "type": "uint256" }, { "internalType": "uint256", "name": "sumInsured", "type": "uint256" }, { "internalType": "bytes", "name": "metaData", "type": "bytes" }, { "internalType": "bytes", "name": "applicationData", "type": "bytes" } ], "name": "applyForPolicy", "outputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "approvalCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "archiveCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "policyId", "type": "bytes32" } ], "name": "collectPremium", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "declineCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getApplicationDataStructure", "outputs": [ { "internalType": "string", "name": "dataStructure", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getClaimDataStructure", "outputs": [ { "internalType": "string", "name": "dataStructure", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getName", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getOwner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getPayoutDataStructure", "outputs": [ { "internalType": "string", "name": "dataStructure", "type": "string" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getPolicyFlow", "outputs": [ { "internalType": "address", "name": "policyFlow", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getRegistry", "outputs": [ { "internalType": "contract IRegistry", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getRiskpoolId", "outputs": [ { "internalType": "uint256", "name": "riskpoolId", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getState", "outputs": [ { "internalType": "enum IComponent.ComponentState", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getToken", "outputs": [ { "internalType": "address", "name": "token", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "getType", "outputs": [ { "internalType": "enum IComponent.ComponentType", "name": "", "type": "uint8" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isOracle", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isProduct", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isRiskpool", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pauseCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "proposalCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "resumeCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "capacity", "type": "uint256" } ], "name": "riskPoolCapacityCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "id", "type": "uint256" } ], "name": "setId", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "policyId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimAmount", "type": "uint256" } ], "name": "submitClaim", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "suspendCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unpauseCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "allSourcePaths": { "13": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC20/IERC20.sol", "18": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721.sol", "22": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Context.sol", "26": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/introspection/IERC165.sol", "30": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IComponent.sol", "32": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IProduct.sol", "37": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IAccess.sol", "4": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/access/Ownable.sol", "44": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IRegistry.sol", "46": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IComponentOwnerService.sol", "47": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IInstanceOperatorService.sol", "48": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IInstanceService.sol", "49": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IOracleService.sol", "50": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IProductService.sol", "51": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IRiskpoolService.sol", "53": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/tokens/IBundleToken.sol", "94": "contracts/test/TestCompromisedProduct.sol" }, "ast": { "absolutePath": "contracts/test/TestCompromisedProduct.sol", "exportedSymbols": { "Context": [ 24074 ], "ERC20": [ 21536 ], "IAccess": [ 21938 ], "IBundle": [ 20491 ], "IBundleToken": [ 24052 ], "IComponent": [ 22099 ], "IComponentOwnerService": [ 23478 ], "IERC165": [ 27203 ], "IERC20": [ 18510 ], "IERC20Metadata": [ 27166 ], "IERC721": [ 23745 ], "IInstanceOperatorService": [ 23629 ], "IInstanceService": [ 22849 ], "IOracleService": [ 23755 ], "IPolicy": [ 20837 ], "IPool": [ 21652 ], "IProduct": [ 21995 ], "IProductService": [ 23900 ], "IRegistry": [ 21750 ], "IRiskpoolService": [ 24006 ], "ITreasury": [ 23443 ], "Ownable": [ 20950 ], "TestCompromisedProduct": [ 15965 ] }, "id": 15966, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 15444, "literals": [ "solidity", "0.8", ".2" ], "nodeType": "PragmaDirective", "src": "39:22:94" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IComponent.sol", "file": "@etherisc/gif-interface/contracts/components/IComponent.sol", "id": 15445, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 22100, "src": "63:69:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IProduct.sol", "file": "@etherisc/gif-interface/contracts/components/IProduct.sol", "id": 15446, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 21996, "src": "133:67:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IAccess.sol", "file": "@etherisc/gif-interface/contracts/modules/IAccess.sol", "id": 15447, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 21939, "src": "202:63:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPolicy.sol", "file": "@etherisc/gif-interface/contracts/modules/IPolicy.sol", "id": 15448, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 20838, "src": "266:63:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IRegistry.sol", "file": "@etherisc/gif-interface/contracts/modules/IRegistry.sol", "id": 15449, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 21751, "src": "330:65:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IComponentOwnerService.sol", "file": "@etherisc/gif-interface/contracts/services/IComponentOwnerService.sol", "id": 15450, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 23479, "src": "397:79:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IProductService.sol", "file": "@etherisc/gif-interface/contracts/services/IProductService.sol", "id": 15451, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 23901, "src": "477:72:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/services/IInstanceService.sol", "file": "@etherisc/gif-interface/contracts/services/IInstanceService.sol", "id": 15452, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 22850, "src": "550:73:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/access/Ownable.sol", "file": "@openzeppelin/contracts/access/Ownable.sol", "id": 15453, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 20951, "src": "625:52:94", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC20/ERC20.sol", "file": "@openzeppelin/contracts/token/ERC20/ERC20.sol", "id": 15454, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 15966, "sourceUnit": 21537, "src": "678:55:94", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 15455, "name": "IProduct", "nodeType": "IdentifierPath", "referencedDeclaration": 21995, "src": "1130:8:94" }, "id": 15456, "nodeType": "InheritanceSpecifier", "src": "1130:8:94" }, { "baseName": { "id": 15457, "name": "Ownable", "nodeType": "IdentifierPath", "referencedDeclaration": 20950, "src": "1144:7:94" }, "id": 15458, "nodeType": "InheritanceSpecifier", "src": "1144:7:94" } ], "contractDependencies": [ 20950, 21995, 22099, 24074 ], "contractKind": "contract", "fullyImplemented": true, "id": 15965, "linearizedBaseContracts": [ 15965, 20950, 24074, 21995, 22099 ], "name": "TestCompromisedProduct", "nameLocation": "1099:22:94", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "functionSelector": "3b5284b6", "id": 15464, "mutability": "constant", "name": "FAKE_STATE", "nameLocation": "1201:10:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1159:87:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_ComponentState_$22010", "typeString": "enum IComponent.ComponentState" }, "typeName": { "id": 15460, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 15459, "name": "IComponent.ComponentState", "nodeType": "IdentifierPath", "referencedDeclaration": 22010, "src": "1159:25:94" }, "referencedDeclaration": 22010, "src": "1159:25:94", "typeDescriptions": { "typeIdentifier": "t_enum$_ComponentState_$22010", "typeString": "enum IComponent.ComponentState" } }, "value": { "expression": { "expression": { "id": 15461, "name": "IComponent", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22099, "src": "1214:10:94", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IComponent_$22099_$", "typeString": "type(contract IComponent)" } }, "id": 15462, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "ComponentState", "nodeType": "MemberAccess", "referencedDeclaration": 22010, "src": "1214:25:94", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_ComponentState_$22010_$", "typeString": "type(enum IComponent.ComponentState)" } }, "id": 15463, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "Active", "nodeType": "MemberAccess", "referencedDeclaration": 22006, "src": "1214:32:94", "typeDescriptions": { "typeIdentifier": "t_enum$_ComponentState_$22010", "typeString": "enum IComponent.ComponentState" } }, "visibility": "public" }, { "constant": true, "functionSelector": "09128d83", "id": 15467, "mutability": "constant", "name": "POLICY_FLOW", "nameLocation": "1281:11:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1257:57:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 15465, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1257:7:94", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "hexValue": "506f6c69637944656661756c74466c6f77", "id": 15466, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1295:19:94", "typeDescriptions": { "typeIdentifier": "t_stringliteral_4c6194c52a3447410e4616772f780a88c4ac5f0b731d2fc7e7979c603182714e", "typeString": "literal_string \"PolicyDefaultFlow\"" }, "value": "PolicyDefaultFlow" }, "visibility": "public" }, { "constant": false, "id": 15469, "mutability": "mutable", "name": "_componentName", "nameLocation": "1337:14:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1321:30:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 15468, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1321:7:94", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "private" }, { "constant": false, "id": 15471, "mutability": "mutable", "name": "_tokenAddress", "nameLocation": "1373:13:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1357:29:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 15470, "name": "address", "nodeType": "ElementaryTypeName", "src": "1357:7:94", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "private" }, { "constant": false, "id": 15473, "mutability": "mutable", "name": "_componentId", "nameLocation": "1408:12:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1392:28:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 15472, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1392:7:94", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "private" }, { "constant": false, "id": 15475, "mutability": "mutable", "name": "_riskpoolId", "nameLocation": "1442:11:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1426:27:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 15474, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1426:7:94", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "private" }, { "constant": false, "id": 15478, "mutability": "mutable", "name": "_registry", "nameLocation": "1482:9:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1464:27:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IRegistry_$21750", "typeString": "contract IRegistry" }, "typeName": { "id": 15477, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 15476, "name": "IRegistry", "nodeType": "IdentifierPath", "referencedDeclaration": 21750, "src": "1464:9:94" }, "referencedDeclaration": 21750, "src": "1464:9:94", "typeDescriptions": { "typeIdentifier": "t_contract$_IRegistry_$21750", "typeString": "contract IRegistry" } }, "visibility": "private" }, { "constant": false, "id": 15481, "mutability": "mutable", "name": "_access", "nameLocation": "1513:7:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1497:23:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IAccess_$21938", "typeString": "contract IAccess" }, "typeName": { "id": 15480, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 15479, "name": "IAccess", "nodeType": "IdentifierPath", "referencedDeclaration": 21938, "src": "1497:7:94" }, "referencedDeclaration": 21938, "src": "1497:7:94", "typeDescriptions": { "typeIdentifier": "t_contract$_IAccess_$21938", "typeString": "contract IAccess" } }, "visibility": "private" }, { "constant": false, "id": 15484, "mutability": "mutable", "name": "_componentOwnerService", "nameLocation": "1557:22:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1526:53:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IComponentOwnerService_$23478", "typeString": "contract IComponentOwnerService" }, "typeName": { "id": 15483, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 15482, "name": "IComponentOwnerService", "nodeType": "IdentifierPath", "referencedDeclaration": 23478, "src": "1526:22:94" }, "referencedDeclaration": 23478, "src": "1526:22:94", "typeDescriptions": { "typeIdentifier": "t_contract$_IComponentOwnerService_$23478", "typeString": "contract IComponentOwnerService" } }, "visibility": "private" }, { "constant": false, "id": 15487, "mutability": "mutable", "name": "_instanceService", "nameLocation": "1610:16:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1585:41:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IInstanceService_$22849", "typeString": "contract IInstanceService" }, "typeName": { "id": 15486, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 15485, "name": "IInstanceService", "nodeType": "IdentifierPath", "referencedDeclaration": 22849, "src": "1585:16:94" }, "referencedDeclaration": 22849, "src": "1585:16:94", "typeDescriptions": { "typeIdentifier": "t_contract$_IInstanceService_$22849", "typeString": "contract IInstanceService" } }, "visibility": "private" }, { "constant": false, "id": 15489, "mutability": "mutable", "name": "_policyFlow", "nameLocation": "1648:11:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1632:27:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 15488, "name": "address", "nodeType": "ElementaryTypeName", "src": "1632:7:94", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "private" }, { "constant": false, "id": 15492, "mutability": "mutable", "name": "_productService", "nameLocation": "1689:15:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1665:39:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_IProductService_$23900", "typeString": "contract IProductService" }, "typeName": { "id": 15491, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 15490, "name": "IProductService", "nodeType": "IdentifierPath", "referencedDeclaration": 23900, "src": "1665:15:94" }, "referencedDeclaration": 23900, "src": "1665:15:94", "typeDescriptions": { "typeIdentifier": "t_contract$_IProductService_$23900", "typeString": "contract IProductService" } }, "visibility": "private" }, { "constant": false, "id": 15494, "mutability": "mutable", "name": "_policies", "nameLocation": "1727:9:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1711:25:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 15493, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1711:7:94", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "private" }, { "constant": false, "id": 15496, "mutability": "mutable", "name": "_claims", "nameLocation": "1758:7:94", "nodeType": "VariableDeclaration", "scope": 15965, "src": "1742:23:94", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 15495, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1742:7:94", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "private" }, { "body": { "id": 15517, "nodeType": "Block", "src": "1816:217:94", "statements": [ { "assignments": [ 15501 ], "declarations": [ { "constant": false, "id": 15501, "mutability": "mutable", "name": "policyHolder", "nameLocation": "1834:12:94", "nodeType": "VariableDeclaration", "scope": 15517, "src": "1826:20:94", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 15500, "name": "address", "nodeType": "ElementaryTypeName", "src": "1826:7:94", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "id": 15507, "initialValue": { "expression": { "arguments": [ { "id": 15504, "name": "policyId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15498, "src": "1878:8:94", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "id": 15502, "name": "_instanceService", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15487, "src": "1849:16:94", "typeDescriptions": { "typeIdentifier": "t_contract$_IInstanceService_$22849", "typeString": "contract IInstanceService" } }, "id": 15503, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "getMetadata", "nodeType": "MemberAccess", "referencedDeclaration": 22768, "src": "1849:28:94", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_struct$_Metadata_$20652_memory_ptr_$", "typeString": "function (bytes32) view external returns (struct IPolicy.Metadata memory)" } }, "id": 15505, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1849:38:94", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_struct$_Metadata_$20652_memory_ptr", "typeString": "struct IPolicy.Metadata memory" } }, "id": 15506, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "owner", "nodeType": "MemberAccess", "referencedDeclaration": 20640, "src": "1849:44:94", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "VariableDeclarationStatement", "src": "1826:67:94" }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 15512, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [], "expression": { "argumentTypes": [], "id": 15509, "name": "_msgSender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24064, "src": "1924:10:94", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 15510, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1924:12:94", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "id": 15511, "name": "policyHolder", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15501, "src": "1940:12:94", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1924:28:94", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "4552524f523a5443502d313a494e56414c49445f504f4c4943595f4f525f484f4c444552", "id": 15513, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1967:38:94", "typeDescriptions": { "typeIdentifier": "t_stringliteral_45b7c023a985c9e867fb92bc16a50e3a4287536d298108f611ee335f5fdad6ba", "typeString": "literal_string \"ERROR:TCP-1:INVALID_POLICY_OR_HOLDER\"" }, "value": "ERROR:TCP-1:INVALID_POLICY_OR_HOLDER" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_45b7c023a985c9e867fb92bc16a50e3a4287536d298108f611ee335f5fdad6ba", "typeString": "literal_string \"ERROR:TCP-1:INVALID_POLICY_OR_HOLDER\"" } ], "id": 15508, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1903:7:94", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 15514, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1903:112:94", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 15515, "nodeType": "ExpressionStatement", "src": "1903:112:94" }, { "id": 15516, "nodeType": "PlaceholderStatement", "src": "2025:1:94" } ] }, "id": 15518, "name": "onlyPolicyHolder", "nameLocation": "1781:16:94", "nodeType": "ModifierDefinition", "parameters": { "id": 15499, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 15498, "mutability": "mutable", "name": "policyId", "nameLocation": "1806:8:94", "nodeType": "VariableDeclaration", "scope": 15518, "src": "1798:16:94", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 15497, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1798:7:94", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" } ], "src": "1797:18:94" }, "src": "1772:261:94", "virtual": false, "visibility": "internal" }, { "body": { "id": 15581, "nodeType": "Block", "src": "2240:463:94", "statements": [ { "expression": { "id": 15535, "isConstant": false, "isLValue": false, "isPure":