Skip to content

Commit

Permalink
fix(TwabRewards): apply CEI pattern in endPromotion
Browse files Browse the repository at this point in the history
  • Loading branch information
PierrickGT committed Jun 2, 2022
1 parent 38986af commit 2920f6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/TwabRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ contract TwabRewards is ITwabRewards {
_promotions[_promotionId].numberOfEpochs = _epochNumber;

uint256 _remainingRewards = _getRemainingRewards(_promotion);
_promotion.token.safeTransfer(_to, _remainingRewards);

_promotions[_promotionId].rewardsUnclaimed -= _remainingRewards;

_promotion.token.safeTransfer(_to, _remainingRewards);

emit PromotionEnded(_promotionId, _to, _remainingRewards, _epochNumber);

return true;
Expand Down

0 comments on commit 2920f6b

Please sign in to comment.