{
    "Function": "verifyStructure",
    "File": "contracts/implementations/recovery/StrategyControllerPaused.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/proxy/Initializable.sol",
        "contracts/StrategyControllerStorage.sol",
        "contracts/interfaces/IStrategyController.sol",
        "contracts/helpers/StrategyTypes.sol"
    ],
    "High-Level Calls": [
        "ITokenRegistry",
        "IOracle",
        "ITokenRegistry",
        "SignedSafeMath"
    ],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "_checkCyclicDependency",
        "require(bool,string)",
        "oracle",
        "require(bool,string)",
        "require(bool,string)"
    ],
    "Library Calls": [
        "add"
    ],
    "Low-Level Calls": [],
    "Code": "function verifyStructure(address strategy, StrategyItem[] memory newItems)\n        public\n        view\n        override\n        returns (bool)\n    {\n        require(newItems.length > 0, \"Cannot set empty structure\");\n        require(newItems[0].item != address(0), \"Invalid item addr\"); //Everything else will caught by the ordering requirement below\n        require(newItems[newItems.length-1].item != address(-1), \"Invalid item addr\"); //Reserved space for virtual item\n\n        ITokenRegistry registry = oracle().tokenRegistry();\n\n        int256 total = 0;\n        for (uint256 i = 0; i < newItems.length; i++) {\n            address item = newItems[i].item;\n            require(i == 0 || newItems[i].item > newItems[i - 1].item, \"Item ordering\");\n            int256 percentage = newItems[i].percentage;\n            if (registry.itemCategories(item) == uint256(ItemCategory.DEBT)) {\n              require(percentage <= 0, \"Debt cannot be positive\");\n              require(percentage >= -PERCENTAGE_BOUND, \"Out of bounds\");\n            } else {\n              require(percentage >= 0, \"Token cannot be negative\");\n              require(percentage <= PERCENTAGE_BOUND, \"Out of bounds\");\n            }\n            uint256 category = registry.estimatorCategories(item);\n            require(category != uint256(EstimatorCategory.BLOCKED), \"Token blocked\");\n            if (category == uint256(EstimatorCategory.STRATEGY))\n                _checkCyclicDependency(strategy, IStrategy(item), registry);\n            total = total.add(percentage);\n        }\n        require(total == int256(DIVISOR), \"Total percentage wrong\");\n        return true;\n    }"
}