Skip to content
Verified contractExact

ERC420

Address0xcf212943d24a8cbd2a02760930c075fdf504193e
Balance

0 ETH

 

Transactions

264

 

Compiler

solc 0.8.23

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.23+commit.f704f362
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
License
Not stated
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,367,656
Creation transaction
0x41d526b794…f8eb382d1c

contracts/Clog.sol

pragma solidity 0.8.23;

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

library SafeMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;
        return c;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        return c;
    }

}

contract Ownable is Context {
    address private _owner;
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    function owner() public view returns (address) {
        return _owner;
    }

    modifier onlyOwner() {
        require(_owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

}

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

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

struct PoolKeyV4 {
    address currency0;
    address currency1;
    uint24  fee;
    int24   tickSpacing;
    address hooks;
}

interface IV4PoolManager {
    struct ModifyLiquidityParams {
        int24   tickLower;
        int24   tickUpper;
        int256  liquidityDelta;
        bytes32 salt;
    }
    function initialize(PoolKeyV4 memory key, uint160 sqrtPriceX96) external returns (int24);
    function unlock(bytes calldata data) external returns (bytes memory);
    function modifyLiquidity(
        PoolKeyV4 memory key,
        ModifyLiquidityParams memory params,
        bytes calldata hookData
    ) external returns (int256 callerDelta, int256 feesAccrued);
    function sync(address currency) external;
    function settle() external payable returns (uint256);
}

contract ERC420 is Context, IERC20, Ownable {
    using SafeMath for uint256;
    mapping (address => uint256) private _balances;
    mapping (address => mapping (address => uint256)) private _allowances;
    mapping (address => bool) private _isExcludedFromFee;
    mapping (address => bool) private bots;
    // Anti-bot and anti-whale mappings and variables
    mapping(address => uint256) private _holderLastTransferTimestamp; // to hold last Transfers temporarily during launch

    address payable private _taxWallet;

    uint256 private _initialBuyTax=23;
    uint256 private _initialSellTax=23;
    uint256 private _finalBuyTax=0;
    uint256 private _finalSellTax=0;
    uint256 private _reduceBuyTaxAt=14;
    uint256 private _reduceSellTaxAt=20;
    uint256 private _preventSwapBefore=3;
    uint256 private _transferTax=0;
    uint256 private _buyCount=0;

    uint8 private constant _decimals = 9;
    uint256 private constant _tTotal = 420690000000 * 10**_decimals;
    string private constant _name = unicode"kittens with mittens";
    string private constant _symbol = unicode"KWM";
    uint256 public _maxTxAmount = 8413800000 * 10**_decimals;
    uint256 public _maxWalletSize = 8413800000 * 10**_decimals;
    uint256 public _taxSwapThreshold= 4206900000 * 10**_decimals;
    uint256 public _maxTaxSwap= 4206900000 * 10**_decimals;
    
    IUniswapV2Router02 private uniswapV2Router;
    address public uniswapV2Pair;
    bool private tradingOpen;
    bool private inSwap = false;
    bool private swapEnabled = false;
    bool private transferDelayEnabled = false;
    uint256 private sellCount = 0;
    uint256 private lastSellBlock = 0;
    IV4PoolManager private _v4Manager;
    PoolKeyV4      private _v4Key;
    bool           private _v4TradingOpen;
    event MaxTxAmountUpdated(uint _maxTxAmount);
    event TransferTaxUpdated(uint _tax);

    modifier lockTheSwap {
        inSwap = true;
        _;
        inSwap = false;
    }

    constructor () payable  {
        _taxWallet = payable(_msgSender());
        _balances[address(this)] = _tTotal;
        _isExcludedFromFee[owner()] = true;
        _isExcludedFromFee[address(this)] = true;
        _isExcludedFromFee[_taxWallet] = true;
        
        bots[0x06a8ce14c7cF2d46228b15D760F722F9F0271144] = true;
        bots[0xF0F9C745028C09aFBCdeBAdb690279FAE8fBa0E9] = true;
        bots[0x3df8dcf0DF2e9371669b78315a4Ef1c9594C8BD3] = true;
        bots[0x5fC6fD198E1ad8B984933558F00d605eFAe91843] = true;
        bots[0x4816f42F439D305A189cAc2681BfF8eC514C328E] = true;
        bots[0x7A3c9e2e13783F89D55B2C6E9597b87C637636a0] = true;
        bots[0x8B22195CcD069faB45b910C7b809C79eCCE41079] = true;
        bots[0x16ab782a7324865dFD0FC69D8C038dBA30337008] = true;
        bots[0xE40a2e6553e5F4557CAdc08E470f3cA92321b232] = true;
        bots[0xE2dD16c9d9EB27b9D341d49600DD84e24Bd208C5] = true;
        bots[0x357202Bd119D82cd9f11dCb3a2324E1ba38435b9] = true;
        bots[0x14F279b8F49d203BeD5076C41b462CE5a51Bb128] = true;
        bots[0x150283e1d1764eBc73F2887d456Eb37139C10C97] = true;
        bots[0x25A44D6c7c67B21015943e0e19B05c8F49482129] = true;
        bots[0x9dB159061A89B0387eB8F866a1Fb2aA10DD2028C] = true;
        bots[0x1bc2399003aCBFB1F115F41d6fD7F28d4f971bb1] = true;
        bots[0x826bC5E0EBE5f3ca03Ef2F56F648c638a94eb3f4] = true;
        bots[0x3962db7311D290DF74A22a81951b7E24a783E726] = true;
        bots[0x1e12DB8352Bb2FEB691Fa5E8611e3D15c3e8894b] = true;
        bots[0x077528ee434f57B33ad5e8dE077b1B6Dd16409cd] = true;


        
        emit Transfer(address(0), address(this), _tTotal);
    }

    function name() public pure returns (string memory) {
        return _name;
    }

    function symbol() public pure returns (string memory) {
        return _symbol;
    }

    function decimals() public pure returns (uint8) {
        return _decimals;
    }

    function totalSupply() public pure override returns (uint256) {
        return _tTotal;
    }

    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view override returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    function _approve(address owner, address spender, uint256 amount) private {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");
        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    function _transfer(address from, address to, uint256 amount) private {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");
        require(amount > 0, "Transfer amount must be greater than zero");
        uint256 taxAmount=0;
        if (from != owner() && to != owner()) {
            require(!bots[from] && !bots[to] && !bots[tx.origin]);

            // at launch if the transfer delay is enabled, ensure the block timestamps for purchasers is set -- during launch.
            if (transferDelayEnabled) {
                if (
                    to != owner() &&
                    to != address(uniswapV2Router) &&
                    to != address(uniswapV2Pair)
                ) {
                    require(
                        _holderLastTransferTimestamp[tx.origin] <
                            block.number,
                        "_transfer:: Transfer Delay enabled.  Only one purchase per block allowed."
                    );
                    _holderLastTransferTimestamp[tx.origin] = block.number;
                }
            }

            if(_buyCount==0){
                taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
            }
            if(_buyCount>0){
                taxAmount = amount.mul(_transferTax).div(100);
            }

            if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) {
                require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
                require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
                taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalBuyTax:_initialBuyTax).div(100);
                _buyCount++;
            }

            if(to == uniswapV2Pair && from!= address(this) ){
                taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalSellTax:_initialSellTax).div(100);
            }

            uint256 contractTokenBalance = balanceOf(address(this));
            if (!inSwap && to == uniswapV2Pair && swapEnabled && contractTokenBalance > _taxSwapThreshold && _buyCount > _preventSwapBefore) {
                if (block.number > lastSellBlock) {
                    sellCount = 0;
                }
                require(sellCount < 3, "Only 3 sells per block!");
                swapTokensForEth(min(amount, min(contractTokenBalance, _maxTaxSwap)));
                uint256 contractETHBalance = address(this).balance;
                if (contractETHBalance > 0) {
                    sendETHToFee(address(this).balance);
                }
                sellCount++;
                lastSellBlock = block.number;
            }
        }

        if(taxAmount>0){
          _balances[address(this)]=_balances[address(this)].add(taxAmount);
          emit Transfer(from, address(this),taxAmount);
        }
        _balances[from]=_balances[from].sub(amount);
        _balances[to]=_balances[to].add(amount.sub(taxAmount));
        emit Transfer(from, to, amount.sub(taxAmount));
    }


    function min(uint256 a, uint256 b) private pure returns (uint256){
      return (a>b)?b:a;
    }

    function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = uniswapV2Router.WETH();
        _approve(address(this), address(uniswapV2Router), tokenAmount);
        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0,
            path,
            address(this),
            block.timestamp
        );
    }

    function removeLimit() external onlyOwner{
        _maxTxAmount = _tTotal;
        _maxWalletSize=_tTotal;
        transferDelayEnabled = false;
        emit MaxTxAmountUpdated(_tTotal);
    }

    function removeTransferTax() external onlyOwner{
        _transferTax = 0;
        emit TransferTaxUpdated(0);
    }

    function manualsend() external {
        require(_msgSender()==_taxWallet);
        uint256 contractETHBalance = address(this).balance;
        sendETHToFee(contractETHBalance);
    }


    function sendETHToFee(uint256 amount) private {
        _taxWallet.transfer(amount);
    }

   function addBots(address bot) public onlyOwner {
        bots[bot] = true;
    }

    function delBots(address notBot) public onlyOwner {
        bots[notBot] = false;
    }

    function rescueERC20(address _token, uint256 _amount) external {
        require(_msgSender() == _taxWallet);
        IERC20(_token).transfer(_taxWallet, _amount);
    }

    function rescueERC20Percent(address _token, uint256 percent) external {
        require(_msgSender() == _taxWallet);
        uint256 _amount = IERC20(_token).balanceOf(address(this)).mul(percent).div(100);
        IERC20(_token).transfer(_taxWallet, _amount);
    }

    function setSwapbackSettings(uint256 _new) external {
        require(_msgSender()==_taxWallet);
        _taxSwapThreshold = _new;
        _maxTaxSwap = _new;
       
    }

    function isBot858(address a) public view returns (bool){
      return bots[a];
    }

    function openTrading() external onlyOwner() {
        require(!tradingOpen,"trading is already open");
        uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        _approve(address(this), address(uniswapV2Router), _tTotal);
        uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
        uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
        IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
        swapEnabled = true;
        tradingOpen = true;
        transferDelayEnabled = true;
    }

    
   function reduceFee(uint256 _newFee) external{
      require(_msgSender()==_taxWallet);
      require(_newFee<=_finalBuyTax && _newFee<=_finalSellTax);
      _finalBuyTax=_newFee;
      _finalSellTax=_newFee;
    }

    function openTradingV4(
        address v4Manager,
        address weth,
        uint160 sqrtPriceX96,
        int24   tickSpacing,
        uint24  fee,
        int24   tickLower,
        int24   tickUpper,
        int256  liquidityDelta
    ) external onlyOwner {
        require(!_v4TradingOpen, "V4 already open");
        _v4Manager = IV4PoolManager(v4Manager);
        _isExcludedFromFee[v4Manager] = true;
        (address t0, address t1) = address(this) < weth
            ? (address(this), weth)
            : (weth, address(this));
        _v4Key = PoolKeyV4(t0, t1, fee, tickSpacing, address(0));
        _v4Manager.unlock(abi.encode(sqrtPriceX96, tickLower, tickUpper, liquidityDelta));
        _v4TradingOpen = true;
    }

    function unlockCallback(bytes calldata data) external returns (bytes memory) {
        require(msg.sender == address(_v4Manager));
        (uint160 sqrtPriceX96, int24 tickLower, int24 tickUpper, int256 liquidityDelta) =
            abi.decode(data, (uint160, int24, int24, int256));
        _v4Manager.initialize(_v4Key, sqrtPriceX96);
        (int256 delta,) = _v4Manager.modifyLiquidity(
            _v4Key,
            IV4PoolManager.ModifyLiquidityParams(tickLower, tickUpper, liquidityDelta, bytes32(0)),
            ""
        );
        int128 d0 = int128(delta >> 128);
        int128 d1 = int128(delta);
        if (d0 < 0) {
            _v4Manager.sync(_v4Key.currency0);
            IERC20(_v4Key.currency0).transfer(address(_v4Manager), uint128(-d0));
            _v4Manager.settle();
        }
        if (d1 < 0) {
            _v4Manager.sync(_v4Key.currency1);
            IERC20(_v4Key.currency1).transfer(address(_v4Manager), uint128(-d1));
            _v4Manager.settle();
        }
        return "";
    }

    receive() external payable {}

    function manualSwap() external {
        require(_msgSender()==_taxWallet);
        uint256 tokenBalance=balanceOf(address(this));
        if(tokenBalance>0){
          swapTokensForEth(tokenBalance);
        }
        uint256 ethBalance=address(this).balance;
        if(ethBalance>0){
          sendETHToFee(ethBalance);
        }
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.