contract NDT2Token is BurnableToken, StandardToken,Pausable {
    /*这会在区块链上产生一个公共事件，通知客户端*/
    mapping (address => bool) public frozenAccount;
    event FrozenFunds(address target, bool frozen);
    function NDT2Token() public 
    {
        totalSupply_ = 10000000000 ether;//代币总量,单位eth
        balances[msg.sender] = totalSupply_;               //为创建者提供所有初始令牌
        name = "NDT2Token";             //为显示目的设置交易名称
        symbol = "NDT2";                               //为显示目的设置交易符号简称
    }

//@dev从目标地址和减量津贴中焚烧特定数量的标记
//@param _from地址您想从中发送令牌的地址
//@param _value uint256要被刻录的令牌数量

    function burnFrom(address _from, uint256 _value) public {
        require(_value <= allowed[_from][msg.sender]);
        // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
        //此功能需要发布具有更新批准的事件。
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        _burn(_from, _value);
    }
    //锁定一个账号,只有管理员才能执行
    function freezeAccount(address target, bool freeze) onlyOwner public {
        frozenAccount[target] = freeze;
        emit FrozenFunds(target, freeze);
    }
    function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
        require(!frozenAccount[msg.sender]);               //检查发送人是否被冻结
        return super.transfer(_to, _value);
    }
    //发送代币到某个账号并且马上锁定这个账号,只有管理员才能执行
    function transferAndFrozen(address _to, uint256 _value) onlyOwner public whenNotPaused returns (bool) {
        require(!frozenAccount[msg.sender]);               //检查发送人是否被冻结
        bool Result = transfer(_to,_value);
        freezeAccount(_to,true);
        return Result;
    }
    function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
        require(!frozenAccount[_from]);                     //检查发送人是否被冻结
        return super.transferFrom(_from, _to, _value);
    }

    function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
        return super.approve(_spender, _value);
    }

    function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
        return super.increaseApproval(_spender, _addedValue);
    }

    function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
        return super.decreaseApproval(_spender, _subtractedValue);
    }
}
/*  自定义的最终Token代码 */
function freezeAccount(address target, bool freeze) onlyOwner public {
        frozenAccount[target] = freeze;
        emit FrozenFunds(target, freeze);
    }
//锁定一个账号,只有管理员才能执行