The calculateRewards should not be callable by the whitelisted contract
The `calculateRewards` function should only be called for non-whitelisted addresses:\\n```\\nfunction calculateRewards(address to)\\n public\\n virtual\\n override\\n whenNotPaused\\n returns (bool success)\\n{\\n require(to == \\_msgSender(), "ST5");\\n uint256 reward = \\_calculateRewards(to);\\n emit TriggeredCalculateRewards(to, reward, block.timestamp);\\n return true;\\n}\\n```\\n\\nFor all the whitelisted addresses, the `calculateHolderRewards` function is called. But if the `calculateRewards` function is called by the whitelisted address directly, the function will execute, and the rewards will be distributed to the caller instead of the intended recipients.
Resolution\\nComment from pSTAKE Finance team:\\nHave created a require condition in Smart Contract code to disallow whitelisted contracts from calling the function\\nWhile this scenario is unlikely to happen, adding the additional check in the `calculateRewards` is a good option.
```\\nfunction calculateRewards(address to)\\n public\\n virtual\\n override\\n whenNotPaused\\n returns (bool success)\\n{\\n require(to == \\_msgSender(), "ST5");\\n uint256 reward = \\_calculateRewards(to);\\n emit TriggeredCalculateRewards(to, reward, block.timestamp);\\n return true;\\n}\\n```\\n