contract VIPP is Owned, SafeMath, Pausable, EIP20Interface {
    uint256 private totalSupply_;
    string public name;
    string public symbol;
    uint8 public decimals;
    
    mapping (address => uint256) public balances;
    mapping (address => uint256) public frozen;
    mapping (address => mapping (address => uint256)) public allowed;

    event Freeze(address indexed from, uint256 value);
    event Unfreeze(address indexed from, uint256 value);
    event Burned(address indexed from, uint256 value);

    constructor() public {
        name = "VIPP056";
        symbol = "VIPP056";
        decimals = 6;
        totalSupply_ = 1000000 * 10 ** uint256(decimals);
        balances[msg.sender] = totalSupply_;
    }

    // burn
    function burn(address _addr, uint256 _amount) onlyOwner public returns (bool success) {
        require(_addr != 0);
        require(_amount <= balances[_addr]);

        totalSupply_ = sub(totalSupply_, _amount);
        balances[_addr] = sub(balances[_addr], _amount);
        emit Transfer(_addr, address(0), _amount);
        emit Burned(_addr, _amount);
        return true;
    }

    // freeze part
    function freeze(address _addr, uint256 _value) public onlyOwner returns (bool success) {
        require(balances[_addr] >= _value);
        require(_value > 0);
        balances[_addr] = sub(balances[_addr], _value);
        frozen[_addr] = add(frozen[_addr], _value);
        emit Freeze(_addr, _value);
        return true;
    }
    
    function unfreeze(address _addr, uint256 _value) public onlyOwner returns (bool success) {
        require(frozen[_addr] >= _value);
        require(_value > 0);
        frozen[_addr] = sub(frozen[_addr], _value);
        balances[_addr] = add(balances[_addr], _value);
        emit Unfreeze(_addr, _value);
        return true;
    }

    function frozenOf(address _addr) public view returns (uint256 balance) {
        return frozen[_addr];
    }
    
    // erc20 part
    function totalSupply() public view returns (uint256) {
        return totalSupply_;
    }

    function balanceOf(address _addr) public view returns (uint256 balance) {
        return balances[_addr];
    }

    function transfer(address _to, uint256 _value) public notPaused returns (bool success) {
        require(balances[msg.sender] >= _value);
        require(balances[_to] + _value >= balances[_to]);
        balances[msg.sender] -= _value;
        balances[_to] += _value;
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public notPaused returns (bool success) {
        require(balances[_from] >= _value);
        require(balances[_to] + _value >= balances[_to]);
        require(allowed[_from][msg.sender] >= _value);
        balances[_to] += _value;
        balances[_from] -= _value;
        allowed[_from][msg.sender] -= _value;
        emit Transfer(_from, _to, _value);
        return true;
    }

    function approve(address _spender, uint256 _value) public notPaused returns (bool success) {
        require(_value > 0);
        allowed[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
        return allowed[_owner][_spender];
    } 
}
function burn(address _addr, uint256 _amount) onlyOwner public returns (bool success) {
    require(_addr != 0);
    require(_amount <= balances[_addr]);

    totalSupply_ = sub(totalSupply_, _amount);
    balances[_addr] = sub(balances[_addr], _amount);
    emit Transfer(_addr, address(0), _amount);
    emit Burned(_addr, _amount);
    return true;
}

// burn