When users transfer GiantLP, some rewards may be lost
When a user transfers GiantLP tokens, the contract attempts to distribute rewards but does not claim the latest rewards from StakingFundsVault first, so the calculated reward per share is lower and the user loses some rewards.
Submitted by cccz
GiantMevAndFeesPool.beforeTokenTransfer will try to distribute the user’s current rewards to the user when transferring GaintLP, but since beforeTokenTransfer will not call StakingFundsVault.claimRewards to claim the latest rewards, thus making the calculated accumulatedETHPerLPShare smaller and causing the user to lose some rewards.
Proof of Concept
Recommended Mitigation Steps
Consider claiming the latest rewards from StakingFundsVault before the GiantMevAndFeesPool.beforeTokenTransfer calls updateAccumulatedETHPerLP()
vince0656 (Stakehouse) acknowledged and commented:
So the nuance here is that due to contract limitations, users should be encouraged for this specific case to claim rewards before transferring tokens due to the requirement of claim params that the contract wouldn’t readily have when executing a transfer. We can document this limitation in detail and encourage users to always claim before transferring the tokens.
I think medium is appropriate for this issue given that we have a loss of funds if the user performs actions out of order.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the transfer hook updates the accumulated reward per share without first claiming pending rewards from the staking vault, so the calculation uses stale data.
Impact
A user who transfers GiantLP tokens may lose some of their earned rewards because the contract does not claim the latest rewards before calculating the payout.
What the attacker needed
User holds GiantLP tokens with pending rewards; user transfers GiantLP tokens
The fix
The contract should claim the latest rewards from StakingFundsVault before updating the accumulated reward per share during a transfer, or users should be clearly instructed to claim rewards before transferring.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a smart contract bug where transferring a token triggers a reward payout, but the contract forgets to first collect the newest rewards from another contract. Because of that, the reward calculation uses outdated numbers, so the user gets less than they should. In short, the order of operations is wrong, and the user loses money.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.