Submitted by WatchPug, also found by 0xDjango and hyh
LiquidityFarming.sol#L229-L253
LiquidityFarming.sol#L122-L165
When withdraw() is called, _sendRewardsForNft(_nftId, _to) will be called to send the rewards.
In _sendRewardsForNft(), when address(this).balance is insufficient at the moment, nft.unpaidRewards = pending - balance will be recorded and the user can get it back at the next time.
However, at L244, the whole nftInfo is being deleted, so that nft.unpaidRewards will also get erased.
There is no way for the user to get back this unpaidRewards anymore.
Consider adding a new parameter named force for withdraw(), require(force || unpaidRewards == 0) before deleting nftInfo.
ankurdubey521 (Biconomy) confirmed and commented:
pauliax (judge) commented:
KenzoAgada (warden) commented:
0xleastwood (warden) commented:
pauliax (judge) commented:
