Submitted by auditor0517
The staked funds might be locked because the deposit/withdraw/transfer logic reverts.
In StargateRewardableWrapper, _claimAssetRewards() claims the accumulated rewards from the staking contract and its called during every deposit/withdraw/transfer in _beforeTokenTransfer() and _claimAndSyncRewards().
And in the stargate staking contract, deposit() calls updatePool() inside the function.
The problem is updatePool() reverts when totalAllocPoint == 0 and this value can be changed by stargate admin using set().
So user funds might be locked like the below.
We should implement a logic for an emergency in StargateRewardableWrapper.
During the emergency, _claimAssetRewards() should return 0 without interacting with the staking contract and we should use stakingContract.emergencyWithdraw() to rescue the funds.
Error
cccz (judge) decreased severity to Medium and commented:
tbrent (Reserve) confirmed
Reserve Mitigated:
Status: Mitigation confirmed. Full details in reports from ronnyx2017, bin2chen and RaymondFam.
