Skip to content

Commit

Permalink
Merge pull request sushi-labs#79 from sushiswap/feat/lpInfo
Browse files Browse the repository at this point in the history
Include update to rewarder on emergency withdraw
  • Loading branch information
Clearwood authored Apr 17, 2021
2 parents 79e19c9 + 7b76e53 commit 48488f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/MasterChefV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ contract MasterChefV2 is BoringOwnable, BoringBatchable {
uint256 amount = user.amount;
user.amount = 0;
user.rewardDebt = 0;

IRewarder _rewarder = rewarder[pid];
if (address(_rewarder) != address(0)) {
_rewarder.onSushiReward(pid, msg.sender, to, 0, 0);
}

// Note: transfer can fail or succeed if `amount` is zero.
lpToken[pid].safeTransfer(to, amount);
emit EmergencyWithdraw(msg.sender, pid, amount, to);
Expand Down

0 comments on commit 48488f2

Please sign in to comment.