swap form frontend calculation error for ETH to any token.
[BUG] : when we click max button, I should get my exact balance in the input field(Actual Balance: 0.010), as you can see what am I getting (0.000174...) its happening only for ETH
I want to work on this, I already started and setup it up in my local env. This will be my first contribution to Uniswap
This is not a bug I think, as you said it's only happening with ETH.
As ETH is the native currency, which is used to pay for gas fees. Uniswap Dapp just shows the amount after substracting the amount that needs to be in the wallet for the gas fees so that the transaction successfully goes through.
Other protocols do this as well, because the user doesn't know how much will be the gas cost.
Im having this same issue too. I'm trying to fork a swap on a test net, and this same thing happens.. works fine on the actualy network, but I get this issue with ETH on arbitrum
Hey @RedPillPhil what is the exact issue, can you also share the screenshots?
Hey @RedPillPhil what is the exact issue, can you also share the screenshots?
Thanks for your response.
Actually, my issue is a bit different..
I click the "Max" button, and it just inputs 0. Despite having a balance showing that is above zero. Any time I try to make a swap involving ETH native token, it shows me an error "The transaction cannot succeed due to error: undefined. This is probably an issue with one of the tokens you are swapping." I can swap token for token just fine, but swapping involving ETH does not work. It does let me attempt to wrap eth if I swap for wrapped ETH.
This happens when I attempt to fork a swap on arbitrum, there must be something I am forgetting to change.
https://swapfork.vercel.app/#/swap <--- I put together a live version here, so you can see the problem https://github.com/RedPillPhil/swapfork <---- repo is here