From b161b9055222a639770f9f42141f2221fa006526 Mon Sep 17 00:00:00 2001 From: kexley <87971154+kexleyBeefy@users.noreply.github.com> Date: Thu, 28 Sep 2023 17:04:56 -0400 Subject: [PATCH] Move `TooManyRewards` error --- contracts/BIFI/infra/BeefyRewardPool.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/BIFI/infra/BeefyRewardPool.sol b/contracts/BIFI/infra/BeefyRewardPool.sol index fe7a1e6c..5ea7cb63 100644 --- a/contracts/BIFI/infra/BeefyRewardPool.sol +++ b/contracts/BIFI/infra/BeefyRewardPool.sol @@ -135,9 +135,9 @@ contract BeefyRewardPool is LPTokenWrapperInitializable, OwnableUpgradeable { if (_reward == address(stakedToken)) revert StakedTokenIsNotAReward(); if (_duration < 1 days) revert ShortDuration(); if (_reward != rewardTokens[rewardTokenIndex[_reward]]) { - if (rewardTokens.length > rewardMax - 1) revert TooManyRewards(); rewardTokenIndex[_reward] = rewardTokens.length; rewardTokens.push(_reward); + if (rewardTokens.length > rewardMax) revert TooManyRewards(); } uint256 leftover;