wavevote icon indicating copy to clipboard operation
wavevote copied to clipboard

Update condition checking and functions modifiers.

Open chrsow opened this issue 8 years ago • 1 comments

There are two changes in the commit

  1. Use require() and assert() instead of throw for condition checking
  • use require() and assert() instead of throw. These two function will refunds gas in case of an error occurs while throw don't refunds. Ref: http://solidity.readthedocs.io/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions
  1. Change functions modifiers 'view' and pure instead of constant
  • use view and pure modifier which has more clear leading word than constant. Ref: http://solidity.readthedocs.io/en/develop/miscellaneous.html#modifiers

chrsow avatar Jan 10 '18 14:01 chrsow

Thanks for this commit.

I won't merge atm, because I didn't manage to compile with Ethereum Wallet with a compiler higher than 0.8.10. Indeed, with all compiler higher than 0.8.10, there is a warning due to the jump instructions which denies me to compile and push the contracts.

And in 0.8.10 version, the key word "pure" doesn't exist. I keep this pull request to merge, when this issue will be resolved.

descampsk avatar Jan 10 '18 16:01 descampsk