-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat(swap): add an option not to withdraw swapped ZRC20 #96
Conversation
@andresaiello this is a proposal to extend the swap example to handle a scenario where a user wants to keep the swapped ZRC-20 asset instead of immediatly withdrawing it. This might seem odd, but I'm building an example frontend where I want users to be able to transfer/swap/withdraw/deposit all tokens to all other tokens. One of the few operations left is "deposit and swap": Want to know your opinion on this. Even though not withdrawing might seem odd (most users will want to withdraw), having this swap component talk to this example contract would make it component also a demo of the example contract. |
@andresaiello another question I have is adapting example-contracts/omnichain/swap/contracts/Swap.sol Lines 28 to 39 in 7dab1a4
Of course, we already have a helper for this, but it's only for Would it be a good idea to add the |
good idea. I didn't need it yet but looks like someone may need it. Let's just call it bytesMemoryToAddress |
@andresaiello wdyt about the changes to contract in general? The ability to not withdraw tokens during swap may seem a bit niche, but it has a few advantages: it matches the requirements of the example frontend (to be able to swap gas/ERC-20 to ZRC-20 without withdrawing) and uses the same pattern of |
We need to update this PR to be compatible with the code as it is in the |
Going to implement this next as a third part of the swap tutorial:
To simplify things I'm probably not going to use an |
No description provided.