function _newRewards(
    VaultInfo memory pool,
    uint256 _totalAllocPoint
) internal view returns (uint256 newReward, uint256 newAccRewardPerShare) {
    .....
    if (lpSupply > 0) {
->      uint256 duration = block.timestamp - pool.lastRewardTime;
->      uint256 rawReward = duration * rewardsPerSecond;

->      uint256 rewards = availableRewards();
->      if (rewards < rawReward) {
->          rawReward = rewards;
->      }
        .....
    }
}
          [-----A-----|-----B-----]            (pool 1)
          [-----------C-----------]            (pool 2)
    Day:  0           x           y       z
Ran 1 test for src/test/unit/ChefIncentivesController.t.sol:ChefIncentivesControllerTest
[PASS] test_durationHack() (gas: 688851)
Logs:
  Alice rewards at 2 minutes: 59999999999999999970
  Alice rewards at 3 minutes: 74999999999999999955
  Bob's reward at the end:    45000000000000000000

Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 5.68ms (1.13ms CPU time)

Ran 1 test suite in 301.12ms (5.68ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
struct VaultInfo {
    uint256 totalSupply;
    uint256 allocPoint; // How many allocation points assigned to this vault.
    uint256 lastRewardTime; // Last second that reward distribution occurs.
    uint256 accRewardPerShare; // Accumulated rewards per share, times ACC_REWARD_PRECISION. See below.
+   uint256 accountedRewards;
}
function _updatePool(VaultInfo storage pool, uint256 _totalAllocPoint) internal {
    uint256 timestamp = block.timestamp;
    uint256 endReward = endRewardTime();
    if (endReward <= timestamp) {
        timestamp = endReward;
    }
    if (timestamp <= pool.lastRewardTime) {
        return;
    }

    (uint256 reward, uint256 newAccRewardPerShare) = _newRewards(pool, _totalAllocPoint);
    accountedRewards = accountedRewards + reward;
+   pool.accountedRewards = pool.accountedRewards + reward;
    pool.accRewardPerShare = pool.accRewardPerShare + newAccRewardPerShare;
    pool.lastRewardTime = timestamp;
}
function _newRewards(
    VaultInfo memory pool,
    uint256 _totalAllocPoint
) internal view returns (uint256 newReward, uint256 newAccRewardPerShare) {
    uint256 lpSupply = pool.totalSupply;
    if (lpSupply > 0) {
        uint256 duration = block.timestamp - pool.lastRewardTime;
        uint256 rawReward = duration * rewardsPerSecond;

-       uint256 rewards = availableRewards();
+       uint256 rewards = (depositedRewards * pool.allocPoint / _totalAllocPoint) - pool.accountedRewards;
        if (rewards < rawReward) {
            rawReward = rewards;
        }
-       newReward = (rawReward * pool.allocPoint) / _totalAllocPoint;
+       newReward = rawReward;
        newAccRewardPerShare = (newReward * ACC_REWARD_PRECISION) / lpSupply;
    }
}
Ran 1 test for src/test/unit/ChefIncentivesController.t.sol:ChefIncentivesControllerTest
[PASS] test_durationHack() (gas: 713083)
Logs:
  Alice rewards at 2 minutes: 60000000000000000000
  Alice rewards at 3 minutes: 60000000000000000000
  Bob's reward at the end:    60000000000000000000

Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 34.47ms (4.83ms CPU time)

Ran 1 test suite in 348.00ms (34.47ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
