contract Lockable is ERC20Token, Ownable {
    using SafeMath for uint256;
    mapping (address => uint256) public lockAmounts;

    // function lock(address to, uint amount) public onlyOwner {
    //     lockAmounts[to] = lockAmounts[to].add(amount);
    // }

    function unlock(address to, uint amount) public onlyOwner {
        lockAmounts[to] = lockAmounts[to].sub(amount);
    }

    function issueCoin(address to, uint amount) public onlyOwner {
        lockAmounts[to] = lockAmounts[to].add(amount);
        transfer(to, amount);
    //  balances[to] = balances[to].add(amount);
    //  balances[owner] = balances[owner].sub(amount);
    //  emit Transfer(owner, to, amount);
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(balances[msg.sender] >= _value + lockAmounts[msg.sender]);
        return super.transfer(_to, _value);
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        require(balances[_from] >= _value + lockAmounts[_from]);
        return super.transferFrom(_from, _to, _value);
    }
}
function unlock(address to, uint amount) public onlyOwner {
    lockAmounts[to] = lockAmounts[to].sub(amount);
}

// function lock(address to, uint amount) public onlyOwner {
//     lockAmounts[to] = lockAmounts[to].add(amount);
// }