DA0-DA0 / docs

DAO DAO documentation.
https://docs.daodao.zone
12 stars 14 forks source link

Incorrect calculation of tokens while creating a proposal with send message #25

Closed szymcio32 closed 2 years ago

szymcio32 commented 2 years ago

When I create a proposal and add a send message with token's amount 0.05 then the proposal is created with an incorrect amount: 50000

juno_dao-3-1

juno_dao-3-2 .

JakeHartnell commented 2 years ago

This is actually the right amount... note the denom is ujunox. Cosmos tokens have normal and micro denoms, and blockchains in general don't use floating point numbers for math. For example, 1 Bitcoin is comprised of 100,000,000 Satoshis.

Curious how we could make this more clear to the user... thanks for all of these issues by the way. I've moved them over to the relevant repos to be addressed. All code will be open sourced on the 31st.

szymcio32 commented 2 years ago

Ohh, good to know. Have you considered showing the message to the end-user in a more user-friendly format than json? I mean you could create a UI template to which json file will be converted and then display to the user. When the user sends the proposal the UI template will be converted back to json file. In this case you could handle floating point numbers. But it will definitely require more work and maintain additional functionality.