Last active
July 13, 2017 08:48
-
-
Save elenadimitrova/5da89dbdbf83e6e03f443d3aff651255 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract DataVerifiable { | |
/// @notice throws if ether was sent accidentally | |
modifier refundEtherSentByAccident() { | |
if(msg.value > 0) throw; | |
_ | |
} | |
/// @notice throw if an address is invalid | |
/// @param _target the address to check | |
modifier throwIfAddressIsInvalid(address _target) { | |
if(_target == 0x0) throw; | |
_ | |
} | |
/// @notice throw if the id is invalid | |
/// @param _id the ID to validate | |
modifier throwIfIsEmptyString(string _id) { | |
if(bytes(_id).length == 0) throw; | |
_ | |
} | |
/// @notice throw if the uint is equal to zero | |
/// @param _id the ID to validate | |
modifier throwIfEqualToZero(uint _id) { | |
if(_id == 0) throw; | |
_ | |
} | |
/// @notice throw if the id is invalid | |
/// @param _id the ID to validate | |
modifier throwIfIsEmptyBytes32(bytes32 _id) { | |
if(_id == "") throw; | |
_ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment