-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break down fee calculator interfaces
The pool contract needs to estimate the fee to charge for a deposit or redemption separately from executing the distribution of the total fee to the fee recipients because in between the two the pool contract needs to either burn the tokens from the user in case of a redemption or mint tokens to the user in case of a deposit. In order to best facilitate this requirement the current fee calculator interface needs to separate estimating the fee of a deposit/redemption from estimating the shares for each fee recipient.
- Loading branch information
1 parent
fbcbc73
commit d4cf262
Showing
8 changed files
with
162 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-FileCopyrightText: 2023 Neutral Labs Inc. | ||
// | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
// If you encounter a vulnerability or an issue, please contact <info@neutralx.com> | ||
pragma solidity ^0.8.13; | ||
|
||
/// @title IFeeCalculator | ||
/// @author Neutral Labs Inc. | ||
/// @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 depositAmount The amount to be deposited. | ||
/// @return feeAmount The fee to be charged in pool | ||
/// tokens for this deposit. | ||
function calculateDepositFees(address tco2, address pool, uint256 depositAmount) | ||
external | ||
returns (uint256 feeAmount); | ||
|
||
/// @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 redemptionAmount The amount to be redeemed. | ||
/// @return feeAmount The fee to be charged in pool | ||
/// tokens for this redemption. | ||
function calculateRedemptionFees(address tco2, address pool, uint256 redemptionAmount) | ||
external | ||
returns (uint256 feeAmount); | ||
|
||
/// @notice Calculates the total fee among the recipients according to their shares. | ||
/// @param totalFee The total fee to be distributed. | ||
/// @return recipients The addresses of the fee recipients. | ||
/// @return feesDenominatedInPoolTokens The amount of fees each recipient should receive. | ||
function calculateFeeAmongShares(uint256 totalFee) | ||
external | ||
view | ||
returns (address[] memory recipients, uint256[] memory feesDenominatedInPoolTokens); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.