Description:
In Staking::claimRewards()
first time claimers can claim rewards without staking if they deposit just before the first claim. This is because the staking period is calculated from the token idToCreationTimestamp
rather than from the first deposit.
Proof of Concept:
Add test to Staking.t.sol
Holder claims rewards by staking just before the first claim
Tools Used:
Manual Review
Recommendation:
lastClaim
should be checked and updated by Staking::deposit
on first deposite
The check should be removed from Staking::claimRewards
aswell
High severity, this allows users to claim additional rewards without committing to intended weekly staking period via multi-deposit/deposit right before claiming rewards.
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.