-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Combined swap and add/remove liquidity contract #26
Conversation
I realize this could be a lot more gas efficient, either by going to the pair directly or using the router ETH methods, but this unoptimized version works for now |
Some tokens like USDT do not allow approving an amount M > 0 when an existing amount N > 0 is already approved. This is to protect from an ERC20 attack vector described here https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/edit#heading=h.b32yfk54vyg9. We are encountering some issues adding/removing liquidity with A simple fix would probably be to just clear any residual allowance at the end of a call. |
Any progress on the above issue reported? It is blocking a lot of transactions atm and there's also the KNC token suffering the same symptoms on token.approve as USDT. |
…ovals with the router (#38) * Using MAX_UINT approvals with the router to avoid issues with tokens that don't support changing a non-zero approval * Clearing the existing router allowance in the (unlikely) case the allowance has shrank to less than the required amount * Trying to fix linter issue
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
closes #22