Browse Source

add preconditions to constructor

Francisco Giordano 8 years ago
parent
commit
998c72ab5b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      contracts/token/TokenVesting.sol

+ 4 - 0
contracts/token/TokenVesting.sol

@@ -31,6 +31,10 @@ contract TokenVesting is Ownable {
    * @param _end timestamp of the moment when all balance will have been vested
    * @param _end timestamp of the moment when all balance will have been vested
    */
    */
   function TokenVesting(address _beneficiary, uint256 _cliff, uint256 _end) {
   function TokenVesting(address _beneficiary, uint256 _cliff, uint256 _end) {
+    require(_beneficiary != 0x0);
+    require(_cliff > now);
+    require(_end > _cliff);
+
     beneficiary = _beneficiary;
     beneficiary = _beneficiary;
     cliff = _cliff;
     cliff = _cliff;
     end = _end;
     end = _end;