Skip to content

Fix v3 behaviour when input or output token is ETH #159

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

Merged
merged 7 commits into from
Sep 17, 2021

Conversation

nimcon
Copy link
Contributor

@nimcon nimcon commented Aug 23, 2021

Fix for Uniswap v3 behaviour when ETH is the input or output token, resolving issues #154 and #155. There has also been some general tidying-up of parts of the code. Basic tests for all v3 scenarios have been run, but it would be good to check edge cases and verify that v1 and v2 still work as expected.

@romanbsd
Copy link
Contributor

Cool! I didn't get to do it, and it's pretty much what I had in mind!

@@ -376,28 +395,27 @@ def make_trade(
if slippage is None:
slippage = self.default_slippage

if input_token == output_token:
raise ValueError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe assert input_token != output_token is better?

Copy link
Member

@ErikBjare ErikBjare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Ran tests locally and works well!

A couple of unrelated tests failed, but that's my bad, and they're not testing anything important.

@ErikBjare ErikBjare merged commit c177a87 into uniswap-python:master Sep 17, 2021
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy