Skip to content
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

Merged
merged 10 commits into from
Apr 3, 2024
Merged

Fees #314

merged 10 commits into from
Apr 3, 2024

Conversation

dimpar
Copy link
Member

@dimpar dimpar commented Mar 14, 2024

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

dimpar added 2 commits March 14, 2024 12:11
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.
Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 7d2e5ba
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/660d753ab0e3710008c1b8f2
😎 Deploy Preview https://deploy-preview-314--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dimpar dimpar requested a review from nkuba March 14, 2024 11:57
@dimpar dimpar self-assigned this Mar 15, 2024
@nkuba nkuba mentioned this pull request Mar 18, 2024
@dimpar dimpar marked this pull request as ready for review March 19, 2024 09:23
@nkuba nkuba requested a review from r-czajkowski March 19, 2024 12:21
@dimpar dimpar mentioned this pull request Mar 20, 2024
core/test/stBTC.test.ts Outdated Show resolved Hide resolved
core/test/stBTC.test.ts Show resolved Hide resolved
core/test/stBTC.test.ts Outdated Show resolved Hide resolved
core/test/stBTC.test.ts Outdated Show resolved Hide resolved
core/test/stBTC.test.ts Show resolved Hide resolved
core/test/stBTC.test.ts Outdated Show resolved Hide resolved
@dimpar dimpar requested a review from nkuba April 3, 2024 10:53
@nkuba nkuba enabled auto-merge April 3, 2024 15:28
@nkuba nkuba merged commit 1e05e0e into main Apr 3, 2024
21 checks passed
@nkuba nkuba deleted the fees branch April 3, 2024 15:30
This was referenced Apr 4, 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants