Reward Token(WETH) deposit transaction can be front-run with a deposit of a large quantity of staking token(TKN) making the frontrunner eligible for a large share of claimable reward.
The staking contract will be refilled with the reward token(WETH) on a regular basis to maintain the reward cycle. The attacker can front-run this reward deposit transaction and deposit the large amount of TKN using the Staking.deposit()
, This will make him eligible to claim a high reward from the contract in an unfair way.
The frontrunning bot can see the upcoming reward deposit in the mempool and can front-run the transaction by depositing a large amount of staking tokens, that way the attacker can earn a large portion of the reward making the reward system unfair.
manual review
The better way to write the staking contract would be to use Synthetix StakingRewards as an inspiration which does not have the frontrunning issues.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.