anonymousvoting
anonymousvoting copied to clipboard
Change function modifiers and condition checking instruction
There are two changes in the commit
- Use
require()
andassert()
instead ofthrow
for condition checking
- Since the solidity version from 0.4.10 onwards supports
require()
andassert()
. Those two function will refunds gas in case of an error occurs.
Ref: http://solidity.readthedocs.io/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions
- Change functions modifiers 'view' and
pure
instead ofconstant
- Version 0.4.17 supports
view
andpure
which has more clear leading word thanconstant
.
Ref: http://solidity.readthedocs.io/en/develop/miscellaneous.html#modifiers
Hey thanks for doing this! I'll test out the changes (and check everything is working with latest solidity) before committing them
@chrsow, how did you compile smart contract? Because I also tried to compile in Etherium Wallet and received warning message: Warning: Jump instructions are low-level EVM features that can lead to incorrect stack access. Because of that they are discouraged. Please consider using “switch” or “for” statements instead. jumpi(end, iszero(bit)) ^---^ The same warning for jump assembly command.