Quant

0x41af7e794dee45eefab49b6c387eac9368d69c4d

Verification
Verified
v0.8.26+commit.8a97fa7a
Type
Contract
6,718 bytes
ABI entries
66
29 read · 13 write
License
none

Contract information

Address
0x41af7e794dee45eefab49b6c387eac9368d69c4d
Chain
Robinhood Chain (4663)
Compiler
v0.8.26+commit.8a97fa7a
Optimization
Enabled
Creation tx
0x43b6d50dac…de9f651362

Token

Name
QUANT
Symbol
QUANT
Decimals
18
Holders
712

Read contract (29)

BPS()uint256
GRADUATED_TAX_BPS()uint256
LAUNCH_TAX_BPS()uint256
TOTAL_SUPPLY()uint256
allowance(address, address)uint256
balanceOf(address)uint256
buyTaxBps()uint256
clogAmount()uint256
clogRemaining()uint256
contractTokens()uint256
decimals()uint8
distributor()address
graduated()bool
isExempt(address)bool
limitsInEffect()bool
maxSwapPerSell()uint256
maxTxAmount()uint256
maxWalletAmount()uint256
name()string
owner()address
pair()address
projectWallet()address
router()address
sellTaxBps()uint256
swapThreshold()uint256
symbol()string
totalContractTokensSold()uint256
totalSupply()uint256
tradingOpen()bool

Events (9)

ApprovalDistributorSetGraduatedLimitsRemovedOwnershipTransferredSwapBackTaxesLoweredTradingOpenedTransfer

ABI

[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "router_",
        "type": "address"
      },
      {
        "internalType": "address",
        "name": "projectWallet_",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "clogBps_",
        "type": "uint256"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "inputs": [],
    "name": "AlreadyOpen",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "allowance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "ERC20InsufficientAllowance",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "balance",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "needed",
        "type": "uint256"
      }
    ],
    "name": "ERC20InsufficientBalance",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "approver",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidApprover",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "receiver",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidReceiver",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "sender",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidSender",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "spender",
        "type": "address"
      }
    ],
    "name": "ERC20InvalidSpender",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "MaxTx",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "MaxWallet",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      }
    ],
    "name": "OwnableInvalidOwner",
    "type": "error"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      }
    ],
    "name": "OwnableUnauthorizedAccount",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "TaxIncrease",
    "type": "error"
  },
  {
    "inputs": [],
    "name": "TradingClosed",
    "type": "error"
  },
  {
    "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": "distributor",
        "type": "address"
      }
    ],
    "name": "DistributorSet",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [],
    "name": "Graduated",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [],
    "name": "LimitsRemoved",
    "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": "uint256",
        "name": "tokensSwapped",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "ethOut",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "address",
        "name": "destination",
        "type": "address"
      }
    ],
    "name": "SwapBack",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "buyBps",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "sellBps",
        "type": "uint256"
      }
    ],
    "name": "TaxesLowered",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": false,
        "internalType": "address",
        "name": "pair",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "lpTokens",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "lpEth",
        "type": "uint256"
      }
    ],
    "name": "TradingOpened",
    "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": "BPS",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "GRADUATED_TAX_BPS",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "LAUNCH_TAX_BPS",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "TOTAL_SUPPLY",
    "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": "value",
        "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": [],
    "name": "buyTaxBps",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "clogAmount",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "clogRemaining",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "contractTokens",
    "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": "distributor",
    "outputs": [
      {
        "internalType": "address payable",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "graduate",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "graduated",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "name": "isExempt",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "limitsInEffect",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "buyBps_",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "sellBps_",
        "type": "uint256"
      }
    ],
    "name": "lowerTaxes",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxSwapPerSell",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxTxAmount",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxWalletAmount",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "name",
    "outputs": [
      {
        "internalType": "string",
        "name": "",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "openTrading",
    "outputs": [],
    "stateMutability": "payable",
    "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": [],
    "name": "projectWallet",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "removeLimits",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "renounceOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "account",
        "type": "address"
      }
    ],
    "name": "resync",
    "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 payable",
        "name": "distributor_",
        "type": "address"
      }
    ],
    "name": "setDistributor",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "who",
        "type": "address"
      },
      {
        "internalType": "bool",
        "name": "exempt",
        "type": "bool"
      }
    ],
    "name": "setExempt",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "threshold_",
        "type": "uint256"
      },
      {
        "internalType": "uint256",
        "name": "maxPerSell_",
        "type": "uint256"
      }
    ],
    "name": "setSwapConfig",
    "outputs": [],
    "stateMutability": "nonpayable",
    "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": [],
    "name": "totalContractTokensSold",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "totalSupply",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "tradingOpen",
    "outputs": [
      {
        "internalType": "bool",
        "name": "",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "value",
        "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": "value",
        "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"
  },
  {
    "stateMutability": "payable",
    "type": "receive"
  }
]

Source code

// SPDX-License-Identifier: MIT
//
//   QUANT
//   https://quantrh.com
//   https://x.com/Quantrhood
//
pragma solidity 0.8.26;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

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

interface IQuantDistributor {
    function syncShares(address from, address to, uint256 fromBal, uint256 toBal) external;
}

interface IUniswapV2Router02 {
    function factory() external pure returns (address);
    function WETH() 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;
}

contract Quant is ERC20, Ownable {
    uint256 public constant TOTAL_SUPPLY = 1_000_000_000 ether;
    uint256 public constant BPS = 10_000;
    uint256 public constant GRADUATED_TAX_BPS = 400;
    uint256 public constant LAUNCH_TAX_BPS = 2_500;

    IUniswapV2Router02 public immutable router;
    address public immutable projectWallet;
    address payable public distributor;
    address public pair;
    uint256 public clogAmount;
    uint256 public totalContractTokensSold;

    uint256 public buyTaxBps = LAUNCH_TAX_BPS;
    uint256 public sellTaxBps = LAUNCH_TAX_BPS;
    bool public graduated;
    bool public tradingOpen;
    bool public limitsInEffect = true;

    uint256 public maxTxAmount = TOTAL_SUPPLY / 50;
    uint256 public maxWalletAmount = TOTAL_SUPPLY / 50;
    uint256 public swapThreshold = TOTAL_SUPPLY / 2000;
    uint256 public maxSwapPerSell = TOTAL_SUPPLY / 500;

    mapping(address => bool) public isExempt;
    bool private inSwap;

    event DistributorSet(address distributor);
    event TradingOpened(address pair, uint256 lpTokens, uint256 lpEth);
    event TaxesLowered(uint256 buyBps, uint256 sellBps);
    event Graduated();
    event LimitsRemoved();
    event SwapBack(uint256 tokensSwapped, uint256 ethOut, address destination);

    error TradingClosed();
    error AlreadyOpen();
    error TaxIncrease();
    error MaxTx();
    error MaxWallet();

    constructor(address router_, address projectWallet_, uint256 clogBps_)
        ERC20("QUANT", "QUANT")
        Ownable(msg.sender)
    {
        require(router_ != address(0) && projectWallet_ != address(0), "zero addr");
        require(clogBps_ <= 3000, "clog > 30%");
        router = IUniswapV2Router02(router_);
        projectWallet = projectWallet_;
        clogAmount = (TOTAL_SUPPLY * clogBps_) / BPS;

        isExempt[msg.sender] = true;
        isExempt[address(this)] = true;
        isExempt[projectWallet_] = true;

        _mint(address(this), TOTAL_SUPPLY);

        if (clogAmount == 0) _graduate();
    }

    receive() external payable {}

    function setDistributor(address payable distributor_) external onlyOwner {
        require(distributor == address(0) && distributor_ != address(0), "set once");
        distributor = distributor_;
        isExempt[distributor_] = true;
        emit DistributorSet(distributor_);
    }

    function openTrading() external payable onlyOwner {
        if (pair != address(0)) revert AlreadyOpen();
        require(distributor != address(0), "distributor unset");
        require(msg.value > 0, "no ETH");

        IUniswapV2Factory factory = IUniswapV2Factory(router.factory());

        pair = factory.getPair(address(this), router.WETH());
        if (pair == address(0)) pair = factory.createPair(address(this), router.WETH());
        uint256 lpTokens = balanceOf(address(this)) - clogAmount;
        _approve(address(this), address(router), lpTokens);
        router.addLiquidityETH{value: msg.value}(
            address(this), lpTokens, (lpTokens * 99) / 100, (msg.value * 99) / 100, msg.sender, block.timestamp
        );
        tradingOpen = true;
        emit TradingOpened(pair, lpTokens, msg.value);
    }

    function lowerTaxes(uint256 buyBps_, uint256 sellBps_) external onlyOwner {
        if (buyBps_ > buyTaxBps || sellBps_ > sellTaxBps) revert TaxIncrease();
        buyTaxBps = buyBps_;
        sellTaxBps = sellBps_;
        emit TaxesLowered(buyBps_, sellBps_);
    }

    function graduate() external onlyOwner {
        require(!graduated, "already graduated");
        _graduate();
    }

    function _graduate() private {
        graduated = true;
        if (buyTaxBps > GRADUATED_TAX_BPS) buyTaxBps = GRADUATED_TAX_BPS;
        if (sellTaxBps > GRADUATED_TAX_BPS) sellTaxBps = GRADUATED_TAX_BPS;
        emit Graduated();
    }

    function removeLimits() external onlyOwner {
        limitsInEffect = false;
        emit LimitsRemoved();
    }

    function setSwapConfig(uint256 threshold_, uint256 maxPerSell_) external onlyOwner {
        require(threshold_ > 0 && threshold_ <= TOTAL_SUPPLY / 100, "threshold");
        require(maxPerSell_ >= threshold_ && maxPerSell_ <= TOTAL_SUPPLY / 100, "maxPerSell");
        swapThreshold = threshold_;
        maxSwapPerSell = maxPerSell_;
    }

    function setExempt(address who, bool exempt) external onlyOwner {
        require(who != pair, "not pair");
        isExempt[who] = exempt;
    }

    function contractTokens() external view returns (uint256) {
        return balanceOf(address(this));
    }

    function resync(address account) external { _notifyShares(account); }

    function clogRemaining() public view returns (uint256) {
        return totalContractTokensSold >= clogAmount ? 0 : clogAmount - totalContractTokensSold;
    }

    function _update(address from, address to, uint256 value) internal override {
        if (from == address(0) || to == address(0) || inSwap || isExempt[from] || isExempt[to]) {
            super._update(from, to, value);
            _notifyShares(from);
            _notifyShares(to);
            return;
        }
        if (!tradingOpen) revert TradingClosed();

        uint256 taxBps;
        if (from == pair) {
            taxBps = buyTaxBps;
            if (limitsInEffect) {
                if (value > maxTxAmount) revert MaxTx();
                if (balanceOf(to) + value > maxWalletAmount) revert MaxWallet();
            }
        } else if (to == pair) {
            taxBps = sellTaxBps;
            if (limitsInEffect && value > maxTxAmount) revert MaxTx();
            uint256 bal = balanceOf(address(this));
            if (bal >= swapThreshold) {
                _swapBack(bal > maxSwapPerSell ? maxSwapPerSell : bal);
            }
        }

        uint256 tax = (value * taxBps) / BPS;
        if (tax > 0) {
            super._update(from, address(this), tax);
            value -= tax;
        }
        super._update(from, to, value);
        _notifyShares(from);
        _notifyShares(to);
    }

    function _notifyShares(address account) private {
        if (account == address(0) || distributor == address(0)) return;
        uint256 bal = (account == pair || account == address(this) || isExempt[account])
            ? 0 : balanceOf(account);
        try IQuantDistributor(distributor).syncShares(account, account, bal, bal) {} catch {}
    }

    function _swapBack(uint256 amount) private {
        inSwap = true;
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = router.WETH();
        _approve(address(this), address(router), amount);
        try router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            amount, 0, path, address(this), block.timestamp
        ) {

            uint256 ethBal = address(this).balance;
            address dest = graduated ? distributor : projectWallet;
            totalContractTokensSold += amount;
            if (!graduated && totalContractTokensSold >= clogAmount) _graduate();
            if (ethBal > 0) {
                (bool ok, ) = dest.call{value: ethBal}("");
                if (ok) emit SwapBack(amount, ethBal, dest);
            }
        } catch {}
        inSwap = false;
    }
}

Chain explorer4461msChain node77ms