-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fees #314
Conversation
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
Fee calculation logic was inspired by OpenZeppelin lib extending ERC4626 vault. This commit is handling only fees upon depositing tBTC. Basis points will be set in next commits.
Calculation is inspired by the OZ lib extending ERC4626 with collecting fees upon withdrawal. Recepient for deposit and withdrawal is the same address pointing to treasury.
✅ Deploy Preview for acre-dapp-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Closed
Merged
nkuba
reviewed
Apr 2, 2024
nkuba
approved these changes
Apr 3, 2024
nkuba
added a commit
that referenced
this pull request
Apr 10, 2024
Depends on #314 This PR adds the first tBTC Allocator with depositing functionality only that will work with Mezo L2. The gateway for tBTC allocation on Mezo is called Mezo Portal and this is where tBTC are allocated from Acre. As of now, 100% of assets will flow to Mezo Portal upon staking in Acre. In the future the % of allocation might change once other L2/DeFi are introduced. Deposits are created as "rolling" deposits, meaning that the "old" Acre's deposit is drained and all the assets are moved to a newly created deposit. A new id is assigned and replaces the old one. The "old" deposit with zero balance is abandoned. Mezo Allocator now serves as a "Dispatcher" contract in stBTC because there is only one Mezo Allocator. Once we have more allocators, then the Dispatcher contract will need to be implemented and switched with the current Mezo Allocator contract in stBTC. MezoAllocator will be included in Dispatcher's authorized list of allocators.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds treasury fees upon depositing, minting, withdrawing and redeeming calls. Entry and exit fees are calculated based on the basis points. Entry and exit fees can be updated by the owner/governance.
Inspiration for fees calculation by OpenZeppelin: https://docs.openzeppelin.com/contracts/5.x/erc4626#fees