0xProject / 0x-launch-kit-frontend

Apache License 2.0
114 stars 208 forks source link

Frontend supports only 18 decimal tokens #516

Closed icinsight closed 5 years ago

icinsight commented 5 years ago

If your token has something else than 18 decimals you'll get weird calculations in orders and balances. My Wallet renders correctly. These orders fail, of course.

image

icinsight commented 5 years ago

In this case "Wallet balance" shows 0.00 (it is 800 in reality) and "Trade Size" shows 20000000000 (the real one I managed to post was 2 tokens).

image

image

icinsight commented 5 years ago

8 decimals in 0xBitcoin token. I used "8" in tokens_metadata file. Trying "18" didn't solve the issue, obviously. https://etherscan.io/token/0xb6ed7644c69416d67b522e20bc294a9a9b405b31

icinsight commented 5 years ago

I added DGD, a 9 decimal token, as one more option. As seen before, numbers are 9 decimals too big. Orders were for 0.1 and 0.25 DGD. Also, I have some DGD in the wallet, but Balance shows 0.00.

image

tomhschmidt commented 5 years ago

Wow, this is really bad. Huge potential for misleading order creation / fills.

willwarren89 commented 5 years ago

Definitely an oversight, thank you for bringing this to our attention @icinsight.

alessiofx commented 5 years ago

I have same problem whit the crypto 2 decimals

unjapones commented 5 years ago

This should be now fixed in development. It ended up being a little bit trickier than we originally thought because of the price abstraction the UI handles.

I remember that other UI/relayers like Bamboo presented a more verbosed form in the UI that let you enter the maker & taker amounts. That design is absolutely more explicit but it also forces the user to do the math :grimacing: