gnosis / safe-cmm-app-react

MIT License
2 stars 2 forks source link

Bug: Max Button rounding #219

Open andre-meyer opened 3 years ago

andre-meyer commented 3 years ago

Description

When the user uses the "max" funding, an issue can occur making it impossible to sign the transaction or worse, receive a failed transaction.

To Reproduce:

Steps to reproduce the behavior: This works best with odd amount of tokens. For example if you've used ETH to pay Gas, it will work well. Using exactly 10 xDAI won't work to reproduce.

  1. Navigate to the deploy page
  2. Using a token you have an odd amount of, use the max button on either funding side
  3. Continue as usual
  4. Sign transaction
  5. Observe failed transaction or failing signature

Expected Behaviour

Max should use exactly the users funds, and not round up using too much.

Actual Behaviour

Max amount can round up to be too much, resulting in errors.

Screenshots/Videos

/

Environment

Any

Background

One possible fix is to do a check if the selected amount is +/- 0.001 away from max funding, and if it is, use exactly the users balance.

alfetopito commented 3 years ago

Not able to reproduce. Tried several times with full amount of different tokens.

Tried both on Chrome and FF