realcodywburns / TokenMint

:fish_cake: Token Browser and Manager for Ethereum Classic and Ethereum
Apache License 2.0
44 stars 27 forks source link

Fundraising Goal Bug #55

Closed ChuckSRQ closed 7 years ago

ChuckSRQ commented 7 years ago

I created an ICO with Fundraising Goal of .00001000 ETC and got this.

Funding Goal: 288230376018821608 ETC ($6676856660476002549.32)

image

elaineo commented 7 years ago

i'm surprised you were even able to submit that, because decimals get encoded as negative numbers :b

So here's the thing -- TokenPrice is actually submitted in wei (so .0000000001 ETC actually gets converted to 100000000 wei). But Funding Goal is submitted in ether, because we assumed that no one would ever bother crowdfunding less than $20. We can update the contract to set the funding goal in wei, if that seems like a reasonable use case. @realcodywburns do you know if this affects gas costs?

realcodywburns commented 7 years ago

It shouldnt effect the gas. You could add a test that throws if the fund goal > 100 million or something. That would fix the roll over. Solidity really needs floating point operations

elaineo commented 7 years ago

browser-side validation added before tx submission