balance-io / balance-manager

A tool to manage your wallets
https://manager.balance.io
GNU General Public License v3.0
143 stars 84 forks source link

Sending Max amount of tokens fails due to rounding (For example LPT token) #468

Open abstractpoint opened 5 years ago

abstractpoint commented 5 years ago

What is this issue about? (select one)

Issue Description

I have tried to send LPT token to another address, so I clicked on Max and it game me a value of 97.5489046591681266 to be sent. I then got a transaction submitted without a problem, but later transaction failed with an error

Warning! Error encountered during contract execution [Reverted] 
ERC-20 Token Transfer Error (Unable to locate Corresponding Transfer Event Logs), Check with Sender.

I suspect it is either an amount that got rounded up, which my account didn't have or this particular token does not allow sending fractions of itself.

In either case, some kind of advisory note in the UI would help prevent this error.

Steps to reproduce

  1. Send a non round amount (with 16 decimal points) of LPT token to yourself or another address
  2. Note the error with LPT smart contract

Expected Behavior

Transaction should have succeeded, or UI shouldn't let me send the amount I entered.

 Actual Behavior

Transaction resulted in a revert.