UNPKG

@etherisc/gif-contracts

Version:

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

1,473 lines (1,472 loc) 1.77 MB
{ "abi": [ { "inputs": [ { "internalType": "address", "name": "_registry", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "NAME", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "expectedPremiumAmount", "type": "uint256" }, { "internalType": "uint256", "name": "sumInsuredAmount", "type": "uint256" } ], "name": "adjustPremiumSumInsured", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "requestId", "type": "uint256" } ], "name": "cancelRequest", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "close", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimId", "type": "uint256" } ], "name": "closeClaim", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "collectPremium", "outputs": [ { "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "uint256", "name": "feeAmount", "type": "uint256" }, { "internalType": "uint256", "name": "netPremiumAmount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimId", "type": "uint256" }, { "internalType": "uint256", "name": "confirmedAmount", "type": "uint256" } ], "name": "confirmClaim", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "decline", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimId", "type": "uint256" } ], "name": "declineClaim", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "expire", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "getApplicationData", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimId", "type": "uint256" } ], "name": "getClaimData", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "_contractName", "type": "bytes32" } ], "name": "getContractFromRegistry", "outputs": [ { "internalType": "address", "name": "_addr", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "payoutId", "type": "uint256" } ], "name": "getPayoutData", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "premiumAmount", "type": "uint256" }, { "internalType": "uint256", "name": "sumInsuredAmount", "type": "uint256" }, { "internalType": "bytes", "name": "metaData", "type": "bytes" }, { "internalType": "bytes", "name": "applicationData", "type": "bytes" } ], "name": "newApplication", "outputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimAmount", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "newClaim", "outputs": [ { "internalType": "uint256", "name": "claimId", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "claimId", "type": "uint256" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "newPayout", "outputs": [ { "internalType": "uint256", "name": "payoutId", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "uint256", "name": "payoutId", "type": "uint256" } ], "name": "processPayout", "outputs": [ { "internalType": "bool", "name": "success", "type": "bool" }, { "internalType": "uint256", "name": "feeAmount", "type": "uint256" }, { "internalType": "uint256", "name": "netPayoutAmount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "registry", "outputs": [ { "internalType": "contract IRegistry", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" }, { "internalType": "bytes", "name": "_input", "type": "bytes" }, { "internalType": "string", "name": "_callbackMethodName", "type": "string" }, { "internalType": "address", "name": "_callbackContractAddress", "type": "address" }, { "internalType": "uint256", "name": "_responsibleOracleId", "type": "uint256" } ], "name": "request", "outputs": [ { "internalType": "uint256", "name": "_requestId", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "revoke", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bytes32", "name": "processId", "type": "bytes32" } ], "name": "underwrite", "outputs": [ { "internalType": "bool", "name": "success", "type": "bool" } ], "stateMutability": "nonpayable", "type": "function" } ], "allSourcePaths": { "10": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/proxy/utils/Initializable.sol", "101": "contracts/tokens/BundleToken.sol", "11": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/security/Pausable.sol", "13": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC20/IERC20.sol", "17": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/ERC721.sol", "18": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721.sol", "19": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/IERC721Receiver.sol", "20": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/token/ERC721/extensions/IERC721Metadata.sol", "21": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Address.sol", "22": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Context.sol", "24": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/Strings.sol", "25": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/introspection/ERC165.sol", "26": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/introspection/IERC165.sol", "27": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/utils/structs/EnumerableSet.sol", "30": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IComponent.sol", "31": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IOracle.sol", "32": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IProduct.sol", "33": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IRiskpool.sol", "37": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IAccess.sol", "38": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IBundle.sol", "39": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IComponentEvents.sol", "4": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/access/Ownable.sol", "41": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPolicy.sol", "42": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPool.sol", "43": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IQuery.sol", "44": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IRegistry.sol", "45": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/ITreasury.sol", "53": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/tokens/IBundleToken.sol", "72": "contracts/flows/PolicyDefaultFlow.sol", "74": "contracts/modules/BundleController.sol", "75": "contracts/modules/ComponentController.sol", "77": "contracts/modules/PolicyController.sol", "78": "contracts/modules/PoolController.sol", "79": "contracts/modules/QueryModule.sol", "81": "contracts/modules/TreasuryModule.sol", "88": "contracts/shared/CoreController.sol", "90": "contracts/shared/TransferHelper.sol", "91": "contracts/shared/WithRegistry.sol" }, "ast": { "absolutePath": "contracts/flows/PolicyDefaultFlow.sol", "exportedSymbols": { "Address": [ 26374 ], "BundleController": [ 5504 ], "BundleToken": [ 17246 ], "ComponentController": [ 6504 ], "Context": [ 24074 ], "CoreController": [ 14924 ], "ERC165": [ 26079 ], "ERC721": [ 24987 ], "EnumerableSet": [ 19390 ], "IAccess": [ 21938 ], "IBundle": [ 20491 ], "IBundleToken": [ 24052 ], "IComponent": [ 22099 ], "IComponentEvents": [ 22419 ], "IComponentOwnerService": [ 23478 ], "IERC165": [ 27203 ], "IERC20": [ 18510 ], "IERC721": [ 23745 ], "IERC721Metadata": [ 27618 ], "IERC721Receiver": [ 27591 ], "IInstanceOperatorService": [ 23629 ], "IInstanceService": [ 22849 ], "IOracle": [ 22133 ], "IOracleService": [ 23755 ], "IPolicy": [ 20837 ], "IPool": [ 21652 ], "IProduct": [ 21995 ], "IProductService": [ 23900 ], "IQuery": [ 22500 ], "IRegistry": [ 21750 ], "IRiskpool": [ 22366 ], "IRiskpoolService": [ 24006 ], "ITreasury": [ 23443 ], "Initializable": [ 18432 ], "Ownable": [ 20950 ], "Pausable": [ 23183 ], "PolicyController": [ 8529 ], "PolicyDefaultFlow": [ 3987 ], "PoolController": [ 9719 ], "QueryModule": [ 10106 ], "Strings": [ 23075 ], "TransferHelper": [ 15170 ], "TreasuryModule": [ 12127 ], "WithRegistry": [ 15290 ] }, "id": 3988, "license": "Apache-2.0", "nodeType": "SourceUnit", "nodes": [ { "id": 3098, "literals": [ "solidity", "0.8", ".2" ], "nodeType": "PragmaDirective", "src": "39:22:72" }, { "absolutePath": "contracts/modules/ComponentController.sol", "file": "../modules/ComponentController.sol", "id": 3099, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 6505, "src": "63:44:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/modules/PoolController.sol", "file": "../modules/PoolController.sol", "id": 3100, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 9720, "src": "108:39:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/modules/PolicyController.sol", "file": "../modules/PolicyController.sol", "id": 3101, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 8530, "src": "148:41:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/modules/QueryModule.sol", "file": "../modules/QueryModule.sol", "id": 3102, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 10107, "src": "190:36:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/modules/TreasuryModule.sol", "file": "../modules/TreasuryModule.sol", "id": 3103, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 12128, "src": "227:39:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/shared/WithRegistry.sol", "file": "../shared/WithRegistry.sol", "id": 3104, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 15291, "src": "267:36:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPolicy.sol", "file": "@etherisc/gif-interface/contracts/modules/IPolicy.sol", "id": 3105, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 20838, "src": "305:63:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IRegistry.sol", "file": "@etherisc/gif-interface/contracts/modules/IRegistry.sol", "id": 3106, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 21751, "src": "435:65:72", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPool.sol", "file": "@etherisc/gif-interface/contracts/modules/IPool.sol", "id": 3107, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 3988, "sourceUnit": 21653, "src": "501:61:72", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "baseName": { "id": 3108, "name": "WithRegistry", "nodeType": "IdentifierPath", "referencedDeclaration": 15290, "src": "600:12:72" }, "id": 3109, "nodeType": "InheritanceSpecifier", "src": "600:12:72" } ], "contractDependencies": [ 15290 ], "contractKind": "contract", "fullyImplemented": true, "id": 3987, "linearizedBaseContracts": [ 3987, 15290 ], "name": "PolicyDefaultFlow", "nameLocation": "574:17:72", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "functionSelector": "a3f4df7e", "id": 3112, "mutability": "constant", "name": "NAME", "nameLocation": "644:4:72", "nodeType": "VariableDeclaration", "scope": 3987, "src": "620:50:72", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 3110, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "620:7:72", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "hexValue": "506f6c69637944656661756c74466c6f77", "id": 3111, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "651:19:72", "typeDescriptions": { "typeIdentifier": "t_stringliteral_4c6194c52a3447410e4616772f780a88c4ac5f0b731d2fc7e7979c603182714e", "typeString": "literal_string \"PolicyDefaultFlow\"" }, "value": "PolicyDefaultFlow" }, "visibility": "public" }, { "body": { "id": 3136, "nodeType": "Block", "src": "722:224:72", "statements": [ { "assignments": [ 3118 ], "declarations": [ { "constant": false, "id": 3118, "mutability": "mutable", "name": "policy", "nameLocation": "749:6:72", "nodeType": "VariableDeclaration", "scope": 3136, "src": "732:23:72", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" }, "typeName": { "id": 3117, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 3116, "name": "PolicyController", "nodeType": "IdentifierPath", "referencedDeclaration": 8529, "src": "732:16:72" }, "referencedDeclaration": 8529, "src": "732:16:72", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" } }, "visibility": "internal" } ], "id": 3121, "initialValue": { "arguments": [], "expression": { "argumentTypes": [], "id": 3119, "name": "getPolicyContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3960, "src": "758:17:72", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_PolicyController_$8529_$", "typeString": "function () view returns (contract PolicyController)" } }, "id": 3120, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "758:19:72", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" } }, "nodeType": "VariableDeclarationStatement", "src": "732:45:72" }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_enum$_PolicyState_$20630", "typeString": "enum IPolicy.PolicyState" }, "id": 3131, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "arguments": [ { "id": 3125, "name": "processId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3114, "src": "825:9:72", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "id": 3123, "name": "policy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3118, "src": "808:6:72", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" } }, "id": 3124, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "getPolicy", "nodeType": "MemberAccess", "referencedDeclaration": 8442, "src": "808:16:72", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_struct$_Policy_$20686_memory_ptr_$", "typeString": "function (bytes32) view external returns (struct IPolicy.Policy memory)" } }, "id": 3126, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "808:27:72", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_struct$_Policy_$20686_memory_ptr", "typeString": "struct IPolicy.Policy memory" } }, "id": 3127, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "state", "nodeType": "MemberAccess", "referencedDeclaration": 20669, "src": "808:33:72", "typeDescriptions": { "typeIdentifier": "t_enum$_PolicyState_$20630", "typeString": "enum IPolicy.PolicyState" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "expression": { "id": 3128, "name": "IPolicy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20837, "src": "845:7:72", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IPolicy_$20837_$", "typeString": "type(contract IPolicy)" } }, "id": 3129, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "PolicyState", "nodeType": "MemberAccess", "referencedDeclaration": 20630, "src": "845:19:72", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_PolicyState_$20630_$", "typeString": "type(enum IPolicy.PolicyState)" } }, "id": 3130, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "Active", "nodeType": "MemberAccess", "referencedDeclaration": 20627, "src": "845:26:72", "typeDescriptions": { "typeIdentifier": "t_enum$_PolicyState_$20630", "typeString": "enum IPolicy.PolicyState" } }, "src": "808:63:72", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "4552524f523a5046442d3030313a504f4c4943595f4e4f545f414354495645", "id": 3132, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "885:33:72", "typeDescriptions": { "typeIdentifier": "t_stringliteral_9b1cef90b481c0b75b84bee986adfe33e860c5dd41a12fda22045023a52d80d2", "typeString": "literal_string \"ERROR:PFD-001:POLICY_NOT_ACTIVE\"" }, "value": "ERROR:PFD-001:POLICY_NOT_ACTIVE" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_9b1cef90b481c0b75b84bee986adfe33e860c5dd41a12fda22045023a52d80d2", "typeString": "literal_string \"ERROR:PFD-001:POLICY_NOT_ACTIVE\"" } ], "id": 3122, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "787:7:72", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 3133, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "787:141:72", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3134, "nodeType": "ExpressionStatement", "src": "787:141:72" }, { "id": 3135, "nodeType": "PlaceholderStatement", "src": "938:1:72" } ] }, "id": 3137, "name": "onlyActivePolicy", "nameLocation": "686:16:72", "nodeType": "ModifierDefinition", "parameters": { "id": 3115, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3114, "mutability": "mutable", "name": "processId", "nameLocation": "711:9:72", "nodeType": "VariableDeclaration", "scope": 3137, "src": "703:17:72", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 3113, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "703:7:72", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" } ], "src": "702:19:72" }, "src": "677:269:72", "virtual": false, "visibility": "internal" }, { "body": { "id": 3161, "nodeType": "Block", "src": "998:226:72", "statements": [ { "assignments": [ 3143 ], "declarations": [ { "constant": false, "id": 3143, "mutability": "mutable", "name": "policy", "nameLocation": "1025:6:72", "nodeType": "VariableDeclaration", "scope": 3161, "src": "1008:23:72", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" }, "typeName": { "id": 3142, "nodeType": "UserDefinedTypeName", "pathNode": { "id": 3141, "name": "PolicyController", "nodeType": "IdentifierPath", "referencedDeclaration": 8529, "src": "1008:16:72" }, "referencedDeclaration": 8529, "src": "1008:16:72", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" } }, "visibility": "internal" } ], "id": 3146, "initialValue": { "arguments": [], "expression": { "argumentTypes": [], "id": 3144, "name": "getPolicyContract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3960, "src": "1034:17:72", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_contract$_PolicyController_$8529_$", "typeString": "function () view returns (contract PolicyController)" } }, "id": 3145, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1034:19:72", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" } }, "nodeType": "VariableDeclarationStatement", "src": "1008:45:72" }, { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_enum$_PolicyState_$20630", "typeString": "enum IPolicy.PolicyState" }, "id": 3156, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "arguments": [ { "id": 3150, "name": "processId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3139, "src": "1101:9:72", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "id": 3148, "name": "policy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3143, "src": "1084:6:72", "typeDescriptions": { "typeIdentifier": "t_contract$_PolicyController_$8529", "typeString": "contract PolicyController" } }, "id": 3149, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "getPolicy", "nodeType": "MemberAccess", "referencedDeclaration": 8442, "src": "1084:16:72", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_struct$_Policy_$20686_memory_ptr_$", "typeString": "function (bytes32) view external returns (struct IPolicy.Policy memory)" } }, "id": 3151, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1084:27:72", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_struct$_Policy_$20686_memory_ptr", "typeString": "struct IPolicy.Policy memory" } }, "id": 3152, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "state", "nodeType": "MemberAccess", "referencedDeclaration": 20669, "src": "1084:33:72", "typeDescriptions": { "typeIdentifier": "t_enum$_PolicyState_$20630", "typeString": "enum IPolicy.PolicyState" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "expression": { "expression": { "id": 3153, "name": "IPolicy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20837, "src": "1121:7:72", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_IPolicy_$20837_$", "typeString": "type(contract IPolicy)" } }, "id": 3154, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "PolicyState", "nodeType": "MemberAccess", "referencedDeclaration": 20630, "src": "1121:19:72", "typeDescriptions": { "typeIdentifier": "t_type$_t_enum$_PolicyState_$20630_$", "typeString": "type(enum IPolicy.PolicyState)" } }, "id": 3155, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "Expired", "nodeType": "MemberAccess", "referencedDeclaration": 20628, "src": "1121:27:72", "typeDescriptions": { "typeIdentifier": "t_enum$_PolicyState_$20630", "typeString": "enum IPolicy.PolicyState" } }, "src": "1084:64:72", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "4552524f523a5046442d3030323a504f4c4943595f4e4f545f45585049524544", "id": 3157, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1162:34:72", "typeDescriptions": { "typeIdentifier": "t_stringliteral_18e20048df1336701316840c9034a9ef82a2e25efaf59ab47262e1bc60a26085", "typeString": "literal_string \"ERROR:PFD-002:POLICY_NOT_EXPIRED\"" }, "value": "ERROR:PFD-002:POLICY_NOT_EXPIRED" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_18e20048df1336701316840c9034a9ef82a2e25efaf59ab47262e1bc60a26085", "typeString": "literal_string \"ERROR:PFD-002:POLICY_NOT_EXPIRED\"" } ], "id": 3147, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "1063:7:72", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 3158, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall",