Token
0xe0cc2751249b797871b694ad3779755b7d4b1111
Verification
Verified
v0.8.20+commit.a1b79de6
Type
Contract
8,886 bytes
ABI entries
61
41 read · 10 write
License
none
Contract information
- Address
- 0xe0cc2751249b797871b694ad3779755b7d4b1111
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.20+commit.a1b79de6
- Optimization
- Enabled
- Creator
- 0x005F841e20…34719b7474
- Creation tx
- 0x641b042501…8d7131b4af
Token
- Name
- CashDog
- Symbol
- CASHDOG
- Decimals
- 18
- Holders
- 3,406
- Market
- View token page →
Read contract (41)
MIN_LIQ_THRESHOLD() → uint256
START_LIQ_THRESHOLD() → uint256
allowance(address, address) → uint256
autoProcessTaxOnSell() → bool
autoProcessTaxOnSellEnabled() → bool
balanceOf(address) → uint256
burnTaxBps() → uint16
buyTaxBps() → uint16
buyTaxRate() → uint16
decimals() → uint8
deployer() → address
dividendContract() → address
dividendTaxBps() → uint16
dividendTracker() → address
factory() → address
getPoolStateData() → uint8, uint16, uint16, uint256, uint256, uint256
initialLiquidationThreshold() → uint256
launched() → bool
liquidationThreshold() → uint256
liquidityTaxBps() → uint16
mainPool() → address
marketingTaxBps() → uint16
minLiquidationThreshold() → uint256
name() → string
notLiquidating() → bool
pair() → address
quoteToken() → address
router() → address
sale() → address
sellTaxBps() → uint16
sellTaxRate() → uint16
slippageBps() → uint16
state() → uint8
symbol() → string
taxProcessor() → address
taxRate() → uint16
totalSupply() → uint256
totalTaxBps() → uint16
treasury() → address
v2Router() → address
weth() → address
Events (8)
ApprovalAutoProcessTaxOnSellUpdatedDividendBatchProcessFailedDividendSyncFailedLiquidationThresholdUpdatedTaxLiquidationErrorTaxTakenTransfer
ABI
[
{
"inputs": [
{
"internalType": "uint16",
"name": "_slippageBps",
"type": "uint16"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"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": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "AutoProcessTaxOnSellUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "DividendBatchProcessFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "DividendSyncFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "oldThreshold",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newThreshold",
"type": "uint256"
},
{
"indexed": false,
"internalType": "int8",
"name": "direction",
"type": "int8"
}
],
"name": "LiquidationThresholdUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes",
"name": "reason",
"type": "bytes"
}
],
"name": "TaxLiquidationError",
"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": "taxAmount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint16",
"name": "taxBps",
"type": "uint16"
}
],
"name": "TaxTaken",
"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": "MIN_LIQ_THRESHOLD",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "START_LIQ_THRESHOLD",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"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": [],
"name": "autoProcessTaxOnSell",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "autoProcessTaxOnSellEnabled",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "burnTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "buyTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "buyTaxRate",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"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": "subtracted",
"type": "uint256"
}
],
"name": "decreaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "deployer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "dividendContract",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "dividendTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "dividendTracker",
"outputs": [
{
"internalType": "contract DividendTracker",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "factory",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getPoolStateData",
"outputs": [
{
"internalType": "enum Token.PoolState",
"name": "currentState",
"type": "uint8"
},
{
"internalType": "uint16",
"name": "currentBuyTaxRate",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "currentSellTaxRate",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "currentLiquidationThreshold",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "currentTaxExpirationTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "currentAntiFarmerExpirationTime",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "added",
"type": "uint256"
}
],
"name": "increaseAllowance",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "string",
"name": "symbol",
"type": "string"
},
{
"internalType": "uint256",
"name": "totalSupply",
"type": "uint256"
},
{
"internalType": "address",
"name": "router",
"type": "address"
},
{
"internalType": "address",
"name": "treasury",
"type": "address"
},
{
"internalType": "uint16",
"name": "platformShareBps",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "burnTaxBps",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "marketingTaxBps",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "dividendTaxBps",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "liquidityTaxBps",
"type": "uint16"
},
{
"internalType": "address",
"name": "marketingWallet",
"type": "address"
},
{
"internalType": "address",
"name": "dividendToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "swapThreshold",
"type": "uint256"
},
{
"internalType": "address",
"name": "sale",
"type": "address"
},
{
"internalType": "address",
"name": "tracker",
"type": "address"
},
{
"internalType": "address",
"name": "taxProcessor",
"type": "address"
},
{
"internalType": "uint256",
"name": "dividendProcessGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxDividendProcessAccounts",
"type": "uint256"
}
],
"internalType": "struct Token.InitConfig",
"name": "c",
"type": "tuple"
}
],
"name": "init",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "initialLiquidationThreshold",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "launched",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "liquidationThreshold",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "liquidityTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "mainPool",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "marketingTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "minLiquidationThreshold",
"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": "notLiquidating",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "notifyDividend",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "pair",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "maxAmount",
"type": "uint256"
}
],
"name": "processTax",
"outputs": [
{
"internalType": "uint256",
"name": "processed",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "quoteToken",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "router",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "sale",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "sellTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "sellTaxRate",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "enabled",
"type": "bool"
}
],
"name": "setAutoProcessTaxOnSell",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_pair",
"type": "address"
}
],
"name": "setLaunched",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "slippageBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "state",
"outputs": [
{
"internalType": "enum Token.PoolState",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "taxProcessor",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "taxRate",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalTaxBps",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"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": [],
"name": "treasury",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "v2Router",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "weth",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]Source code
pragma solidity ^0.8.20;
import {IERC20} from "./interfaces/IERC20.sol";
import {IUniswapV2Router02} from "./interfaces/IUniswapV2Router02.sol";
import {DividendTracker} from "./DividendTracker.sol";
interface ITokenDeployer {
function factory() external view returns (address);
}
interface ITaxProcessorForToken {
function processTaxTokens(uint256 taxAmount) external returns (int8 liqThresholdDirection);
}
interface IFactoryOwnerForToken {
function owner() external view returns (address);
function globalAutoProcessTaxOnSell() external view returns (bool);
}
contract Token is IERC20 {
address internal constant DEAD = 0x000000000000000000000000000000000000dEaD;
uint16 internal constant BPS_BASE = 10000;
uint16 internal constant MAX_TOTAL_TAX_BPS = 500;
uint256 public constant MIN_LIQ_THRESHOLD = 50_000 ether;
uint256 public constant START_LIQ_THRESHOLD = 400_000 ether;
enum PoolState {
BondingCurve,
Migrating,
TaxEnforcedAntiFarmer,
TaxEnforced,
TaxFree
}
string public name;
string public symbol;
uint8 public constant decimals = 18;
uint256 public override totalSupply;
mapping(address => uint256) public override balanceOf;
mapping(address => mapping(address => uint256)) public override allowance;
address public immutable deployer;
address public factory;
address public router;
address public weth;
address public treasury;
address public sale;
address public taxProcessor;
DividendTracker public dividendTracker;
address public pair;
bool public launched;
bool public notLiquidating;
bool public autoProcessTaxOnSell;
uint256 public liquidationThreshold;
uint256 public initialLiquidationThreshold;
uint256 public minLiquidationThreshold;
uint16 public buyTaxBps;
uint16 public sellTaxBps;
uint16 public totalTaxBps;
uint16 public burnTaxBps;
uint16 public marketingTaxBps;
uint16 public dividendTaxBps;
uint16 public liquidityTaxBps;
uint16 public immutable slippageBps;
event TaxTaken(address indexed from, address indexed to, uint256 taxAmount, uint16 taxBps);
event TaxLiquidationError(bytes reason);
event AutoProcessTaxOnSellUpdated(bool enabled);
event LiquidationThresholdUpdated(uint256 oldThreshold, uint256 newThreshold, int8 direction);
event DividendSyncFailed(address indexed account);
event DividendBatchProcessFailed();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
struct InitConfig {
string name;
string symbol;
uint256 totalSupply;
address router;
address treasury;
uint16 platformShareBps;
uint16 burnTaxBps;
uint16 marketingTaxBps;
uint16 dividendTaxBps;
uint16 liquidityTaxBps;
address marketingWallet;
address dividendToken;
uint256 swapThreshold;
address sale;
address tracker;
address taxProcessor;
uint256 dividendProcessGas;
uint256 maxDividendProcessAccounts;
}
modifier onlyTaxProcessor() {
require(msg.sender == taxProcessor, "ONLY_TAX_PROCESSOR");
_;
}
constructor(uint16 _slippageBps) {
deployer = msg.sender;
require(_slippageBps >= 100 && _slippageBps <= 2000, "BAD_SLIPPAGE");
slippageBps = _slippageBps;
}
function init(InitConfig calldata c) external {
require(factory == address(0), "INITIALIZED");
require(msg.sender == ITokenDeployer(deployer).factory(), "ONLY_FACTORY");
require(c.sale != address(0), "ZERO_SALE");
require(c.tracker != address(0), "ZERO_TRACKER");
require(c.taxProcessor != address(0), "ZERO_TAX_PROCESSOR");
uint16 taxSum = c.burnTaxBps + c.marketingTaxBps + c.dividendTaxBps + c.liquidityTaxBps;
require(taxSum <= MAX_TOTAL_TAX_BPS, "TAX_TOO_HIGH");
factory = msg.sender;
name = c.name;
symbol = c.symbol;
totalSupply = c.totalSupply;
router = c.router;
weth = IUniswapV2Router02(c.router).WETH();
treasury = c.treasury;
sale = c.sale;
taxProcessor = c.taxProcessor;
dividendTracker = DividendTracker(payable(c.tracker));
notLiquidating = true;
burnTaxBps = c.burnTaxBps;
marketingTaxBps = c.marketingTaxBps;
dividendTaxBps = c.dividendTaxBps;
liquidityTaxBps = c.liquidityTaxBps;
initialLiquidationThreshold = c.swapThreshold;
liquidationThreshold = c.swapThreshold;
minLiquidationThreshold = c.swapThreshold < MIN_LIQ_THRESHOLD ? c.swapThreshold : MIN_LIQ_THRESHOLD;
totalTaxBps = taxSum;
buyTaxBps = taxSum;
sellTaxBps = taxSum;
dividendTracker.setExcluded(c.sale, true);
dividendTracker.setExcluded(c.taxProcessor, true);
balanceOf[c.sale] = c.totalSupply;
emit Transfer(address(0), c.sale, c.totalSupply);
}
function setLaunched(address _pair) external {
require(msg.sender == sale, "ONLY_SALE");
require(!launched, "LAUNCHED");
require(_pair != address(0), "ZERO_PAIR");
launched = true;
pair = _pair;
dividendTracker.setExcluded(_pair, true);
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function increaseAllowance(address spender, uint256 added) external returns (bool) {
_approve(msg.sender, spender, allowance[msg.sender][spender] + added);
return true;
}
function decreaseAllowance(address spender, uint256 subtracted) external returns (bool) {
uint256 current = allowance[msg.sender][spender];
require(current >= subtracted, "ALLOWANCE_BELOW_ZERO");
_approve(msg.sender, spender, current - subtracted);
return true;
}
function transfer(address to, uint256 amount) external override returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) external override returns (bool) {
uint256 allowed = allowance[from][msg.sender];
if (allowed != type(uint256).max) {
require(allowed >= amount, "INSUFFICIENT_ALLOWANCE");
_approve(from, msg.sender, allowed - amount);
}
_transfer(from, to, amount);
return true;
}
function processTax(uint256 maxAmount) external returns (uint256 processed) {
uint256 bal = balanceOf[address(this)];
uint256 cap = liquidationThreshold;
uint256 amount = maxAmount == 0 || maxAmount > cap ? cap : maxAmount;
if (amount > bal) amount = bal;
require(amount > 0, "NO_TAX");
require(maxAmount == 0 || msg.sender == IFactoryOwnerForToken(factory).owner(), "ONLY_OWNER_PARTIAL");
require(maxAmount != 0 || bal >= cap, "BELOW_THRESHOLD");
(bool ok, int8 direction) = _processTaxAmount(amount);
if (ok) {
_adjustLiquidationThreshold(direction);
processed = amount;
}
}
function setAutoProcessTaxOnSell(bool enabled) external {
require(msg.sender == IFactoryOwnerForToken(factory).owner(), "ONLY_FACTORY_OWNER");
autoProcessTaxOnSell = enabled;
emit AutoProcessTaxOnSellUpdated(enabled);
}
function autoProcessTaxOnSellEnabled() public view returns (bool) {
if (autoProcessTaxOnSell) return true;
if (factory == address(0)) return false;
try IFactoryOwnerForToken(factory).globalAutoProcessTaxOnSell() returns (bool enabled) {
return enabled;
} catch {
return false;
}
}
function v2Router() external view returns (address) {
return router;
}
function quoteToken() external view returns (address) {
return weth;
}
function mainPool() external view returns (address) {
return pair;
}
function dividendContract() external view returns (address) {
return address(dividendTracker);
}
function state() external view returns (PoolState) {
return launched ? PoolState.TaxEnforced : PoolState.BondingCurve;
}
function taxRate() external view returns (uint16) {
return buyTaxBps > sellTaxBps ? buyTaxBps : sellTaxBps;
}
function buyTaxRate() external view returns (uint16) {
return buyTaxBps;
}
function sellTaxRate() external view returns (uint16) {
return sellTaxBps;
}
function getPoolStateData()
external
view
returns (
PoolState currentState,
uint16 currentBuyTaxRate,
uint16 currentSellTaxRate,
uint256 currentLiquidationThreshold,
uint256 currentTaxExpirationTime,
uint256 currentAntiFarmerExpirationTime
)
{
return (
launched ? PoolState.TaxEnforced : PoolState.BondingCurve,
buyTaxBps,
sellTaxBps,
liquidationThreshold,
0,
0
);
}
function notifyDividend(uint256 amount) external onlyTaxProcessor {
dividendTracker.distributeTokens(amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0) && spender != address(0), "ZERO_ADDR");
allowance[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) internal {
require(from != address(0) && to != address(0), "ZERO_ADDR");
require(balanceOf[from] >= amount, "INSUFFICIENT_BALANCE");
uint16 taxBps = _taxBps(from, to);
if (taxBps == 0) {
_basicTransfer(from, to, amount);
} else {
uint256 tax = (amount * taxBps) / BPS_BASE;
if (tax > 0) {
_basicTransfer(from, address(this), tax);
emit TaxTaken(from, to, tax, taxBps);
}
_basicTransfer(from, to, amount - tax);
}
if (launched) {
_syncDividend(from);
_syncDividend(to);
}
}
function _processTaxAmount(uint256 amount) internal returns (bool ok, int8 direction) {
_approve(address(this), taxProcessor, amount);
try ITaxProcessorForToken(taxProcessor).processTaxTokens(amount) returns (int8 d) {
_approve(address(this), taxProcessor, 0);
direction = d;
ok = true;
} catch (bytes memory reason) {
_approve(address(this), taxProcessor, 0);
emit TaxLiquidationError(reason);
uint256 fallbackAmount = amount;
uint256 remainingBalance = balanceOf[address(this)];
if (fallbackAmount > remainingBalance) fallbackAmount = remainingBalance;
if (fallbackAmount > 0) {
_basicTransfer(address(this), taxProcessor, fallbackAmount);
}
ok = false;
}
}
function _adjustLiquidationThreshold(int8 direction) internal {
if (direction == 0) return;
uint256 oldThreshold = liquidationThreshold;
uint256 threshold = oldThreshold;
if (direction > 0) {
threshold = (threshold * 101) / 100;
if (threshold > initialLiquidationThreshold) {
threshold = initialLiquidationThreshold;
}
} else {
threshold = (threshold * 99) / 100;
if (threshold < minLiquidationThreshold) {
threshold = minLiquidationThreshold;
}
}
if (threshold != oldThreshold) {
liquidationThreshold = threshold;
emit LiquidationThresholdUpdated(oldThreshold, threshold, direction);
}
}
function _taxBps(address from, address to) internal view returns (uint16) {
if (!launched || pair == address(0) || totalTaxBps == 0) return 0;
if (_isSystemAddress(from) || _isSystemAddress(to)) return 0;
if (from == pair) return buyTaxBps;
if (to == pair) return sellTaxBps;
return 0;
}
function _isSystemAddress(address account) internal view returns (bool) {
return account == address(this) ||
account == taxProcessor ||
account == sale ||
account == router ||
account == address(dividendTracker) ||
account == DEAD;
}
function _basicTransfer(address from, address to, uint256 amount) internal {
balanceOf[from] -= amount;
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
}
function _syncDividend(address account) internal {
if (account == address(0) || _isSystemAddress(account) || account == pair) return;
try dividendTracker.setBalance(account, balanceOf[account]) {} catch {
emit DividendSyncFailed(account);
}
}
receive() external payable {
revert("NO_ETH");
}
}
Chain explorer4926msChain node71ms