Sitelet https://github.com/roycoprotocol/royco-iam/commit/050b763418fc378636b591f0a2bb0ec0fb1ccfa6
Skip to content

Commit 050b763

Browse files
authored
Merge pull request #131 from roycoprotocol/rewardsAdded-leftover
2 parents 06edfbe + 15a0b6f commit 050b763

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎src/WrappedVault.sol‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { FixedPointMathLib } from "lib/solmate/src/utils/FixedPointMathLib.sol";
1212
import { FixedPointMathLib as SoladyMath } from "lib/solady/src/utils/FixedPointMathLib.sol";
1313
import { IWrappedVault } from "src/interfaces/IWrappedVault.sol";
1414
import { WrappedVaultFactory } from "src/WrappedVaultFactory.sol";
15-
import { Initializable } from "lib/openzeppelin-contracts/contracts/proxy/utils/Initializable.sol";
1615

1716
/// @title WrappedVault
1817
/// @author Jack Corddry, CopyPaste, Shivaansh Kapoor
@@ -152,8 +151,6 @@ contract WrappedVault is Ownable, InitializableERC20, IWrappedVault {
152151
DEPOSIT_ASSET.approve(vault, type(uint256).max);
153152
}
154153

155-
constructor() { }
156-
157154
/// @param rewardsToken The new reward token / points program to be used as incentives
158155
function addRewardsToken(address rewardsToken) public payable onlyOwner {
159156
// Check if max rewards offered limit has been reached
@@ -255,7 +252,7 @@ contract WrappedVault is Ownable, InitializableERC20, IWrappedVault {
255252

256253
uint256 remainingRewards = rewardsInterval.rate * (rewardsInterval.end - newStart);
257254
uint256 rate = (rewardsAdded - frontendFeeTaken - protocolFeeTaken + remainingRewards) / (newEnd - newStart);
258-
rewardsAdded = (rate - rewardsInterval.rate) * (newEnd - newStart) + frontendFeeTaken + protocolFeeTaken;
255+
rewardsAdded = rate * (newEnd - newStart) - remainingRewards + frontendFeeTaken + protocolFeeTaken;
259256

260257
if (rate < rewardsInterval.rate) revert RateCannotDecrease();
261258

0 commit comments

Comments
 (0)