Skip to content
Verified contractPartialMIT

Gta_bigfood_skunk_ape

Address0xe2f1fac24379096c34c366bea7fccaa40ace66bb
Balance

0 ETH

 

Transactions

39

 

Compiler

solc 0.8.20

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.20+commit.a1b79de6
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
Via IR
yes
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
26,451,221
Creation transaction
0x99974c44e6…f999f7e788

UniswapTokenFull.sol

/*
Website:  https://www.watchpreviously.com/news/gta-vi-bigfoot-skunk-ape-cottonmouth-lake/
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, 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 from, address to, 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);
}

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

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 Gta_bigfood_skunk_ape is IERC20 {
    string private _name;
    string private _symbol;
    uint8 private constant _decimals = 18;
    uint256 private constant _tTotal = 1_000_000_000 * 10 ** _decimals;
    uint256 private constant WHITELIST_MAX = 50;

    uint256 private constant _swapThreshold = 2_000_000 * 10 ** _decimals;
    uint256 private constant _maxTaxSwap = 10_000_000 * 10 ** _decimals;

    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;
    mapping(address => bool) private _taxFreeWallet;
    mapping(address => bool) private _unlimitedWallet;

    uint256 public immutable initialBuyFee;
    uint256 public immutable initialSellFee;
    uint256 public immutable finalBuyFee;
    uint256 public immutable finalSellFee;
    uint256 public immutable feeTransitionSeconds;

    uint256 public immutable maxWalletAmount;
    uint256 public immutable maxTxAmount;
    uint256 public immutable limitsActiveSeconds;

    address private constant DEPLOYER = 0x374DfEF9228271A177530f32d23014528fECc412;
    address payable public constant treasury = payable(0x4d7434BDf9f1a57a51FE5f5e73bd40FFFe2f3Af4);
    IUniswapV2Router02 public immutable uniswapRouter;
    address public uniswapPair;
    bool public tradingEnabled;
    uint256 public tradingStartTimestamp;

    uint256 public totalFeesCollected;

    bool private inSwap;
    modifier lockTheSwap() { inSwap = true; _; inSwap = false; }

    event TradingOpened(address indexed pair, uint256 timestamp);
    event WhitelistAdded(address indexed account);

    constructor(
        string memory name_,
        string memory symbol_,
        address router_,
        uint256 devSupply_,
        uint256 initialBuyFee_,
        uint256 initialSellFee_,
        uint256 finalBuyFee_,
        uint256 finalSellFee_,
        uint256 feeTransitionSeconds_,
        uint256 maxWalletBps_,
        uint256 maxTxBps_,
        uint256 limitsActiveSeconds_,
        address[] memory whitelist_
    ) {
        require(router_ != address(0), "router=0");
        require(devSupply_ <= _tTotal, "dev>total");
        require(initialBuyFee_ <= 10_000 && initialSellFee_ <= 10_000, "fee>100%");
        require(finalBuyFee_ <= initialBuyFee_, "finalBuy>initial");
        require(finalSellFee_ <= initialSellFee_, "finalSell>initial");
        require(maxWalletBps_ > 0 && maxWalletBps_ <= 10_000, "bad maxWalletBps");
        require(maxTxBps_ > 0 && maxTxBps_ <= 10_000, "bad maxTxBps");
        require(whitelist_.length <= WHITELIST_MAX, "whitelist too big");

        _name = name_;
        _symbol = symbol_;
        uniswapRouter = IUniswapV2Router02(router_);

        initialBuyFee = initialBuyFee_;
        initialSellFee = initialSellFee_;
        finalBuyFee = finalBuyFee_;
        finalSellFee = finalSellFee_;
        feeTransitionSeconds = feeTransitionSeconds_;

        maxWalletAmount = (_tTotal * maxWalletBps_) / 10_000;
        maxTxAmount = (_tTotal * maxTxBps_) / 10_000;
        limitsActiveSeconds = limitsActiveSeconds_;

        if (devSupply_ > 0) {
            _balances[DEPLOYER] = devSupply_;
            emit Transfer(address(0), DEPLOYER, devSupply_);
        }
        uint256 lpSupply = _tTotal - devSupply_;
        if (lpSupply > 0) {
            _balances[address(this)] = lpSupply;
            emit Transfer(address(0), address(this), lpSupply);
        }

        _taxFreeWallet[address(this)] = true;
        _taxFreeWallet[treasury] = true;
        _unlimitedWallet[DEPLOYER] = true;
        _unlimitedWallet[address(this)] = true;

        for (uint256 i = 0; i < whitelist_.length; i++) {
            address w = whitelist_[i];
            require(w != address(0), "wl zero");
            _taxFreeWallet[w] = true;
            _unlimitedWallet[w] = true;
            emit WhitelistAdded(w);
        }
    }

    function name() public view returns (string memory) { return _name; }
    function symbol() public view 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 to, uint256 amount) public override returns (bool) {
        _transfer(msg.sender, to, 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(msg.sender, spender, amount);
        return true;
    }

    function transferFrom(address from, address to, uint256 amount) public override returns (bool) {
        _transfer(from, to, amount);
        uint256 currentAllowance = _allowances[from][msg.sender];
        require(currentAllowance >= amount, "ERC20: insufficient allowance");
        unchecked { _approve(from, msg.sender, currentAllowance - amount); }
        return true;
    }

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

    function currentBuyFee() public view returns (uint256) { return _decayedFee(initialBuyFee, finalBuyFee); }
    function currentSellFee() public view returns (uint256) { return _decayedFee(initialSellFee, finalSellFee); }

    function _decayedFee(uint256 initial, uint256 final_) private view returns (uint256) {
        if (!tradingEnabled || feeTransitionSeconds == 0) return final_;
        uint256 elapsed = block.timestamp - tradingStartTimestamp;
        if (elapsed >= feeTransitionSeconds) return final_;
        uint256 drop = ((initial - final_) * elapsed) / feeTransitionSeconds;
        return initial - drop;
    }

    function limitsActive() public view returns (bool) {
        if (!tradingEnabled) return true;
        if (limitsActiveSeconds == 0) return true;
        return block.timestamp - tradingStartTimestamp < limitsActiveSeconds;
    }

    function _transfer(address from, address to, uint256 amount) private {
        require(from != address(0) && to != address(0), "ERC20: zero addr");
        require(amount > 0, "ERC20: zero amount");

        if (!tradingEnabled) {
            require(
                from == DEPLOYER || to == DEPLOYER || from == address(this) || to == address(this),
                "trading not open"
            );
            _rawTransfer(from, to, amount);
            return;
        }

        bool takeFee = !(_taxFreeWallet[from] || _taxFreeWallet[to]);
        bool checkLimits = limitsActive() && !_unlimitedWallet[from] && !_unlimitedWallet[to];

        uint256 feeAmount = 0;

        if (from == uniswapPair && to != address(uniswapRouter)) {
            if (checkLimits) {
                require(amount <= maxTxAmount, "max tx exceeded");
                require(_balances[to] + amount <= maxWalletAmount, "max wallet exceeded");
            }
            if (takeFee) feeAmount = (amount * currentBuyFee()) / 10_000;
        } else if (to == uniswapPair && from != address(this)) {
            if (checkLimits) require(amount <= maxTxAmount, "max tx exceeded");
            if (takeFee) feeAmount = (amount * currentSellFee()) / 10_000;
            uint256 contractBal = _balances[address(this)];
            if (!inSwap && contractBal >= _swapThreshold) {
                uint256 swapAmount = contractBal > _maxTaxSwap ? _maxTaxSwap : contractBal;
                _swapTokensForEth(swapAmount);
                uint256 ethBal = address(this).balance;
                if (ethBal > 0) {
                    // low-level call so a contract treasury needing >2300 gas
                    // can't brick sells; count fees only on a successful send.
                    (bool sent, ) = treasury.call{value: ethBal}("");
                    if (sent) totalFeesCollected += ethBal;
                }
            }
        }

        if (feeAmount > 0) _rawTransfer(from, address(this), feeAmount);
        _rawTransfer(from, to, amount - feeAmount);
    }

    function _rawTransfer(address from, address to, uint256 amount) private {
        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: insufficient balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            _balances[to] += amount;
        }
        emit Transfer(from, to, amount);
    }

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

    function openTrading() external payable {
        require(msg.sender == DEPLOYER, "not deployer");
        require(!tradingEnabled, "already open");
        require(msg.value > 0, "no eth");

        address factory = uniswapRouter.factory();
        address weth = uniswapRouter.WETH();
        address pair = IUniswapV2Factory(factory).createPair(address(this), weth);
        uniswapPair = pair;

        uint256 lpTokens = _balances[address(this)];
        require(lpTokens > 0, "no lp tokens");
        _approve(address(this), address(uniswapRouter), lpTokens);

        uniswapRouter.addLiquidityETH{value: msg.value}(
            address(this),
            lpTokens,
            0,
            0,
            DEPLOYER,
            block.timestamp
        );

        tradingEnabled = true;
        tradingStartTimestamp = block.timestamp;
        emit TradingOpened(pair, block.timestamp);

        IERC20(pair).approve(address(uniswapRouter), type(uint256).max);
    }

    receive() external payable {}
}
Compiler settingsShow
{
  "viaIR": true,
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.