-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/access-control' of github.com:meTokens/meTokens-cor…
…e into fix/access-control
- Loading branch information
Showing
35 changed files
with
1,923 additions
and
1,277 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 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 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 |
---|---|---|
@@ -1,58 +1,87 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.0; | ||
|
||
/// @title Curve Interface | ||
/// @title Generic Curve interface | ||
/// @author Carl Farterson (@carlfarterson) | ||
/// @dev Required for all Curves | ||
interface ICurve { | ||
event Updated(uint256 indexed hubId); | ||
/// @notice Event when curveDetails are updated from target values to actual values | ||
event Updated(uint256 indexed _hubId); | ||
|
||
/// @notice Given a hub, baseX, baseY and connector weight, add the configuration to the | ||
/// BancorZero Curve registry | ||
/// @dev Curve need to be encoded as the Hub may register Curves for different curves | ||
/// that may contain different Curve arguments | ||
/// @param _hubId unique hub identifier | ||
/// @param _encodedDetails encoded Curve arguments | ||
/// @param _hubId unique hub identifier | ||
/// @param _encodedDetails encoded Curve arguments | ||
function register(uint256 _hubId, bytes calldata _encodedDetails) external; | ||
|
||
/// @notice TODO | ||
/// @param _hubId unique hub identifier | ||
/// @param _encodedDetails encoded target Curve arguments | ||
/// @notice Initialize reconfiguring curveDetails for a hub | ||
/// @param _hubId unique hub identifier | ||
/// @param _encodedDetails encoded target Curve arguments | ||
function initReconfigure(uint256 _hubId, bytes calldata _encodedDetails) | ||
external; | ||
|
||
/// @notice Finish reconfiguring curveDetails for a hub | ||
/// @param _hubId uinque hub identifier | ||
function finishReconfigure(uint256 _hubId) external; | ||
|
||
/// @notice Get curveDetails for a hub | ||
/// @return curveDetails (TODO: curve w/ more than 4 curveDetails) | ||
function getDetails(uint256 _hubId) | ||
external | ||
view | ||
returns (uint256[4] memory); | ||
|
||
/// @notice Calculate meTokens minted based on a curve's active details | ||
/// @param _assetsDeposited Amount of assets deposited to the hub | ||
/// @param _hubId unique hub identifier | ||
/// @param _supply current meToken supply | ||
/// @param _balancePooled area under curve | ||
/// @return meTokensMinted amount of MeTokens minted | ||
function viewMeTokensMinted( | ||
uint256 _assetsDeposited, | ||
uint256 _hubId, | ||
uint256 _supply, | ||
uint256 _balancePooled | ||
) external view returns (uint256 meTokensMinted); | ||
|
||
/// @notice Calculate assets returned based on a curve's active details | ||
/// @param _meTokensBurned Amount of assets deposited to the hub | ||
/// @param _hubId unique hub identifier | ||
/// @param _supply current meToken supply | ||
/// @param _balancePooled area under curve | ||
/// @return assetsReturned amount of assets returned | ||
function viewAssetsReturned( | ||
uint256 _meTokensBurned, | ||
uint256 _hubId, | ||
uint256 _supply, | ||
uint256 _balancePooled | ||
) external view returns (uint256 assetsReturned); | ||
|
||
/// @notice Calculate meTokens minted based on a curve's target details | ||
/// @param _assetsDeposited Amount of assets deposited to the hub | ||
/// @param _hubId unique hub identifier | ||
/// @param _supply current meToken supply | ||
/// @param _balancePooled area under curve | ||
/// @return meTokensMinted amount of MeTokens minted | ||
function viewTargetMeTokensMinted( | ||
uint256 _assetsDeposited, | ||
uint256 _hubId, | ||
uint256 _supply, | ||
uint256 _balancePooled | ||
) external view returns (uint256 meTokensMinted); | ||
|
||
/// @notice Calculate assets returned based on a curve's target details | ||
/// @param _meTokensBurned Amount of assets deposited to the hub | ||
/// @param _hubId unique hub identifier | ||
/// @param _supply current meToken supply | ||
/// @param _balancePooled area under curve | ||
/// @return assetsReturned amount of assets returned | ||
function viewTargetAssetsReturned( | ||
uint256 _meTokensBurned, | ||
uint256 _hubId, | ||
uint256 _supply, | ||
uint256 _balancePooled | ||
) external view returns (uint256 assetsReturned); | ||
|
||
function finishReconfigure(uint256 id) external; | ||
} |
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 |
---|---|---|
@@ -1,28 +1,50 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.0; | ||
|
||
/// @title MeTokens protocol fee interface | ||
/// @author Carl Farterson (@carlfarterson) | ||
interface IFees { | ||
function setBurnBuyerFee(uint256 amount) external; | ||
/// @notice Set meToken protocol BurnBuyer fee | ||
/// @param _fee new fee | ||
function setBurnBuyerFee(uint256 _fee) external; | ||
|
||
function setBurnOwnerFee(uint256 amount) external; | ||
/// @notice Set meToken protocol BurnOwner fee | ||
/// @param _fee new fee | ||
function setBurnOwnerFee(uint256 _fee) external; | ||
|
||
function setTransferFee(uint256 amount) external; | ||
/// @notice Set meToken protocol Transfer fee | ||
/// @param _fee new fee | ||
function setTransferFee(uint256 _fee) external; | ||
|
||
function setInterestFee(uint256 amount) external; | ||
/// @notice Set meToken protocol Interest fee | ||
/// @param _fee new fee | ||
function setInterestFee(uint256 _fee) external; | ||
|
||
function setYieldFee(uint256 amount) external; | ||
|
||
function setOwner(address _owner) external; | ||
/// @notice Set meToken protocol Yield fee | ||
/// @param _fee new fee | ||
function setYieldFee(uint256 _fee) external; | ||
|
||
/// @notice Get mint fee | ||
/// @return uint256 _mintFee | ||
function mintFee() external view returns (uint256); | ||
|
||
/// @notice Get burnBuyer fee | ||
/// @return uint256 _burnBuyerFee | ||
function burnBuyerFee() external view returns (uint256); | ||
|
||
/// @notice Get burnOwner fee | ||
/// @return uint256 _burnOwnerFee | ||
function burnOwnerFee() external view returns (uint256); | ||
|
||
/// @notice Get transfer fee | ||
/// @return uint256 _transferFee | ||
function transferFee() external view returns (uint256); | ||
|
||
/// @notice Get interest fee | ||
/// @return uint256 _interestFee | ||
function interestFee() external view returns (uint256); | ||
|
||
/// @notice Get yield fee | ||
/// @return uint256 _yieldFee | ||
function yieldFee() external view returns (uint256); | ||
} |
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.