contract DXCToken is ERC20Interface {
    using SafeMath for uint;

    string public symbol;
    string public name;
    uint8 public decimals;
    uint public totalSupply;
    address public owner;

    mapping(address => uint) private balances;
    mapping(address => mapping(address => uint)) private allowed;

    event Burn(address indexed _from, uint256 _value);

    /**
     * constructor
     */
    constructor(string _symbol, string _name, uint _totalSupply, uint8 _decimals, address _owner) public {
        symbol = _symbol;
        name = _name;
        decimals = _decimals;
        totalSupply = _totalSupply;
        owner = _owner;
        balances[_owner] = _totalSupply;

        emit Transfer(address(0), _owner, _totalSupply);
    }

    /**
     * @dev Gets the balance of the specified address.
     * @param _owner The address to query the balance of.
     * @return An uint256 representing the amount owned by the passed address.
    */
    function balanceOf(address _owner) public view returns (uint balance) {
        return balances[_owner];
    }

    /**
     * @dev Transfer token from a specified address to another specified address
     * @param _from The address to transfer from.
     * @param _to The address to transfer to.
     * @param _value The amount to be transferred.
    */
    function _transfer(address _from, address _to, uint _value) internal {
        require(_to != 0x0);
        require(balances[_from] >= _value);
        require(balances[_to] + _value > balances[_to]);

        uint previousBalance = balances[_from].add(balances[_to]);

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);

        emit Transfer(_from, _to, _value);

        assert(balances[_from].add(balances[_to]) == previousBalance);
    }

    /**
     * @dev Transfer token for a specified address
     * @param _to The address to transfer to.
     * @param _value The amount to be transferred.
    */
    function transfer(address _to, uint _value) public returns (bool success) {
        _transfer(msg.sender, _to, _value);

        return true;
    }

    /**
     * @dev Transfer tokens from one address to another
     * @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, uint _value) public returns (bool success) {
        
        if (_from == msg.sender) {
            _transfer(_from, _to, _value);

        } else {
            require(allowed[_from][msg.sender] >= _value);
            allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);

            _transfer(_from, _to, _value);

        }

        return true;
    }

    /**
     * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
     * Beware that changing an allowance with this method brings the risk that someone may use both the old
     * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
     * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     * @param _spender The address which will spend the funds.
     * @param _value The amount of tokens to be spent.
    */
    function approve(address _spender, uint _value) public returns (bool success) {
        allowed[msg.sender][_spender] = _value;

        emit Approval(msg.sender, _spender, _value);

        return true;
    }

    /**
     @dev burn amount of tokens
     @param _value The amount of tokens to be burnt.
     */
    function burn(uint256 _value) public returns (bool success) {
        // Check if the sender has enough
        require(balances[msg.sender] >= _value);
        require(_value > 0);

        // Subtract from the sender
        balances[msg.sender] = balances[msg.sender].sub(_value);
        // Updates totalSupply
        totalSupply = totalSupply.sub(_value);

        emit Burn(msg.sender, _value);

        return true;
    }

    /**
     * @dev Function to check the amount of tokens that an owner allowed to a spender.
     * @param _owner address The address which owns the funds.
     * @param _spender address The address which will spend the funds.
     * @return A uint256 specifying the amount of tokens still available for the spender.
    */
    function allowance(address _owner, address _spender) public view returns (uint remaining) {
        return allowed[_owner][_spender];
    }

    /**
     * never receive Ether
     */
    function () public payable {
        revert();
    }
}
// ----------------------------------------------------------------------------
// ERC20 Token
// ----------------------------------------------------------------------------
function _transfer(address _from, address _to, uint _value) internal {
    require(_to != 0x0);
    require(balances[_from] >= _value);
    require(balances[_to] + _value > balances[_to]);

    uint previousBalance = balances[_from].add(balances[_to]);

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);

    emit Transfer(_from, _to, _value);

    assert(balances[_from].add(balances[_to]) == previousBalance);
}

/**
 * @dev Transfer token from a specified address to another specified address
 * @param _from The address to transfer from.
 * @param _to The address to transfer to.
 * @param _value The amount to be transferred.
 */