TheHoodies

0x281079a7832b15238ed9c6ec1e787f3ed9db6ad1

Verification
Verified
v0.8.17+commit.8df45f5f
Type
Contract
23,917 bytes
ABI entries
68
31 read · 20 write
License
none

Contract information

Address
0x281079a7832b15238ed9c6ec1e787f3ed9db6ad1
Chain
Robinhood Chain (4663)
Compiler
v0.8.17+commit.8df45f5f
Optimization
Disabled
Creation tx
0xdd2152f76c…af2392e839

Token

Name
The Hoodies
Symbol
HOODIES
Decimals
18
Holders
931

Read contract (31)

DOMAIN_SEPARATOR()bytes32
EW()uint256
LP_BPS()uint256
MAX_SUPPLY()uint256
MAX_SWAP_POOL_BPS()uint256
MAX_TAX_BPS()uint256
allowance(address, address)uint256
balanceOf(address)uint256
bel(address)bool
buyTaxBps()uint256
decimals()uint8
ecosystemWallet()address
eip712Domain()bytes1, string, string, uint256, address, bytes32, uint256[]
isAMMPair(address)bool
maxSwap()uint256
name()string
nonces(address)uint256
owner()address
pair()address
router()address
sellTaxBps()uint256
swapEnabled()bool
swapPoolBps()uint256
swapThreshold()uint256
symbol()string
taxExempt(address)bool
taxWallet()address
totalSupply()uint256
tradingEnabled()bool
tradingOpenAt()uint256
weth()address

Events (12)

AMMPairSetApprovalBelSetEIP712DomainChangedLaunchedOwnershipTransferredSwapEnabledSetSwapSettingsSetTaxExemptSetTaxSetTaxWalletSetTransfer

ABI

[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "_router",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "_taxWallet",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "_ecosystemWallet",
        "type": "address"
      },
      {
        "internalType": "address[]",
        "name": "_bel",
        "type": "address[]"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "InvalidShortString",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "NotOpen",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "string",
        "name": "str",
        "type": "string"
      }
    ],
    "name": "StringTooLong",
    "type": "error"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "pair",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "bool",
        "name": "isPair",
        "type": "bool"
      }
    ],
    "name": "AMMPairSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Approval",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "bool",
        "name": "allowed",
        "type": "bool"
      }
    ],
    "name": "BelSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [],
    "name": "EIP712DomainChanged",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "tokenAmount",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "ethAmount",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "address",
        "name": "lpRecipient",
        "type": "address"
      }
    ],
    "name": "Launched",
    "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"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "bool",
        "name": "enabled",
        "type": "bool"
      }
    ],
    "name": "SwapEnabledSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "swapThreshold",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "maxSwap",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "swapPoolBps",
        "type": "uint256"
      }
    ],
    "name": "SwapSettingsSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "account",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "bool",
        "name": "exempt",
        "type": "bool"
      }
    ],
    "name": "TaxExemptSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "buyTaxBps",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "sellTaxBps",
        "type": "uint256"
      }
    ],
    "name": "TaxSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "taxWallet",
        "type": "address"
      }
    ],
    "name": "TaxWalletSet",
    "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"
  },
  {
    "inputs": [],
    "name": "DOMAIN_SEPARATOR",
    "outputs": [
      {
        "internalType": "bytes32",
        "name": "",
        "type": "bytes32"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "EW",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "LP_BPS",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "MAX_SUPPLY",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "MAX_SWAP_POOL_BPS",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "MAX_TAX_BPS",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }
    ],
    "name": "allowance",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "approve",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      }
    ],
    "name": "balanceOf",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "bel",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "buyTaxBps",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "decimals",
    "outputs": [
      {
        "internalType": "uint8",
        "name": "",
        "type": "uint8"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "subtractedValue",
        "type": "uint256"
      }
    ],
    "name": "decreaseAllowance",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "ecosystemWallet",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "eip712Domain",
    "outputs": [
      {
        "internalType": "bytes1",
        "name": "fields",
        "type": "bytes1"
      },
      {
        "internalType": "string",
        "name": "name",
        "type": "string"
      },
      {
        "internalType": "string",
        "name": "version",
        "type": "string"
      },
      {
        "internalType": "uint256",
        "name": "chainId",
        "type": "uint256"
      },
      {
        "internalType": "address",
        "name": "verifyingContract",
        "type": "address"
      },
      {
        "internalType": "bytes32",
        "name": "salt",
        "type": "bytes32"
      },
      {
        "internalType": "uint256[]",
        "name": "extensions",
        "type": "uint256[]"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "addedValue",
        "type": "uint256"
      }
    ],
    "name": "increaseAllowance",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "isAMMPair",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "lpRecipient",
        "type": "address"
      }
    ],
    "name": "launch",
    "outputs": [],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxSwap",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "name",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      }
    ],
    "name": "nonces",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "owner",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "pair",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "deadline",
        "type": "uint256"
      },
      {
        "internalType": "uint8",
        "name": "v",
        "type": "uint8"
      },
      {
        "internalType": "bytes32",
        "name": "r",
        "type": "bytes32"
      },
      {
        "internalType": "bytes32",
        "name": "s",
        "type": "bytes32"
      }
    ],
    "name": "permit",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "renounceOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "rescueETH",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "token",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "rescueToken",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "router",
    "outputs": [
      {
        "internalType": "contract IUniswapV2Router02",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "sellTaxBps",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "p",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "isPair",
        "type": "bool"
      }
    ],
    "name": "setAMMPair",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "a",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "allowed",
        "type": "bool"
      }
    ],
    "name": "setBel",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "bps",
        "type": "uint256"
      }
    ],
    "name": "setBuyTax",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "bps",
        "type": "uint256"
      }
    ],
    "name": "setSellTax",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "bool",
        "name": "e",
        "type": "bool"
      }
    ],
    "name": "setSwapEnabled",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "_swapThreshold",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "_maxSwap",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "_swapPoolBps",
        "type": "uint256"
      }
    ],
    "name": "setSwapSettings",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "a",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "exempt",
        "type": "bool"
      }
    ],
    "name": "setTaxExempt",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "w",
        "type": "address"
      }
    ],
    "name": "setTaxWallet",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "swapEnabled",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "swapPoolBps",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "swapThreshold",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "symbol",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "taxExempt",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "taxWallet",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "totalSupply",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "tradingEnabled",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "tradingOpenAt",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "transfer",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "from",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "transferFrom",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newOwner",
        "type": "address"
      }
    ],
    "name": "transferOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "weth",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "withdrawTokens",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "stateMutability": "payable",
    "type": "receive"
  }
]

Source code

// SPDX-License-Identifier: GPL-3.0

/*
The Hoodies - $HOODIES

The Cult Of RobinHood.

TG: https://t.me/TheHoodiesCult
X: https://x.com/TheHoodiesCult
*/

pragma solidity 0.8.17;

import {ERC20} from "@openzeppelin/contracts@4.9.6/token/ERC20/ERC20.sol";
import {ERC20Permit} from "@openzeppelin/contracts@4.9.6/token/ERC20/extensions/ERC20Permit.sol";
import {IERC20} from "@openzeppelin/contracts@4.9.6/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts@4.9.6/token/ERC20/utils/SafeERC20.sol";
import {Ownable} from "@openzeppelin/contracts@4.9.6/access/Ownable.sol";


interface IUniswapV2Router02 {
    function WETH() external pure returns (address);
    function factory() external pure returns (address);
    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

interface IUniswapV2Factory {
    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function createPair(address tokenA, address tokenB) external returns (address pair);
}

interface IUniswapV2Pair {
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function token0() external view returns (address);
}

contract TheHoodies is ERC20, ERC20Permit, Ownable {
    using SafeERC20 for IERC20;

    uint256 public constant MAX_SUPPLY = 1_000_000_000 ether;
    uint256 public constant LP_BPS = 7_700;
    uint256 public constant MAX_TAX_BPS = 1_500;
    uint256 public constant MAX_SWAP_POOL_BPS = 1_000;
    uint256 public constant EW = 30;

    IUniswapV2Router02 public immutable router;
    address public immutable weth;
    address public pair;
    address public immutable ecosystemWallet;

    address public taxWallet;
    uint256 public buyTaxBps = 0;
    uint256 public sellTaxBps = 0;

    bool public tradingEnabled;
    bool public swapEnabled;
    uint256 public swapThreshold = MAX_SUPPLY / 10_000;
    uint256 public maxSwap = MAX_SUPPLY / 100;
    uint256 public swapPoolBps = 50;
    bool private inSwap;

    mapping(address => bool) public taxExempt;
    mapping(address => bool) public isAMMPair;
    mapping(address => bool) public bel;
    uint256 public tradingOpenAt;

    error NotOpen();

    event Launched(uint256 tokenAmount, uint256 ethAmount, address lpRecipient);
    event BelSet(address account, bool allowed);
    event TaxSet(uint256 buyTaxBps, uint256 sellTaxBps);
    event TaxWalletSet(address taxWallet);
    event TaxExemptSet(address account, bool exempt);
    event AMMPairSet(address pair, bool isPair);
    event SwapEnabledSet(bool enabled);
    event SwapSettingsSet(uint256 swapThreshold, uint256 maxSwap, uint256 swapPoolBps);

    modifier lockSwap() {
        inSwap = true;
        _;
        inSwap = false;
    }

    constructor(address _router, address _taxWallet, address _ecosystemWallet, address[] memory _bel)
        ERC20("The Hoodies", "HOODIES")
        ERC20Permit("HOODIES")
    {
        require(_router != address(0) && _taxWallet != address(0) && _ecosystemWallet != address(0), "zero addr");
        router = IUniswapV2Router02(_router);
        weth = router.WETH();
        taxWallet = _taxWallet;
        ecosystemWallet = _ecosystemWallet;

        taxExempt[owner()] = true;
        taxExempt[address(this)] = true;
        taxExempt[_taxWallet] = true;
        taxExempt[_ecosystemWallet] = true;

        for (uint256 i; i < _bel.length; i++) bel[_bel[i]] = true;

        _mint(address(this), MAX_SUPPLY);
    }

    function launch(address lpRecipient) external payable onlyOwner {
        require(!tradingEnabled, "already launched");
        require(msg.value > 0, "no ETH");
        require(lpRecipient != address(0), "zero recipient");

        IUniswapV2Factory factory = IUniswapV2Factory(router.factory());
        address p = factory.getPair(address(this), weth);
        if (p == address(0)) p = factory.createPair(address(this), weth);
        require(balanceOf(p) == 0 && IERC20(weth).balanceOf(p) == 0, "pair not empty");
        pair = p;
        isAMMPair[p] = true;

        uint256 held = balanceOf(address(this));
        uint256 tokenAmount = (held * LP_BPS) / 10_000;
        require(tokenAmount > 0, "no tokens");
        _approve(address(this), address(router), tokenAmount);
        router.addLiquidityETH{value: msg.value}(address(this), tokenAmount, 0, 0, lpRecipient, block.timestamp);
        tradingEnabled = true;
        swapEnabled = true;
        tradingOpenAt = block.timestamp;
        emit Launched(tokenAmount, msg.value, lpRecipient);
    }

    function setBuyTax(uint256 bps) external onlyOwner {
        require(bps <= MAX_TAX_BPS, "max 15%");
        buyTaxBps = bps;
        emit TaxSet(bps, sellTaxBps);
    }

    function setSellTax(uint256 bps) external onlyOwner {
        require(bps <= MAX_TAX_BPS, "max 15%");
        sellTaxBps = bps;
        emit TaxSet(buyTaxBps, bps);
    }

    function setTaxWallet(address w) external onlyOwner {
        require(w != address(0), "zero addr");
        address old = taxWallet;
        if (old != owner() && old != address(this) && old != ecosystemWallet) taxExempt[old] = false;
        taxWallet = w;
        taxExempt[w] = true;
        emit TaxWalletSet(w);
    }

    function setTaxExempt(address a, bool exempt) external onlyOwner {
        require(a != address(0), "zero addr");
        taxExempt[a] = exempt;
        emit TaxExemptSet(a, exempt);
    }

    function setAMMPair(address p, bool isPair) external onlyOwner {
        require(p != address(0), "zero addr");
        isAMMPair[p] = isPair;
        emit AMMPairSet(p, isPair);
    }

    function setBel(address a, bool allowed) external onlyOwner {
        bel[a] = allowed;
        emit BelSet(a, allowed);
    }

    function setSwapEnabled(bool e) external onlyOwner {
        swapEnabled = e;
        emit SwapEnabledSet(e);
    }

    function setSwapSettings(uint256 _swapThreshold, uint256 _maxSwap, uint256 _swapPoolBps) external onlyOwner {
        require(_maxSwap > 0, "zero maxSwap");
        require(_swapThreshold <= _maxSwap, "threshold > maxSwap");
        require(_swapPoolBps > 0 && _swapPoolBps <= MAX_SWAP_POOL_BPS, "bad poolBps");
        swapThreshold = _swapThreshold;
        maxSwap = _maxSwap;
        swapPoolBps = _swapPoolBps;
        emit SwapSettingsSet(_swapThreshold, _maxSwap, _swapPoolBps);
    }

    function rescueETH() external onlyOwner {
        (bool ok, ) = owner().call{value: address(this).balance}("");
        require(ok, "eth send failed");
    }

    function rescueToken(address token, uint256 amount) external onlyOwner {
        require(token != address(this), "no self");
        IERC20(token).safeTransfer(owner(), amount);
    }

    function _transfer(address from, address to, uint256 amount) internal override {
        if (inSwap || taxExempt[from] || taxExempt[to]) {
            super._transfer(from, to, amount);
            return;
        }
        require(tradingEnabled, "trading not enabled");

        bool isBuy = isAMMPair[from];
        bool isSell = isAMMPair[to];

        if (isBuy && block.timestamp < tradingOpenAt + EW && !bel[to]) revert NotOpen();

        if (isSell && swapEnabled && balanceOf(address(this)) >= swapThreshold) {
            _swapBack();
        }

        uint256 tax;
        if (isBuy) tax = (amount * buyTaxBps) / 10_000;
        else if (isSell) tax = (amount * sellTaxBps) / 10_000;
        if (tax > 0) {
            super._transfer(from, address(this), tax);
            amount -= tax;
        }
        super._transfer(from, to, amount);
    }

    function _swapBack() private lockSwap {
        uint256 amount = balanceOf(address(this));
        if (amount > maxSwap) amount = maxSwap;
        uint256 poolCap = _poolSwapCap();
        if (amount > poolCap) amount = poolCap;
        if (amount == 0) return;
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = weth;
        _approve(address(this), address(router), amount);
        try router.swapExactTokensForETHSupportingFeeOnTransferTokens(amount, 0, path, taxWallet, block.timestamp) {}
        catch {}
    }

    function withdrawTokens(uint256 amount) external onlyOwner {
        uint256 bal = balanceOf(address(this));
        require(bal > 0, "no tokens");
        if (amount == 0 || amount > bal) amount = bal;
        _transfer(address(this), owner(), amount);
    }

    function _poolSwapCap() private view returns (uint256) {
        address p = pair;
        if (p == address(0)) return 0;
        (uint112 r0, uint112 r1, ) = IUniswapV2Pair(p).getReserves();
        uint256 reserveArrow = IUniswapV2Pair(p).token0() == address(this) ? uint256(r0) : uint256(r1);
        return (reserveArrow * swapPoolBps) / 10_000;
    }

    function _transferOwnership(address newOwner) internal override {
        super._transferOwnership(newOwner);
        if (newOwner != address(0)) taxExempt[newOwner] = true;
    }

    receive() external payable {}
}
Chain explorer3372msChain node88ms