Skip to content

Commit

Permalink
allow deposit fee ratio scale above 1
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelTroka committed Dec 4, 2023
1 parent 25d6f5c commit 44ff3eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/FeeCalculator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ contract FeeCalculator is IDepositFeeCalculator, IRedemptionFeeCalculator, Ownab
/// @dev Can only be called by the current owner.
/// @param _depositFeeRatioScale The new deposit fee ratio scale.
function setDepositFeeRatioScale(SD59x18 _depositFeeRatioScale) external onlyOwner {
require(
_depositFeeRatioScale >= zero && _depositFeeRatioScale <= one,
"Deposit fee ratio scale must be between 0 and 1"
);
require(_depositFeeRatioScale >= zero, "Deposit fee ratio scale must be above 0");
depositFeeRatioScale = _depositFeeRatioScale;
}

Expand Down
8 changes: 1 addition & 7 deletions test/FeeCalculator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,6 @@ contract FeeCalculatorTest is Test {
feeCalculator.setDepositFeeScale(invalid);
}

function testSetDepositFeeRatioScaleReverts() public {
SD59x18 invalid = sd(1.2 * 1e18);
vm.expectRevert("Deposit fee ratio scale must be between 0 and 1");
feeCalculator.setDepositFeeRatioScale(invalid);
}

function testSetSingleAssetDepositRelativeFeeReverts() public {
SD59x18 invalid = sd(1.3 * 1e18);
vm.expectRevert("Single asset deposit relative fee must be between 0 and 1");
Expand Down Expand Up @@ -715,7 +709,7 @@ contract FeeCalculatorTest is Test {

function testSetDepositFeeRatioScaleNegativeReverts() public {
SD59x18 invalid = sd(-0.2 * 1e18);
vm.expectRevert("Deposit fee ratio scale must be between 0 and 1");
vm.expectRevert("Deposit fee ratio scale must be above 0");
feeCalculator.setDepositFeeRatioScale(invalid);
}

Expand Down

0 comments on commit 44ff3eb

Please sign in to comment.