```\nfunction claim() external {\n        address sender = msg.sender;\n\n        UserDetails storage s = userdetails[sender];\n        require(s.userDeposit != 0, "No Deposit");\n      require(s.index != vestingPoints.length, "already claimed");\n        uint256 pctAmount;\n        uint256 i = s.index;\n        for (i; i <= vestingPoints.length - 1; i++) {\n            if (block.timestamp >= vestingPoints[i][0]) {\n                pctAmount += (s.userDeposit * vestingPoints[i][1]) / 10000;\n            } else {\n                break;\n            }\n        }\n        if (pctAmount != 0) {\n            if (address(token) == address(1)) {\n              (bool sent, ) = payable(sender).call{value: pctAmount}("");\n                require(sent, "Failed to send BNB to receiver");\n            } else {\n                token.safeTransfer(sender, pctAmount);\n            }\n          s.index = uint128(i);\n            s.amountClaimed += pctAmount;\n        }\n    }\n```\n