This repository has been archived by the owner on Nov 24, 2024. It is now read-only.
utsav - setStartBlock
doesn't update the lastRewardBlock
#155
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Disputed
The sponsor disputed this issue's validity
utsav
medium
setStartBlock
doesn't update thelastRewardBlock
Summary
setStartBlock
doesn't update thelastRewardBlock
and this can lead towrong
reward calculationVulnerability Detail
Owner can update the startBlock before farming started
But the issue is
setStartBlock
doesn'tupdate
lastRewardBlock of pools. As a resultpool
will be started earlier or later butreward
will be calculated based on oldlastRewardBlock
Impact
User can get less/more reward than expected
Code Snippet
https://github.com/sherlock-audit/2024-05-sophon/blob/main/farming-contracts/contracts/farm/SophonFarming.sol#L272C1-L280C6
Tool used
Manual Review + VS code
Recommendation
Update
thelastRewardBlock
while updatingstartBlock
Duplicate of #108
The text was updated successfully, but these errors were encountered: