contract DmlToken is StandardToken, Pausable{
	using SafeMath for uint;

 	string public constant name = "DML Token";
	uint8 public constant decimals = 18;
	string public constant symbol = 'DML';

	uint public constant MAX_TOTAL_TOKEN_AMOUNT = 330000000 ether;
	address public minter;
	uint public endTime;

	mapping (address => uint) public lockedBalances;

	modifier onlyMinter {
    	  assert(msg.sender == minter);
    	  _;
    }

    modifier maxDmlTokenAmountNotReached (uint amount){
    	  assert(totalSupply.add(amount) <= MAX_TOTAL_TOKEN_AMOUNT);
    	  _;
    }

    /**
     * @dev Constructor
     * @param _minter Contribution Smart Contract
     * @return _endTime End of the contribution period
     */
	function DmlToken(address _minter, uint _endTime){
    	  minter = _minter;
    	  endTime = _endTime;
    }

    /**
     * @dev Mint Token
     * @param receipent address owning mint tokens    
     * @param amount amount of token
     */
    function mintToken(address receipent, uint amount)
        external
        onlyMinter
        maxDmlTokenAmountNotReached(amount)
        returns (bool)
    {
        require(now <= endTime);
      	lockedBalances[receipent] = lockedBalances[receipent].add(amount);
      	totalSupply = totalSupply.add(amount);
      	return true;
    }

    /**
     * @dev Unlock token for trade
     */
    function claimTokens(address receipent)
        public
        onlyMinter
    {
      	balances[receipent] = balances[receipent].add(lockedBalances[receipent]);
      	lockedBalances[receipent] = 0;
    }

    function lockedBalanceOf(address _owner) constant returns (uint balance) {
        return lockedBalances[_owner];
    }

	/**
	* @dev override to add validRecipient
	* @param _to The address to transfer to.
	* @param _value The amount to be transferred.
	*/
	function transfer(address _to, uint _value)
		public
		validRecipient(_to)
		returns (bool success)
	{
		return super.transfer(_to, _value);
	}

	/**
	* @dev override to add validRecipient
	* @param _spender The address which will spend the funds.
	* @param _value The amount of tokens to be spent.
	*/
	function approve(address _spender, uint256 _value)
		public
		validRecipient(_spender)
		returns (bool)
	{
		return super.approve(_spender,  _value);
	}

	/**
	* @dev override to add validRecipient
	* @param _from address The address which you want to send tokens from
	* @param _to address The address which you want to transfer to
	* @param _value uint256 the amount of tokens to be transferred
	*/
	function transferFrom(address _from, address _to, uint256 _value)
		public
		validRecipient(_to)
		returns (bool)
	{
		return super.transferFrom(_from, _to, _value);
	}

	// MODIFIERS

 	modifier validRecipient(address _recipient) {
    	require(_recipient != address(this));
    	_;
  	}
}
/**
 * @title DML Token Contract
 * @dev DML Token Contract
 * @dev inherite from StandardToken, Pasuable and Ownable by Zeppelin
 * @author DML team
 */
function transfer(address _to, uint _value)
	public
	validRecipient(_to)
	returns (bool success)
{
	return super.transfer(_to, _value);
}

/**
 	* @dev override to add validRecipient
 	* @param _to The address to transfer to.
 	* @param _value The amount to be transferred.
 	*/