-
Notifications
You must be signed in to change notification settings - Fork 1k
Voluntary fees IBC middleware #4968
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
base: main
Are you sure you want to change the base?
Conversation
d028bf5 to
c1e5d52
Compare
🧪 CI InsightsHere's what we observed from your CI run for 18eea0b. ✅ Passed Jobs With Interesting Signals
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
22817c3 to
18eea0b
Compare
| else { | ||
| break 'frontend_sus_fee None; | ||
| }; | ||
| if !swap_into_znam { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we want to pay a sus fee because the source is shielded? (So swapping from a shielded address to a transparent one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, build_ibc_transfer attaches the fee to the transfer data on the way out so we should be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we overwrite the value of transfer.frontend_sus_fee to None when we build the memo (i.e. when we swap from a transparent to a shielded address)? Cause the build_ibc_transfer function seems to return an error in this case
Describe your changes
Closes #4944
Based on #4939
Review: https://github.com/namada-net/namada/pull/4968/files/ed70e61a6aa728c9efa2a42aca24068ebb4888b6..18eea0b7ed599f23df15713592869302a3722533
This PR reworks the now useless Osmosis Shielded Swaps IBC middleware, which was then used to transfer amounts overflowing the min output of a trade to a transparent account.
Its role is now to redirect some funds transferred to a payment address (with memoless IBC shieldings) to a transparent account, to collect IBC shielding fees.
In this PR, it is integrated with the existing Osmosis Shielded Swaps SDK functionality. In Namadillo, an IBC memo must be set when using Keplr to shield funds over to Namada. It should have the following structure:
{ "namada": { "voluntary_fees": { "fee_receiver": "tnam1...", "new_received_amount": "123" } } }Where
new_received_amountis the original amount minus the intended fee.Checklist before merging
breaking::labelsnamada-docsreponamada-indexerornamada-masp-indexer, a corresponding PR is opened in that repo