浏览代码

add preconditions to constructor

Francisco Giordano 8 年之前
父节点
当前提交
998c72ab5b
共有 1 个文件被更改,包括 4 次插入0 次删除
  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
    */
   function TokenVesting(address _beneficiary, uint256 _cliff, uint256 _end) {
+    require(_beneficiary != 0x0);
+    require(_cliff > now);
+    require(_end > _cliff);
+
     beneficiary = _beneficiary;
     cliff = _cliff;
     end = _end;