From 8d87d7f4ec61e764e40e88306283eff7b4c4887f Mon Sep 17 00:00:00 2001 From: ryuhei Date: Thu, 23 Sep 2021 18:21:06 +0900 Subject: [PATCH] fix issue when lastBlockReward > rewardCycleEnd --- contracts/core/RewardManagerV2.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/core/RewardManagerV2.sol b/contracts/core/RewardManagerV2.sol index cf68a22..8bffac9 100644 --- a/contracts/core/RewardManagerV2.sol +++ b/contracts/core/RewardManagerV2.sol @@ -129,7 +129,7 @@ contract RewardManagerV2 is BalanceWrapper, ArmorModule, IRewardManagerV2 { return; } - if (rewardCycleEnd == 0 || totalAllocPoint == 0) { + if (rewardCycleEnd == 0 || totalAllocPoint == 0 || lastRewardBlock > rewardCycleEnd) { lastRewardBlock = block.number; return; } @@ -356,7 +356,7 @@ contract RewardManagerV2 is BalanceWrapper, ArmorModule, IRewardManagerV2 { view returns (uint256) { - if (rewardCycleEnd == 0 || totalAllocPoint == 0) { + if (rewardCycleEnd == 0 || totalAllocPoint == 0 || lastRewardBlock > rewardCycleEnd) { return 0; }