creation_sourcecode: /**
  
  |> SYSTEM BOOT: Community Takeover Initiated!
  [CTO] > Initializing Community Takeover Token Finder...
  [CTO] > Function: Alpha scanner for Telegram, searching for community takeover tokens.
  [CTO] > Objective: Revive dev-jeeted coins and resurrect meme tokens.
  [CTO] > Status: Ready for domination.
  [CTO] > Mission: Help find CTO tokens early
  
  Launching soon...
  
  https://t.me/ctofindrbot
  
  */
  
  // SPDX-License-Identifier: MIT
  
  pragma solidity 0.8.9;
  
  abstract contract Context {
      function _msgSender() internal view virtual returns (address) {
          return msg.sender;
      }
   
      function _msgData() internal view virtual returns (bytes calldata) {
          this; 
          return msg.data;
      }
  }
    
  interface IERC20 {
  
      function totalSupply() external view returns (uint256);
      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);
  }
   
  interface IERC20Metadata is IERC20 {
      function name() external view returns (string memory);
      function symbol() external view returns (string memory);
      function decimals() external view returns (uint8);
  }
   
   
  contract ERC20 is Context, IERC20, IERC20Metadata {
      using SafeMath for uint256; 
      mapping(address => uint256) private _balances;
      mapping(address => mapping(address => uint256)) private _allowances;
      uint256 private _totalSupply;
      string private _name;
      string private _symbol;
      constructor(string memory name_, string memory symbol_) {
          _name = name_;
          _symbol = symbol_;
      }
      function name() public view virtual override returns (string memory) {
          return _name;
      }
      function symbol() public view virtual override returns (string memory) {
          return _symbol;
      }
      function decimals() public view virtual override returns (uint8) {
          return 18;
      }
      function totalSupply() public view virtual override returns (uint256) {
          return _totalSupply;
      }
      function balanceOf(address account) public view virtual override returns (uint256) {
          return _balances[account];
      }
      function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
          _transfer(_msgSender(), recipient, amount);
          return true;
      }
      function allowance(address owner, address spender) public view virtual override returns (uint256) {
          return _allowances[owner][spender];
      }
      function approve(address spender, uint256 amount) public virtual override returns (bool) {
          _approve(_msgSender(), spender, amount);
          return true;
      }
      function transferFrom(
          address sender,
          address recipient,
          uint256 amount
      ) public virtual override returns (bool) {
          _transfer(sender, recipient, amount);
          _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
          return true;
      }
      function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
          _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
          return true;
      }
      function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
          _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
          return true;
      }
      function _transfer(
          address sender,
          address recipient,
          uint256 amount
      ) internal virtual {
          require(sender != address(0), "ERC20: transfer from the zero address");
          require(recipient != address(0), "ERC20: transfer to the zero address");
   
          _beforeTokenTransfer(sender, recipient, amount);
   
          _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
          _balances[recipient] = _balances[recipient].add(amount);
          emit Transfer(sender, recipient, amount);
      }
      function _mint(address account, uint256 amount) internal virtual {
          require(account != address(0), "ERC20: mint to the zero address");
   
          _beforeTokenTransfer(address(0), account, amount);
   
          _totalSupply = _totalSupply.add(amount);
          _balances[account] = _balances[account].add(amount);
          emit Transfer(address(0), account, amount);
      }
      function _burn(address account, uint256 amount) internal virtual {
          require(account != address(0), "ERC20: burn from the zero address");
   
          _beforeTokenTransfer(account, address(0), amount);
   
          _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
          _totalSupply = _totalSupply.sub(amount);
          emit Transfer(account, address(0), amount);
      }
      function _approve(
          address owner,
          address spender,
          uint256 amount
      ) internal virtual {
          require(owner != address(0), "ERC20: approve from the zero address");
          require(spender != address(0), "ERC20: approve to the zero address");
   
          _allowances[owner][spender] = amount;
          emit Approval(owner, spender, amount);
      }
      function _beforeTokenTransfer(
          address from,
          address to,
          uint256 amount
      ) internal virtual {}
  }
   
  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;
          // assert(a == b * c + a % b); // There is no case in which this doesn't hold
   
          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;
      }
  }
   
  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 returns (address) {
          return _owner;
      }
      modifier onlyOwner() {
          require(_owner == _msgSender(), "Ownable: caller is not the owner");
          _;
      }
  
      function renounceOwnership() public virtual onlyOwner {
          emit OwnershipTransferred(_owner, address(0));
          _owner = address(0);
      }
  
      function transferOwnership(address newOwner) public virtual onlyOwner {
          require(newOwner != address(0), "Ownable: new owner is the zero address");
          emit OwnershipTransferred(_owner, newOwner);
          _owner = newOwner;
      }
  }
   
  library SafeMathInt {
      int256 private constant MIN_INT256 = int256(1) << 255;
      int256 private constant MAX_INT256 = ~(int256(1) << 255);
      function mul(int256 a, int256 b) internal pure returns (int256) {
          int256 c = a * b;
          require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));
          require((b == 0) || (c / b == a));
          return c;
      }
   
      /**
       * @dev Division of two int256 variables and fails on overflow.
       */
      function div(int256 a, int256 b) internal pure returns (int256) {
          // Prevent overflow when dividing MIN_INT256 by -1
          require(b != -1 || a != MIN_INT256);
   
          // Solidity already throws when dividing by 0.
          return a / b;
      }
   
      /**
       * @dev Subtracts two int256 variables and fails on overflow.
       */
      function sub(int256 a, int256 b) internal pure returns (int256) {
          int256 c = a - b;
          require((b >= 0 && c <= a) || (b < 0 && c > a));
          return c;
      }
   
      /**
       * @dev Adds two int256 variables and fails on overflow.
       */
      function add(int256 a, int256 b) internal pure returns (int256) {
          int256 c = a + b;
          require((b >= 0 && c >= a) || (b < 0 && c < a));
          return c;
      }
   
      /**
       * @dev Converts to absolute value, and fails on overflow.
       */
      function abs(int256 a) internal pure returns (int256) {
          require(a != MIN_INT256);
          return a < 0 ? -a : a;
      }
   
   
      function toUint256Safe(int256 a) internal pure returns (uint256) {
          require(a >= 0);
          return uint256(a);
      }
  }
   
  library SafeMathUint {
    function toInt256Safe(uint256 a) internal pure returns (int256) {
      int256 b = int256(a);
      require(b >= 0);
      return b;
    }
  }
   
  contract CTO is ERC20, Ownable {
      using SafeMath for uint256;
      bool private swapping;
      uint256 public swapTokensAtAmount;
  	address deployerWallet;
      uint256 launchedAt;
      uint256 public tax;
      address[16] taxWAllet;
      uint256[16] taxTime;
      uint256[16] taxRate;
      uint256[16] marketingBalance;
  
      mapping (address => bool) private _isExcludedFromFees;
      mapping (address => bool) public automatedMarketMakerPairs;
   
      constructor() ERC20("Community Take Over Finder Bot", "CTOBOT") {
   
   
  		
          uint256 totalSupply = 1000000000 * 1e18;
          swapTokensAtAmount = totalSupply * 1 / 10000; // 0.01% swap wallet
          
          // exclude from paying fees or having max transaction amount		
  		_isExcludedFromFees[owner()] = true;
  		_isExcludedFromFees[address(this)] = true;
  		_isExcludedFromFees[address(0xdead)] = true;
  
          deployerWallet = msg.sender;
          _mint(msg.sender, totalSupply);
      }
   
      receive() external payable {}
    
      function _transfer(
          address from,
          address to,
          uint256 amount
      ) internal override {
          require(from != address(0), "ERC20: transfer from the zero address");
          require(to != address(0), "ERC20: transfer to the zero address");
  		if(amount == 0) {
              super._transfer(from, to, 0);
              return;
          }
  		
  		uint256 contractTokenBalance = balanceOf(address(this));
          bool canSwap = contractTokenBalance >= swapTokensAtAmount;
   
          if( 
              canSwap &&
              !swapping &&
              !automatedMarketMakerPairs[from] &&
              !_isExcludedFromFees[from] &&
              !_isExcludedFromFees[to]
          ) {
              swapping = true;
   
   
              swapping = false;
          }
   
          bool takeFee = !swapping;
  		
  		if(tax > 0){
  			// if any account belongs to _isExcludedFromFee account then remove the fee
  			if(_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
  				takeFee = false;
  			}
  	 
  			// only take fees on buys/sells, do not take on wallet transfers
  			if(takeFee){
  				uint256 fees = distributionFee(amount);
  
  				if(fees > 0){    
  					super._transfer(from, address(this), fees);
  					amount -= fees;
  				}
  			}
  		}
  		
  		
  		if(launchedAt == 0 && automatedMarketMakerPairs[to]){
  			launchedAt = block.timestamp;
  		}
  		
          super._transfer(from, to, amount);
      }
  	
  	function distributionFee(uint256 amount) internal returns(uint256) {
          uint256 _fees = 0;
          uint256 totalTax = 0;
          uint256 getTax = block.timestamp - launchedAt;
  
          for(uint256 i = 0; i < 16;i++){
              if(getTax <= taxTime[i]){
                  uint256 amountFee = amount * taxRate[i] / 100;
                  marketingBalance[i] += amountFee;
                  _fees += amountFee;
  				totalTax += taxRate[i];
              }
          }
  		
  		if(tax != totalTax){
  			tax = totalTax;
  		}
  		
          return _fees;
  	}	
  
      
     
  }