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

Validation is not shown in case if user tries to confirm transaction with small gas fee that can't cover the transaction #21417

Open
VolodLytvynenko opened this issue Oct 11, 2024 · 5 comments

Comments

@VolodLytvynenko
Copy link
Contributor

Steps:

  1. Go to the swap page using an account with a small amount of ETH (e.g., 0.000001 ETH on the Arbitrum network).
  2. Attempt to confirm a transaction (e.g., USDC to Chainlink swap).

Actual Result:

On mobile: The user can navigate from the swap page to the confirmation page, then a "status-proxy-0.error: insufficient funds for gas" toast message is displayed after confirm button is tapped

mobile_swap.mp4

On desktop: The user is navigated to the main page, but the transaction does not proceed to the blockchain.

desktopswap.mp4

Expected result:

The user should receive a clear error message before attempting to confirm the transaction on swap page
Image

https://www.figma.com/design/AD2JSKg0I8dZcylyiGa62O/Swap-for-Mobile?node-id=48-124279&node-type=frame&m=dev

Logs:

Mobile:
Status-debug-logs.zip

Desktop:
Desktop.txt

@VolodLytvynenko
Copy link
Contributor Author

Hi @saledjenic this issue is a medium priority. It seems related to both, mobile and desktop. Could you take a look?

@saledjenic
Copy link

@VolodLytvynenko it's a bit different for Swap, @dlipicar may confirm, we're not building tx on our side as we do for other transactions that we can check for the estimated gas before signing the tx. I guess that we could display that error in case of swapping ETH for some other token, but in the case of ERC20 tokens, we cannot. We're using an external service, paraswap for that, and we're getting that error after we ask paraswap to build the tx for us, but we cannot ask paraswap to build it before we have approval for the token being swapped, so we cannot check before an approval tx is completed on the chain and at that point it's late. All we can do is do say that we rely on an external service and the tx will be validated after approval is placed.

@VolodLytvynenko
Copy link
Contributor Author

@saledjenic Got it. thank you for the explanation

but we cannot ask paraswap to build it before we have approval for the token being swapped, so we cannot check before an approval tx is completed on the chain and at that point it's late. All we can do is do say that we rely on an external service and the tx will be validated after approval is placed

In this case, I had already approved the ERC-20 asset. Therefore, I encountered the error after the transaction confirmation, not during the transaction approval.

@saledjenic
Copy link

@VolodLytvynenko is it easily reproducible? Could you share details/account that can be used to reproduce that issue?

@dlipicar
Copy link

@saledjenic could reproduce on L1 but not on Optimism, so this might be related to the account's ETH balance in relation to the gas required to perform the swap.
https://github.com/user-attachments/assets/09b7c03d-9eed-4dda-8038-ba94910e0fe8

geth.log doesn't show any error message


DEBUG[10-11|16:19:03.466|github.com/status-im/status-go/services/wallet/api.go:509]                                  call to StopSuggestedRoutesAsyncCalculation 
DEBUG[10-11|16:19:03.467|rpc/handler.go:307]                                                                         Served wallet_stopSuggestedRoutesAsyncCalculation reqid=105 duration="67.416µs"

DEBUG[10-11|16:19:06.204|github.com/status-im/status-go/services/wallet/api.go:779]                                  [WalletAPI::BuildTransactionsFromRoute] builds transactions from the generated best route uuid=m24xmt3kgm08c
DEBUG[10-11|16:19:06.204|rpc/handler.go:307]                                                                         Served wallet_buildTransactionsFromRoute reqid=108 duration="64.125µs"
DEBUG[10-11|16:19:06.922|github.com/status-im/status-go/services/wallet/api.go:666]                                  [WalletAPI::SignMessage]                 message=0x040895f8cb1de01466c20188ea982ae27a905fdcbf7941c3d508e1d24c90081f address=0xa1E277eA6b97eFfc5b61B3BF5dE03F438981247E
DEBUG[10-11|16:19:07.021|rpc/handler.go:307]                                                                         Served wallet_signMessage                reqid=111 duration=99.449334ms
DEBUG[10-11|16:19:07.021|github.com/status-im/status-go/services/wallet/api.go:842]                                  [WalletAPI:: SendRouterTransactionsWithSignatures] sign with signatures and send 
DEBUG[10-11|16:19:07.021|rpc/handler.go:307]                                                                         Served wallet_sendRouterTransactionsWithSignatures reqid=112 duration="90.083µs"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants