uint256 public antiWhaleDuration = 15 minutes;
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual override {
if (
antiWhaleTime > block.timestamp &&
amount > antiWhaleAmount &&
whales[sender]
) {
revert("Anti Whale");
}
uint256 transferFeeRate = recipient == uniswapV2Pair
? sellFeeRate
: (sender == uniswapV2Pair ? buyFeeRate : 0);
if (
transferFeeRate > 0 &&
sender != address(this) &&
recipient != address(this)
) {
uint256 _fee = amount.mul(transferFeeRate).div(100);
super._transfer(sender, address(this), _fee); // TransferFee
amount = amount.sub(_fee);
}
super._transfer(sender, recipient, amount);
}
function antiWhale(uint256 amount) external onlyOwner {
require(amount > 0, "not accept 0 value");
require(!antiWhaleEnabled);
antiWhaleAmount = amount;
antiWhaleTime = block.timestamp.add(antiWhaleDuration);
antiWhaleEnabled = true;
}