Submitted by unforgiven
https://github.com/code-423n4/2022-11-stakehouse/blob/4b6828e9c807f2f7c569e6d721ca1289f7cf7112/contracts/liquid-staking/GiantMevAndFeesPool.sol#L195-L204
https://github.com/code-423n4/2022-11-stakehouse/blob/4b6828e9c807f2f7c569e6d721ca1289f7cf7112/contracts/liquid-staking/GiantPoolBase.sol#L33-L48
When depositETH() is called in giant pool it calls _onDepositETH() which calls _setClaimedToMax() to make sure new ETH stakers are not entitled to ETH earned by but this can cause users to lose their remaining rewards when they deposits. code should first transfer user remaining rewards when deposit happens.
This is depositETH() code in GiantPoolBase:
As you can see it increase user lpTokenETH balance and then calls _onDepositETH(). This is _onDepositETH() and _setClaimedToMax() code in GiantMevAndFeesPool contract:
As you can see the code set claimed[msg.sender][address(lpTokenETH] to maximum value so the user wouldnt be entitled to previous rewards but if user had some remaining rewards in contract he would lose those rewards cant withdraw them. these are the steps:
VIM
When deposit happens, contract should first send remaining rewards, then increase the users balance and then set the user claim to max.
vince0656 (Stakehouse) confirmed
