From 57adbe3319f06e6b565a05b5460c9ac1f5b35840 Mon Sep 17 00:00:00 2001 From: Jack Corddry Date: Thu, 28 Nov 2024 04:18:36 -0800 Subject: [PATCH 1/2] Use remainingRewards to calculate updated rewardsAdded --- src/WrappedVault.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WrappedVault.sol b/src/WrappedVault.sol index f5aca93..ebeb66e 100644 --- a/src/WrappedVault.sol +++ b/src/WrappedVault.sol @@ -255,7 +255,7 @@ contract WrappedVault is Ownable, InitializableERC20, IWrappedVault { uint256 remainingRewards = rewardsInterval.rate * (rewardsInterval.end - newStart); uint256 rate = (rewardsAdded - frontendFeeTaken - protocolFeeTaken + remainingRewards) / (newEnd - newStart); - rewardsAdded = (rate - rewardsInterval.rate) * (newEnd - newStart) + frontendFeeTaken + protocolFeeTaken; + rewardsAdded = rate * (newEnd - newStart) - remainingRewards + frontendFeeTaken + protocolFeeTaken; if (rate < rewardsInterval.rate) revert RateCannotDecrease(); From 15a0b6feadc528cab47abe64a9738de5ff9ea4bd Mon Sep 17 00:00:00 2001 From: Jack Corddry Date: Thu, 28 Nov 2024 04:51:12 -0800 Subject: [PATCH 2/2] Github actions nits --- src/WrappedVault.sol | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/WrappedVault.sol b/src/WrappedVault.sol index ebeb66e..9c3a187 100644 --- a/src/WrappedVault.sol +++ b/src/WrappedVault.sol @@ -12,7 +12,6 @@ import { FixedPointMathLib } from "lib/solmate/src/utils/FixedPointMathLib.sol"; import { FixedPointMathLib as SoladyMath } from "lib/solady/src/utils/FixedPointMathLib.sol"; import { IWrappedVault } from "src/interfaces/IWrappedVault.sol"; import { WrappedVaultFactory } from "src/WrappedVaultFactory.sol"; -import { Initializable } from "lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol"; /// @title WrappedVault /// @author Jack Corddry, CopyPaste, Shivaansh Kapoor @@ -152,8 +151,6 @@ contract WrappedVault is Ownable, InitializableERC20, IWrappedVault { DEPOSIT_ASSET.approve(vault, type(uint256).max); } - constructor() { } - /// @param rewardsToken The new reward token / points program to be used as incentives function addRewardsToken(address rewardsToken) public payable onlyOwner { // Check if max rewards offered limit has been reached