Facebook
From Diminutive Matamata, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 66
  1. /**
  2.  *Submitted for verification at BscScan.com on 2022-11-23
  3. */
  4.  
  5. /**
  6. https://t.me/Cryptofootballbsc
  7. */
  8.  
  9. // SPDX-License-Identifier: MIT
  10.  
  11. pragma solidity 0.8.17;
  12.  
  13. interface IUniswapV2Factory {
  14.     event PairCreated(address indexed token0, address indexed token1, address pair, uint);
  15.  
  16.     function feeTo() external view returns (address);
  17.     function feeToSetter() external view returns (address);
  18.     function getPair(address tokenA, address tokenB) external view returns (address pair);
  19.     function allPairs(uint) external view returns (address pair);
  20.     function allPairsLength() external view returns (uint);
  21.     function createPair(address tokenA, address tokenB) external returns (address pair);
  22.     function setFeeTo(address) external;
  23.     function setFeeToSetter(address) external;
  24. }
  25.  
  26. interface IUniswapV2Pair {
  27.     event Approval(address indexed owner, address indexed spender, uint value);
  28.     event Transfer(address indexed from, address indexed to, uint value);
  29.  
  30.     function name() external pure returns (string memory);
  31.     function symbol() external pure returns (string memory);
  32.     function decimals() external pure returns (uint8);
  33.     function totalSupply() external view returns (uint);
  34.     function balanceOf(address owner) external view returns (uint);
  35.     function allowance(address owner, address spender) external view returns (uint);
  36.  
  37.     function approve(address spender, uint value) external returns (bool);
  38.     function transfer(address to, uint value) external returns (bool);
  39.     function transferFrom(address from, address to, uint value) external returns (bool);
  40.  
  41.     function DOMAIN_SEPARATOR() external view returns (bytes32);
  42.     function PERMIT_TYPEHASH() external pure returns (bytes32);
  43.     function nonces(address owner) external view returns (uint);
  44.  
  45.     function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
  46.  
  47.     event Mint(address indexed sender, uint amount0, uint amount1);
  48.     event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
  49.     event Swap(
  50.         address indexed sender,
  51.         uint amount0In,
  52.         uint amount1In,
  53.         uint amount0Out,
  54.         uint amount1Out,
  55.         address indexed to
  56.     );
  57.     event Sync(uint112 reserve0, uint112 reserve1);
  58.  
  59.     function MINIMUM_LIQUIDITY() external pure returns (uint);
  60.     function factory() external view returns (address);
  61.     function token0() external view returns (address);
  62.     function token1() external view returns (address);
  63.     function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
  64.     function price0CumulativeLast() external view returns (uint);
  65.     function price1CumulativeLast() external view returns (uint);
  66.     function kLast() external view returns (uint);
  67.  
  68.     function mint(address to) external returns (uint liquidity);
  69.     function burn(address to) external returns (uint amount0, uint amount1);
  70.     function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
  71.     function skim(address to) external;
  72.     function sync() external;
  73.  
  74.     function initialize(address, address) external;
  75. }
  76.  
  77. interface IUniswapV2Router01 {
  78.     function factory() external pure returns (address);
  79.     function WETH() external pure returns (address);
  80.  
  81.     function addLiquidity(
  82.         address tokenA,
  83.         address tokenB,
  84.         uint amountADesired,
  85.         uint amountBDesired,
  86.         uint amountAMin,
  87.         uint amountBMin,
  88.         address to,
  89.         uint deadline
  90.     ) external returns (uint amountA, uint amountB, uint liquidity);
  91.     function addLiquidityETH(
  92.         address token,
  93.         uint amountTokenDesired,
  94.         uint amountTokenMin,
  95.         uint amountETHMin,
  96.         address to,
  97.         uint deadline
  98.     ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
  99.     function removeLiquidity(
  100.         address tokenA,
  101.         address tokenB,
  102.         uint liquidity,
  103.         uint amountAMin,
  104.         uint amountBMin,
  105.         address to,
  106.         uint deadline
  107.     ) external returns (uint amountA, uint amountB);
  108.     function removeLiquidityETH(
  109.         address token,
  110.         uint liquidity,
  111.         uint amountTokenMin,
  112.         uint amountETHMin,
  113.         address to,
  114.         uint deadline
  115.     ) external returns (uint amountToken, uint amountETH);
  116.     function removeLiquidityWithPermit(
  117.         address tokenA,
  118.         address tokenB,
  119.         uint liquidity,
  120.         uint amountAMin,
  121.         uint amountBMin,
  122.         address to,
  123.         uint deadline,
  124.         bool approveMax, uint8 v, bytes32 r, bytes32 s
  125.     ) external returns (uint amountA, uint amountB);
  126.     function removeLiquidityETHWithPermit(
  127.         address token,
  128.         uint liquidity,
  129.         uint amountTokenMin,
  130.         uint amountETHMin,
  131.         address to,
  132.         uint deadline,
  133.         bool approveMax, uint8 v, bytes32 r, bytes32 s
  134.     ) external returns (uint amountToken, uint amountETH);
  135.     function swapExactTokensForTokens(
  136.         uint amountIn,
  137.         uint amountOutMin,
  138.         address[] calldata path,
  139.         address to,
  140.         uint deadline
  141.     ) external returns (uint[] memory amounts);
  142.     function swapTokensForExactTokens(
  143.         uint amountOut,
  144.         uint amountInMax,
  145.         address[] calldata path,
  146.         address to,
  147.         uint deadline
  148.     ) external returns (uint[] memory amounts);
  149.     function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
  150.         external
  151.         payable
  152.         returns (uint[] memory amounts);
  153.     function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
  154.         external
  155.         returns (uint[] memory amounts);
  156.     function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
  157.         external
  158.         returns (uint[] memory amounts);
  159.     function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
  160.         external
  161.         payable
  162.         returns (uint[] memory amounts);
  163.  
  164.     function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
  165.     function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
  166.     function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
  167.     function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
  168.     function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
  169. }
  170.  
  171. interface IUniswapV2Router02 is IUniswapV2Router01 {
  172.     function removeLiquidityETHSupportingFeeOnTransferTokens(
  173.         address token,
  174.         uint liquidity,
  175.         uint amountTokenMin,
  176.         uint amountETHMin,
  177.         address to,
  178.         uint deadline
  179.     ) external returns (uint amountETH);
  180.     function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
  181.         address token,
  182.         uint liquidity,
  183.         uint amountTokenMin,
  184.         uint amountETHMin,
  185.         address to,
  186.         uint deadline,
  187.         bool approveMax, uint8 v, bytes32 r, bytes32 s
  188.     ) external returns (uint amountETH);
  189.  
  190.     function swapExactTokensForTokensSupportingFeeOnTransferTokens(
  191.         uint amountIn,
  192.         uint amountOutMin,
  193.         address[] calldata path,
  194.         address to,
  195.         uint deadline
  196.     ) external;
  197.     function swapExactETHForTokensSupportingFeeOnTransferTokens(
  198.         uint amountOutMin,
  199.         address[] calldata path,
  200.         address to,
  201.         uint deadline
  202.     ) external payable;
  203.     function swapExactTokensForETHSupportingFeeOnTransferTokens(
  204.         uint amountIn,
  205.         uint amountOutMin,
  206.         address[] calldata path,
  207.         address to,
  208.         uint deadline
  209.     ) external;
  210. }
  211.  
  212. interface IERC20 {
  213.     function totalSupply() external view returns (uint256);
  214.     function balanceOf(address account) external view returns (uint256);
  215.     function transfer(address recipient, uint256 amount) external returns (bool);
  216.     function allowance(address owner, address spender) external view returns (uint256);
  217.     function approve(address spender, uint256 amount) external returns (bool);
  218.     function transferFrom(
  219.         address sender,
  220.         address recipient,
  221.         uint256 amount
  222.     ) external returns (bool);
  223.    
  224.     event Transfer(address indexed from, address indexed to, uint256 value);
  225.     event Approval(address indexed owner, address indexed spender, uint256 value);
  226. }
  227.  
  228. interface IERC20Metadata is IERC20 {
  229.     function name() external view returns (string memory);
  230.     function symbol() external view returns (string memory);
  231.     function decimals() external view returns (uint8);
  232. }
  233.  
  234. library Address {
  235.  
  236.     function isContract(address account) internal view returns (bool) {
  237.         // This method relies on extcodesize/address.code.length, which returns 0
  238.         // for contracts in construction, since the code is only stored at the end
  239.         // of the constructor execution.
  240.  
  241.         return account.code.length > 0;
  242.     }
  243.  
  244.     function sendValue(address payable recipient, uint256 amount) internal {
  245.         require(address(this).balance >= amount, "Address: insufficient balance");
  246.  
  247.         (bool success, ) = recipient.call{value: amount}("");
  248.         require(success, "Address: unable to send value, recipient may have reverted");
  249.     }
  250.  
  251.     function functionCall(address target, bytes memory data) internal returns (bytes memory) {
  252.         return functionCallWithValue(target, data, 0, "Address: low-level call failed");
  253.     }
  254.  
  255.     function functionCall(
  256.         address target,
  257.         bytes memory data,
  258.         string memory errorMessage
  259.     ) internal returns (bytes memory) {
  260.         return functionCallWithValue(target, data, 0, errorMessage);
  261.     }
  262.  
  263.     function functionCallWithValue(
  264.         address target,
  265.         bytes memory data,
  266.         uint256 value
  267.     ) internal returns (bytes memory) {
  268.         return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
  269.     }
  270.  
  271.     function functionCallWithValue(
  272.         address target,
  273.         bytes memory data,
  274.         uint256 value,
  275.         string memory errorMessage
  276.     ) internal returns (bytes memory) {
  277.         require(address(this).balance >= value, "Address: insufficient balance for call");
  278.         (bool success, bytes memory returndata) = target.call{value: value}(data);
  279.         return verifyCallResultFromTarget(target, success, returndata, errorMessage);
  280.     }
  281.  
  282.     function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
  283.         return functionStaticCall(target, data, "Address: low-level static call failed");
  284.     }
  285.  
  286.     function functionStaticCall(
  287.         address target,
  288.         bytes memory data,
  289.         string memory errorMessage
  290.     ) internal view returns (bytes memory) {
  291.         (bool success, bytes memory returndata) = target.staticcall(data);
  292.         return verifyCallResultFromTarget(target, success, returndata, errorMessage);
  293.     }
  294.  
  295.     function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
  296.         return functionDelegateCall(target, data, "Address: low-level delegate call failed");
  297.     }
  298.  
  299.     function functionDelegateCall(
  300.         address target,
  301.         bytes memory data,
  302.         string memory errorMessage
  303.     ) internal returns (bytes memory) {
  304.         (bool success, bytes memory returndata) = target.delegatecall(data);
  305.         return verifyCallResultFromTarget(target, success, returndata, errorMessage);
  306.     }
  307.  
  308.     function verifyCallResultFromTarget(
  309.         address target,
  310.         bool success,
  311.         bytes memory returndata,
  312.         string memory errorMessage
  313.     ) internal view returns (bytes memory) {
  314.         if (success) {
  315.             if (returndata.length == 0) {
  316.                 require(isContract(target), "Address: call to non-contract");
  317.             }
  318.             return returndata;
  319.         } else {
  320.             _revert(returndata, errorMessage);
  321.         }
  322.     }
  323.  
  324.     function verifyCallResult(
  325.         bool success,
  326.         bytes memory returndata,
  327.         string memory errorMessage
  328.     ) internal pure returns (bytes memory) {
  329.         if (success) {
  330.             return returndata;
  331.         } else {
  332.             _revert(returndata, errorMessage);
  333.         }
  334.     }
  335.  
  336.     function _revert(bytes memory returndata, string memory errorMessage) private pure {
  337.         if (returndata.length > 0) {
  338.             /// @solidity memory-safe-assembly
  339.             assembly {
  340.                 let returndata_size := mload(returndata)
  341.                 revert(add(32, returndata), returndata_size)
  342.             }
  343.         } else {
  344.             revert(errorMessage);
  345.         }
  346.     }
  347. }
  348.  
  349. abstract contract Context {
  350.     function _msgSender() internal view virtual returns (address) {
  351.         return msg.sender;
  352.     }
  353.  
  354.     function _msgData() internal view virtual returns (bytes calldata) {
  355.         this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  356.         return msg.data;
  357.     }
  358. }
  359.  
  360. abstract contract Ownable is Context {
  361.     address private _owner;
  362.  
  363.     event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  364.  
  365.     constructor () {
  366.         address msgSender = _msgSender();
  367.         _owner = msgSender;
  368.         emit OwnershipTransferred(address(0), msgSender);
  369.     }
  370.  
  371.     function owner() public view returns (address) {
  372.         return _owner;
  373.     }
  374.  
  375.     modifier onlyOwner() {
  376.         require(_owner == _msgSender(), "Ownable: caller is not the owner");
  377.         _;
  378.     }
  379.  
  380.     function renounceOwnership() public virtual onlyOwner {
  381.         emit OwnershipTransferred(_owner, address(0));
  382.         _owner = address(0);
  383.     }
  384.  
  385.     function transferOwnership(address newOwner) public virtual onlyOwner {
  386.         require(newOwner != address(0), "Ownable: new owner is the zero address");
  387.         emit OwnershipTransferred(_owner, newOwner);
  388.         _owner = newOwner;
  389.     }
  390. }
  391.  
  392. contract ERC20 is Context, IERC20, IERC20Metadata {
  393.     mapping(address => uint256) private _balances;
  394.  
  395.     mapping(address => mapping(address => uint256)) private _allowances;
  396.  
  397.     uint256 private _totalSupply;
  398.  
  399.     string private _name;
  400.     string private _symbol;
  401.  
  402.     constructor(string memory name_, string memory symbol_) {
  403.         _name = name_;
  404.         _symbol = symbol_;
  405.     }
  406.  
  407.     function name() public view virtual override returns (string memory) {
  408.         return _name;
  409.     }
  410.  
  411.     function symbol() public view virtual override returns (string memory) {
  412.         return _symbol;
  413.     }
  414.  
  415.     function decimals() public view virtual override returns (uint8) {
  416.         return 18;
  417.     }
  418.  
  419.     function totalSupply() public view virtual override returns (uint256) {
  420.         return _totalSupply;
  421.     }
  422.  
  423.     function balanceOf(address account) public view virtual override returns (uint256) {
  424.         return _balances[account];
  425.     }
  426.  
  427.     function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
  428.         _transfer(_msgSender(), recipient, amount);
  429.         return true;
  430.     }
  431.  
  432.     function allowance(address owner, address spender) public view virtual override returns (uint256) {
  433.         return _allowances[owner][spender];
  434.     }
  435.  
  436.     function approve(address spender, uint256 amount) public virtual override returns (bool) {
  437.         _approve(_msgSender(), spender, amount);
  438.         return true;
  439.     }
  440.  
  441.     function transferFrom(
  442.         address sender,
  443.         address recipient,
  444.         uint256 amount
  445.     ) public virtual override returns (bool) {
  446.         uint256 currentAllowance = _allowances[sender][_msgSender()];
  447.         if (currentAllowance != type(uint256).max) {
  448.             require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
  449.             unchecked {
  450.                 _approve(sender, _msgSender(), currentAllowance - amount);
  451.             }
  452.         }
  453.  
  454.         _transfer(sender, recipient, amount);
  455.  
  456.         return true;
  457.     }
  458.  
  459.     function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
  460.         _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
  461.         return true;
  462.     }
  463.  
  464.     function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
  465.         uint256 currentAllowance = _allowances[_msgSender()][spender];
  466.         require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
  467.         unchecked {
  468.             _approve(_msgSender(), spender, currentAllowance - subtractedValue);
  469.         }
  470.  
  471.         return true;
  472.     }
  473.  
  474.     function _transfer(
  475.         address sender,
  476.         address recipient,
  477.         uint256 amount
  478.     ) internal virtual {
  479.         require(sender != address(0), "ERC20: transfer from the zero address");
  480.         require(recipient != address(0), "ERC20: transfer to the zero address");
  481.  
  482.         _beforeTokenTransfer(sender, recipient, amount);
  483.  
  484.         uint256 senderBalance = _balances[sender];
  485.         require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
  486.         unchecked {
  487.             _balances[sender] = senderBalance - amount;
  488.         }
  489.         _balances[recipient] += amount;
  490.  
  491.         emit Transfer(sender, recipient, amount);
  492.  
  493.         _afterTokenTransfer(sender, recipient, amount);
  494.     }
  495.  
  496.     function _mint(address account, uint256 amount) internal virtual {
  497.         require(account != address(0), "ERC20: mint to the zero address");
  498.  
  499.         _beforeTokenTransfer(address(0), account, amount);
  500.  
  501.         _totalSupply += amount;
  502.         _balances[account] += amount;
  503.         emit Transfer(address(0), account, amount);
  504.  
  505.         _afterTokenTransfer(address(0), account, amount);
  506.     }
  507.  
  508.     function _burn(address account, uint256 amount) internal virtual {
  509.         require(account != address(0), "ERC20: burn from the zero address");
  510.  
  511.         _beforeTokenTransfer(account, address(0), amount);
  512.  
  513.         uint256 accountBalance = _balances[account];
  514.         require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
  515.         unchecked {
  516.             _balances[account] = accountBalance - amount;
  517.         }
  518.         _totalSupply -= amount;
  519.  
  520.         emit Transfer(account, address(0), amount);
  521.  
  522.         _afterTokenTransfer(account, address(0), amount);
  523.     }
  524.  
  525.     function _approve(
  526.         address owner,
  527.         address spender,
  528.         uint256 amount
  529.     ) internal virtual {
  530.         require(owner != address(0), "ERC20: approve from the zero address");
  531.         require(spender != address(0), "ERC20: approve to the zero address");
  532.  
  533.         _allowances[owner][spender] = amount;
  534.         emit Approval(owner, spender, amount);
  535.     }
  536.  
  537.     function _beforeTokenTransfer(
  538.         address from,
  539.         address to,
  540.         uint256 amount
  541.     ) internal virtual {}
  542.  
  543.     function _afterTokenTransfer(
  544.         address from,
  545.         address to,
  546.         uint256 amount
  547.     ) internal virtual {}
  548. }
  549.  
  550. contract CryptoFootball is ERC20, Ownable {
  551.     using Address for address payable;
  552.     using Address for address;
  553.  
  554.     IUniswapV2Router02 public uniswapV2Router;
  555.     address public  uniswapV2Pair;
  556.  
  557.     mapping (address => bool) private _isExcludedFromFees;
  558.  
  559.     uint256 public totalFeesOnBuy;
  560.     uint256 public totalFeesOnSell;
  561.  
  562.     address public  marketingWallet;
  563.    
  564.     address private DEAD;
  565.  
  566.     uint256 public swapTokensAtAmount;
  567.     bool    private swapping;
  568.  
  569.     uint256 public launchTime;
  570.  
  571.     event ExcludeFromFees(address indexed account, bool isExcluded);
  572.     event MarketingWalletChanged(address marketingWallet);
  573.     event SwapAndSendMarketing(uint256 tokensSwapped, uint256 bnbSend);
  574.     event SwapTokensAtAmountUpdated(uint256 swapTokensAtAmount);
  575.     event FeesChanged(uint256 totalFeesOnBuy, uint256 totalFeesOnSell);
  576.  
  577.  
  578.     constructor () ERC20("Crypto Football", "CFB")
  579.     {      
  580.         address router;
  581.         if (block.chainid == 56) {
  582.             router = 0x10ED43C718714eb63d5aA57B78B54704E256024E; // BSC Pancake Mainnet Router
  583.         } else if (block.chainid == 97) {
  584.             router =  0xD99D1c33F9fC3444f8101754aBC46c52416550D1; // BSC Pancake Testnet Router
  585.         } else if (block.chainid == 1 || block.chainid == 5) {
  586.             router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // ETH Uniswap Mainnet % Testnet
  587.         } else {
  588.             revert();
  589.         }
  590.  
  591.         IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router);
  592.         address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
  593.             .createPair(address(this), _uniswapV2Router.WETH());
  594.  
  595.         uniswapV2Router = _uniswapV2Router;
  596.         uniswapV2Pair   = _uniswapV2Pair;
  597.  
  598.         _approve(address(this), address(uniswapV2Router), type(uint256).max);
  599.  
  600.         totalFeesOnBuy    = 5;
  601.         totalFeesOnSell   = 5;
  602.  
  603.         marketingWallet = 0xA1Aa3BAfa28d1f01140bA568eA1c2D9b1a538004;
  604.         DEAD = 0x000000000000000000000000000000000000dEaD;
  605.  
  606.         _isExcludedFromFees[owner()] = true;
  607.         _isExcludedFromFees[DEAD] = true;
  608.         _isExcludedFromFees[marketingWallet] = true;
  609.         _isExcludedFromFees[address(this)] = true;
  610.  
  611.         _mint(owner(), 1e6 * (10 ** decimals()));
  612.         swapTokensAtAmount = totalSupply() / 5000;
  613.     }
  614.  
  615.     receive() external payable {
  616.  
  617.         }
  618.     function setTotalFeesOnBuy(uint256 fee) external onlyOwner {
  619.         totalFeesOnBuy = fee;
  620.     }  
  621.  
  622.      function setTotalFeesOnSell(uint256 fee) external onlyOwner {
  623.         totalFeesOnSell = fee;
  624.     }  
  625.  
  626.     function claimStuckTokens(address token) external onlyOwner returns(bool){
  627.         require(token != address(this), "Owner cannot claim contract's balance of its own tokens");
  628.         if (token == address(0x0)) {
  629.             payable(msg.sender).sendValue(address(this).balance);
  630.             return true;
  631.         }
  632.         IERC20 ERC20token = IERC20(token);
  633.         uint256 balance = ERC20token.balanceOf(address(this));
  634.         bool success = ERC20token.transfer(msg.sender, balance);
  635.         return success;
  636.     }
  637.  
  638. //------------------FeeManagement------------------//
  639.     function excludeFromFees(address account, bool excluded)external onlyOwner{
  640.         require(_isExcludedFromFees[account] != excluded,"Account is already the value of 'excluded'");
  641.         _isExcludedFromFees[account] = excluded;
  642.         emit ExcludeFromFees(account, excluded);
  643.     }
  644.  
  645.     function isExcludedFromFees(address account) public view returns(bool) {
  646.         return _isExcludedFromFees[account];
  647.     }
  648.  
  649.     function changeMarketingWallet(address _marketingWallet) external onlyOwner{
  650.         require(_marketingWallet != marketingWallet,"Marketing wallet is already that address");
  651.         require(!_marketingWallet.isContract(),"Marketing wallet cannot be a contract");
  652.         require( _marketingWallet != address(0),"Marketing wallet cannot be the zero address");
  653.         marketingWallet = _marketingWallet;
  654.         emit MarketingWalletChanged(marketingWallet);
  655.     }
  656. //------------------Transfer------------------//
  657.     function _transfer(address from,address to,uint256 amount) internal  override {
  658.         require(from != address(0), "ERC20: transfer from the zero address");
  659.         require(to != address(0), "ERC20: transfer to the zero address");
  660.        
  661.         if (amount == 0) {
  662.             super._transfer(from, to, 0);
  663.             return;
  664.         }
  665.  
  666.                 uint256 contractTokenBalance = balanceOf(address(this));
  667.  
  668.         bool canSwap = contractTokenBalance >= swapTokensAtAmount;
  669.  
  670.         if (canSwap &&
  671.             !swapping &&
  672.             to == uniswapV2Pair
  673.         ) {
  674.             swapping = true;
  675.             swapAndSendMarketing(contractTokenBalance);
  676.             swapping = false;
  677.         }
  678.  
  679.         uint256 _totalFees;
  680.         if ((_isExcludedFromFees[from] || _isExcludedFromFees[to])||
  681.             ( from != uniswapV2Pair && to != uniswapV2Pair)||
  682.             swapping) {
  683.             _totalFees = 0;
  684.         } else if (from == uniswapV2Pair) {
  685.             _totalFees = totalFeesOnBuy;
  686.         } else {
  687.             _totalFees = totalFeesOnSell;
  688.         }
  689.  
  690.         if (_totalFees > 0) {
  691.             uint256 fees = (amount * _totalFees) / 100;
  692.             amount = amount - fees;
  693.             super._transfer(from, address(this), fees);
  694.         }
  695.         super._transfer(from, to, amount);
  696.     }
  697.  
  698. //------------------Swap------------------//
  699.     function setSwapTokensAtAmount(uint256 newAmount) external onlyOwner{
  700.         require(newAmount > 1 ether, "SwapTokensAtAmount must be greater than 0.001% of total supply");
  701.         swapTokensAtAmount = newAmount;
  702.         emit SwapTokensAtAmountUpdated(swapTokensAtAmount);
  703.     }
  704.  
  705.     function swapAndSendMarketing(uint256 tokenAmount) private {
  706.         uint256 initialBalance = address(this).balance;
  707.  
  708.         address[] memory path = new address[](2);
  709.         path[0] = address(this);
  710.         path[1] = uniswapV2Router.WETH();
  711.  
  712.         uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
  713.             tokenAmount,
  714.             0, // accept any amount of ETH
  715.             path,
  716.             address(this),
  717.             block.timestamp);
  718.  
  719.         uint256 newBalance = address(this).balance - initialBalance;
  720.  
  721.         payable(marketingWallet).sendValue(newBalance);
  722.  
  723.         emit SwapAndSendMarketing(tokenAmount, newBalance);
  724.     }
  725. }