function notifyRewardAmount(
    uint256 reward,
    IERC20 rewardsToken
) external onlyOwner updateReward(address(0), address(rewardsToken)) {
    if (block.timestamp >= periodFinish[address(rewardsToken)]) {
        rewardRates[address(rewardsToken)] = reward.div(
            rewardsDuration[address(rewardsToken)]
        );
    } else {
        uint256 remaining = periodFinish[address(rewardsToken)].sub(
            block.timestamp
        );
        uint256 leftover = remaining.mul(
            rewardRates[address(rewardsToken)]
        );
        rewardRates[address(rewardsToken)] = reward.add(leftover).div(
            rewardsDuration[address(rewardsToken)]
        );
    }
rewardRates[address(rewardsToken)] = reward.div(
    rewardsDuration[address(rewardsToken)]
);
--- a/test/hardhat-tests/bath-buddy.ts
+++ b/test/hardhat-tests/bath-buddy.ts
@@ -44,9 +44,9 @@ describe("RubiconV2 rewards system", function () {
     );
     const testStableCoin = await testCoinFactory.deploy(
       owner.address,
-      "Test Stablecoin",
-      "TUSDC",
-      6
+      "Test WBTC",
+      "WBTC",
+      8
     );

-    await testStableCoin.transfer(buddy.address, parseUnits("10000", 6));
+    await testStableCoin.transfer(buddy.address, parseUnits("0.315", 8));
     await buddy.notifyRewardAmount(
-      parseUnits("10000", 6),
+      parseUnits("0.315", 8),
+      testStableCoin.address
+    );
    it("gets abusive amount of rewards per year", async function () {
      const {
        owner,
        testCoin,
        testStableCoin,
        testRewardCoin,
        bathTEST,
        buddy,
        bathHouse,
        comptroller,
      } = await loadFixture(buddySetupFixtureAudit);

      expect(await comptroller.getCompAddress()).to.be.equal(
        testRewardCoin.address
      );
      const b0 = await testStableCoin.balanceOf(owner.address);

      await testCoin.approve(bathTEST.address, parseUnits("1000"));
      await bathTEST.mint(parseUnits("1000"));

      const earned = await buddy.earned(owner.address, testStableCoin.address);

      const earnedComp = await testRewardCoin.balanceOf(owner.address);
      expect(earnedComp).to.be.equal(0);

      // skip a year
      await time.increaseTo((await time.latest()) + 365 * 24 * 60 * 60);

      bathHouse.claimRewards([buddy.address], [testStableCoin.address]);

      const earned2 = await testStableCoin.balanceOf(owner.address);
      console.log(`Rewards earned per year: ${earned2.sub(b0)}`)
      const earnedComp2 = await testRewardCoin.balanceOf(owner.address);

      expect(earned).to.be.lt(earned2);
      expect(earnedComp).to.be.lt(earnedComp2);
    });
Rewards earned per year: 0
Rewards earned per year: 31536000
