gnosis / cowswap

🐮 CowSwap: First Gnosis Protocol v2 UI
https://gnosis.io
GNU General Public License v3.0
113 stars 55 forks source link

Slightly more WETH unwrapped than requested #1286

Open MareenG opened 3 years ago

MareenG commented 3 years ago

Description I wanted to unwrap 0.5 WETH but 0.5025125 ETH was unwrapped. https://rinkeby.etherscan.io/tx/0xa5209572c3610cac85b7a25864588deaf12c96deae66281090932d57422e145f This happened on Rinkeby in production. I submitted another request to unwrap right after and the exact amount was unwraped.

Bildschirmfoto 2021-08-19 um 15 24 37

Expected behavior Exact input amount should be unwrapped

alfetopito commented 3 years ago

That's not good. Did you manually enter the 0.5 input? Or was it by any chance a left over of switching back and forth buy/sell amounts?

MareenG commented 3 years ago

It was manually. Could this happen by switching back and forth buy/sell amounts? The input displayed was definitely 0.5.

alfetopito commented 3 years ago

I don't know, I'm trying to understand how this could have happened. My guess would be that if inputting the "buy amount" and it calculated to something close to "0.5".

@W3stside any clues?

elena-zh commented 2 years ago

I have been able to reproduce this issue today when testing #1606 pr: amount

So I entered manually an amount of 0.01 WETH, then swapped tokens not changing the amount, then sighed the transaction.

alfetopito commented 2 years ago

@gnosis/gp-frontend guys, I think the state might not be cleared completely when doing a wrap instead of swap.

From the report looks like the "extra" wrapped amount could be equivalent to the fee added to sell amounts.

Thoughts?

anxolin commented 2 years ago

~Ohh, that looks bad! This a new issue we (and probably me) just introduced?~

😅 I wrote too fast. This must be an old issue. Looks bad... yep good to address it

elena-zh commented 2 years ago

I have faced the issue again in RC 1.5.0 image