// Contract: CryptoMindSophie
// Target function: function transfer(address recipient, uint256 amount) external override returns (bool)
// CryptoMindSophie Token (CMS)
// Native token of the CryptoMind ecosystem.
// Code developed in collaboration with a neural network.
// This project is a social experiment in the interaction between neural networks and humans.
// 1% fee on purchases (burned), 1% fee on sales (sent to the ecosystem support fund).
// This information is not financial advice.
// Decisions about investments and contributions should be based on personal analysis and risk assessment.

pragma solidity ^0.6.12;
// SPDX-License-Identifier: Apache-2.0

// Magic begins! 🎩✨
// Hope you're ready for an exciting journey!

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function decimals() external view returns (uint256);
    function symbol() external view returns (string memory);
    function name() external view returns (string memory);
    function getOwner() external view returns (address);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address _owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

library SafeMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;

        return c;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// The grand ERC-20 theatrical performance begins!
contract Context {
    constructor () internal { }

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this;
        return msg.data;
    }
}

contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    function owner() public view returns (address) {
        return _owner;
    }

    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

contract CryptoMindSophie is Context, IERC20, Ownable {
    using SafeMath for uint256;

    mapping (address => uint256) private _rOwned;
    mapping (address => uint256) private _tOwned;
    mapping (address => mapping (address => uint256)) private _allowances;

    mapping (address => bool) private _isExcludedFromFee;

    mapping (address => bool) private _isExcluded;
    address[] private _excluded;
   
    uint256 private constant MAX = ~uint256(0);
    uint256 private _tTotal;
    uint256 private _rTotal;
    uint256 private _tFeeTotal;

    string private _name;
    string private _symbol;
    uint256 private _decimals;

    address public EcoSystemFundAddress;
    address public pairAddress;
   
    uint256 public _taxFee;
    uint256 private _previousTaxFee;
   
    uint256 public _EcoSystemFee;
    uint256 private _previousEcoSystemFee;

    uint256 public _burnFee;
    uint256 private _previousBurnFee;
   
    uint256 public _maxHoldPercent;
    uint256 public _maxTxAmount;

    address public constant HYPERBURNADDR = 0x000000000000000000000000000000000000dEaD;
   
    constructor () public {
        _name = "CryptoMindSophie";
        _symbol = "CMS";
        _decimals = 18;
        _tTotal = 100000000 * 10 ** _decimals;
        _rTotal = (MAX - (MAX % _tTotal));

        _taxFee = 0;
        _EcoSystemFee = 1;
        _burnFee = 1;
        _previousTaxFee = _taxFee;
        _previousEcoSystemFee = _EcoSystemFee;
        _previousBurnFee = _burnFee;
        _maxTxAmount = 100000000 * 10 ** _decimals;
        _maxHoldPercent = 100;
        EcoSystemFundAddress = owner();
       
        _rOwned[owner()] = _rTotal;
       
        _isExcludedFromFee[owner()] = true;
        _isExcludedFromFee[address(this)] = true;

        emit Transfer(address(0), owner(), _tTotal);
    }

    function name() external view override returns (string memory) {
        return _name;
    }

    function symbol() external view override returns (string memory) {
        return _symbol;
    }

    function decimals() external view override returns (uint256) {
        return _decimals;
    }

    function totalSupply() external view override returns (uint256) {
        return _tTotal;
    }

    // Back to the roots: here's your address, milord!
    function getOwner() external view override returns (address) {
        return owner();
    }

    // Say "Hello" to the tokens on your balance!
    function balanceOf(address account) public view override returns (uint256) {
        if (_isExcluded[account]) return _tOwned[account];
        return tokenFromReflection(_rOwned[account]);
    }