golemfactory / golem-crowdfunding

Golem token and crowdfunding contracts
GNU General Public License v3.0
78 stars 27 forks source link

Refactor required state checking #73

Closed chfast closed 8 years ago

subtly commented 8 years ago

Looks good. Should we put the if(fundingMode) and if(!fundingMode) into modifiers? This particular code is repeated in several functions. Also: I noticed that in multisig the modifier wraps the function code-body rather than throwing an exception. Again, not sure what to think of this because I haven't read the EVM it produces – but EF contract is well-vetted.

chfast commented 8 years ago

@subtly Having !fundingMode check in a modifier and other at the beginning of functions will not help IMHO. Also, having preconditions expressed in form of if (!precondition) throw everywhere where possible is fine. I guess we are still developing best practice rules...