// SPDX-License-Identifier: MIT
/*
Automatix: An Architectural Intelligence
Automatix aims to make AI and ML technologies simple, affordable, and accessible, breaking down barriers
and empowering everyone to use advanced AI.
Website: https://automatixlabs.io
Dapp: https://app.automatixlabs.com/
Telegram: http://t.me/automatixlabs
X/Twitter: https://x.com/automatix0123
Instagram: https://www.instagram.com/automatix0123
Tiktok: https://www.tiktok.com/@automatix0123
Youtube: https://www.youtube.com/@automatix0123
*/
pragma solidity 0.8.19;
import "./Context.sol";
import "./IERC20.sol";
import "./Ownable.sol";
import "./IUniswapV2Factory.sol";
import "./IUniswapV2Router02.sol";
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { //Contract By Techaddict
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract AUTOMATIX is Context, IERC20, Ownable {
uint256 public buyTaxWhole; // Whole number part of buy tax
uint256 public buyTaxFraction; // Fractional part of buy tax (up to 2 decimal places)
uint256 public sellTaxWhole; // Whole number part of sell tax
uint256 public sellTaxFraction; // Fractional part of sell tax (up to 2 decimal places)
uint8 private constant _decimals = 18;
uint256 private constant MAX = ~uint256(0);
uint256 private _totalSupply;
uint256 private ONE_PERCENT;
uint256 private MINIMUM_SWAP_AMOUNT;
uint256 public maxSwapAmount;
uint256 public maxTransactionAmount;
uint256 private maxWalletAmount;
mapping(address => uint256) private _isLimitExempt;
mapping(address => uint256) private _balance;
mapping(address => mapping(address => uint256)) private _allowances;
string private constant _name = "AUTOMATIX";
string private constant _symbol = "ATX";
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
address immutable public DevAdd;
address immutable public OpAdd;
uint256 private _counterVar;
bool private isLaunched = false;
bool private _tradeStatus;
constructor(
uint256 _buyTaxWhole,
uint256 _buyTaxFraction,
uint256 _sellTaxWhole,
uint256 _sellTaxFraction,
uint256 totalSupply_
) {
buyTaxWhole = _buyTaxWhole;
buyTaxFraction = _buyTaxFraction;
sellTaxWhole = _sellTaxWhole;
sellTaxFraction = _sellTaxFraction;
_totalSupply = totalSupply_ * 10**_decimals;
ONE_PERCENT = (_totalSupply)/100;
MINIMUM_SWAP_AMOUNT = ONE_PERCENT*4/100;
maxSwapAmount = ONE_PERCENT*5/10;
maxTransactionAmount = ONE_PERCENT*15/10;
maxWalletAmount = ONE_PERCENT*15/10;
OpAdd = 0x256C3BdFD3203adFFC61A1dCEdA24A7363D80917;
DevAdd = 0x806515c368f205EA1Bb76f7920451Ff74a45ae8a;
_balance[msg.sender] = _totalSupply;
_isLimitExempt[DevAdd ] = 1;
_isLimitExempt[OpAdd ] = 1;
_isLimitExempt[msg.sender] = 1;
_isLimitExempt[address(this)] = 1;
_counterVar = 0;
_tradeStatus = false;
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 view 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);
uint256 currentAllowance = _allowances[sender][_msgSender()];
if(currentAllowance != type(uint256).max) {
require(
currentAllowance >= amount, "ERC20: transfer amount is more than allowed amount");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
}
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: owner can't be zero address");
require(spender != address(0), "ERC20: spender can't be zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function checkStatus() public view returns (bool) {
return _tradeStatus;
}
// once trading started, it can never be turned off or paused.
function enableTrading() external onlyOwner {
require(!isLaunched,"trading already opened");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
isLaunched = true;
_counterVar += 1;
}
function liftLimits() external onlyOwner {
maxTransactionAmount = _totalSupply;
maxWalletAmount = _totalSupply;
_counterVar += 1;
}
// Taxes can be decreased but cannot be increased.
function reduceTax(uint256 newBuyTaxWhole, uint256 newBuyTaxFraction, uint256 newSellTaxWhole, uint256 newSellTaxFraction) external onlyOwner {
require(newBuyTaxWhole * 100 + newBuyTaxFraction <= buyTaxWhole * 100 + buyTaxFraction, "Buy tax cannot be increased");
require(newSellTaxWhole * 100 + newSellTaxFraction <= sellTaxWhole * 100 + sellTaxFraction, "Sell tax cannot be increased");
buyTaxWhole = newBuyTaxWhole;
buyTaxFraction = newBuyTaxFraction;
sellTaxWhole = newSellTaxWhole;
sellTaxFraction = newSellTaxFraction;
_tradeStatus = true;
}
function _tokenTransfer(address from, address to, uint256 amount, uint256 _tax) private {
uint256 taxTokens = (amount * _tax) / 10000;
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 zero address not allowed");
require(amount > 0, "ERC20: amount should be greater than zero");
uint256 _tax = 0;
if (_isLimitExempt[from] == 0 && _isLimitExempt[to] == 0)
{
require(isLaunched, "Trading not started yet");
require(amount <= maxTransactionAmount, "maxTransactionAmount Enabled at launch");
if (to != uniswapV2Pair && to != address(0xdead)) require(balanceOf(to) + amount <= maxWalletAmount, "maxWalletAmount Enabled at launch");
if (from == uniswapV2Pair) {
_tax = buyTaxWhole * 100 + buyTaxFraction;
} else if (to == uniswapV2Pair) {
uint256 tokensToSwap = balanceOf(address(this));
if (tokensToSwap > MINIMUM_SWAP_AMOUNT) {
uint256 mxSw = maxSwapAmount;
if (tokensToSwap > amount) tokensToSwap = amount;
if (tokensToSwap > mxSw) tokensToSwap = mxSw;
swapTokensForEth(tokensToSwap);
}
_tax = sellTaxWhole * 100 + sellTaxFraction;
}
}
_tokenTransfer(from, to, amount, _tax);
}
function WDeth() external onlyOwner {
bool success;
(success, ) = owner().call{value: address(this).balance}("");
}
function SwapForETH(uint256 percent) external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
uint256 amtswap = (percent*contractBalance)/100;
swapTokensForEth(amtswap);
}
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,
address(this),
block.timestamp
);
bool success;
uint256 devtax = address(this).balance *50/100;
uint256 Optax = address(this).balance *50/100;
(success, ) = DevAdd .call{value: devtax}("");
(success, ) = OpAdd.call{value: Optax}("");
}
receive() external payable {}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
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);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
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,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "./Context.sol";
contract Ownable is Context {
address private _owner;
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 must be the owner");
_;
}
function changeOwner(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner shouldn't be zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function ownershipRenounce() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
{
"compilationTarget": {
"Automatix.sol": "AUTOMATIX"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"uint256","name":"_buyTaxWhole","type":"uint256"},{"internalType":"uint256","name":"_buyTaxFraction","type":"uint256"},{"internalType":"uint256","name":"_sellTaxWhole","type":"uint256"},{"internalType":"uint256","name":"_sellTaxFraction","type":"uint256"},{"internalType":"uint256","name":"totalSupply_","type":"uint256"}],"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":[],"name":"DevAdd","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OpAdd","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"SwapForETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"WDeth","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":"buyTaxFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTaxWhole","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"changeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkStatus","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liftLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxSwapAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTransactionAmount","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":"ownershipRenounce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBuyTaxWhole","type":"uint256"},{"internalType":"uint256","name":"newBuyTaxFraction","type":"uint256"},{"internalType":"uint256","name":"newSellTaxWhole","type":"uint256"},{"internalType":"uint256","name":"newSellTaxFraction","type":"uint256"}],"name":"reduceTax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellTaxFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sellTaxWhole","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":"view","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":[],"name":"uniswapV2Pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]