// SPDX-License-Identifier: MIT
/**

Shiba Keikogi Inu - $SHIBGI

Shiba Keikogi, a fierce Shiba Inu warrior trained in karate, protected his village and their cryptocurrency from ruthless bandits by using both his physical and technical skills, earning him the title of protector and guardian. He emerged victorious and lived a peaceful life, having saved his home and people from certain disaster.

 Tokenomics
 ⛩ Total Supply: 1.000.000 
 ⛩ Max transaction: 2% / 20.000
 ⛩ Max wallet: 2% / 20.000
 ⛩ Tax: 5% 

Socials
Website: https://www.shibgi.com/
Twitter: https://twitter.com/ShibKeikogi
Telegram: https://t.me/ShibGi
                                                                                                                                                                                 
GGGGGGB##GGGGGGGGB##BGGGGGGGG##BGGGGGGG###BGGGBBBBB##&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&######&&&#&&###BGGGGGGGB#BGPPP5555555YJ?77!!!~~~^^::::::::
GGGGGGB#BGGGGGGGGB##GGPPPPPPG##BGGGGGGGB#BGGGGGGGGGB#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#BBBBBB#&&##&###G5555YY5PBB5J??7777?YY?~~^^^:::^^^:........
GGGGGGB#BGGGGGGGGB##GGPPPPPPG##BGGGGGGGB#BGGGGGGGGGB#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#BGGGGB#####&###G55YYYYYPBGY??777!!7JJ7~^^::::::^^:........
#########BBBBBBBBB##BBGGGGGGB##BGGGGGGGB#BGGGGGGGGGB#&&&&&&&&&&&&&&&&&&&&&&&#5Y5B&&&&&&&&&&#BGGGGB#&&##&#&#G55YYYYYPBG5??77!!!7JJ7^^:::::::^^:........
#######&&#########&&#########&&#########&##BY?JYPBB##&&&&&&&&&&&&&&&&&&&&&&Y~^~7YG#&&&&&&&&##BBBBB#&&##&&&#GP555555PBG5J?777!!!?J7^^:::::::^^:........
GGGGGB###BGGGGGGGB##BBGBBBBBB#&#BBBBBBB#&##Y7?JJJY5GB#&&&&&&&&&&&&&&&&&&&#7^~?J!!YG#&&&&&&&&&####&&&&&&&&&##BBBBBBBBBBGPP55YYJJYJ?!~~~^^^^^^^::.......
GGGGGGB##GGGGGGGGB##BGGGGGGGG##BGGGGGGGB#BGJ7YPP5YJJYPGB#&&&&&##BBGGGGGGP!:~JB#BJ~YPG#&&&&&&#BBBBB#&&&&&&&#BGPPPPPGGBBGP555YYYYYYJ?77!!!~~~~~^::::::::
GGGGGGB##GGGGGGGGB##BGGGGGGGG##BGGGGGGGB#BGY!YPBBBPYJY5PPGPJ77!!!!~~^^^~~^~?P#&##7~5P5B&&&&&BBBGBB#&&&&&&&#G5555YY5PBB5J??777!7JY7~~^^^^::^~^::.......
GGGGGGB##BGGGGGGGB##BGGGGGGGG##BGGGGGGGB#BGP!75G####5JYGGPY7!!7??7!!~!JYY^!YP#&&&Y^JGP5P#&&&#BBBBB#&&&&&&&#G5555YY5PBB5J??77!!7JY7~^^^^:::^~^:........
GGGGGGB##BGGGGGGGB##BGGGGGGGG##BGGGGGGGB#BGGY^?5G#&&GJ5G5?77?JJ???????5BBJ7Y5G&&&5^7PPPY5#&&#BBBBB#&&&&&&&#G5555YY5PBB5J??777!7JY?~^^^^:::^~^::.......
##BBBB#&##BBBBBBB###BBBBBBBBB##BBGGGGGGB##GGG?^?5G#&#G5?77??YY?JJJJYYJJYPBGBB####J!JPPPPJ5#&#BBBBB#&&&&&&&#GP555555PBB5J??777!7YY?~^^^^^:^^~~::.......
######&&&#########&&#########&&&########&#####J!55PB5?777?JY5JJJJYYYYYYYJY5GBBGP5YYYYY5P5YP#&&####&&&&&&&&&#BBBBBBBB##GPP555YYY55Y?77!!!~~!!~^^:::::::
BBBBBB#&#BBBBBBBBB&&#BBBBBBBB#&#BBBBBB##&######?!JY?!!!77JY5JJJJJ55555YYYJ??????YP55Y5PGG5YG######&&&&&&&&&#BBBBBBB###BGPPPP555PP5JJ???777777!~~~~^^^~
BBBGGB###BBGGGGGGB##BGGGGGGGB##BBGGGGGB#&#BGGGGGJ!~~!~:!JY55J7~!JPP555YYJJ???????J5G##BBGP55GBBBB##&&&&&&&#BP555555GBB5J???777?Y5J!~~~~^^^~7!^::::::::
BBBBBB###BGGGGGGGB##BGGGGGGGB##BGGGGGGG#&#BGGGGG7:^~!~:^Y55YJ~!YY??JJYY5YJJJJJJJJJJJYPGGGP55PBBBBB#&&&&&&&#BP555YY5PBB5J??77!!7Y5J!~~^^^^^~7!^::::::.:
BBBGBB###BGGGGGGGB##BGGGGGGGB##BGGGGGGG###BGGGG5^:~!!7~75YJ?JJYGBBB##GGGP555555YYJ??7?J5PPP55GBBBB#&&&&&&&#BP555YY5PBB5J??777!7Y5J!~~~^^^^~77~::::::::
BBBBBB#&#BBBGGGGGB##BGGGGGGGB##BBGGGGGG#&#BGGGB?.:~!JBBY7!!!?P##&##B5YY?!~~!77!!~~~~~!7?5PP555BBBB#&&&&&&&#BP555555PBBPJ??7777?5PJ!~~~~^^^!?7~^:::::::
#######&##########&&##BBBBBB##&#BBBBBBB#&#BBBBG~  ..:77~^~!7?J55JJ?JY5J!^^^::::^^^^~~~!7J5P555GBB##&&&&&&&&#BBBBGGGB##GPPP55555PG5YJ???777?J?7!!!~~~~~
######&&&#########&&#########&&&#######&&&&&#&P:   ...:^~!7?JY55Y77??7~^^^^^^^^~~~~~~!!7J5P555P#&&&&&&&&&&&#BBBBBBBB##BGGPPPPPPGGP5YYJJJ??JJJ??7777777
BBBBBB#&#BBBBBBBB#&&#BBBBBBBB#&#BBBBBBB#&###B#J .:~!7!~^:^~7J5PPY~:...:^~!!~~~~~~~~~!!7?Y5PP555B###&&&&&&&#BP555YY5PBBPJJ???77JPPY7!!~~~~~7JJ!~^^^^^^^
BBBBBB#&#BBBBBBBBB##BBBGGGGBB#&#BBBBGBB#&#BBBB7^PB&&&#Y!~^^^!5G5?^:::^~!7???7!!!!!!!!7?JY5PP555PBB##&&&&&&#B55YYYYYPBB5J??7777?PPY7!~~~~~~7JJ!~^^^^^^^
BBBBBB#&#BBBBBBBBB##BBBGGGGBB#&#BBBBGBB#&#BBBB7:G&&&&#PJ7!!!!?J?!~~~!!7777???7777777??JY5PPPP55PBB##&#&&&&#G5YYYYYY5BB5J??7777JPGY7!~~~~~~7YJ!~^^^^^^^
BBBBBB#&#BBBBBBBBB##BBBBBBBBB#&#BBBBBBB#&#BBBBY.~G#&&#BG5J?77!!!77?J?7!7777??7777???JY5PPGGPP555GB##&&&&&&#BGPPPPPPGBBG5YYYYJJYGG5J????777J5Y?7!!!!!!!
#######&#####BBBB#&&#BBBBBBBB#&#BBBBBBB#&#BBBBG?.75B####BGGPP555PB#BPJ?JJ???????JJYY5PGGGPPPP55YGB#&&&&&&&&####BBBB###BBBBBGGGGBBBGGPPPPPPPGGP5555YYYY
&&&&&&&&&&&&&&&&&&&&&########&&&########&######BY^.!55PGGGGGGGGPPP555555YJ????JYY5PGGGGGGGPPPPJJPBG&&&&&&&&BPPPP55PG##G5YYYYYY5GBPYJ??????YPPY??77777?
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&###5^...:~!!7JY555PPPPPP55YYYYY55PGGBBBGGPPPPGPYJ5PPG#&&&&&&#BPPPP555GB#G5YYJJJJ5GBPJ????77?YPPJ77!!!!!7
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#?^.  .:^^~7JY55PPPPPPP5PPPPPGGGGPPP5YYY5P5YY555PGB##&&########BBBB##BBBBBBGGBBBBGGGGPPPPGGGPPP555555
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&B~:.  ..:^~7?J5PPGGGGGPP5555555YYYYYYYY55YY555YPGGGPG########################BBBBBBBBBBBBBBBBGGGGGGGG
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&?. .  ..::^~!7JY55PPP555YYYYYYYYJJJYYY5YJJYY55PPPPP55B&&############################BBBBBBBBBBBGGGGGG
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&J.  .  ..::^~~!???JY5YYYYYYYYYJJJJJJY55YJJJJY5555P55Y5GGB&&&###############################BBBBBBBBBBB
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#5..  .. ...:^^!!7?JJJYYYYYYYYYJ??JJYYYYJJJJJJ55Y55YYY5GGYY5B################################BBBBBBBBBBB
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#G5^.:  .: ...::^^!!7??JJYJJJJ????JJJYYJ??7??JY5YY55YJY5GGGY55YPB###########################BBBBBBBBBBBBBB
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&BPB7...  .~....::^^~~777????????????J5Y???????JYYYY5JJJ5GBGPP5YJ5YP###############################BBBBBBBBB
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&P5#P:...  .!:..:::^^~!!!77???777???J5Y?????JJJYYJJY555Y55P5YJJJYPGP5PBBBBB###BBBBBBBB###BBBBBBBBB##BGGGGGGGG
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&55&B?:.:.  .7~..::::^~~!!!77777?7??JYJ7?????77JYJJYPGGG5YPGPP55PG###BBG#GGG##BGPPPPPPGB#BGPPPPPPPG##GP5555555
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#Y&&B?^:~.   !J^::::^^^~!!77!7!!7?JJYJ7?777777JYJJYPBBGP5GBBBBBBBB########GG##BPPPPPPPGB#BP5555555GB#G555YYYY5
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&BP?B&#Y~^~:...^5?^:::^^^~~~!7!!77?JJ5Y?J???777JYYY5PBBGPPGBGBBBBBB##########G##BPPPPPPPGB#BP5555555GB#GP555YY55
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&BPJ?7?YB&G?7!~::::J5!^^^^^^^~!~!!!77?JY57??????7J555PPB#G55GBGBBBBBBBB#########B##BGPPPPPPGB#BGPPPPPPPG##BPP555555
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#YJ??JJJ?JP#5Y7?^^^^!5J~~~^^^~~~~!!???YY5?7?77??7J55PPPB#G55GBGGGGBGPPG##########GB###BBBBBB####BBBBBBBBB###BBBBBBBB
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#PJYYYYJ??YBBPYY?~~~!?G?!!~~~~~~!77??YYYY7??????J5PPPPG&BGGGGGGBBGY77?YB########BGG##BBBBBBBB###BGGGGGGGB##BGGGGGGGG
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&GJJYJJ5G&##BP55?!!!75P7!77~~~~!?7JYYY5JJJJJJJJ5PGGGB#&B#5JJJYPPY!7?YB##BP5PPB#GGPBBGGPPPPPGB#BGPPPPPPPG##BPPPPP55P
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&####&B5YJ5G###&##BGP5?77?JG577J7!~!??Y5YYY5JYYYYYY5GGGG#B###577?7!77777JYGBGPG5PG##GGPG#BGGPGGGG##BGPPPPPPPB##BPPPPPPPP
&&&&&&&&&&&&&&&&&&#&&&&&&#&&&&&###&B5GPP########BBGGPJJYYYGY??YJ777Y55YY5YYY5YYY5GGGG##BB#P7~^^~~~~!7?555GBBP5#&&GGP5PB##BP5PGB##BGGGGGGPGB##BGPPPPPPP
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&#&BYPBGYBBBB###&&#BBGPYYYY5G5JY5Y?5555Y5PY555555PGBBB##BB&#GPYJ7!~~!7?Y55GBPBP#&#PPP5PGB#BGY7YG###BBBBBBBBB##BBGGGGGGG
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&##&B?5GBBJYGGGBBBB###BBGP55555BGP5J555555GP555555PGBBBB&##B&&GBBB#BBP5YYJJJPGBB5B#BGPP5PBB#BPPJ~7YG#####################
&&&&&&&&&&&&&&&&&&##&&&&&&&&#BB&G!JPGBBP75PGBBBBBBB#BBBG5555P#BJ555555PG5555555PBBBBB&#&&##GPGBB###&#BBPP5Y5PG##GPPP5PBBBBGGP!~~7YG###################
&&&&&&&&&&&&&&#&&&####&&&&&&#GB5^75PGGBG??PPPGBBBB####BBGP555PYY55555PGP555555PGBBBBB##&&&&GGBBB##&&######BGPPBBPPP55PBBBBBBG?!!~!75B#################
&&&&&&&&&&&&&&&&&&######&&&BG#Y:~Y5PGGGGY7JGGPPGB###&&&##BGPP555555PPGG5PPPP5PGBBBBB####&&&GBBB#&&########&##BGPP5555GBBBBBBPJJ?7!!!JG################
&&&&&&&&&&&&&&&&&&&&&&&&##BPG7.^?55PGGBGP?7YGGGPPPGBBBBB####BGPPPPPPGBPPPPPPPPBBB#BB##&&&&#GBB#&#GB#####B###BBGP55YY5GBBBBBB5JJJJ?777JG#&&&&&&&#######
&#&&&&&&#&&&&&&&&&&&&&&#&B5J^.^7Y55PGGBGG5??5GGGGP5555PGB&&&&##BGGGB#GPPPPPPGGBB####&&&&&&BG##&#5G####GPGBBBGP55YYYYPBBBBBBBPYYYJJJ?77JG##############
&&&&&&&&&###&&&&&&&&##&&#G?::~7J555PPGGBGPY?J5PGGGGPPPPG#&&#&&&####&#BBBBBBBB############&GB#&B5GBBBBP5PGGGPP5YYJYY5GBBBBBB##G5YYYYJJ??YGBBBGGGGGGGGGG
########BBBBBBBBBBBBBBGGG7::^!JY555PPGGGBGPY?Y5PGGGGGPGB&&&B#@&##BBBGBGGGBGGGGGGGGGBBB##&&GB#G5BBBBG5JYPPPP55YJJJJJ5GBBBBBB#&#GP5YYYYJJJYYYYYJJJJJJJJ?
PPPPPPPPP5555555555555Y?^::~!?J5555PPPGGGGG5JJYPPGGPPPGB#&&BB&@&&##BBBGGGGGGGBGGBBB####&&&B#G5BBBGGY??5PPP5YYJJ??JYPBBBBBB####GBG555YYYYYYJJJJJJJJJ???
YYYYYYYYYYYYYYYY55555Y?^::^!?JY55555PPPGGBGP5JY5PPP55GB####GB&@@@&&####B#BBBB#B######&&&&&BG5BBBGPY??J5555YYJJ???J5GBBBBBB##&#BPBB5555YYYPBBGGGGGGGGGG
PPPPPPPPPPPPPPGGGGGGBBBGY77?JY555555PPPGGGGGPY5Y55555GB##BGGB&@@@&&&&&#########&&&&&&&&&@@BPGBBGPY?7?JY555YJJ????YPGBBBBBB#&&#BPG#G555555P############
##########################BP5YY55555PPPPGGGGP55555555PGBBBGGB&@@@@&&&&&&&&&&&&&&&&&&&&@@@@GGBBGPY?77?JY55YYJJ????JPGBBBB###&###GGB#PPPPP5P#&&&&#&#####
##############&###########&&#BGP55555PPPGGGGGP5PPP555PPGBBGG##&@@@@@&&&&&&&&&&&&&&&&&&&&&BPBBGPY?7!7?JYYYYJJ??77?JPGBBBB##&&&&#BBB##PPPPPPB&&&&&######
####&#####&&&&#&&&#########&####BP555PPPPGGGGPPPPPP55PPGGGPB##&@&&&&#&&&###&&&####BBB####GGBBPY?!!!7?JJYYJJJ??77?YPGBBB#BB#&&&BGGGB&BGGGGG#&&&&&&&&&&#
########&&&&&#&&&#######&&######&##GP555PPPPPPPPPPPPPPPP5PBB#&&&@&&&####BGGBBPPGPBBBBB##BGBBGY?7!!!7??JJJJJ???77?5GGBB#BB#&&&#BBGGB&#BGGGG#&&&&&&&&&&&
#######&&&&##&&&&#########&###&######BG555555PPPPPP55555GBBB#&&&@&&&######BB##BBBB######GBGPY?7!!!77??JJJJJ????7?YPGBBBB##&####BBGB#&BBBBB#&&&&&&#####
#########&&#&&#####################&&&&#G55YYYJJJJYY5PGBBBB##&&&&&&&&&&&&########&&&&&&BGGPY?7!!!!!7????JJJJJJJJJYPGBB########BGGPB###BBBBBBBBBBGGGGGG
BBBBBBBBBBBBBBBBBBBBBBBGGGGGGGGGGGGGGGGBBGP5Y??Y5PGGBBBBBB##&#B&@&&&&&&&@@&&&&&&&##&&&&BGPY?7!~!!?JYY5555PPPB###############BBGGGBB###BBBGPPPPPP555555
55555555555555555555555555555555555555555555P57?PGGGGGBBBBBGJ~?#@@&&&&&&@@&&#&&&&&#&&##P5YJYY5G##BBBBBBBBBBB&@&&&&&&&&&################BGPP55555555555
5YY5YYYYYYY5YYYYYYYYYYYYYYYYYYYYYYYYYY55555J7^:!YPGGGBGJ?!^::!YB&@&&@@@&&@&&&&####&&&&#BB##&@@@@@BGGBBBBBBB#&&&&&&&&&&&&&&&&&&&&&&&&#B#BGGPPPPP5555YY5
55555555555555555Y555YYYYY5555YYYYYYYY??7!^::^~!?YGBGY!!~!775PB#&&&&&&@@&&@&&&####&&&&&&&&&&&&&&&G55555PPGGB@@@&&@@&&&&&&&&&&&&&&&&&###BBBGGPPPPP55555
5555555555555555555555555555555555Y?!^~!^!?!!?JY5GBG55PBGBGB##&&&&&&@@@@@&&@&&&&&&&&&&&&&&&&&@@&PJJJJJ?JJYYP#@@&&&&&&&&&&&&&&&&&&&&&&##BBGGGPPPPP55555
PPP555555555555555PPPP5PPPP5555PP55PP5G5PBGPGGBB##BGGGGGGGB####&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&P5JPYY5JYP55PP&@@@@@@@@@@&&&&&&&&####BBGGPPPPPP5555555Y
55555555555555555555555555PPP55PPPPGBBBBBBBBB###BBBBBBBGGGGGGGBBBBB#########################&&&##B######&&&&#&&&&&&&&&&&&####BBBBGGGPPP5P5555YYYYYYYYJ
PPPPPPPPPPPPP55PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGGGGGGGGPPPPPGGGGGGGGGGGGGGGBBBBBBBBBBBBBBBBB###############BBB###BBBBBGGGGGGGGPPP555555YYYYYJYJJJJ
PPPGGGGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPGGGGGGGGGGPPPPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPP5555Y555555YYYJJJJJ
PPP555PPP55PPPPPPPGGGPGGGGGPGGGPPPPPPPPPPPPPPPPPPGGGGGGGGGGGGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPPP555YYYYJJJJJJJJJJJ

**/
pragma solidity 0.8.17;

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);
}

contract ShibaKeikogiInu 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;
    mapping(address => uint256) private _holderLastTransferTimestamp;
    bool public transferDelayEnabled = false;
    address payable private _taxWallet;

    uint256 private _initialBuyTax=9;
    uint256 private _initialSellTax=12;
    uint256 private _finalTax=5;
    uint256 private _reduceBuyTaxAt=15;
    uint256 private _reduceSellTaxAt=25;
    uint256 private _preventSwapBefore=10;
    uint256 private _buyCount=0;

    uint8 private constant _decimals = 8;
    uint256 private constant _tTotal = 1000000 * 10**_decimals;
    string private constant _name = unicode"Shiba Keikogi Inu";
    string private constant _symbol = unicode"SHIBGI";
    uint256 public _maxTxAmount =   20000 * 10**_decimals;
    uint256 public _maxWalletSize = 20000 * 10**_decimals;
    uint256 public _taxSwapThreshold=10000 * 10**_decimals;
    uint256 public _maxTaxSwap=20000 * 10**_decimals;

    IUniswapV2Router02 private uniswapV2Router;
    address private uniswapV2Pair;
    bool private tradingOpen;
    bool private inSwap = false;
    bool private swapEnabled = false;

    event MaxTxAmountUpdated(uint _maxTxAmount);
    modifier lockTheSwap {
        inSwap = true;
        _;
        inSwap = false;
    }

    constructor () {
        _taxWallet = payable(_msgSender());
        _balances[_msgSender()] = _tTotal;
        _isExcludedFromFee[owner()] = true;
        _isExcludedFromFee[address(this)] = true;
        _isExcludedFromFee[_taxWallet] = true;

        emit Transfer(address(0), _msgSender(), _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]);
            taxAmount = amount.mul((_buyCount>_reduceBuyTaxAt)?_finalTax:_initialBuyTax).div(100);

            if (transferDelayEnabled) {
                  if (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 (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] ) {
                require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
                require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
                _buyCount++;
            }

            if(to == uniswapV2Pair && from!= address(this) ){
                taxAmount = amount.mul((_buyCount>_reduceSellTaxAt)?_finalTax:_initialSellTax).div(100);
            }

            uint256 contractTokenBalance = balanceOf(address(this));
            if (!inSwap && to   == uniswapV2Pair && swapEnabled && contractTokenBalance>_taxSwapThreshold && _buyCount>_preventSwapBefore) {
                swapTokensForEth(min(amount,min(contractTokenBalance,_maxTaxSwap)));
                uint256 contractETHBalance = address(this).balance;
                if(contractETHBalance > 0) {
                    sendETHToFee(address(this).balance);
                }
            }
        }

        _balances[from]=_balances[from].sub(amount);
        _balances[to]=_balances[to].add(amount.sub(taxAmount));
        emit Transfer(from, to, amount.sub(taxAmount));
        if(taxAmount>0){
          _balances[address(this)]=_balances[address(this)].add(taxAmount);
          emit Transfer(from, address(this),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 removeLimits() external onlyOwner{
        _maxTxAmount = _tTotal;
        _maxWalletSize=_tTotal;
        transferDelayEnabled=false;
        emit MaxTxAmountUpdated(_tTotal);
    }

    function sendETHToFee(uint256 amount) private {
        _taxWallet.transfer(amount);
    }

    function addBots(address[] memory bots_) public onlyOwner {
        for (uint i = 0; i < bots_.length; i++) {
            bots[bots_[i]] = true;
        }
    }

    function delBots(address[] memory notbot) public onlyOwner {
      for (uint i = 0; i < notbot.length; i++) {
          bots[notbot[i]] = false;
      }
    }

    function isBot(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);
        swapEnabled = true;
        tradingOpen = true;
        IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
    }

    
    function reduceFee(uint256 _newFee) external{
      require(_msgSender()==_taxWallet);
      require(_newFee<=_finalTax);
      _finalTax=_newFee;
    }

    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);
        }
    }
}