contract ERC20Base {



    mapping (address => uint) internal _balanceOf;
    uint internal _totalSupply; 

    event Transfer(
        address indexed from,
        address indexed to,
        uint256 value
    );


    /**
    * @dev Total number of tokens in existence
    */

    function totalSupply() public view returns(uint) {
        return _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) {
        return _balanceOf[owner];
    }



    /**
    * @dev Transfer token for a specified addresses
    * @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, uint256 value) internal {
        _checkRequireERC20(to, value, true, _balanceOf[from]);

        // _balanceOf[from] -= value;
        // _balanceOf[to] += value;
        _balanceOf[from] = SafeMath.sub(_balanceOf[from], value);
        _balanceOf[to] = SafeMath.add(_balanceOf[to], value);
        emit Transfer(from, to, value);
    }


    /**
    * @dev Internal function that mints an amount of the token and assigns it to
    * an account. This encapsulates the modification of balances such that the
    * proper events are emitted.
    * @param account The account that will receive the created tokens.
    * @param value The amount that will be created.
    */

    function _mint(address account, uint256 value) internal {
        _checkRequireERC20(account, value, false, 0);
        _totalSupply = SafeMath.add(_totalSupply, value);
        _balanceOf[account] = SafeMath.add(_balanceOf[account], value);
        emit Transfer(address(0), account, value);
    }

    /**
    * @dev Internal function that burns an amount of the token of a given
    * account.
    * @param account The account whose tokens will be burnt.
    * @param value The amount that will be burnt.
    */

    function _burn(address account, uint256 value) internal {
        _checkRequireERC20(account, value, true, _balanceOf[account]);

        _totalSupply = SafeMath.sub(_totalSupply, value);
        _balanceOf[account] = SafeMath.sub(_balanceOf[account], value);
        emit Transfer(account, address(0), value);
    }


    function _checkRequireERC20(address addr, uint value, bool checkMax, uint max) internal pure {
        require(addr != address(0), "Empty address");
        require(value > 0, "Empty value");
        if (checkMax) {
            require(value <= max, "Out of value");
        }
    }

}
/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
 */
function _burn(address account, uint256 value) internal {
    _checkRequireERC20(account, value, true, _balanceOf[account]);

    _totalSupply = SafeMath.sub(_totalSupply, value);
    _balanceOf[account] = SafeMath.sub(_balanceOf[account], value);
    emit Transfer(account, address(0), value);
}

/**
 * @dev Internal function that burns an amount of the token of a given
 * account.
 * @param account The account whose tokens will be burnt.
 * @param value The amount that will be burnt.
 */