/*
Twitter: https://twitter.com/CavachonEth
Telegram: https://t.me/CavachonCoin
Medium: https://medium.com/@dev_72199/cavachon-6730e21a7470
Web: https://www.cavachon.io
Web REDIR http://www.cavachon.biz
Web REDIR http://www.cavachon.club
Web REDIR http://www.cavachon.info
Web REDIR http://www.cavachon.live
Web REDIR http://www.cavachon.online
Web REDIR http://www.cavachon.pro
Web REDIR http://www.cavachon.site
Web REDIR http://www.cavachon.space
Web REDIR http://www.cavachon.tech
Web REDIR http://www.cavachon.vip
Web REDIR http://www.cavachon.xyz
Web REDIR http://www.cavachon.art
Web REDIR http://www.cavachon.store
Web REDIR http://www.cavachon.ink
Web REDIR http://www.cavachon.cloud
Web REDIR http://www.cavachon.cc
@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BGP5YJ???7777???JY5PGB&@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&#G5J?7!!!!!!!!!!!!!!!!!!!!!!7?J5G#&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@#PY?!!!!!!!!!!!!!!!!!!!777777!!!!!!!!!?YP#@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@#5?!!!!!!!!!!!!!!!!!!!!7?77!7JY?777!!!7!!!!!!?5B@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@&P?!!!!!!!!!!!!!!!!!!77?J??~^!?J?7!!!!7?J?!!!!!!!!!?P&@@@@@@@@@@@@@
@@@@@@@@@@@#57!!!!!!!!!!!!!!!!???77?J?~^^~~^^^^~!!7?JJ7!!!!!!!!!!!7Y#@@@@@@@@@@@
@@@@@@@@@&Y7!!!!!!!!!!!!!!J77775~^~^::::^^^^~!7J?^::.^!7?J?777!!!!!!!Y#@@@@@@@@@
@@@@@@@@P7!!!!!!!!!77777??JJ7^!^::~?~::^~~~~~!!~^::::^^~!777?J7?!!!!!!75@@@@@@@@
@@@@@@#J!!!!!!!!7?????JJYJJ7::^::::^^::^:::::::.::::::^^^^^^~~???7!!!!!!?#@@@@@@
@@@@@G7!!!!!!!7??777??????JJ~:.:::.:~~^^......::::::^^~!7?!~~^:::7?!!!!!!7G@@@@@
@@@@P!!!!!!!!7J?7??????JYYYYJ~^:::~!:::::::^^^::::^~~~!Y7:.:^~~^:.JY?!!!!!!P@@@@
@@@P!!!!!!!!7Y?????????JYJYY5?!^:7~:^~^~~~!7??7!^^!!~!7!^~!7!!~77:~5JJ7!!!!!P@@@
@@B!!!!!!!!!5Y??J????????JYY5?!~?7~!^:~~!JJYYJJ?7^:::^~JYYYY?77:^?!Y?JY7!!!!!G@@
@&7!!!!!!!!Y5?7YY??J?????YY5J!!?57~:.7?7Y5GGBPY55~.::.YGGBPPP?J^.~YY?75Y!!!!!7&@
@5!!!!!!!?55J?YY??YY?7J??Y5Y?!!77~:::7Y55B#&&P?J5!^:::P#&&YJY5J^~~JYY!7P?!!!!!5@
&7!!!!!!75YJYYJ??YYJ77J?JY5Y?!!!?~.::~~?YGPB#BP75?!^:.7PGGG?75?!??Y5Y?7YJ!!!!!7#
G!!!!!!?5JJYJ??J????7?J?YYPJ?!!77^^::.:!?YY77!~~~^^::::::^~^?JJ?7?5PYY5Y57!!!!!P
Y!!!!!75Y??77??J??JY??Y7YYP7!7??!~::^^~~^::......:::.........:!??755YYYJ5Y7!!!!Y
J!!!!!?5Y??7J??5??5Y5YY7YPY77YY!7JJ?7~::::.:::::::::^?Y557^^::..:!55Y5?J57!!!!!?
J!!!!!YP???JY7YYJ?5YYY5?YG?7!~^~JJ!^:.^~~^^^^:.::::^B&&&&#~J^:::..:!5Y?5Y!!!!!!?
Y!!!!7YJ??JYJ5Y?Y?Y5Y???Y?7?:.~5!:..:7?7!!?7~:.:::::P&&##&5Y::::^~~^^J5P7!!!!!!Y
G!!!!!??Y?J??J?YY??5Y???Y7J?:.7!::::??~:.!~:^~~::::.~JPB#B5~:::^:!77^:J5!!!!!!!P
&7!!!!?YPJ??!??5???Y?7?YY!~:.!7^:::^^...^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!!!!777777!!!!7JP#@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@&#G5J?7!!!!!!!!!!!!!!!!!!!!!!7?J5G#&@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@&BGP5YJ???7777???JY5PGB&&@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.18;
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;
address private _previousOwner;
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 transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
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(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract Cavachon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _walletExcluded;
uint256 private constant MAX = ~uint256(0);
uint8 private constant _decimals = 18;
uint256 private constant _totalSupply = 10**15 * 10**_decimals;
uint256 private constant minSwap = 400000000000 * 10**_decimals;
uint256 private constant onePercent = 10000000000000 * 10**_decimals;
uint256 public maxTxAmount = onePercent * 2;
uint256 private launchBlock;
uint256 private buyValue;
uint256 private _tax;
uint256 public buyTax = 39;
uint256 public sellTax = 39;
string private constant _name = "Cavachon";
string private constant _symbol = "CAVA";
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
address payable public treasury;
bool public launch = false;
constructor(address[] memory wallets) {
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
treasury = payable(wallets[0]);
_balance[msg.sender] = _totalSupply;
for (uint256 i = 0; i < wallets.length; i++) {
_walletExcluded[wallets[i]] = true;
}
_walletExcluded[msg.sender] = true;
_walletExcluded[address(this)] = true;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
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 _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[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 Cavachooooon(uint256 _buyValue) external onlyOwner {
launch = true;
launchBlock = block.number;
buyValue = _buyValue;
}
function addExcludedWallet(address wallet) external onlyOwner {
_walletExcluded[wallet] = true;
}
function removeLimits() external onlyOwner {
maxTxAmount = _totalSupply;
}
function changeTax(uint256 newBuyTax, uint256 newSellTax) external onlyOwner {
buyTax = newBuyTax;
sellTax = newSellTax;
}
function _tokenTransfer(address from, address to, uint256 amount) private {
uint256 taxTokens = (amount * _tax) / 100;
uint256 transferAmount = amount - taxTokens;
_balance[from] = _balance[from] - amount;
_balance[to] = _balance[to] + transferAmount;
_balance[address(this)] = _balance[address(this)] + taxTokens;
emit Transfer(from, to, transferAmount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
if (_walletExcluded[from] || _walletExcluded[to]) {
_tax = 0;
} else {
require(launch, "Trading not open");
require(amount <= maxTxAmount, "MaxTx Enabled at launch");
if (block.number < launchBlock + buyValue) {_tax=99;} else {
if (from == uniswapV2Pair) {
_tax = buyTax;
} else if (to == uniswapV2Pair) {
uint256 tokensToSwap = balanceOf(address(this));
if (tokensToSwap > minSwap) { //Sets Max Internal Swap
if (tokensToSwap > onePercent * 4) {
tokensToSwap = onePercent * 4;
}
swapTokensForEth(tokensToSwap);
}
_tax = sellTax;
} else {
_tax = 0;
}
}
}
_tokenTransfer(from, to, amount);
}
function manualSendBalance() external {
require(_msgSender() == treasury);
uint256 contractETHBalance = address(this).balance;
treasury.transfer(contractETHBalance);
uint256 contractBalance = balanceOf(address(this));
treasury.transfer(contractBalance);
}
function manualSwapTokens() external {
require(_msgSender() == treasury);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function swapTokensForEth(uint256 tokenAmount) private {
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,
treasury,
block.timestamp
);
}
receive() external payable {}
}
{
"compilationTarget": {
"Cavachon.sol": "Cavachon"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address[]","name":"wallets","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"uint256","name":"_buyValue","type":"uint256"}],"name":"Cavachooooon","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"addExcludedWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBuyTax","type":"uint256"},{"internalType":"uint256","name":"newSellTax","type":"uint256"}],"name":"changeTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"launch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manualSendBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"manualSwapTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxTxAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellTax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV2Pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]