Skip to content

Commit

Permalink
Merge pull request #131 from roycoprotocol/rewardsAdded-leftover
Browse files Browse the repository at this point in the history
  • Loading branch information
corddry authored Nov 29, 2024
2 parents 06edfbe + 15a0b6f commit 050b763
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/WrappedVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -255,7 +252,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();

Expand Down

0 comments on commit 050b763

Please sign in to comment.