Skip to content

Latest commit

 

History

History
43 lines (23 loc) · 1.77 KB

File metadata and controls

43 lines (23 loc) · 1.77 KB

Interesting Gingerbread Aphid

Medium

ERC20 rewards can be stuck forever if no user stack during distribution period

Summary

If no user stack during distribution period, or if user do not claim their rewards afterwards, funds can be stuck forever in the contract.

Root Cause

No way to retrieve ERC20 after distribution period has ended.

Internal pre-conditions

  1. Incentivizer call createDistribution() to create a new reward distribution, ERC20 are sent to GammaRewarder.sol

External pre-conditions

  1. Hypervizor badly communicates of incentivized plan for the associated Gamma Vault
  2. No user stack in the Gamma Vault, thus no one to claim the rewards
  3. Time elapse and distribution.endBlockNumber > block.number
  4. Users are unable to claim because the distribution range has passed. If user stack now, it's too late. Because no one staked during the distribution range, now no one can claim the distribution with proof that will pass handleProofResult()
  5. ERC20 are stuck forevere in the contract, as there is no way to retrieved the funds

Attack Path

Not an attack. Funds can be stuck forever if no user stack during the distribution period.

Impact

Fund stuck forever in GammaRewarder.sol

PoC

See external pre-conditions

Mitigation

Add a way for incentivizer to retrieve rewardAmount left after the distribution period has ended. Add a grace period for user to claim their rewards before incentivizer can retrieve the blocked funds.