{
    "Function": "claimFee",
    "File": "contracts/hyphen/LiquidityProviders.sol",
    "Parent Contracts": [
        "contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol",
        "contracts/hyphen/metatx/ERC2771ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [
        "ILPToken"
    ],
    "Internal Calls": [
        "nonReentrant",
        "_burnSharesFromNft",
        "_msgSender",
        "_msgSender",
        "require(bool,string)",
        "require(bool,string)",
        "_msgSender",
        "onlyValidLpToken",
        "_isSupportedToken",
        "_transferFromLiquidityPool",
        "_msgSender",
        "onlyValidLpToken",
        "sharesToTokenAmount",
        "whenNotPaused",
        "getTokenPriceInLPShares"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function claimFee(uint256 _nftId) external onlyValidLpToken(_nftId, _msgSender()) whenNotPaused nonReentrant {\n        (address _tokenAddress, uint256 nftSuppliedLiquidity, uint256 totalNFTShares) = lpToken.tokenMetadata(_nftId);\n        require(_isSupportedToken(_tokenAddress), \"ERR__TOKEN_NOT_SUPPORTED\");\n\n        uint256 lpSharesForSuppliedLiquidity = nftSuppliedLiquidity * getTokenPriceInLPShares(_tokenAddress);\n\n        // Calculate rewards accumulated\n        uint256 eligibleLiquidity = sharesToTokenAmount(totalNFTShares, _tokenAddress);\n        uint256 lpFeeAccumulated = eligibleLiquidity - nftSuppliedLiquidity;\n        require(lpFeeAccumulated > 0, \"ERR__NO_REWARDS_TO_CLAIM\");\n        // Calculate amount of lp shares that represent accumulated Fee\n        uint256 lpSharesRepresentingFee = totalNFTShares - lpSharesForSuppliedLiquidity;\n\n        totalReserve[_tokenAddress] -= lpFeeAccumulated;\n        totalSharesMinted[_tokenAddress] -= lpSharesRepresentingFee;\n        totalLPFees[_tokenAddress] -= lpFeeAccumulated;\n\n        _burnSharesFromNft(_nftId, lpSharesRepresentingFee, 0, _tokenAddress);\n        _transferFromLiquidityPool(_tokenAddress, _msgSender(), lpFeeAccumulated);\n        emit FeeClaimed(_tokenAddress, lpFeeAccumulated, _msgSender(), lpSharesRepresentingFee);\n    }"
}