{
    "Function": "_calcSharesForArbRestake",
    "File": "contracts/Sherlock.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts/access/Ownable.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol",
        "contracts/interfaces/ISherlock.sol",
        "node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol",
        "node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol",
        "node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol",
        "node_modules/@openzeppelin/contracts/utils/Context.sol",
        "contracts/interfaces/ISherlockStrategy.sol",
        "contracts/interfaces/ISherlockPayout.sol",
        "contracts/interfaces/ISherlockGov.sol",
        "contracts/interfaces/ISherlockStake.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function _calcSharesForArbRestake(uint256 _id) internal view returns (uint256, bool) {\n    // this is the first point at which an arb can restake a position (i.e. two weeks after the initial lockup ends)\n    uint256 initialArbTime = lockupEnd_[_id] + ARB_RESTAKE_WAIT_TIME;\n\n    // If the initialArbTime has not passed, return 0 for the stake shares and false for whether an arb can restake the position\n    if (initialArbTime > block.timestamp) return (0, false);\n\n    // The max rewards (as a % of the position's shares) for the arb are available at this timestamp\n    uint256 maxRewardArbTime = initialArbTime + ARB_RESTAKE_GROWTH_TIME;\n\n    // Caps the timestamp at the maxRewardArbTime so the calc below never goes above 100%\n    uint256 targetTime = block.timestamp < maxRewardArbTime ? block.timestamp : maxRewardArbTime;\n\n    // Scaled by 10**18\n    // Represents the max amount of stake shares that an arb could get from restaking this position\n    uint256 maxRewardScaled = ARB_RESTAKE_MAX_PERCENTAGE * stakeShares[_id];\n\n    // Calcs what % of the max reward an arb gets based on the timestamp at which they call this function\n    // If targetTime == maxRewardArbTime, then the arb gets 100% of the maxRewardScaled\n    return (\n      ((targetTime - initialArbTime) * maxRewardScaled) / (ARB_RESTAKE_GROWTH_TIME) / 10**18,\n      true\n    );\n  }"
}