-
I need to do swap from uni to eth, my code is as below, all is fine except the unwrap procedure, the weth continue to increase, but not unwrap to eth, and I have tried to change unwrap_weth 1st para from FunctionRecipient.ROUTER, FunctionRecipient.SENDER, and 2nd para from 0 to int(0.03*10**18)) , but none work, it doesn't report any error, just not unwrap weth to eth, I have also tried use call only the unwrap function, not work as sell, any help for me to unwrap the weth to eth? many thank in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @whlustb , In order to receive ETH i/o WETH, I confirm that the first parameter should be .unwrap_weth(FunctionRecipient.SENDER, 0) Apart from that, I don't see any obvious issue with your code. |
Beta Was this translation helpful? Give feedback.
-
Are you using this address for WETH on Sepolia: Also, maybe you could share the link to a transaction where you use |
Beta Was this translation helpful? Give feedback.
-
1/ The 2/ In your last transaction, you instructed the router to send the result of the swap directly to you, so there is no remaining weth to unwrap ... |
Beta Was this translation helpful? Give feedback.
1/ The
unwrap_weth()
method unwraps weth that are in the router's balance, not in you wallet.2/ In your last transaction, you instructed the router to send the result of the swap directly to you, so there is no remaining weth to unwrap ...
The recipient of the swap method should be
FunctionRecipient.ROUTER
in this case.