CORIONplatform / solidity

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

Recommendation: Follow the same coding standard #114

Closed Dexaran closed 7 years ago

Dexaran commented 7 years ago

Here you have function isOwner() https://github.com/CORIONplatform/solidity/blob/master/owned.sol#L12 The purpose of this function is to create functions that are only available to the owner. In this case you placed a requirement inside the function code.

Here you have hardcoded the check for the owner: https://github.com/CORIONplatform/solidity/blob/master/ico.sol#L218 The purpose of this check is exactly the same with isOwner.

Here you have a modifier: https://github.com/CORIONplatform/solidity/blob/master/schelling.sol#L44 The purpose of this modifier is exactly the same with isOwner.

Using similar implementations for similar things will simplify your code a lot and reduce a probability of mistake. Common pattern is to use only_owner modifier.

iFA88 commented 7 years ago

Approved!