diff --git a/src/FeeCalculator.sol b/src/FeeCalculator.sol index 2bb57cf..e33e1ea 100644 --- a/src/FeeCalculator.sol +++ b/src/FeeCalculator.sol @@ -133,12 +133,12 @@ contract FeeCalculator is IFeeCalculator, Ownable { } /// @notice Calculates the deposit fee for a given amount. - /// @param tco2 The address of the TCO2 token. /// @param pool The address of the pool. + /// @param tco2 The address of the TCO2 token. /// @param depositAmount The amount to be deposited. /// @return feeDistribution How the fee is meant to be /// distributed among the fee recipients. - function calculateDepositFees(address tco2, address pool, uint256 depositAmount) + function calculateDepositFees(address pool, address tco2, uint256 depositAmount) external view override @@ -177,12 +177,12 @@ contract FeeCalculator is IFeeCalculator, Ownable { } /// @notice Calculates the redemption fees for a given amount. - /// @param tco2 The address of the TCO2 token. /// @param pool The address of the pool. + /// @param tco2 The address of the TCO2 token. /// @param redemptionAmount The amount to be redeemed. /// @return feeDistribution How the fee is meant to be /// distributed among the fee recipients. - function calculateRedemptionFees(address tco2, address pool, uint256 redemptionAmount) + function calculateRedemptionFees(address pool, address tco2, uint256 redemptionAmount) external view override diff --git a/src/interfaces/IFeeCalculator.sol b/src/interfaces/IFeeCalculator.sol index 9b2442d..2ef267b 100644 --- a/src/interfaces/IFeeCalculator.sol +++ b/src/interfaces/IFeeCalculator.sol @@ -15,23 +15,23 @@ struct FeeDistribution { /// @notice This interface defines methods for calculating fees. interface IFeeCalculator { /// @notice Calculates the deposit fee for a given amount. - /// @param tco2 The address of the TCO2 token. /// @param pool The address of the pool. + /// @param tco2 The address of the TCO2 token. /// @param depositAmount The amount to be deposited. /// @return feeDistribution How the fee is meant to be /// distributed among the fee recipients. - function calculateDepositFees(address tco2, address pool, uint256 depositAmount) + function calculateDepositFees(address pool, address tco2, uint256 depositAmount) external view returns (FeeDistribution memory feeDistribution); /// @notice Calculates the redemption fees for a given amount. - /// @param tco2 The address of the TCO2 token. /// @param pool The address of the pool. + /// @param tco2 The address of the TCO2 token. /// @param redemptionAmount The amount to be redeemed. /// @return feeDistribution How the fee is meant to be /// distributed among the fee recipients. - function calculateRedemptionFees(address tco2, address pool, uint256 redemptionAmount) + function calculateRedemptionFees(address pool, address tco2, uint256 redemptionAmount) external view returns (FeeDistribution memory feeDistribution); diff --git a/test/FeeCalculator.fuzzy.t.sol b/test/FeeCalculator.fuzzy.t.sol index 4f70cb2..c73d94f 100644 --- a/test/FeeCalculator.fuzzy.t.sol +++ b/test/FeeCalculator.fuzzy.t.sol @@ -48,7 +48,7 @@ contract FeeCalculatorTestFuzzy is Test { mockToken.setTokenBalance(address(mockPool), 1e9 * 1e18); vm.expectRevert("Fee must be greater than 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFeesFuzzy(uint256 depositAmount, uint256 current, uint256 total) public { @@ -68,7 +68,7 @@ contract FeeCalculatorTestFuzzy is Test { mockToken.setTokenBalance(address(mockPool), current); // Act - try feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount) {} + try feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount) {} catch Error(string memory reason) { assertTrue( keccak256(bytes("Fee must be greater than 0")) == keccak256(bytes(reason)) @@ -120,7 +120,7 @@ contract FeeCalculatorTestFuzzy is Test { uint256 multipleTimesRedemptionFailedCount = 0; // Act - try feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemptionAmount) returns ( + try feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemptionAmount) returns ( FeeDistribution memory feeDistribution ) { oneTimeFee = feeDistribution.shares.sumOf(); @@ -145,7 +145,7 @@ contract FeeCalculatorTestFuzzy is Test { for (uint256 i = 0; i < numberOfRedemptions; i++) { uint256 redemption = equalRedemption + (i == 0 ? restRedemption : 0); - try feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemption) returns ( + try feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemption) returns ( FeeDistribution memory feeDistribution ) { feeFromDividedRedemptions += feeDistribution.shares.sumOf(); @@ -203,7 +203,7 @@ contract FeeCalculatorTestFuzzy is Test { uint256 oneTimeFee = 0; // Act - try feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount) returns ( + try feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount) returns ( FeeDistribution memory feeDistribution ) { oneTimeFee = feeDistribution.shares.sumOf(); @@ -223,7 +223,7 @@ contract FeeCalculatorTestFuzzy is Test { for (uint256 i = 0; i < numberOfDeposits; i++) { uint256 deposit = equalDeposit + (i == 0 ? restDeposit : 0); - try feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), deposit) returns ( + try feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), deposit) returns ( FeeDistribution memory feeDistribution ) { feeFromDividedDeposits += feeDistribution.shares.sumOf(); @@ -278,7 +278,7 @@ contract FeeCalculatorTestFuzzy is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory gotRecipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; diff --git a/test/FeeCalculator.t.sol b/test/FeeCalculator.t.sol index 823292a..dc89840 100644 --- a/test/FeeCalculator.t.sol +++ b/test/FeeCalculator.t.sol @@ -74,7 +74,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -95,7 +95,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemptionAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemptionAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -116,7 +116,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemptionAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemptionAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -138,7 +138,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemptionAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemptionAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -168,7 +168,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -201,7 +201,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -224,7 +224,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -244,7 +244,7 @@ contract FeeCalculatorTest is Test { // Act vm.expectRevert("Fee must be greater than 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_DepositOfHundredWei_ShouldThrowError() public { @@ -261,7 +261,7 @@ contract FeeCalculatorTest is Test { // Act vm.expectRevert("Fee must be greater than 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_DepositOfHundredThousandsPartOfOne_NonzeroFee() public { @@ -275,7 +275,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -295,7 +295,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -334,7 +334,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -382,7 +382,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -411,7 +411,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -431,7 +431,7 @@ contract FeeCalculatorTest is Test { // Act vm.expectRevert("depositAmount must be > 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_CurrentGreaterThanTotal_ExceptionShouldBeThrown() public { @@ -447,7 +447,7 @@ contract FeeCalculatorTest is Test { vm.expectRevert( "The total volume in the pool must be greater than or equal to the volume for an individual asset" ); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateRedemptionFees_CurrentGreaterThanTotal_ExceptionShouldBeThrown() public { @@ -463,7 +463,7 @@ contract FeeCalculatorTest is Test { vm.expectRevert( "The total volume in the pool must be greater than or equal to the volume for an individual asset" ); - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateRedemptionFees_AmountGreaterThanCurrent_ExceptionShouldBeThrown() public { @@ -477,7 +477,7 @@ contract FeeCalculatorTest is Test { // Act vm.expectRevert("The amount to be redeemed cannot exceed the current balance of the pool"); - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateRedemptionFees_ZeroRedemption_ExceptionShouldBeThrown() public { @@ -491,7 +491,7 @@ contract FeeCalculatorTest is Test { // Act & Assert vm.expectRevert("redemptionAmount must be > 0"); - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_EmptyPool_FeeCappedAt10Percent() public { @@ -505,7 +505,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -525,7 +525,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -545,7 +545,7 @@ contract FeeCalculatorTest is Test { // Act vm.expectRevert("redemptionAmount must be > 0"); - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemptionAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemptionAmount); } function testCalculateRedemptionFees_TotalEqualCurrent_FeeCappedAt10Percent() public { @@ -559,7 +559,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), redemptionAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), redemptionAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -579,7 +579,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -599,7 +599,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -619,7 +619,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -640,7 +640,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -660,7 +660,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -805,7 +805,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), 100 * 1e18); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), 100 * 1e18); uint256[] memory fees = feeDistribution.shares; // Assert @@ -821,7 +821,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), 100 * 1e18); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), 100 * 1e18); uint256[] memory fees = feeDistribution.shares; // Assert @@ -837,7 +837,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), 100 * 1e18); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), 100 * 1e18); uint256[] memory fees = feeDistribution.shares; // Assert @@ -853,7 +853,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), 100e18); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), 100e18); uint256[] memory fees = feeDistribution.shares; // Assert @@ -869,7 +869,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), 100e18); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), 100e18); uint256[] memory fees = feeDistribution.shares; // Assert @@ -885,7 +885,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), 100 * 1e18); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), 100 * 1e18); uint256[] memory fees = feeDistribution.shares; assertEq(fees[0], 83 * 1e18); @@ -903,7 +903,7 @@ contract FeeCalculatorTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateRedemptionFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateRedemptionFees(address(mockPool), address(mockToken), depositAmount); uint256[] memory fees = feeDistribution.shares; // Assert diff --git a/test/FeeCalculatorLaunchParams.fuzzy.t.sol b/test/FeeCalculatorLaunchParams.fuzzy.t.sol index 3e91a7a..9c1576d 100644 --- a/test/FeeCalculatorLaunchParams.fuzzy.t.sol +++ b/test/FeeCalculatorLaunchParams.fuzzy.t.sol @@ -49,7 +49,7 @@ contract FeeCalculatorLaunchParamsTestFuzzy is Test { mockToken.setTokenBalance(address(mockPool), 1e9 * 1e18); vm.expectRevert("Fee must be greater than 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFeesFuzzy(uint256 depositAmount, uint256 current, uint256 total) public { @@ -69,7 +69,7 @@ contract FeeCalculatorLaunchParamsTestFuzzy is Test { mockToken.setTokenBalance(address(mockPool), current); // Act - try feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount) {} + try feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount) {} catch Error(string memory reason) { assertTrue( keccak256(bytes("Fee must be greater than 0")) == keccak256(bytes(reason)) @@ -116,7 +116,7 @@ contract FeeCalculatorLaunchParamsTestFuzzy is Test { uint256 oneTimeFee = 0; // Act - try feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount) returns ( + try feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount) returns ( FeeDistribution memory feeDistribution ) { oneTimeFee = feeDistribution.shares.sumOf(); @@ -137,7 +137,7 @@ contract FeeCalculatorLaunchParamsTestFuzzy is Test { for (uint256 i = 0; i < numberOfDeposits; i++) { uint256 deposit = equalDeposit + (i == 0 ? restDeposit : 0); - try feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), deposit) returns ( + try feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), deposit) returns ( FeeDistribution memory feeDistribution ) { feeFromDividedDeposits += feeDistribution.shares.sumOf(); diff --git a/test/FeeCalculatorLaunchParams.t.sol b/test/FeeCalculatorLaunchParams.t.sol index b9c42b2..3e4ee52 100644 --- a/test/FeeCalculatorLaunchParams.t.sol +++ b/test/FeeCalculatorLaunchParams.t.sol @@ -43,7 +43,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -74,7 +74,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -107,7 +107,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -130,7 +130,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -151,7 +151,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act vm.expectRevert("Fee must be greater than 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_DepositOfHundredWei_ShouldThrowError() public { @@ -168,7 +168,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act vm.expectRevert("Fee must be greater than 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_DepositOfHundredThousandsPartOfOne_NonzeroFee() public { @@ -182,7 +182,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -203,7 +203,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -243,7 +243,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -292,7 +292,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -322,7 +322,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -343,7 +343,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act vm.expectRevert("depositAmount must be > 0"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_CurrentGreaterThanTotal_ExceptionShouldBeThrown() public { @@ -359,7 +359,7 @@ contract FeeCalculatorLaunchParamsTest is Test { vm.expectRevert( "The total volume in the pool must be greater than or equal to the volume for an individual asset" ); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_EmptyPool_FeeCappedAt10Percent() public { @@ -373,7 +373,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -393,7 +393,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act vm.expectRevert("Deposit outside range"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_TotalEqualCurrent_FeeCappedAt10Percent() public { @@ -407,7 +407,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares; @@ -427,7 +427,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act vm.expectRevert("Deposit outside range"); - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); } function testCalculateDepositFees_ZeroCurrent_NormalFees() public { @@ -441,7 +441,7 @@ contract FeeCalculatorLaunchParamsTest is Test { // Act FeeDistribution memory feeDistribution = - feeCalculator.calculateDepositFees(address(mockToken), address(mockPool), depositAmount); + feeCalculator.calculateDepositFees(address(mockPool), address(mockToken), depositAmount); address[] memory recipients = feeDistribution.recipients; uint256[] memory fees = feeDistribution.shares;