{
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "activeBundles",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "name": "LogBasicRiskpoolBundlesAndPolicies",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "index",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "maxAmount",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "collateralAmount",
          "type": "uint256"
        }
      ],
      "name": "LogBasicRiskpoolCandidateBundleAmountCheck",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentApproved",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentArchived",
      "type": "event"
    },
    {
      "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": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentDeclined",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentPaused",
      "type": "event"
    },
    {
      "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": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentProposed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentResumed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "enum IComponent.ComponentState",
          "name": "stateOld",
          "type": "uint8"
        },
        {
          "indexed": false,
          "internalType": "enum IComponent.ComponentState",
          "name": "stateNew",
          "type": "uint8"
        }
      ],
      "name": "LogComponentStateChanged",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentSuspended",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogComponentUnpaused",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolApproved",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolBundleCreated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "bool",
          "name": "isMatching",
          "type": "bool"
        }
      ],
      "name": "LogRiskpoolBundleMatchesPolicy",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "collateralAmount",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "bool",
          "name": "isSecured",
          "type": "bool"
        }
      ],
      "name": "LogRiskpoolCollateralLocked",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "collateralAmount",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolCollateralReleased",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "riskpoolAddress",
          "type": "address"
        }
      ],
      "name": "LogRiskpoolCreated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolDeclined",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolPayoutProcessed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolPremiumProcessed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "id",
          "type": "uint256"
        }
      ],
      "name": "LogRiskpoolProposed",
      "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": "DEFAULT_FILTER_DATA_STRUCTURE",
      "outputs": [
        {
          "internalType": "string",
          "name": "",
          "type": "string"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "FULL_COLLATERALIZATION_LEVEL",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "activeBundles",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "approvalCallback",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "archiveCallback",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "id",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "riskpoolId",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "tokenId",
              "type": "uint256"
            },
            {
              "internalType": "enum IBundle.BundleState",
              "name": "state",
              "type": "uint8"
            },
            {
              "internalType": "bytes",
              "name": "filter",
              "type": "bytes"
            },
            {
              "internalType": "uint256",
              "name": "capital",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "lockedCapital",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "balance",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "createdAt",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "updatedAt",
              "type": "uint256"
            }
          ],
          "internalType": "struct IBundle.Bundle",
          "name": "bundle",
          "type": "tuple"
        },
        {
          "components": [
            {
              "internalType": "enum IPolicy.ApplicationState",
              "name": "state",
              "type": "uint8"
            },
            {
              "internalType": "uint256",
              "name": "premiumAmount",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "sumInsuredAmount",
              "type": "uint256"
            },
            {
              "internalType": "bytes",
              "name": "data",
              "type": "bytes"
            },
            {
              "internalType": "uint256",
              "name": "createdAt",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "updatedAt",
              "type": "uint256"
            }
          ],
          "internalType": "struct IPolicy.Application",
          "name": "application",
          "type": "tuple"
        }
      ],
      "name": "bundleMatchesApplication",
      "outputs": [
        {
          "internalType": "bool",
          "name": "isMatching",
          "type": "bool"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "bundles",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "name": "burnBundle",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "name": "closeBundle",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "internalType": "uint256",
          "name": "collateralAmount",
          "type": "uint256"
        }
      ],
      "name": "collateralizePolicy",
      "outputs": [
        {
          "internalType": "bool",
          "name": "success",
          "type": "bool"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "bytes",
          "name": "filter",
          "type": "bytes"
        },
        {
          "internalType": "uint256",
          "name": "initialAmount",
          "type": "uint256"
        }
      ],
      "name": "createBundle",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "declineCallback",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "defundBundle",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "netAmount",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "fundBundle",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "netAmount",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "idx",
          "type": "uint256"
        }
      ],
      "name": "getActiveBundleId",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getBalance",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "idx",
          "type": "uint256"
        }
      ],
      "name": "getBundle",
      "outputs": [
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "id",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "riskpoolId",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "tokenId",
              "type": "uint256"
            },
            {
              "internalType": "enum IBundle.BundleState",
              "name": "state",
              "type": "uint8"
            },
            {
              "internalType": "bytes",
              "name": "filter",
              "type": "bytes"
            },
            {
              "internalType": "uint256",
              "name": "capital",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "lockedCapital",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "balance",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "createdAt",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "updatedAt",
              "type": "uint256"
            }
          ],
          "internalType": "struct IBundle.Bundle",
          "name": "",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getCapacity",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getCapital",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getCollateralizationLevel",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getErc20Token",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getFilterDataStructure",
      "outputs": [
        {
          "internalType": "string",
          "name": "",
          "type": "string"
        }
      ],
      "stateMutability": "pure",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getFullCollateralizationLevel",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "pure",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getId",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getMaximumNumberOfActiveBundles",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "maximumNumberOfActiveBundles",
          "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": "getRegistry",
      "outputs": [
        {
          "internalType": "contract IRegistry",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getState",
      "outputs": [
        {
          "internalType": "enum IComponent.ComponentState",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getSumOfSumInsuredCap",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getTotalValueLocked",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getType",
      "outputs": [
        {
          "internalType": "enum IComponent.ComponentType",
          "name": "",
          "type": "uint8"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getWallet",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "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": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "name": "lockBundle",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "owner",
      "outputs": [
        {
          "internalType": "address",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "pauseCallback",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "processPolicyPayout",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        },
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "processPolicyPremium",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "proposalCallback",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "bytes32",
          "name": "processId",
          "type": "bytes32"
        }
      ],
      "name": "releasePolicy",
      "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": "id",
          "type": "uint256"
        }
      ],
      "name": "setId",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "maximumNumberOfActiveBundles",
          "type": "uint256"
        }
      ],
      "name": "setMaximumNumberOfActiveBundles",
      "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": [
        {
          "internalType": "uint256",
          "name": "bundleId",
          "type": "uint256"
        }
      ],
      "name": "unlockBundle",
      "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",
    "28": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/BasicRiskpool.sol",
    "29": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/Component.sol",
    "30": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IComponent.sol",
    "33": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/IRiskpool.sol",
    "36": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/Riskpool.sol",
    "37": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IAccess.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",
    "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"
  },
  "ast": {
    "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/BasicRiskpool.sol",
    "exportedSymbols": {
      "BasicRiskpool": [
        20307
      ],
      "Component": [
        25407
      ],
      "Context": [
        24074
      ],
      "IAccess": [
        21938
      ],
      "IBundle": [
        20491
      ],
      "IBundleToken": [
        24052
      ],
      "IComponent": [
        22099
      ],
      "IComponentEvents": [
        22419
      ],
      "IComponentOwnerService": [
        23478
      ],
      "IERC165": [
        27203
      ],
      "IERC20": [
        18510
      ],
      "IERC721": [
        23745
      ],
      "IInstanceOperatorService": [
        23629
      ],
      "IInstanceService": [
        22849
      ],
      "IOracleService": [
        23755
      ],
      "IPolicy": [
        20837
      ],
      "IPool": [
        21652
      ],
      "IProductService": [
        23900
      ],
      "IRegistry": [
        21750
      ],
      "IRiskpool": [
        22366
      ],
      "IRiskpoolService": [
        24006
      ],
      "ITreasury": [
        23443
      ],
      "Ownable": [
        20950
      ],
      "Riskpool": [
        27141
      ]
    },
    "id": 20308,
    "license": "Apache-2.0",
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 20020,
        "literals": [
          "solidity",
          "0.8",
          ".2"
        ],
        "nodeType": "PragmaDirective",
        "src": "40:22:28"
      },
      {
        "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/Riskpool.sol",
        "file": "./Riskpool.sol",
        "id": 20021,
        "nameLocation": "-1:-1:-1",
        "nodeType": "ImportDirective",
        "scope": 20308,
        "sourceUnit": 27142,
        "src": "66:24:28",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IBundle.sol",
        "file": "../modules/IBundle.sol",
        "id": 20022,
        "nameLocation": "-1:-1:-1",
        "nodeType": "ImportDirective",
        "scope": 20308,
        "sourceUnit": 20492,
        "src": "92:32:28",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "absolutePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/modules/IPolicy.sol",
        "file": "../modules/IPolicy.sol",
        "id": 20023,
        "nameLocation": "-1:-1:-1",
        "nodeType": "ImportDirective",
        "scope": 20308,
        "sourceUnit": 20838,
        "src": "126:32:28",
        "symbolAliases": [],
        "unitAlias": ""
      },
      {
        "abstract": true,
        "baseContracts": [
          {
            "baseName": {
              "id": 20024,
              "name": "Riskpool",
              "nodeType": "IdentifierPath",
              "referencedDeclaration": 27141,
              "src": "279:8:28"
            },
            "id": 20025,
            "nodeType": "InheritanceSpecifier",
            "src": "279:8:28"
          }
        ],
        "contractDependencies": [
          20950,
          22099,
          22366,
          22419,
          24074,
          25407,
          27141
        ],
        "contractKind": "contract",
        "fullyImplemented": false,
        "id": 20307,
        "linearizedBaseContracts": [
          20307,
          27141,
          25407,
          20950,
          24074,
          22419,
          22366,
          22099
        ],
        "name": "BasicRiskpool",
        "nameLocation": "262:13:28",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "anonymous": false,
            "id": 20031,
            "name": "LogBasicRiskpoolBundlesAndPolicies",
            "nameLocation": "303:34:28",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 20030,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20027,
                  "indexed": false,
                  "mutability": "mutable",
                  "name": "activeBundles",
                  "nameLocation": "346:13:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20031,
                  "src": "338:21:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20026,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "338:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20029,
                  "indexed": false,
                  "mutability": "mutable",
                  "name": "bundleId",
                  "nameLocation": "369:8:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20031,
                  "src": "361:16:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20028,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "361:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "337:41:28"
            },
            "src": "297:82:28"
          },
          {
            "anonymous": false,
            "id": 20041,
            "name": "LogBasicRiskpoolCandidateBundleAmountCheck",
            "nameLocation": "391:42:28",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 20040,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20033,
                  "indexed": false,
                  "mutability": "mutable",
                  "name": "index",
                  "nameLocation": "442:5:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20041,
                  "src": "434:13:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20032,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "434:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20035,
                  "indexed": false,
                  "mutability": "mutable",
                  "name": "bundleId",
                  "nameLocation": "457:8:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20041,
                  "src": "449:16:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20034,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "449:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20037,
                  "indexed": false,
                  "mutability": "mutable",
                  "name": "maxAmount",
                  "nameLocation": "475:9:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20041,
                  "src": "467:17:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20036,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "467:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20039,
                  "indexed": false,
                  "mutability": "mutable",
                  "name": "collateralAmount",
                  "nameLocation": "494:16:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20041,
                  "src": "486:24:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20038,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "486:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "433:78:28"
            },
            "src": "385:127:28"
          },
          {
            "constant": false,
            "id": 20045,
            "mutability": "mutable",
            "name": "_collateralizedBy",
            "nameLocation": "745:17:28",
            "nodeType": "VariableDeclaration",
            "scope": 20307,
            "src": "676:86:28",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
              "typeString": "mapping(bytes32 => uint256)"
            },
            "typeName": {
              "id": 20044,
              "keyType": {
                "id": 20042,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "684:7:28",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              },
              "nodeType": "Mapping",
              "src": "676:59:28",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                "typeString": "mapping(bytes32 => uint256)"
              },
              "valueType": {
                "id": 20043,
                "name": "uint256",
                "nodeType": "ElementaryTypeName",
                "src": "711:7:28",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 20048,
            "mutability": "mutable",
            "name": "_policiesCounter",
            "nameLocation": "784:16:28",
            "nodeType": "VariableDeclaration",
            "scope": 20307,
            "src": "769:35:28",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint32",
              "typeString": "uint32"
            },
            "typeName": {
              "id": 20046,
              "name": "uint32",
              "nodeType": "ElementaryTypeName",
              "src": "769:6:28",
              "typeDescriptions": {
                "typeIdentifier": "t_uint32",
                "typeString": "uint32"
              }
            },
            "value": {
              "hexValue": "30",
              "id": 20047,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "803:1:28",
              "typeDescriptions": {
                "typeIdentifier": "t_rational_0_by_1",
                "typeString": "int_const 0"
              },
              "value": "0"
            },
            "visibility": "private"
          },
          {
            "body": {
              "id": 20071,
              "nodeType": "Block",
              "src": "1107:3:28",
              "statements": []
            },
            "id": 20072,
            "implemented": true,
            "kind": "constructor",
            "modifiers": [
              {
                "arguments": [
                  {
                    "id": 20063,
                    "name": "name",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 20050,
                    "src": "1027:4:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  {
                    "id": 20064,
                    "name": "collateralization",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 20052,
                    "src": "1033:17:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  {
                    "id": 20065,
                    "name": "sumOfSumInsuredCap",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 20054,
                    "src": "1052:18:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  {
                    "id": 20066,
                    "name": "erc20Token",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 20056,
                    "src": "1072:10:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  {
                    "id": 20067,
                    "name": "wallet",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 20058,
                    "src": "1084:6:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  {
                    "id": 20068,
                    "name": "registry",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 20060,
                    "src": "1092:8:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  }
                ],
                "id": 20069,
                "modifierName": {
                  "id": 20062,
                  "name": "Riskpool",
                  "nodeType": "IdentifierPath",
                  "referencedDeclaration": 27141,
                  "src": "1018:8:28"
                },
                "nodeType": "ModifierInvocation",
                "src": "1018:83:28"
              }
            ],
            "name": "",
            "nameLocation": "-1:-1:-1",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 20061,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20050,
                  "mutability": "mutable",
                  "name": "name",
                  "nameLocation": "843:4:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20072,
                  "src": "835:12:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 20049,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "835:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20052,
                  "mutability": "mutable",
                  "name": "collateralization",
                  "nameLocation": "866:17:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20072,
                  "src": "858:25:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20051,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "858:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20054,
                  "mutability": "mutable",
                  "name": "sumOfSumInsuredCap",
                  "nameLocation": "902:18:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20072,
                  "src": "894:26:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20053,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "894:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20056,
                  "mutability": "mutable",
                  "name": "erc20Token",
                  "nameLocation": "939:10:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20072,
                  "src": "931:18:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 20055,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "931:7:28",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20058,
                  "mutability": "mutable",
                  "name": "wallet",
                  "nameLocation": "968:6:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20072,
                  "src": "960:14:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 20057,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "960:7:28",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20060,
                  "mutability": "mutable",
                  "name": "registry",
                  "nameLocation": "993:8:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20072,
                  "src": "985:16:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_address",
                    "typeString": "address"
                  },
                  "typeName": {
                    "id": 20059,
                    "name": "address",
                    "nodeType": "ElementaryTypeName",
                    "src": "985:7:28",
                    "stateMutability": "nonpayable",
                    "typeDescriptions": {
                      "typeIdentifier": "t_address",
                      "typeString": "address"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "824:184:28"
            },
            "returnParameters": {
              "id": 20070,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1107:0:28"
            },
            "scope": 20307,
            "src": "813:297:28",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          },
          {
            "baseFunctions": [
              27119
            ],
            "body": {
              "id": 20236,
              "nodeType": "Block",
              "src": "1668:2266:28",
              "statements": [
                {
                  "assignments": [
                    20083
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 20083,
                      "mutability": "mutable",
                      "name": "activeBundles",
                      "nameLocation": "1687:13:28",
                      "nodeType": "VariableDeclaration",
                      "scope": 20236,
                      "src": "1679:21:28",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 20082,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "1679:7:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "visibility": "internal"
                    }
                  ],
                  "id": 20086,
                  "initialValue": {
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "id": 20084,
                      "name": "activeBundles",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 26971,
                      "src": "1703:13:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
                        "typeString": "function () view returns (uint256)"
                      }
                    },
                    "id": 20085,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1703:15:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1679:39:28"
                },
                {
                  "assignments": [
                    20088
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 20088,
                      "mutability": "mutable",
                      "name": "capital",
                      "nameLocation": "1737:7:28",
                      "nodeType": "VariableDeclaration",
                      "scope": 20236,
                      "src": "1729:15:28",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 20087,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "1729:7:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "visibility": "internal"
                    }
                  ],
                  "id": 20091,
                  "initialValue": {
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "id": 20089,
                      "name": "getCapital",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 27027,
                      "src": "1747:10:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
                        "typeString": "function () view returns (uint256)"
                      }
                    },
                    "id": 20090,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1747:12:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1729:30:28"
                },
                {
                  "assignments": [
                    20093
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 20093,
                      "mutability": "mutable",
                      "name": "lockedCapital",
                      "nameLocation": "1778:13:28",
                      "nodeType": "VariableDeclaration",
                      "scope": 20236,
                      "src": "1770:21:28",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 20092,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "1770:7:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "visibility": "internal"
                    }
                  ],
                  "id": 20096,
                  "initialValue": {
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "id": 20094,
                      "name": "getTotalValueLocked",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 27044,
                      "src": "1794:19:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
                        "typeString": "function () view returns (uint256)"
                      }
                    },
                    "id": 20095,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1794:21:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1770:45:28"
                },
                {
                  "eventCall": {
                    "arguments": [
                      {
                        "id": 20098,
                        "name": "activeBundles",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20083,
                        "src": "1868:13:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "id": 20099,
                        "name": "_policiesCounter",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20048,
                        "src": "1883:16:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      ],
                      "id": 20097,
                      "name": "LogBasicRiskpoolBundlesAndPolicies",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20031,
                      "src": "1833:34:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$returns$__$",
                        "typeString": "function (uint256,uint256)"
                      }
                    },
                    "id": 20100,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1833:67:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 20101,
                  "nodeType": "EmitStatement",
                  "src": "1828:72:28"
                },
                {
                  "expression": {
                    "arguments": [
                      {
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 20105,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "id": 20103,
                          "name": "activeBundles",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 20083,
                          "src": "1919:13:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "hexValue": "30",
                          "id": 20104,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "1935:1:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "1919:17:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "hexValue": "4552524f523a4252502d3030313a4e4f5f4143544956455f42554e444c4553",
                        "id": 20106,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1938:33:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_5f018d5c9d0ffbe4a6bed940729e864f2f328246ad7beca8b4bb8a10cde0ff08",
                          "typeString": "literal_string \"ERROR:BRP-001:NO_ACTIVE_BUNDLES\""
                        },
                        "value": "ERROR:BRP-001:NO_ACTIVE_BUNDLES"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_5f018d5c9d0ffbe4a6bed940729e864f2f328246ad7beca8b4bb8a10cde0ff08",
                          "typeString": "literal_string \"ERROR:BRP-001:NO_ACTIVE_BUNDLES\""
                        }
                      ],
                      "id": 20102,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        -18,
                        -18
                      ],
                      "referencedDeclaration": -18,
                      "src": "1911:7:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 20107,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1911:61:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 20108,
                  "nodeType": "ExpressionStatement",
                  "src": "1911:61:28"
                },
                {
                  "expression": {
                    "arguments": [
                      {
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 20112,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "id": 20110,
                          "name": "capital",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 20088,
                          "src": "1991:7:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": ">",
                        "rightExpression": {
                          "id": 20111,
                          "name": "lockedCapital",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 20093,
                          "src": "2001:13:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "1991:23:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "hexValue": "4552524f523a4252502d3030323a4e4f5f465245455f4341504954414c",
                        "id": 20113,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "2016:31:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_8666a6be95c8b59292bddcec1001319daf412450a7c966dd3f24e54df39de22a",
                          "typeString": "literal_string \"ERROR:BRP-002:NO_FREE_CAPITAL\""
                        },
                        "value": "ERROR:BRP-002:NO_FREE_CAPITAL"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_8666a6be95c8b59292bddcec1001319daf412450a7c966dd3f24e54df39de22a",
                          "typeString": "literal_string \"ERROR:BRP-002:NO_FREE_CAPITAL\""
                        }
                      ],
                      "id": 20109,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        -18,
                        -18
                      ],
                      "referencedDeclaration": -18,
                      "src": "1983:7:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 20114,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1983:65:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 20115,
                  "nodeType": "ExpressionStatement",
                  "src": "1983:65:28"
                },
                {
                  "condition": {
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 20120,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "id": 20116,
                      "name": "capital",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20088,
                      "src": "2124:7:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 20119,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "id": 20117,
                        "name": "lockedCapital",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20093,
                        "src": "2135:13:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "id": 20118,
                        "name": "collateralAmount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20076,
                        "src": "2151:16:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "2135:32:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2124:43:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 20235,
                  "nodeType": "IfStatement",
                  "src": "2121:1806:28",
                  "trueBody": {
                    "id": 20234,
                    "nodeType": "Block",
                    "src": "2169:1758:28",
                    "statements": [
                      {
                        "assignments": [
                          20125
                        ],
                        "declarations": [
                          {
                            "constant": false,
                            "id": 20125,
                            "mutability": "mutable",
                            "name": "application",
                            "nameLocation": "2211:11:28",
                            "nodeType": "VariableDeclaration",
                            "scope": 20234,
                            "src": "2184:38:28",
                            "stateVariable": false,
                            "storageLocation": "memory",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_Application_$20666_memory_ptr",
                              "typeString": "struct IPolicy.Application"
                            },
                            "typeName": {
                              "id": 20124,
                              "nodeType": "UserDefinedTypeName",
                              "pathNode": {
                                "id": 20123,
                                "name": "IPolicy.Application",
                                "nodeType": "IdentifierPath",
                                "referencedDeclaration": 20666,
                                "src": "2184:19:28"
                              },
                              "referencedDeclaration": 20666,
                              "src": "2184:19:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_Application_$20666_storage_ptr",
                                "typeString": "struct IPolicy.Application"
                              }
                            },
                            "visibility": "internal"
                          }
                        ],
                        "id": 20130,
                        "initialValue": {
                          "arguments": [
                            {
                              "id": 20128,
                              "name": "processId",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 20074,
                              "src": "2257:9:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            ],
                            "expression": {
                              "id": 20126,
                              "name": "_instanceService",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 26434,
                              "src": "2225:16:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_contract$_IInstanceService_$22849",
                                "typeString": "contract IInstanceService"
                              }
                            },
                            "id": 20127,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "getApplication",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 22776,
                            "src": "2225:31:28",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_external_view$_t_bytes32_$returns$_t_struct$_Application_$20666_memory_ptr_$",
                              "typeString": "function (bytes32) view external returns (struct IPolicy.Application memory)"
                            }
                          },
                          "id": 20129,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "2225:42:28",
                          "tryCall": false,
                          "typeDescriptions": {
                            "typeIdentifier": "t_struct$_Application_$20666_memory_ptr",
                            "typeString": "struct IPolicy.Application memory"
                          }
                        },
                        "nodeType": "VariableDeclarationStatement",
                        "src": "2184:83:28"
                      },
                      {
                        "assignments": [
                          20132
                        ],
                        "declarations": [
                          {
                            "constant": false,
                            "id": 20132,
                            "mutability": "mutable",
                            "name": "idx",
                            "nameLocation": "2368:3:28",
                            "nodeType": "VariableDeclaration",
                            "scope": 20234,
                            "src": "2363:8:28",
                            "stateVariable": false,
                            "storageLocation": "default",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "typeName": {
                              "id": 20131,
                              "name": "uint",
                              "nodeType": "ElementaryTypeName",
                              "src": "2363:4:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "visibility": "internal"
                          }
                        ],
                        "id": 20136,
                        "initialValue": {
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 20135,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "id": 20133,
                            "name": "_policiesCounter",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 20048,
                            "src": "2374:16:28",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint32",
                              "typeString": "uint32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "id": 20134,
                            "name": "activeBundles",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 20083,
                            "src": "2393:13:28",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "2374:32:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "VariableDeclarationStatement",
                        "src": "2363:43:28"
                      },
                      {
                        "body": {
                          "id": 20232,
                          "nodeType": "Block",
                          "src": "2921:995:28",
                          "statements": [
                            {
                              "assignments": [
                                20151
                              ],
                              "declarations": [
                                {
                                  "constant": false,
                                  "id": 20151,
                                  "mutability": "mutable",
                                  "name": "bundleId",
                                  "nameLocation": "2948:8:28",
                                  "nodeType": "VariableDeclaration",
                                  "scope": 20232,
                                  "src": "2940:16:28",
                                  "stateVariable": false,
                                  "storageLocation": "default",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "typeName": {
                                    "id": 20150,
                                    "name": "uint256",
                                    "nodeType": "ElementaryTypeName",
                                    "src": "2940:7:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "visibility": "internal"
                                }
                              ],
                              "id": 20155,
                              "initialValue": {
                                "arguments": [
                                  {
                                    "id": 20153,
                                    "name": "idx",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 20132,
                                    "src": "2977:3:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 20152,
                                  "name": "getActiveBundleId",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 27001,
                                  "src": "2959:17:28",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256) view returns (uint256)"
                                  }
                                },
                                "id": 20154,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "2959:22:28",
                                "tryCall": false,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "VariableDeclarationStatement",
                              "src": "2940:41:28"
                            },
                            {
                              "assignments": [
                                20160
                              ],
                              "declarations": [
                                {
                                  "constant": false,
                                  "id": 20160,
                                  "mutability": "mutable",
                                  "name": "bundle",
                                  "nameLocation": "3022:6:28",
                                  "nodeType": "VariableDeclaration",
                                  "scope": 20232,
                                  "src": "3000:28:28",
                                  "stateVariable": false,
                                  "storageLocation": "memory",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_struct$_Bundle_$20407_memory_ptr",
                                    "typeString": "struct IBundle.Bundle"
                                  },
                                  "typeName": {
                                    "id": 20159,
                                    "nodeType": "UserDefinedTypeName",
                                    "pathNode": {
                                      "id": 20158,
                                      "name": "IBundle.Bundle",
                                      "nodeType": "IdentifierPath",
                                      "referencedDeclaration": 20407,
                                      "src": "3000:14:28"
                                    },
                                    "referencedDeclaration": 20407,
                                    "src": "3000:14:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_struct$_Bundle_$20407_storage_ptr",
                                      "typeString": "struct IBundle.Bundle"
                                    }
                                  },
                                  "visibility": "internal"
                                }
                              ],
                              "id": 20165,
                              "initialValue": {
                                "arguments": [
                                  {
                                    "id": 20163,
                                    "name": "bundleId",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 20151,
                                    "src": "3058:8:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "expression": {
                                    "id": 20161,
                                    "name": "_instanceService",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 26434,
                                    "src": "3031:16:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_contract$_IInstanceService_$22849",
                                      "typeString": "contract IInstanceService"
                                    }
                                  },
                                  "id": 20162,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "getBundle",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 22748,
                                  "src": "3031:26:28",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_external_view$_t_uint256_$returns$_t_struct$_Bundle_$20407_memory_ptr_$",
                                    "typeString": "function (uint256) view external returns (struct IBundle.Bundle memory)"
                                  }
                                },
                                "id": 20164,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3031:36:28",
                                "tryCall": false,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_struct$_Bundle_$20407_memory_ptr",
                                  "typeString": "struct IBundle.Bundle memory"
                                }
                              },
                              "nodeType": "VariableDeclarationStatement",
                              "src": "3000:67:28"
                            },
                            {
                              "assignments": [
                                20167
                              ],
                              "declarations": [
                                {
                                  "constant": false,
                                  "id": 20167,
                                  "mutability": "mutable",
                                  "name": "isMatching",
                                  "nameLocation": "3091:10:28",
                                  "nodeType": "VariableDeclaration",
                                  "scope": 20232,
                                  "src": "3086:15:28",
                                  "stateVariable": false,
                                  "storageLocation": "default",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bool",
                                    "typeString": "bool"
                                  },
                                  "typeName": {
                                    "id": 20166,
                                    "name": "bool",
                                    "nodeType": "ElementaryTypeName",
                                    "src": "3086:4:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    }
                                  },
                                  "visibility": "internal"
                                }
                              ],
                              "id": 20172,
                              "initialValue": {
                                "arguments": [
                                  {
                                    "id": 20169,
                                    "name": "bundle",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 20160,
                                    "src": "3129:6:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_struct$_Bundle_$20407_memory_ptr",
                                      "typeString": "struct IBundle.Bundle memory"
                                    }
                                  },
                                  {
                                    "id": 20170,
                                    "name": "application",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 20125,
                                    "src": "3137:11:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_struct$_Application_$20666_memory_ptr",
                                      "typeString": "struct IPolicy.Application memory"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_struct$_Bundle_$20407_memory_ptr",
                                      "typeString": "struct IBundle.Bundle memory"
                                    },
                                    {
                                      "typeIdentifier": "t_struct$_Application_$20666_memory_ptr",
                                      "typeString": "struct IPolicy.Application memory"
                                    }
                                  ],
                                  "id": 20168,
                                  "name": "bundleMatchesApplication",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 27090,
                                  "src": "3104:24:28",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_view$_t_struct$_Bundle_$20407_memory_ptr_$_t_struct$_Application_$20666_memory_ptr_$returns$_t_bool_$",
                                    "typeString": "function (struct IBundle.Bundle memory,struct IPolicy.Application memory) view returns (bool)"
                                  }
                                },
                                "id": 20171,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3104:45:28",
                                "tryCall": false,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              },
                              "nodeType": "VariableDeclarationStatement",
                              "src": "3086:63:28"
                            },
                            {
                              "eventCall": {
                                "arguments": [
                                  {
                                    "id": 20174,
                                    "name": "bundleId",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 20151,
                                    "src": "3204:8:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "id": 20175,
                                    "name": "isMatching",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 20167,
                                    "src": "3214:10:28",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    }
                                  ],
                                  "id": 20173,
                                  "name": "LogRiskpoolBundleMatchesPolicy",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 22168,
                                  "src": "3173:30:28",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bool_$returns$__$",
                                    "typeString": "function (uint256,bool)"
                                  }
                                },
                                "id": 20176,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3173:52:28",
                                "tryCall": false,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_tuple$__$",
                                  "typeString": "tuple()"
                                }
                              },
                              "id": 20177,
                              "nodeType": "EmitStatement",
                              "src": "3168:57:28"
                            },
                            {
                              "condition": {
                                "id": 20178,
                                "name": "isMatching",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 20167,
                                "src": "3250:10:28",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              },
                              "id": 20231,
                              "nodeType": "IfStatement",
                              "src": "3246:655:28",
                              "trueBody": {
                                "id": 20230,
                                "nodeType": "Block",
                                "src": "3262:639:28",
                                "statements": [
                                  {
                                    "assignments": [
                                      20180
                                    ],
                                    "declarations": [
                                      {
                                        "constant": false,
                                        "id": 20180,
                                        "mutability": "mutable",
                                        "name": "maxAmount",
                                        "nameLocation": "3293:9:28",
                                        "nodeType": "VariableDeclaration",
                                        "scope": 20230,
                                        "src": "3285:17:28",
                                        "stateVariable": false,
                                        "storageLocation": "default",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        },
                                        "typeName": {
                                          "id": 20179,
                                          "name": "uint256",
                                          "nodeType": "ElementaryTypeName",
                                          "src": "3285:7:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        },
                                        "visibility": "internal"
                                      }
                                    ],
                                    "id": 20186,
                                    "initialValue": {
                                      "commonType": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      },
                                      "id": 20185,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "leftExpression": {
                                        "expression": {
                                          "id": 20181,
                                          "name": "bundle",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 20160,
                                          "src": "3305:6:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_struct$_Bundle_$20407_memory_ptr",
                                            "typeString": "struct IBundle.Bundle memory"
                                          }
                                        },
                                        "id": 20182,
                                        "isConstant": false,
                                        "isLValue": true,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "memberName": "capital",
                                        "nodeType": "MemberAccess",
                                        "referencedDeclaration": 20398,
                                        "src": "3305:14:28",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "nodeType": "BinaryOperation",
                                      "operator": "-",
                                      "rightExpression": {
                                        "expression": {
                                          "id": 20183,
                                          "name": "bundle",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 20160,
                                          "src": "3322:6:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_struct$_Bundle_$20407_memory_ptr",
                                            "typeString": "struct IBundle.Bundle memory"
                                          }
                                        },
                                        "id": 20184,
                                        "isConstant": false,
                                        "isLValue": true,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "memberName": "lockedCapital",
                                        "nodeType": "MemberAccess",
                                        "referencedDeclaration": 20400,
                                        "src": "3322:20:28",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "src": "3305:37:28",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "VariableDeclarationStatement",
                                    "src": "3285:57:28"
                                  },
                                  {
                                    "eventCall": {
                                      "arguments": [
                                        {
                                          "id": 20188,
                                          "name": "idx",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 20132,
                                          "src": "3413:3:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        },
                                        {
                                          "id": 20189,
                                          "name": "bundleId",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 20151,
                                          "src": "3418:8:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        },
                                        {
                                          "id": 20190,
                                          "name": "maxAmount",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 20180,
                                          "src": "3428:9:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        },
                                        {
                                          "id": 20191,
                                          "name": "collateralAmount",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 20076,
                                          "src": "3439:16:28",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        }
                                      ],
                                      "expression": {
                                        "argumentTypes": [
                                          {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          },
                                          {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          },
                                          {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          },
                                          {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        ],
                                        "id": 20187,
                                        "name": "LogBasicRiskpoolCandidateBundleAmountCheck",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 20041,
                                        "src": "3370:42:28",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint256_$_t_uint256_$returns$__$",
                                          "typeString": "function (uint256,uint256,uint256,uint256)"
                                        }
                                      },
                                      "id": 20192,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "kind": "functionCall",
                                      "lValueRequested": false,
                                      "names": [],
                                      "nodeType": "FunctionCall",
                                      "src": "3370:86:28",
                                      "tryCall": false,
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_tuple$__$",
                                        "typeString": "tuple()"
                                      }
                                    },
                                    "id": 20193,
                                    "nodeType": "EmitStatement",
                                    "src": "3365:91:28"
                                  },
                                  {
                                    "condition": {
                                      "commonType": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      },
                                      "id": 20196,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "leftExpression": {
                                        "id": 20194,
                                        "name": "maxAmount",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 20180,
                                        "src": "3485:9:28",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "nodeType": "BinaryOperation",
                                      "operator": ">=",
                                      "rightExpression": {
                                        "id": 20195,
                                        "name": "collateralAmount",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 20076,
                                        "src": "3498:16:28",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "src": "3485:29:28",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_bool",
                                        "typeString": "bool"
                                      }
                                    },
                                    "falseBody": {
                                      "id": 20228,
                                      "nodeType": "Block",
                                      "src": "3800:82:28",
                                      "statements": [
                                        {
                                          "expression": {
                                            "id": 20226,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "leftHandSide": {
                                              "id": 20219,
                                              "name": "idx",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 20132,
                                              "src": "3827:3:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            },
                                            "nodeType": "Assignment",
                                            "operator": "=",
                                            "rightHandSide": {
                                              "commonType": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              },
                                              "id": 20225,
                                              "isConstant": false,
                                              "isLValue": false,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "leftExpression": {
                                                "components": [
                                                  {
                                                    "commonType": {
                                                      "typeIdentifier": "t_uint256",
                                                      "typeString": "uint256"
                                                    },
                                                    "id": 20222,
                                                    "isConstant": false,
                                                    "isLValue": false,
                                                    "isPure": false,
                                                    "lValueRequested": false,
                                                    "leftExpression": {
                                                      "id": 20220,
                                                      "name": "idx",
                                                      "nodeType": "Identifier",
                                                      "overloadedDeclarations": [],
                                                      "referencedDeclaration": 20132,
                                                      "src": "3834:3:28",
                                                      "typeDescriptions": {
                                                        "typeIdentifier": "t_uint256",
                                                        "typeString": "uint256"
                                                      }
                                                    },
                                                    "nodeType": "BinaryOperation",
                                                    "operator": "+",
                                                    "rightExpression": {
                                                      "hexValue": "31",
                                                      "id": 20221,
                                                      "isConstant": false,
                                                      "isLValue": false,
                                                      "isPure": true,
                                                      "kind": "number",
                                                      "lValueRequested": false,
                                                      "nodeType": "Literal",
                                                      "src": "3840:1:28",
                                                      "typeDescriptions": {
                                                        "typeIdentifier": "t_rational_1_by_1",
                                                        "typeString": "int_const 1"
                                                      },
                                                      "value": "1"
                                                    },
                                                    "src": "3834:7:28",
                                                    "typeDescriptions": {
                                                      "typeIdentifier": "t_uint256",
                                                      "typeString": "uint256"
                                                    }
                                                  }
                                                ],
                                                "id": 20223,
                                                "isConstant": false,
                                                "isInlineArray": false,
                                                "isLValue": false,
                                                "isPure": false,
                                                "lValueRequested": false,
                                                "nodeType": "TupleExpression",
                                                "src": "3833:9:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint256",
                                                  "typeString": "uint256"
                                                }
                                              },
                                              "nodeType": "BinaryOperation",
                                              "operator": "%",
                                              "rightExpression": {
                                                "id": 20224,
                                                "name": "activeBundles",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 20083,
                                                "src": "3845:13:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint256",
                                                  "typeString": "uint256"
                                                }
                                              },
                                              "src": "3833:25:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            },
                                            "src": "3827:31:28",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_uint256",
                                              "typeString": "uint256"
                                            }
                                          },
                                          "id": 20227,
                                          "nodeType": "ExpressionStatement",
                                          "src": "3827:31:28"
                                        }
                                      ]
                                    },
                                    "id": 20229,
                                    "nodeType": "IfStatement",
                                    "src": "3481:401:28",
                                    "trueBody": {
                                      "id": 20218,
                                      "nodeType": "Block",
                                      "src": "3516:278:28",
                                      "statements": [
                                        {
                                          "expression": {
                                            "arguments": [
                                              {
                                                "id": 20200,
                                                "name": "bundleId",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 20151,
                                                "src": "3580:8:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint256",
                                                  "typeString": "uint256"
                                                }
                                              },
                                              {
                                                "id": 20201,
                                                "name": "processId",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 20074,
                                                "src": "3590:9:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_bytes32",
                                                  "typeString": "bytes32"
                                                }
                                              },
                                              {
                                                "id": 20202,
                                                "name": "collateralAmount",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 20076,
                                                "src": "3601:16:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_uint256",
                                                  "typeString": "uint256"
                                                }
                                              }
                                            ],
                                            "expression": {
                                              "argumentTypes": [
                                                {
                                                  "typeIdentifier": "t_uint256",
                                                  "typeString": "uint256"
                                                },
                                                {
                                                  "typeIdentifier": "t_bytes32",
                                                  "typeString": "bytes32"
                                                },
                                                {
                                                  "typeIdentifier": "t_uint256",
                                                  "typeString": "uint256"
                                                }
                                              ],
                                              "expression": {
                                                "id": 20197,
                                                "name": "_riskpoolService",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 26437,
                                                "src": "3543:16:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_contract$_IRiskpoolService_$24006",
                                                  "typeString": "contract IRiskpoolService"
                                                }
                                              },
                                              "id": 20199,
                                              "isConstant": false,
                                              "isLValue": false,
                                              "isPure": false,
                                              "lValueRequested": false,
                                              "memberName": "collateralizePolicy",
                                              "nodeType": "MemberAccess",
                                              "referencedDeclaration": 23971,
                                              "src": "3543:36:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$",
                                                "typeString": "function (uint256,bytes32,uint256) external"
                                              }
                                            },
                                            "id": 20203,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "kind": "functionCall",
                                            "lValueRequested": false,
                                            "names": [],
                                            "nodeType": "FunctionCall",
                                            "src": "3543:75:28",
                                            "tryCall": false,
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_tuple$__$",
                                              "typeString": "tuple()"
                                            }
                                          },
                                          "id": 20204,
                                          "nodeType": "ExpressionStatement",
                                          "src": "3543:75:28"
                                        },
                                        {
                                          "expression": {
                                            "id": 20209,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "leftHandSide": {
                                              "baseExpression": {
                                                "id": 20205,
                                                "name": "_collateralizedBy",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 20045,
                                                "src": "3645:17:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                                                  "typeString": "mapping(bytes32 => uint256)"
                                                }
                                              },
                                              "id": 20207,
                                              "indexExpression": {
                                                "id": 20206,
                                                "name": "processId",
                                                "nodeType": "Identifier",
                                                "overloadedDeclarations": [],
                                                "referencedDeclaration": 20074,
                                                "src": "3663:9:28",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_bytes32",
                                                  "typeString": "bytes32"
                                                }
                                              },
                                              "isConstant": false,
                                              "isLValue": true,
                                              "isPure": false,
                                              "lValueRequested": true,
                                              "nodeType": "IndexAccess",
                                              "src": "3645:28:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            },
                                            "nodeType": "Assignment",
                                            "operator": "=",
                                            "rightHandSide": {
                                              "id": 20208,
                                              "name": "bundleId",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 20151,
                                              "src": "3676:8:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint256",
                                                "typeString": "uint256"
                                              }
                                            },
                                            "src": "3645:39:28",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_uint256",
                                              "typeString": "uint256"
                                            }
                                          },
                                          "id": 20210,
                                          "nodeType": "ExpressionStatement",
                                          "src": "3645:39:28"
                                        },
                                        {
                                          "expression": {
                                            "id": 20213,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "leftHandSide": {
                                              "id": 20211,
                                              "name": "success",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 20080,
                                              "src": "3711:7:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_bool",
                                                "typeString": "bool"
                                              }
                                            },
                                            "nodeType": "Assignment",
                                            "operator": "=",
                                            "rightHandSide": {
                                              "hexValue": "74727565",
                                              "id": 20212,
                                              "isConstant": false,
                                              "isLValue": false,
                                              "isPure": true,
                                              "kind": "bool",
                                              "lValueRequested": false,
                                              "nodeType": "Literal",
                                              "src": "3721:4:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_bool",
                                                "typeString": "bool"
                                              },
                                              "value": "true"
                                            },
                                            "src": "3711:14:28",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_bool",
                                              "typeString": "bool"
                                            }
                                          },
                                          "id": 20214,
                                          "nodeType": "ExpressionStatement",
                                          "src": "3711:14:28"
                                        },
                                        {
                                          "expression": {
                                            "id": 20216,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "nodeType": "UnaryOperation",
                                            "operator": "++",
                                            "prefix": false,
                                            "src": "3752:18:28",
                                            "subExpression": {
                                              "id": 20215,
                                              "name": "_policiesCounter",
                                              "nodeType": "Identifier",
                                              "overloadedDeclarations": [],
                                              "referencedDeclaration": 20048,
                                              "src": "3752:16:28",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_uint32",
                                                "typeString": "uint32"
                                              }
                                            },
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_uint32",
                                              "typeString": "uint32"
                                            }
                                          },
                                          "id": 20217,
                                          "nodeType": "ExpressionStatement",
                                          "src": "3752:18:28"
                                        }
                                      ]
                                    }
                                  }
                                ]
                              }
                            }
                          ]
                        },
                        "condition": {
                          "commonType": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "id": 20146,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 20143,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "id": 20141,
                              "name": "i",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 20138,
                              "src": "2885:1:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "<",
                            "rightExpression": {
                              "id": 20142,
                              "name": "activeBundles",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 20083,
                              "src": "2889:13:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "2885:17:28",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&&",
                          "rightExpression": {
                            "id": 20145,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "UnaryOperation",
                            "operator": "!",
                            "prefix": true,
                            "src": "2906:8:28",
                            "subExpression": {
                              "id": 20144,
                              "name": "success",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 20080,
                              "src": "2907:7:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "src": "2885:29:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "id": 20233,
                        "initializationExpression": {
                          "assignments": [
                            20138
                          ],
                          "declarations": [
                            {
                              "constant": false,
                              "id": 20138,
                              "mutability": "mutable",
                              "name": "i",
                              "nameLocation": "2878:1:28",
                              "nodeType": "VariableDeclaration",
                              "scope": 20233,
                              "src": "2870:9:28",
                              "stateVariable": false,
                              "storageLocation": "default",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "typeName": {
                                "id": 20137,
                                "name": "uint256",
                                "nodeType": "ElementaryTypeName",
                                "src": "2870:7:28",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "visibility": "internal"
                            }
                          ],
                          "id": 20140,
                          "initialValue": {
                            "hexValue": "30",
                            "id": 20139,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "2882:1:28",
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "nodeType": "VariableDeclarationStatement",
                          "src": "2870:13:28"
                        },
                        "loopExpression": {
                          "expression": {
                            "id": 20148,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "UnaryOperation",
                            "operator": "++",
                            "prefix": false,
                            "src": "2916:3:28",
                            "subExpression": {
                              "id": 20147,
                              "name": "i",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 20138,
                              "src": "2916:1:28",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 20149,
                          "nodeType": "ExpressionStatement",
                          "src": "2916:3:28"
                        },
                        "nodeType": "ForStatement",
                        "src": "2865:1051:28"
                      }
                    ]
                  }
                }
              ]
            },
            "id": 20237,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_lockCollateral",
            "nameLocation": "1542:15:28",
            "nodeType": "FunctionDefinition",
            "overrides": {
              "id": 20078,
              "nodeType": "OverrideSpecifier",
              "overrides": [],
              "src": "1622:8:28"
            },
            "parameters": {
              "id": 20077,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20074,
                  "mutability": "mutable",
                  "name": "processId",
                  "nameLocation": "1566:9:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20237,
                  "src": "1558:17:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 20073,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1558:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20076,
                  "mutability": "mutable",
                  "name": "collateralAmount",
                  "nameLocation": "1585:16:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20237,
                  "src": "1577:24:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20075,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1577:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "1557:45:28"
            },
            "returnParameters": {
              "id": 20081,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20080,
                  "mutability": "mutable",
                  "name": "success",
                  "nameLocation": "1653:7:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20237,
                  "src": "1648:12:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 20079,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1648:4:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "1647:14:28"
            },
            "scope": 20307,
            "src": "1533:2401:28",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          },
          {
            "baseFunctions": [
              27133
            ],
            "body": {
              "id": 20259,
              "nodeType": "Block",
              "src": "4033:136:28",
              "statements": [
                {
                  "assignments": [
                    20246
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 20246,
                      "mutability": "mutable",
                      "name": "bundleId",
                      "nameLocation": "4052:8:28",
                      "nodeType": "VariableDeclaration",
                      "scope": 20259,
                      "src": "4044:16:28",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 20245,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4044:7:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "visibility": "internal"
                    }
                  ],
                  "id": 20250,
                  "initialValue": {
                    "baseExpression": {
                      "id": 20247,
                      "name": "_collateralizedBy",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20045,
                      "src": "4063:17:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                        "typeString": "mapping(bytes32 => uint256)"
                      }
                    },
                    "id": 20249,
                    "indexExpression": {
                      "id": 20248,
                      "name": "processId",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20239,
                      "src": "4081:9:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "nodeType": "IndexAccess",
                    "src": "4063:28:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4044:47:28"
                },
                {
                  "expression": {
                    "arguments": [
                      {
                        "id": 20254,
                        "name": "bundleId",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20246,
                        "src": "4133:8:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "id": 20255,
                        "name": "processId",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20239,
                        "src": "4143:9:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "id": 20256,
                        "name": "amount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20241,
                        "src": "4154:6:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "id": 20251,
                        "name": "_riskpoolService",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 26437,
                        "src": "4102:16:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_IRiskpoolService_$24006",
                          "typeString": "contract IRiskpoolService"
                        }
                      },
                      "id": 20253,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "processPayout",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 23989,
                      "src": "4102:30:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$",
                        "typeString": "function (uint256,bytes32,uint256) external"
                      }
                    },
                    "id": 20257,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4102:59:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 20258,
                  "nodeType": "ExpressionStatement",
                  "src": "4102:59:28"
                }
              ]
            },
            "id": 20260,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_processPayout",
            "nameLocation": "3951:14:28",
            "nodeType": "FunctionDefinition",
            "overrides": {
              "id": 20243,
              "nodeType": "OverrideSpecifier",
              "overrides": [],
              "src": "4019:8:28"
            },
            "parameters": {
              "id": 20242,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20239,
                  "mutability": "mutable",
                  "name": "processId",
                  "nameLocation": "3974:9:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20260,
                  "src": "3966:17:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 20238,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "3966:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20241,
                  "mutability": "mutable",
                  "name": "amount",
                  "nameLocation": "3993:6:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20260,
                  "src": "3985:14:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20240,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "3985:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "3965:35:28"
            },
            "returnParameters": {
              "id": 20244,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "4033:0:28"
            },
            "scope": 20307,
            "src": "3942:227:28",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          },
          {
            "baseFunctions": [
              27126
            ],
            "body": {
              "id": 20282,
              "nodeType": "Block",
              "src": "4269:137:28",
              "statements": [
                {
                  "assignments": [
                    20269
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 20269,
                      "mutability": "mutable",
                      "name": "bundleId",
                      "nameLocation": "4288:8:28",
                      "nodeType": "VariableDeclaration",
                      "scope": 20282,
                      "src": "4280:16:28",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 20268,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4280:7:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "visibility": "internal"
                    }
                  ],
                  "id": 20273,
                  "initialValue": {
                    "baseExpression": {
                      "id": 20270,
                      "name": "_collateralizedBy",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20045,
                      "src": "4299:17:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                        "typeString": "mapping(bytes32 => uint256)"
                      }
                    },
                    "id": 20272,
                    "indexExpression": {
                      "id": 20271,
                      "name": "processId",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20262,
                      "src": "4317:9:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "nodeType": "IndexAccess",
                    "src": "4299:28:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4280:47:28"
                },
                {
                  "expression": {
                    "arguments": [
                      {
                        "id": 20277,
                        "name": "bundleId",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20269,
                        "src": "4370:8:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "id": 20278,
                        "name": "processId",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20262,
                        "src": "4380:9:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "id": 20279,
                        "name": "amount",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 20264,
                        "src": "4391:6:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "id": 20274,
                        "name": "_riskpoolService",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 26437,
                        "src": "4338:16:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_contract$_IRiskpoolService_$24006",
                          "typeString": "contract IRiskpoolService"
                        }
                      },
                      "id": 20276,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "processPremium",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 23980,
                      "src": "4338:31:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_bytes32_$_t_uint256_$returns$__$",
                        "typeString": "function (uint256,bytes32,uint256) external"
                      }
                    },
                    "id": 20280,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4338:60:28",
                    "tryCall": false,
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 20281,
                  "nodeType": "ExpressionStatement",
                  "src": "4338:60:28"
                }
              ]
            },
            "id": 20283,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_processPremium",
            "nameLocation": "4186:15:28",
            "nodeType": "FunctionDefinition",
            "overrides": {
              "id": 20266,
              "nodeType": "OverrideSpecifier",
              "overrides": [],
              "src": "4255:8:28"
            },
            "parameters": {
              "id": 20265,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20262,
                  "mutability": "mutable",
                  "name": "processId",
                  "nameLocation": "4210:9:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20283,
                  "src": "4202:17:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 20261,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "4202:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 20264,
                  "mutability": "mutable",
                  "name": "amount",
                  "nameLocation": "4229:6:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20283,
                  "src": "4221:14:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20263,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "4221:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "4201:35:28"
            },
            "returnParameters": {
              "id": 20267,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "4269:0:28"
            },
            "scope": 20307,
            "src": "4177:229:28",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          },
          {
            "baseFunctions": [
              27140
            ],
            "body": {
              "id": 20305,
              "nodeType": "Block",
              "src": "4538:155:28",
              "statements": [
                {
                  "assignments": [
                    20292
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 20292,
                      "mutability": "mutable",
                      "name": "bundleId",
                      "nameLocation": "4565:8:28",
                      "nodeType": "VariableDeclaration",
                      "scope": 20305,
                      "src": "4557:16:28",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 20291,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4557:7:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "visibility": "internal"
                    }
                  ],
                  "id": 20296,
                  "initialValue": {
                    "baseExpression": {
                      "id": 20293,
                      "name": "_collateralizedBy",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20045,
                      "src": "4576:17:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                        "typeString": "mapping(bytes32 => uint256)"
                      }
                    },
                    "id": 20295,
                    "indexExpression": {
                      "id": 20294,
                      "name": "processId",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20285,
                      "src": "4594:9:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "nodeType": "IndexAccess",
                    "src": "4576:28:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4557:47:28"
                },
                {
                  "expression": {
                    "id": 20303,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "id": 20297,
                      "name": "collateralAmount",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 20289,
                      "src": "4615:16:28",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "arguments": [
                        {
                          "id": 20300,
                          "name": "bundleId",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 20292,
                          "src": "4665:8:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        {
                          "id": 20301,
                          "name": "processId",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 20285,
                          "src": "4675:9:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        ],
                        "expression": {
                          "id": 20298,
                          "name": "_riskpoolService",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 26437,
                          "src": "4634:16:28",
                          "typeDescriptions": {
                            "typeIdentifier": "t_contract$_IRiskpoolService_$24006",
                            "typeString": "contract IRiskpoolService"
                          }
                        },
                        "id": 20299,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "releasePolicy",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 23998,
                        "src": "4634:30:28",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$_t_bytes32_$returns$_t_uint256_$",
                          "typeString": "function (uint256,bytes32) external returns (uint256)"
                        }
                      },
                      "id": 20302,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "4634:51:28",
                      "tryCall": false,
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "4615:70:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 20304,
                  "nodeType": "ExpressionStatement",
                  "src": "4615:70:28"
                }
              ]
            },
            "id": 20306,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_releaseCollateral",
            "nameLocation": "4423:18:28",
            "nodeType": "FunctionDefinition",
            "overrides": {
              "id": 20287,
              "nodeType": "OverrideSpecifier",
              "overrides": [],
              "src": "4480:8:28"
            },
            "parameters": {
              "id": 20286,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20285,
                  "mutability": "mutable",
                  "name": "processId",
                  "nameLocation": "4450:9:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20306,
                  "src": "4442:17:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 20284,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "4442:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "4441:19:28"
            },
            "returnParameters": {
              "id": 20290,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 20289,
                  "mutability": "mutable",
                  "name": "collateralAmount",
                  "nameLocation": "4514:16:28",
                  "nodeType": "VariableDeclaration",
                  "scope": 20306,
                  "src": "4506:24:28",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 20288,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "4506:7:28",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "visibility": "internal"
                }
              ],
              "src": "4505:26:28"
            },
            "scope": 20307,
            "src": "4414:279:28",
            "stateMutability": "nonpayable",
            "virtual": false,
            "visibility": "internal"
          }
        ],
        "scope": 20308,
        "src": "244:4452:28"
      }
    ],
    "src": "40:4656:28"
  },
  "bytecode": "",
  "bytecodeSha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
  "compiler": {
    "evm_version": "istanbul",
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "version": "0.8.2+commit.661d1103"
  },
  "contractName": "BasicRiskpool",
  "coverageMap": {
    "branches": {},
    "statements": {}
  },
  "dependencies": [
    "etherisc/gif-interface@3b0002a/Component",
    "OpenZeppelin/openzeppelin-contracts@4.7.3/Context",
    "etherisc/gif-interface@3b0002a/IAccess",
    "etherisc/gif-interface@3b0002a/IBundleToken",
    "etherisc/gif-interface@3b0002a/IComponent",
    "etherisc/gif-interface@3b0002a/IComponentEvents",
    "etherisc/gif-interface@3b0002a/IComponentOwnerService",
    "OpenZeppelin/openzeppelin-contracts@4.7.3/IERC165",
    "OpenZeppelin/openzeppelin-contracts@4.7.3/IERC20",
    "OpenZeppelin/openzeppelin-contracts@4.7.3/IERC721",
    "etherisc/gif-interface@3b0002a/IInstanceOperatorService",
    "etherisc/gif-interface@3b0002a/IInstanceService",
    "etherisc/gif-interface@3b0002a/IOracleService",
    "etherisc/gif-interface@3b0002a/IProductService",
    "etherisc/gif-interface@3b0002a/IRegistry",
    "etherisc/gif-interface@3b0002a/IRiskpool",
    "etherisc/gif-interface@3b0002a/IRiskpoolService",
    "OpenZeppelin/openzeppelin-contracts@4.7.3/Ownable",
    "etherisc/gif-interface@3b0002a/Riskpool"
  ],
  "deployedBytecode": "",
  "deployedSourceMap": "",
  "language": "Solidity",
  "natspec": {
    "kind": "dev",
    "methods": {
      "owner()": {
        "details": "Returns the address of the current owner."
      },
      "renounceOwnership()": {
        "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
      },
      "transferOwnership(address)": {
        "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
      }
    },
    "version": 1
  },
  "offset": [
    244,
    4696
  ],
  "opcodes": "",
  "pcMap": {},
  "sha1": "71f9e3077c2385a98f193313b54a63fbc5be79d5",
  "source": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.8.2;\n\nimport \"./Riskpool.sol\";\nimport \"../modules/IBundle.sol\";\nimport \"../modules/IPolicy.sol\";\n\n// basic riskpool always collateralizes one application using exactly one bundle\nabstract contract BasicRiskpool is Riskpool {\n\n    event LogBasicRiskpoolBundlesAndPolicies(uint256 activeBundles, uint256 bundleId);\n    event LogBasicRiskpoolCandidateBundleAmountCheck(uint256 index, uint256 bundleId, uint256 maxAmount, uint256 collateralAmount);\n\n    // remember bundleId for each processId\n    // approach only works for basic risk pool where a\n    // policy is collateralized by exactly one bundle\n    mapping(bytes32 /* processId */ => uint256 /** bundleId */) internal _collateralizedBy;\n    uint32 private _policiesCounter = 0;\n\n    constructor(\n        bytes32 name,\n        uint256 collateralization,\n        uint256 sumOfSumInsuredCap,\n        address erc20Token,\n        address wallet,\n        address registry\n    )\n        Riskpool(name, collateralization, sumOfSumInsuredCap, erc20Token, wallet, registry)\n    { }\n\n    \n\n    // needs to remember which bundles helped to cover ther risk\n    // simple (retail) approach: single policy covered by single bundle\n    // first bundle with a match and sufficient capacity wins\n    // Component <- Riskpool <- BasicRiskpool <- TestRiskpool\n    // complex (wholesale) approach: single policy covered by many bundles\n    // Component <- Riskpool <- AdvancedRiskpool <- TestRiskpool\n    function _lockCollateral(bytes32 processId, uint256 collateralAmount) \n        internal override\n        returns(bool success) \n    {\n        uint256 activeBundles = activeBundles();\n        uint256 capital = getCapital();\n        uint256 lockedCapital = getTotalValueLocked();\n\n        emit LogBasicRiskpoolBundlesAndPolicies(activeBundles, _policiesCounter);\n        require(activeBundles > 0, \"ERROR:BRP-001:NO_ACTIVE_BUNDLES\");\n        require(capital > lockedCapital, \"ERROR:BRP-002:NO_FREE_CAPITAL\");\n\n        // ensure there is a chance to find the collateral\n        if(capital >= lockedCapital + collateralAmount) {\n            IPolicy.Application memory application = _instanceService.getApplication(processId);\n\n            // initialize bundle idx with round robin based on active bundles\n            uint idx = _policiesCounter % activeBundles;\n            \n            // basic riskpool implementation: policy coverage by single bundle only/\n            // the initial bundle is selected via round robin based on the policies counter.\n            // If a bundle does not match (application not matching or insufficient funds for collateral) the next one is tried. \n            // This is continued until all bundles have been tried once. If no bundle matches the policy is rejected.\n            for (uint256 i = 0; i < activeBundles && !success; i++) {\n                uint256 bundleId = getActiveBundleId(idx);\n                IBundle.Bundle memory bundle = _instanceService.getBundle(bundleId);\n                bool isMatching = bundleMatchesApplication(bundle, application);\n                emit LogRiskpoolBundleMatchesPolicy(bundleId, isMatching);\n\n                if (isMatching) {\n                    uint256 maxAmount = bundle.capital - bundle.lockedCapital;\n                    emit LogBasicRiskpoolCandidateBundleAmountCheck(idx, bundleId, maxAmount, collateralAmount);\n\n                    if (maxAmount >= collateralAmount) {\n                        _riskpoolService.collateralizePolicy(bundleId, processId, collateralAmount);\n                        _collateralizedBy[processId] = bundleId;\n                        success = true;\n                        _policiesCounter++;\n                    } else {\n                        idx = (idx + 1) % activeBundles;\n                    }\n                }\n            }\n        }\n    }\n\n    function _processPayout(bytes32 processId, uint256 amount)\n        internal override\n    {\n        uint256 bundleId = _collateralizedBy[processId];\n        _riskpoolService.processPayout(bundleId, processId, amount);\n    }\n\n    function _processPremium(bytes32 processId, uint256 amount)\n        internal override\n    {\n        uint256 bundleId = _collateralizedBy[processId];\n        _riskpoolService.processPremium(bundleId, processId, amount);\n    }\n\n    function _releaseCollateral(bytes32 processId) \n        internal override\n        returns(uint256 collateralAmount) \n    {        \n        uint256 bundleId = _collateralizedBy[processId];\n        collateralAmount = _riskpoolService.releasePolicy(bundleId, processId);\n    }\n}",
  "sourceMap": "",
  "sourcePath": "/home/vscode/.brownie/packages/etherisc/gif-interface@3b0002a/contracts/components/BasicRiskpool.sol",
  "type": "contract"
}