{
    "Function": "_removeShares",
    "File": "src/contracts/core/StrategyManager.sol",
    "Parent Contracts": [
        "src/contracts/core/StrategyManagerStorage.sol",
        "src/contracts/interfaces/IStrategyManager.sol",
        "src/contracts/permissions/Pausable.sol",
        "src/contracts/interfaces/IPausable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/security/ReentrancyGuardUpgradeable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "require(bool,string)",
        "require(bool,string)",
        "require(bool,string)",
        "_removeStrategyFromStakerStrategyList"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _removeShares(address depositor, uint256 strategyIndex, IStrategy strategy, uint256 shareAmount)\n        internal\n        returns (bool)\n    {\n        // sanity checks on inputs\n        require(depositor != address(0), \"StrategyManager._removeShares: depositor cannot be zero address\");\n        require(shareAmount != 0, \"StrategyManager._removeShares: shareAmount should not be zero!\");\n\n        //check that the user has sufficient shares\n        uint256 userShares = stakerStrategyShares[depositor][strategy];\n        \n        require(shareAmount <= userShares, \"StrategyManager._removeShares: shareAmount too high\");\n        //unchecked arithmetic since we just checked this above\n        unchecked {\n            userShares = userShares - shareAmount;\n        }\n\n        // subtract the shares from the depositor's existing shares for this strategy\n        stakerStrategyShares[depositor][strategy] = userShares;\n\n        // if no existing shares, remove the strategy from the depositor's dynamic array of strategies\n        if (userShares == 0) {\n            _removeStrategyFromStakerStrategyList(depositor, strategyIndex, strategy);\n\n            // return true in the event that the strategy was removed from stakerStrategyList[depositor]\n            return true;\n        }\n        // return false in the event that the strategy was *not* removed from stakerStrategyList[depositor]\n        return false;\n    }"
}