{
    "Function": "getProducts",
    "File": "tokenomics/contracts/Depository.sol",
    "Parent Contracts": [
        "tokenomics/contracts/interfaces/IErrorsTokenomics.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function getProducts(bool active) external view returns (uint256[] memory productIds) {\n        // Calculate the number of existing products\n        uint256 numProducts = productCounter;\n        bool[] memory positions = new bool[](numProducts);\n        uint256 numSelectedProducts;\n        // Traverse to find requested products\n        for (uint256 i = 0; i < numProducts; ++i) {\n            // Product is always active if its supply is not zero, and inactive otherwise\n            if ((active && mapBondProducts[i].supply > 0) || (!active && mapBondProducts[i].supply == 0)) {\n                positions[i] = true;\n                ++numSelectedProducts;\n            }\n        }\n\n        // Form active or inactive products index array\n        productIds = new uint256[](numSelectedProducts);\n        uint256 numPos;\n        for (uint256 i = 0; i < numProducts; ++i) {\n            if (positions[i]) {\n                productIds[numPos] = i;\n                ++numPos;\n            }\n        }\n    }"
}