-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Consider fee accrual as 1155 balance #203
Comments
Currently protocolFees can be claimed by 2 parties: |
hi @hensha256 , i want to work on this issue. can you please assign it to me? |
Sure! Feel free to tag me here if you have any questions! |
ok. Thank you |
Hi @hensha256 , From reading this and checking contracts I am able to understand that:
"accrued fees" - refer to the fees that have accumulated or been earned by the protocol and hooks.
Am I thinking right?? or is there anything else? Also if it is right then I am thinking to solve it this way:---
also please tell me is it right way to approach? |
Hi @hensha256 , can you please tell me these things?? So now for minting ERC1155, it is required: so I can set the amount to 1. what should i set nft id?? currency key? (key.currency0) and then what to whom should i mint this nft?? to this contract?? (address(this)) or to someone else?? in "collectProtocolFees" function from where should I subtract the amount?? should i create a new mapping for both of the two?? in which we will maintain fees accrued of and then subtract in this function?? and also what should be the key for this mapping?? nft id or same as this?? |
Hi @abhithory! Your approach in your first comment sounds correct to me! Please feel free to try implementing that as a PR!
If you look at the
For hooks, the hook itself should own the 1155. As you can see in For protocol fees it will need to either be the |
The amount will be the NFT owner's balance. For that reason we will not need the functions |
@hensha256 thank you very much.... I will make its correct PR. |
hi @hensha256 , when i remove is it okay?? |
Hi @hensha256 , I apologize for asking so many questions, but this is my first time contributing, and I want to make sure I don't make any mistakes. That's why I'm asking about everything. So, in the PoolManager contract, I have correctly implemented ERC1155 for minting fee accrual. However, after removing the old functions, some test cases are failing in both Hardhat and Foundry tests. So, i commented these function uses in test files and then run all tests according to contribute.md documentation. and everything else is fine after commenting. Now, what should I do?
Please let me know what will be more suitable. |
hi @hensha256 , please let me know at least.... am i asking extra? or anything wrong? |
Hi, |
Hi, I gave it a shot, please let me know if there's anything I should change, thanks! |
We have decided not to move ahead with this for now due to the additional cost on swaps for minting a 6909 |
Components
Singleton, 1155 Balances
Describe the suggested feature and problem it solves.
Currently fees accrued to the protocol and to hooks are stored in mappings. However the ERC1155 implementation of the PoolManager should allow us to actually accrue these as 1155 minting instead of having separate mappings.
Describe the desired implementation.
Remove the 2 mappings
protocolFeesAccrued
andhookFeesAccrued
and instead mint 1155s, similarly to inPoolManager.mint
Describe alternatives.
No response
Additional context.
No response
The text was updated successfully, but these errors were encountered: