{
    "Function": "claimInterest",
    "File": "contracts/Community.sol",
    "Parent Contracts": [
        "node_modules/@openzeppelin/contracts-upgradeable/metatx/ERC2771ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol",
        "contracts/interfaces/ICommunity.sol"
    ],
    "High-Level Calls": [
        "IDebtToken"
    ],
    "Internal Calls": [
        "returnToLender"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function claimInterest(\n        uint256 _communityID,\n        address _project,\n        IDebtToken _wrappedToken\n    ) internal {\n        // Calculate new interest\n        (, , uint256 _interest, uint256 _interestEarned) = returnToLender(\n            _communityID,\n            _project\n        );\n\n        // Local instance of variables. For saving gas.\n        address _lender = _communities[_communityID].owner;\n        ProjectDetails storage _communityProject = _communities[_communityID]\n            .projectDetails[_project];\n\n        if (_interestEarned > 0) {\n            // If any new interest is to be claimed.\n\n            // Increase total interest with new interest to be claimed.\n            _communityProject.interest = _interest;\n\n            // Update lastTimestamp to current time.\n            _communityProject.lastTimestamp = block.timestamp;\n\n            // Burn _interestEarned amount wrapped token to lender\n            _wrappedToken.mint(_lender, _interestEarned);\n\n            emit ClaimedInterest(\n                _communityID,\n                _project,\n                _lender,\n                _interestEarned\n            );\n        }\n    }"
}