Submitted by hubble, also found by CertoraInc and Czar102
During stake or deposit, users would not be transferred the correct Concur token, when MasterChef has under-supply of it.
There is an assumption that MasterChef contract would own enough Concur tokens so as to distribute to users as reward, during deposit or withdraw. But say, due to excess user activity, MasterChef runs out of Concur tokens. All deposits & withdraws that happen after that, would have zero transfer of Concur token to the user. This will continue until the MasterChef contract is replenished again.
MasterChef.sol#L205-L206
Makeshift unit test
Note: Temporarily modify the private function MasterChef.safeConcurTransfer to public function, for unit test validation
Manual review, & makeshift Unit test
Minimal recommended fix:
To MasterChef.safeConcurTransfer function, add the following require statement. This will at least ensure that, when there is zero balance in MasterChef contract, the safeConcurTransfer function will not succeed.
leekt (Concur) acknowledged
Alex the Entreprenerd (judge) commented:
Alex the Entreprenerd (judge) commented:
