Skip to content
Verified contractExactNOLICENSE

HarryFinkSourPatchPrinter69Inu

Address0x8491a3148dca8f70ec693c4c3e41e6a5e489e6b2
Balance

0 ETH

 

Transactions

98

 

Compiler

solc 0.8.20

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.20+commit.a1b79de6
Language
solidity
Optimization
Yes, 200 runs
License
NOLICENSE
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
18,536,827
Creation transaction
0x461ce9f7e3…868080a93f

HarryFinkSourPatchPrinter69Inu.sol

/**
HarryFinkSourPatchPrinter69Inu in honor of $SAFEMOON. 2/2 to reflections for HODLERS. TEH right way TEH Safemoon way.

Website: www.hfspp69inu.com/
Telegram: t.me/HFSPP69I (http://t.me/HFSPP69I)
Twitter: twitter.com/HFSPP69I
*/

// SPDX-License-Identifier: NOLICENSE
pragma solidity ^0.8.20;

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);
}

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

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() {
        _setOwner(_msgSender());
    }

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

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

    function renounceOwnership() public virtual onlyOwner {
        _setOwner(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

interface IRouter {
    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);

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline) external;
}

library Address{
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}


contract HarryFinkSourPatchPrinter69Inu is Context, IERC20, Ownable {
    using Address for address payable;
    
    mapping (address => uint256) private _rOwned;
    mapping (address => uint256) private _tOwned;
    mapping (address => mapping (address => uint256)) private _allowances;
    mapping (address => bool) private _isExcludedFromFee;
    mapping (address => bool) private _isExcluded;
    mapping (address => bool) public allowedTransfer;
    mapping (address => bool) isTimelockExempt;

    address[] private _excluded;
    bool public swapEnabled;
    bool private swapping;
    

    IRouter public router;
    address public pair;

    uint8 private constant _decimals = 9;
    uint256 private constant MAX = ~uint256(0);

    uint256 private _tTotal = 1_000_000_000_000 * 10**_decimals;
    uint256 private _rTotal = (MAX - (MAX % _tTotal));

    uint256 public swapTokensAtAmount = 20_000_000_000 * 10**9;
    uint256 public maxBuyLimit = 20_000_000_000 * 10**9;
    uint256 public maxSellLimit = 20_000_000_000 * 10**9;
    uint256 public maxWalletLimit = 20_000_000_000 * 10**9;

    bool public tradingOpen = false;
    uint256 launchBlock;
    
    address public MarketingWallet = 0xEb93Ecc2938a3A3Ab45D0bf7ea08022D01aD067d;
    address public TeamWallet = 0xEb93Ecc2938a3A3Ab45D0bf7ea08022D01aD067d;
    address public DevelopmentWallet = 0xAa6De51B55b700aD8C38a2c8779a3b66db500281;

    string private constant _name = "HarryFinkSourPatchPrinter69Inu";
    string private constant _symbol = "SAFEMOON";

    struct Taxes {
        uint256 Reflections;
        uint256 Marketing;
        uint256 Liquidity; 
        uint256 Team;
        uint256 Development;
    }

    Taxes public buyTaxes = Taxes(0, 30, 0, 0, 0);
    Taxes public sellTaxes = Taxes(0, 45, 0, 0, 0);

    struct TotFeesPaidStruct{
        uint256 Reflections;
        uint256 Marketing;
        uint256 Liquidity; 
        uint256 Team;
        uint256 Development;
    }
    
    TotFeesPaidStruct public totFeesPaid;

    struct valuesFromGetValues{
      uint256 rAmount;
      uint256 rTransferAmount;
      uint256 rReflections;
      uint256 rMarketing;
      uint256 rLiquidity;
      uint256 rTeam;
      uint256 rDevelopment;
      uint256 tAmount;
      uint256 tTransferAmount;
      uint256 tReflections;
      uint256 tMarketing;
      uint256 tLiquidity;
      uint256 tTeam;
      uint256 tDevelopment;
    }

    event FeesChanged();
    event UpdatedRouter(address oldRouter, address newRouter);

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

    constructor (address routerAddress) {
        IRouter _router = IRouter(routerAddress);
        address _pair = IFactory(_router.factory())
            .createPair(address(this), _router.WETH());

        router = _router;
        pair = _pair;
        
        excludeFromReward(pair);

        _tOwned[owner()] = _tTotal;
        _isExcluded[address(this)] = true;
        _isExcluded[owner()] = true;
        _isExcluded[MarketingWallet] = true;
        _isExcluded[TeamWallet] = true;
        _isExcluded[DevelopmentWallet] = true;

        _rOwned[owner()] = _rTotal;
        _isExcludedFromFee[address(this)] = true;
        _isExcludedFromFee[owner()] = true;
        _isExcludedFromFee[MarketingWallet] = true;
        _isExcludedFromFee[TeamWallet] = true;
        _isExcludedFromFee[DevelopmentWallet] = true;
        
        allowedTransfer[address(this)] = true;
        allowedTransfer[owner()] = true;
        allowedTransfer[pair] = true;
        allowedTransfer[MarketingWallet] = true;
        allowedTransfer[TeamWallet] = true;
        allowedTransfer[DevelopmentWallet] = true;

        isTimelockExempt[address(this)] = true;
        isTimelockExempt[pair] = true;
        isTimelockExempt[owner()] = true;

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

    //std ERC20:
    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;
    }

    //override ERC20:
    function totalSupply() public view override returns (uint256) {
        return _tTotal;
    }

    function balanceOf(address account) public view override returns (uint256) {
        if (_isExcluded[account]) return _tOwned[account];
        return tokenFromReflection(_rOwned[account]);
    }
    
    function allowance(address holder, address spender) external view override returns (uint256) { 
        return _allowances[holder][spender]; }

    function approve(address spender, uint256 amount) public  override  returns(bool) {
        _allowances[msg.sender][spender] = amount;
        _approve(_msgSender(), spender, amount);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transfer(sender, recipient, amount);

        uint256 currentAllowance = _allowances[sender][_msgSender()];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, _msgSender(), currentAllowance - amount);

        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
        uint256 currentAllowance = _allowances[_msgSender()][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(_msgSender(), spender, currentAllowance - subtractedValue);

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

    function isExcludedFromReward(address account) public view returns (bool) {
        return _isExcluded[account];
    }

    function reflectionFromToken(uint256 tAmount, bool deductTransferReflections) public view returns(uint256) {
        require(tAmount <= _tTotal, "Amount must be less than supply");
        if (!deductTransferReflections) {
            valuesFromGetValues memory s = _getValues(tAmount, true, false);
            return s.rAmount;
        } else {
            valuesFromGetValues memory s = _getValues(tAmount, true, false);
            return s.rTransferAmount;
        }
    }

    function launchtime() public onlyOwner {
        tradingOpen = true;
        launchBlock = block.number;
        swapEnabled = true;

    }

    function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
        require(rAmount <= _rTotal, "Amount must be less than total reflections");
        uint256 currentRate =  _getRate();
        return rAmount/currentRate;
    }

    //@Team kept original Reflections naming -> "reward" as in reflection
    function excludeFromReward(address account) public onlyOwner() {
        require(!_isExcluded[account], "Account is already excluded");
        if(_rOwned[account] > 0) {
            _tOwned[account] = tokenFromReflection(_rOwned[account]);
        }
        _isExcluded[account] = true;
        _excluded.push(account);
    }

    function includeInReward(address account) external onlyOwner() {
        require(_isExcluded[account], "Account is not excluded");
        for (uint256 i = 0; i < _excluded.length; i++) {
            if (_excluded[i] == account) {
                _excluded[i] = _excluded[_excluded.length - 1];
                _tOwned[account] = 0;
                _isExcluded[account] = false;
                _excluded.pop();
                break;
            }
        }
    }


    function excludeFromFee(address account) public onlyOwner {
        _isExcludedFromFee[account] = true;
    }

    function includeInFee(address account) public onlyOwner {
        _isExcludedFromFee[account] = false;
    }


    function isExcludedFromFee(address account) public view returns(bool) {
        return _isExcludedFromFee[account];
    }

    function setIsTimelockExempt(address holder, bool exempt) external onlyOwner {
        isTimelockExempt[holder] = exempt;
    }

    function setBuyTaxes(uint256 _Reflections, uint256 _Marketing, uint256 _Liquidity, uint256 _Team, uint256 _Development) public onlyOwner {
       require(_Reflections+(_Marketing)+(_Liquidity)+(_Team)+(_Development) <=25, "Buy Taxes cannot be higher than 25%");
       buyTaxes = Taxes(_Reflections,_Marketing,_Liquidity,_Team,_Development);
        emit FeesChanged();
    }
    
    function setSellTaxes(uint256 _Reflections, uint256 _Marketing, uint256 _Liquidity, uint256 _Team, uint256 _Development) public onlyOwner {
    require(_Reflections+(_Marketing)+(_Liquidity)+(_Team)+(_Development) <=25, "Sell Taxes cannot be higher than 25%");
        emit FeesChanged();
    }

    function _reflectReflections(uint256 rReflections, uint256 tReflections) private {
        _rTotal -=rReflections;
        totFeesPaid.Reflections +=tReflections;
    }

    function _takeLiquidity(uint256 rLiquidity, uint256 tLiquidity) private {
        totFeesPaid.Liquidity +=tLiquidity;

        if(_isExcluded[address(this)])
        {
            _tOwned[address(this)]+=tLiquidity;
        }
        _rOwned[address(this)] +=rLiquidity;
    }

    function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private {
        totFeesPaid.Marketing +=tMarketing;

        if(_isExcluded[address(this)])
        {
            _tOwned[address(this)]+=tMarketing;
        }
        _rOwned[address(this)] +=rMarketing;
    }
    
    function _takeTeam(uint256 rTeam, uint256 tTeam) private {
        totFeesPaid.Team +=tTeam;

        if(_isExcluded[address(this)])
        {
            _tOwned[address(this)]+=tTeam;
        }
        _rOwned[address(this)] +=rTeam;
    }

    function _takeDevelopment(uint256 rDevelopment, uint256 tDevelopment) private {
        totFeesPaid.Development +=tDevelopment;

        if(_isExcluded[address(this)])
        {
            _tOwned[address(this)]+=tDevelopment;
        }
        _rOwned[address(this)] +=rDevelopment;
    }
    
    
    function _getValues(uint256 tAmount, bool takeFee, bool isSell) private view returns (valuesFromGetValues memory to_return) {
        to_return = _getTValues(tAmount, takeFee, isSell);
        (to_return.rAmount, to_return.rTransferAmount, to_return.rReflections, to_return.rMarketing, to_return.rLiquidity, to_return.rTeam, to_return.rDevelopment) = _getRValues(to_return, tAmount, takeFee, _getRate());
        return to_return;
    }

    function _getTValues(uint256 tAmount, bool takeFee, bool isSell) private view returns (valuesFromGetValues memory s) {

        if(!takeFee) {
          s.tTransferAmount = tAmount;
          return s;
        }
        Taxes memory temp;
        if(isSell) temp = sellTaxes;
        else temp = buyTaxes;
        
        s.tReflections = tAmount*temp.Reflections/100;
        s.tMarketing = tAmount*temp.Marketing/100;
        s.tLiquidity = tAmount*temp.Liquidity/100;
        s.tTeam = tAmount*temp.Team/100;
        s.tDevelopment = tAmount*temp.Development/100;
        s.tTransferAmount = tAmount-s.tReflections-s.tMarketing-s.tLiquidity-s.tTeam-s.tDevelopment;
        return s;
    }

    function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rReflections,uint256 rMarketing, uint256 rLiquidity, uint256 rTeam, uint256 rDevelopment){
        rAmount = tAmount*currentRate;

        if(!takeFee) {
          return(rAmount, rAmount, 0,0,0,0,0);
        }

        rReflections = s.tReflections*currentRate;
        rMarketing = s.tMarketing*currentRate;
        rLiquidity = s.tLiquidity*currentRate;
        rTeam = s.tTeam*currentRate;
        rDevelopment = s.tDevelopment*currentRate;
        rTransferAmount =  rAmount-rReflections-rMarketing-rLiquidity-rTeam-rDevelopment;
        return (rAmount, rTransferAmount, rReflections, rMarketing, rLiquidity, rTeam, rDevelopment);
    }

    function _getRate() private view returns(uint256) {
        (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
        return rSupply/tSupply;
    }

    function _getCurrentSupply() private view returns(uint256, uint256) {
        uint256 rSupply = _rTotal;
        uint256 tSupply = _tTotal;
        for (uint256 i = 0; i < _excluded.length; i++) {
            if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
            rSupply = rSupply-_rOwned[_excluded[i]];
            tSupply = tSupply-_tOwned[_excluded[i]];
        }
        if (rSupply < _rTotal/_tTotal) return (_rTotal, _tTotal);
        return (rSupply, tSupply);
    }

    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");
    require(amount <= balanceOf(from),"You are trying to transfer more than your balance");

    // Exclude wallet to wallet fees
    bool takeFee = true;
    if(from != pair && to != pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
        takeFee = false;
          
    }

    if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
        require(tradingOpen,"Trading not open yet");

    }
    
    if(from == pair && !_isExcludedFromFee[to] && !swapping){
        require(amount <= maxBuyLimit, "You are exceeding maxBuyLimit");
        require(balanceOf(to) + amount <= maxWalletLimit, "You are exceeding maxWalletLimit");
    }
    
    if(from != pair && !_isExcludedFromFee[to] && !_isExcludedFromFee[from] && !swapping){
        require(amount <= maxSellLimit, "You are exceeding maxSellLimit");
        if(to != pair){
            require(balanceOf(to) + amount <= maxWalletLimit, "You are exceeding maxWalletLimit");
        }
    }  
    
    bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount;
    if(!swapping && swapEnabled && canSwap && from != pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
        if(to == pair)  swapAndLiquify(swapTokensAtAmount, sellTaxes);
        else  swapAndLiquify(swapTokensAtAmount, buyTaxes);
    }

    if(swapping || _isExcludedFromFee[from] || _isExcludedFromFee[to]) takeFee = false;
    
    _tokenTransfer(from, to, amount, takeFee, to == pair);
}


    //this method is responsible for taking all fee, if takeFee is true
    function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee, bool isSell) private {

        valuesFromGetValues memory s = _getValues(tAmount, takeFee, isSell);

        if (_isExcluded[sender] ) {  //from excluded
                _tOwned[sender] = _tOwned[sender]-tAmount;
        }
        if (_isExcluded[recipient]) { //to excluded
                _tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount;
        }

        _rOwned[sender] = _rOwned[sender]-s.rAmount;
        _rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount;
        
        if(s.rReflections > 0 || s.tReflections > 0) _reflectReflections(s.rReflections, s.tReflections);
        if(s.rLiquidity > 0 || s.tLiquidity > 0) {
            _takeLiquidity(s.rLiquidity,s.tLiquidity);
            emit Transfer(sender, address(this), s.tLiquidity + s.tMarketing + s.tTeam + s.tDevelopment);
        }
        if(s.rMarketing > 0 || s.tMarketing > 0) _takeMarketing(s.rMarketing, s.tMarketing);
        if(s.rTeam > 0 || s.tTeam > 0) _takeTeam(s.rTeam, s.tTeam);
        if(s.rDevelopment > 0 || s.tDevelopment > 0) _takeDevelopment(s.rDevelopment, s.tDevelopment);
        emit Transfer(sender, recipient, s.tTransferAmount);
        
    }

    function swapAndLiquify(uint256 contractBalance, Taxes memory temp) private lockTheSwap{
        uint256 denominator = (temp.Liquidity + temp.Marketing + temp.Team + temp.Development) * 2;
        uint256 tokensToAddLiquidityWith = contractBalance * temp.Liquidity / denominator;
        uint256 toSwap = contractBalance - tokensToAddLiquidityWith;

        uint256 initialBalance = address(this).balance;

        swapTokensForeth(toSwap);

        uint256 deltaBalance = address(this).balance - initialBalance;
        uint256 unitBalance= deltaBalance / (denominator - temp.Liquidity);
        uint256 ethToAddLiquidityWith = unitBalance * temp.Liquidity;

        if(ethToAddLiquidityWith > 0){
            // Add Liquidity to pancake
            addLiquidity(tokensToAddLiquidityWith, ethToAddLiquidityWith);
        }

        uint256 MarketingAmt = unitBalance * 2 * temp.Marketing;
        if(MarketingAmt > 0){
            payable(MarketingWallet).sendValue(MarketingAmt);
        }
        uint256 TeamAmt = unitBalance * 2 * temp.Team;
        if(TeamAmt > 0){
            payable(TeamWallet).sendValue(TeamAmt);
        }
        uint256 DevelopmentAmt = unitBalance * 2 * temp.Development;
        if(DevelopmentAmt > 0){
            payable(DevelopmentWallet).sendValue(DevelopmentAmt);
        }
            
    }

    function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
        // approve token transfer to cover all possible scenarios
        _approve(address(this), address(router), tokenAmount);

        // add the Liquidity
        router.addLiquidityETH{value: ethAmount}(
            address(this),
            tokenAmount,
            0, // slippage is unavoidable
            0, // slippage is unavoidable
            owner(),
            block.timestamp
        );
    }

    function swapTokensForeth(uint256 tokenAmount) private {
        // generate the uniswap pair path of token -> weth
        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = router.WETH();

        _approve(address(this), address(router), tokenAmount);

        // make the swap
        router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            tokenAmount,
            0, // accept any amount of ETH
            path,
            address(this),
            block.timestamp
        );
    }
    
    
    function bulkExcludeFee(address[] memory accounts, bool state) external onlyOwner{
        for(uint256 i = 0; i < accounts.length; i++){
            _isExcludedFromFee[accounts[i]] = state;
        }
    }

    function updateMarketingWallet(address newWallet) external onlyOwner{
        MarketingWallet = newWallet;
    }
    
    function updateTeamWallet(address newWallet) external onlyOwner{
        TeamWallet = newWallet;
    }

    function updateDevelopmentWallet(address newWallet) external onlyOwner{
        DevelopmentWallet = newWallet;

    }

    function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{
        swapTokensAtAmount = amount * 10**_decimals;
    }

    function updateSwapEnabled(bool _enabled) external onlyOwner{
        swapEnabled = _enabled;
    }
    
    function updateAllowedTransfer(address account, bool state) external onlyOwner{
        allowedTransfer[account] = state;
    }
    
    function setmaxTX(uint256 maxBuy, uint256 maxSell) external onlyOwner{
        maxBuyLimit = maxBuy * 10**decimals();
        maxSellLimit = maxSell * 10**decimals();
    }
    
    function setmaxWallet(uint256 amount) external onlyOwner{
        maxWalletLimit = amount * 10**decimals();
    }

    function updateRouterAndPair(address newRouter, address newPair) external onlyOwner{
        router = IRouter(newRouter);
        pair = newPair;
    }
    
    //Use this in case eth are sent to the contract by mistake
    function rescueeth(uint256 weiAmount) external onlyOwner{
        require(address(this).balance >= weiAmount, "insufficient eth balance");
        payable(msg.sender).transfer(weiAmount);
    }
    

    function rescueAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
        IERC20(_tokenAddr).transfer(_to, _amount);
    }

    receive() external payable{
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.