Withdrawing all rewards when setting claim()as false will not allow the user to collect any rewards for that particular stakeInfo index anymore.
When withdrawing TempleGold tokens from the TempleGoldStaking contract, users can set a parameter claimto decide whether or not to claim rewards.
If the user calls withdrawAll(), it means that they intend to withdraw all the amount from the _stakeInfo.amount. If claim is true, then _getReward() will be called:
If a user calls withdrawAll() with claim set to false, then he cannot withdraw his rewards anymore as his balances will become zero and withdrawFor does not allow zero value as the amount.
Users will not be able to claim their reward for that particular index.
Claim rewards will be stuck in contract.
Manual Review
Remove the zero check line. Users can set amount to zero just to claim their rewards.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.