contract TokenTimelock {
    using SafeERC20 for ERC20Basic;

    // ERC20 basic token contract being held
    ERC20Basic public token;

    // beneficiary of tokens after they are released
    address public beneficiary = 0x2F1C2Fb4cf9b46172D59d8878Fc795277b8a2c9a;

    // timestamp when token release is enabled
    uint256 public firstTime = 1529942400;         //2018-06-26
    uint256 public secondTime = 1532534400;        //2018-07-26
    uint256 public thirdTime = 1535212800;         //2018-08-26

    uint256 public firstPay = 900000000000000000000000000;    //900 million  FTI
    uint256 public secondPay = 900000000000000000000000000;    //900 million  FTI
    uint256 public thirdPay = 600000000000000000000000000;    //900 million  FTI

    constructor(
            ERC20Basic _token
            )
        public
        {
            token = _token;
        }

    /**
     * @notice Transfers tokens held by timelock to beneficiary.
     */
    function release() public {
        uint256 tmpPay = 0;
        if(block.timestamp >= firstTime && firstPay > 0){
            tmpPay = firstPay;
            firstPay = 0;
        }else if(block.timestamp >= secondTime && secondPay > 0 ){
            tmpPay = secondPay;
            secondPay = 0;
        }else if (block.timestamp >= thirdTime && thirdPay > 0) {
            tmpPay = token.balanceOf(this);
            thirdPay = 0;
        }
        require(tmpPay > 0);
        uint256 amount = token.balanceOf(this);
        require(amount >= tmpPay);
        token.safeTransfer(beneficiary, tmpPay);
    }
}
/**
 * @title TokenTimelock
 * @dev TokenTimelock is a token holder contract that will allow a
 * beneficiary to extract the tokens after a given release time
 */
function release() public {
    uint256 tmpPay = 0;
    if(block.timestamp >= firstTime && firstPay > 0){
        tmpPay = firstPay;
        firstPay = 0;
    }else if(block.timestamp >= secondTime && secondPay > 0 ){
        tmpPay = secondPay;
        secondPay = 0;
    }else if (block.timestamp >= thirdTime && thirdPay > 0) {
        tmpPay = token.balanceOf(this);
        thirdPay = 0;
    }
    require(tmpPay > 0);
    uint256 amount = token.balanceOf(this);
    require(amount >= tmpPay);
    token.safeTransfer(beneficiary, tmpPay);
}

/**
 * @notice Transfers tokens held by timelock to beneficiary.
 */