CORIONplatform / solidity

GNU General Public License v3.0
12 stars 9 forks source link

No check for overflow. #71

Closed Dexaran closed 7 years ago

Dexaran commented 7 years ago

There is no check for overflow: https://github.com/CORIONplatform/solidity/blob/master/schelling.sol#L154

Why not to use SafeMath here also?

pyskell commented 7 years ago

Adding to this, there are many other cases where SafeAdd and SafeSub are not used: Using - instead of safeSub: image

Using + instead of safeAdd: image

iFA88 commented 7 years ago

@pyskell can you please give a line detailed list from that? Thank you!

pyskell commented 7 years ago

I can't do that easily from my machine at the moment, this is basically a quick search of every place that contains the following operators: - -- -= + ++ += All of which should be able to be replaced with safeSub and safeAdd.