DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Tokens will remain locked if staking is abandoned

Summary

Tokens will remain locked if staking is abandoned

Vulnerability Details

If there are no stakers, or if all stakers unstake and claim their rewards early, the penalty amounts and remaining rewards will stay in the contract. Currently, there is no mechanism to withdraw these amounts.

The only way to claim the remaining rewards is for another user to stake and wait for the required epochs to pass, after which he can claim the rewards and unstake his stake.

Impact

Tokens will be locked in the contract.

Tools Used

Manual review

Recommendations

Implement a function that will enable the Admin to withdraw amounts, in case there are no stakers.

Example:

+ function collectUnclaimableRewards() external onlyRewardAdmin {
+ if (totalStaked != 0) {
+ revert InvalidAmount();
+ }
+
+ uint256 balance = fjordToken.balanceOf(address(this));
+ if (balance == 0) {
+ revert NothingToClaim();
+ }
+
+ fjordToken.safeTransferFrom(address(this), msg.sender, balance - totalRewards); // There might be unclaimed rewards
+ // emit event
+ }
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.