yearn / yearn-finance-v3

Yearn Finance Web App v3
https://yearn.finance
124 stars 140 forks source link

fix: error messaging #664

Closed FoxTheSin closed 2 years ago

FoxTheSin commented 2 years ago

Describe the bug While error messaging has gotten better, we need a specific one for when users don't have enough ETH to cover transaction.

To Reproduce Steps to reproduce the behavior:

  1. make sure wallet has dust of eth
  2. go to an transaction (deposit, withdraw, stake, any tx from any modal.)
  3. try to pass through simulation
  4. See error

Expected behavior A specific error message would pop up when simulation identifies that user doesn't have enough eth for transaction. (if needed, tolerance of ~%10. so if tx would cost 1000 gwei, user would need 1100 gwei to cover.)

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

image

Environment Information

Additional context

Potentially we are ignoring this error https://github.com/yearn/yearn-sdk/blob/11e9632832ec83afac0836c8d0e08cb792de08f7/src/simulationExecutor.ts#L306