SoyFinance / smart-contracts

11 stars 9 forks source link

Critical: possible breach of `earned` function #13

Closed Dexaran closed 3 years ago

Dexaran commented 3 years ago

lastUpdateTime can be greater than lastTimeRewardApplicable() which causes earned( ... ) function to break: https://github.com/SoyFinance/smart-contracts/blob/main/Farming/SOYStakingRewards.sol#L265

This is possible in the event of external call of mintFarmingReward(...) function for this local farm by users without claiming reward in the local farm.

Dexaran commented 3 years ago

Not relevant since https://github.com/SoyFinance/smart-contracts/commit/8ac3f514ce99dfed2449103171c28f8eaf98a675