News for hackers. Stuff that matters.
Re:Understanding Ethereum Smart Contracts by flashmob on Wednesday November 29, 2017 @08:37AM (#15806599)
Some very good points. I recall that the mainnet once had a gas per block limit of 4.7 mil before it was increased. The increase is something that is voted on by the miners, and has been fluid over the years. (Btw, it is something very similar to a block size limit in BTC, although it limits the storage + CPU usage, rather than just storage like in BTC)

About the point on using floats, one should never use floats when working with money, this is because floats are not precise and result in rounding errors (eg. 0.1 + 0.2 results 0.30000000000000004, see for details http://0.30000000000000004.com ). One of the simplest approaches to solve it is to work with the smallest units, so if working with dollars then you can use cents and that means you can use integers which give more precision, which is how Solidity currently deals with it, by working with the smallest unit of Ether which is 'wei'. Some of the units listed here https://etherconverter.online

Re:Understanding Ethereum Smart Contracts by jatsign on Wednesday November 29, 2017 @08:45AM (#15806656)
And it's exasperated by the fact that most Tokens use 18 decimal places of precision. So "1" would be 1000000000000000000. As a programmer, I just found it harder to reason about numbers like that.

I ran into problems testing my solidity contract with javascript, because javascript isn't great at big numbers. Or division.

Re:Understanding Ethereum Smart Contracts by workmandan on Wednesday November 29, 2017 @08:41AM (#15806622)
Dang you got there 3 minutes before me!
Re:Understanding Ethereum Smart Contracts by Slartie on Wednesday November 29, 2017 @08:48AM (#15806692)
Don't worry, I'm sitting in the same boat ;-)