Let’s consider a simple staking contract where users deposit a staking token to earn rewards. When a user deposits, the pool undergoes an update, and the pending reward is calculated and transferred. However, if the rewardDebt variable (tracking the accounted reward for each user) isn’t updated before the transfer, there’s a potential for exploitation. Despite the function being guarded with a ReentrancyGuard, a malicious user could call the getPendingRewards function right after receiving the pending rewards but before the rewardDebt is updated. This would display an inflated reward value, misleading the user about their pending rewards after the deposit.