Skip to content
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

Unable to wrap ETH to WETH and unwrap WETH to ETH on Testnet #11

Open
Z-Hau opened this issue Jul 8, 2021 · 17 comments
Open

Unable to wrap ETH to WETH and unwrap WETH to ETH on Testnet #11

Z-Hau opened this issue Jul 8, 2021 · 17 comments

Comments

@Z-Hau
Copy link

Z-Hau commented Jul 8, 2021

Unable to perform ETH > WETH and WETH > ETH on Testnet.

@vm06007
Copy link

vm06007 commented Aug 27, 2021

is this only for testnet?

@vm06007
Copy link

vm06007 commented Aug 27, 2021

I've experienced same on mainnet as well, swapped into ETH.MAINNET().contractAddress and got WETH back!

@joshstevens19
Copy link
Owner

joshstevens19 commented Aug 28, 2021

Can you give me a code sample so I can test this please. You should not get WETH using ETH logic like that and that would be something we should fix ASAP. ETH > WETH is supported on mainnet on this lib. A demo project on GitHub would be great. @vm06007

@vm06007
Copy link

vm06007 commented Aug 28, 2021

@joshstevens19 it looks like the route-path is not generated correctly, here is the output of trade object after it is created

Screen Shot 2021-08-28 at 6 34 15 PM

so despite the toToken is NO_CONTRACT_ADDRESS I'm still getting WETH swap, and not swapExactTokensForETH as expected

I can't share code, but it is straight forward just making pairFactory and then setting .trade(value);

following by

const signer = library.getSigner(account); await signer.sendTransaction(trade.transaction);

@vm06007
Copy link

vm06007 commented Aug 28, 2021

Screen Shot 2021-08-28 at 6 43 26 PM

@vm06007
Copy link

vm06007 commented Aug 28, 2021

if I can help somehow to resolve this let me know, happy to assist, meanwhile really cool package, sent you some dai: https://etherscan.io/tx/0x7f12891d19597ea32a419f932281f8ea228f244fed2f02a79ed649d1c4971908

@joshstevens19
Copy link
Owner

Ahh nice spot ok will check this out tomorrow thanks a lot for your donation means a lot! Thanks for raising this issue 👍👍👍

@joshstevens19
Copy link
Owner

So this is not part of this ticket but that is now fixed on version 3.4.2 for you @vm06007 great spot!! it now uses multicall to unwrap the weth for you so you get eth back now. I have tested this on rinkeby + mainnet both on input and output and seems to work fine. Let me know its all good your end and thanks again for raising.

In terms of unwrap and wrap eth on testnets should be pretty simple for me to add now I've done the changes for this so will look at that when I get a second as the ticket is quite old.

@vm06007
Copy link

vm06007 commented Aug 29, 2021

Okay cool! I'll upgrade, test it out and let you know

@joshstevens19
Copy link
Owner

awesome this issue was only happening on v3 not v2 it seemed this was just an oversight from me that I forgot to unwrap it once the swap had done (after i refactored to allow native and weth to be separate things) yeah do let me know. Thanks again

@vm06007
Copy link

vm06007 commented Aug 29, 2021

looks good! tried on ropsten https://ropsten.etherscan.io/tx/0x21452ea2d7e895b2fb0b7a0fb993fa56af896210df397542b3676e72e45dee2f
will give it a bit more testing on mainnet tomorrow.

@joshstevens19
Copy link
Owner

Awesome!!!

@vm06007
Copy link

vm06007 commented Sep 4, 2021

All looks good! @joshstevens19 I've tried to send you another 0.05 ETH, but I think I've forgot one 0 https://etherscan.io/tx/0x6bf2ba27226061d09ddc680a9669fc7257812f71388faedd702f27baada38529
could you send it back to same wallet please? 😇

@joshstevens19
Copy link
Owner

joshstevens19 commented Sep 4, 2021

Haha!! Oh gosh @vm06007 thanks for the donation!! Yes you defo added a forgot a 0 haha il send it back to you once back on a computer later today, back to the same address yeah?

thanks again for your donation your a legend!!!!!

@vm06007
Copy link

vm06007 commented Sep 4, 2021

yeah :) same should be fine (0x6dbc5fbb69d43442a5bec07e18037896b1e2ef6d)

@joshstevens19
Copy link
Owner

Sure will do this once back on PC (will be today) will send tx etherscan link once done. Thanks again for 0.05 ETH donation 👍

@joshstevens19
Copy link
Owner

@vm06007 https://etherscan.io/tx/0xe0da6b719b9581af448ba2b56f99d0ef02467bc1da8c3fb019e5089aebfb63b8 < sent 0.45 ETH back! thanks again for the 0.05 donation! 👍

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

No branches or pull requests

3 participants