superhero-com / superhero-wallet

Superhero Wallet – More than just a way to receive, store & send tokens on the æternity blockchain
https://wallet.superhero.com
ISC License
39 stars 38 forks source link

I got an issue when tried to send ERC-20 token one by one #3012

Open Liubov-crypto opened 5 months ago

Liubov-crypto commented 5 months ago

Describe the bug 1- i sent 0.1 link 2 - then i was trying to sent max link in a while and got an issue

I think this is because the previous tx was in pending status and the balance was not updated properly after sent 1st tx

To Reproduce Steps to reproduce the behavior:

  1. Go to eth acc
  2. try to send some amount of erc-20 token
  3. then send full amount of erc-20 token
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context reproducible on dev branch

Image

Image

smaroudasunicorn commented 4 months ago

We need to improve the wording for the message. We have to inform him that balance is not updated, transaction is not mined etc.

martinkaintas commented 4 months ago

The returned error is very vague: "Error happened while trying to execute a function inside a smart contract" so we can't tell why the tx failed

Also, I noticed that the API needs more than 30s to update the new balance, meaning that even if we correct the balance on our side, the next call to the API will likely return the old (false) value and will reset the corrected value.

What we could do is:

  1. After sending a transaction, we check if the balance was updated correctly. If not, show a modal that tells the user that the current token balance might be outdated
  2. Or force the wallet to use the corrected value for some time (e.g. 30s) to give time to the API to update to the correct value
onvisions commented 4 months ago

@CedrikNikita Is there a way to improve the returned errors so based on it we can suggest better wording? Vague wording of errors is always bad for UX. On the other hand if we have technical limitation to know what's the error we can't improve anything and we will continue displaying to the users too generalized error messages.