TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

Some reward tokens may be left in the contract when we migrate the staking contract

Summary

When we want to migrate the staking contract, some reward tokens will be left in the previous staking contract.

Vulnerability Details

When the migrator migrate the staking contract, the migrator will move the staking tokens to the new staking contract and claim reward tokens to the stakers.
The vulnerability is that there is still some left reward tokens from the last distribution period. And these reward tokens will be stuck in the previous contract.l

function migrateWithdraw(address staker, uint256 index) external override onlyMigrator returns (uint256) {
if (staker == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); }
StakeInfo storage _stakeInfo = _stakeInfos[staker][index];
uint256 stakerBalance = _stakeInfo.amount;
_withdrawFor(_stakeInfo, staker, msg.sender, index, _stakeInfo.amount, true, staker);
return stakerBalance;
}

Impact

Some reward tokens are stuck in the previous staking contract.

Tools Used

Manual

Recommendations

Transfer the left reward tokens to the new staking contract.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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