diff --git a/contracts/FixedRateRewardsSource.sol b/contracts/FixedRateRewardsSource.sol index 1fb97db5..30f52139 100644 --- a/contracts/FixedRateRewardsSource.sol +++ b/contracts/FixedRateRewardsSource.sol @@ -89,9 +89,12 @@ contract FixedRateRewardsSource is Governable, Initializable { /// @return rewardAmount Amount of reward that'll be distributed if collected now function previewRewards() public view returns (uint256 rewardAmount) { RewardConfig memory _config = rewardConfig; - + + if (_config.lastCollect == 0) { + return 0; + } + rewardAmount = (block.timestamp - _config.lastCollect) * _config.rewardsPerSecond; - uint256 balance = IERC20(rewardToken).balanceOf(address(this)); if (rewardAmount > balance) { rewardAmount = balance;