Skip to content

Commit

Permalink
Expose fee setup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmichalis committed Dec 21, 2023
1 parent bad587f commit 488a95a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FeeCalculator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,11 @@ contract FeeCalculator is IFeeCalculator, Ownable {

return intoUint256(fee_float);
}

/// @notice Returns the current fee setup.
/// @return recipients shares The fee recipients and their share of the total fee.
function getFeeSetup() external view returns (address[] memory recipients, uint256[] memory shares) {
recipients = _recipients;
shares = _shares;
}
}
20 changes: 20 additions & 0 deletions test/FeeCalculator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ contract FeeCalculatorTest is Test {
feeCalculator.feeSetup(recipients, feeShares);
}

function testGetFeeSetup() public {
address feeRecipient1 = 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B;
address feeRecipient2 = 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c;

address[] memory recipients = new address[](2);
recipients[0] = feeRecipient1;
recipients[1] = feeRecipient2;
uint256[] memory feeShares = new uint256[](2);
feeShares[0] = 30;
feeShares[1] = 70;

feeCalculator.feeSetup(recipients, feeShares);

(address[] memory _recipients, uint256[] memory _feeShares) = feeCalculator.getFeeSetup();
assertEq(_recipients[0], feeRecipient1);
assertEq(_recipients[1], feeRecipient2);
assertEq(_feeShares[0], 30);
assertEq(_feeShares[1], 70);
}

function testCalculateDepositFeesNormalCase() public {
// Arrange
// Set up your test data
Expand Down

0 comments on commit 488a95a

Please sign in to comment.