Verified contractPartialUNLICENSE
WorkLoAI
Address0xb8bb2484657338c69cb2efc950551728eecaee21
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.30
- Same code
Only this contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- UNLICENSE
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 23,275,143
- Creation transaction
- 0xe3db95636d…6a42a1167f
WorkLoAI.sol
// Discord: https://discord.gg/WorkloAI
// X: https://x.com/WorkloAI
// Website: https://www.workloai.com
// SPDX-License-Identifier: UNLICENSE
pragma solidity 0.8.30;
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;
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 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 IUniswapV2Pair {
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function token0() external view returns (address);
function token1() external view returns (address);
function sync() external;
}
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
);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
}
interface IWETH {
function deposit() external payable;
function withdraw(uint256 wad) external;
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
function totalSupply() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
}
contract WorkLoAI is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public _isExcludedFromFee;
address payable private _taxWallet;
uint256 public buyTax = 25;
uint256 public sellTax = 25;
uint256 public sniperTax = 80;
uint256 public transferTax = 10;
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1_000_000_000 * 10 ** _decimals;
string private constant _name = unicode"Worklo AI";
string private constant _symbol = unicode"WLOOP";
uint256 public _maxWalletSize = (_tTotal * 5) / 10000; // 0.05%
uint256 public _taxSwapUpperLimit = (_tTotal * 1) / 1000; // 0.1%
uint256 public _taxSwapLowerLimit = (_tTotal * 5) / 10000; // 0.05%
uint256 public _taxETHSwapLimit = 1e18; // 1 eth = 1000000000000000000
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool public tradingEnabled;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private sellCount;
uint256 private buyCount;
uint256 private lastBuyBlock;
uint256 private lastSellBlock;
uint256 private launchTimestamp;
uint256 private launchBlock;
uint256 private maxBuyCountPerBlock = 25;
uint256 private taxSellPerBlockLimit = 2;
bool public allowOnlyTxOrigin = true;
bool private isToken0;
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_taxWallet = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_isExcludedFromFee[address(uniswapV2Router)] = true;
_approve(msg.sender, address(this), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(
address(this),
uniswapV2Router.WETH()
);
isToken0 = IUniswapV2Pair(uniswapV2Pair).token0() == address(this);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint256).max);
_balances[owner()] = _tTotal;
emit Transfer(address(0), owner(), _tTotal);
}
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 _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[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 _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");
uint256 taxAmount = 0;
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingEnabled);
taxAmount = (amount * transferTax) / 100;
// if sell
if (to == uniswapV2Pair) {
taxAmount = (amount * sellTax) / 100;
if (block.number == launchBlock) {
taxAmount = amount * sniperTax / 100;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (
!inSwap &&
swapEnabled &&
launchTimestamp + 180 <= block.timestamp &&
contractTokenBalance >= _taxSwapLowerLimit
) {
if (block.number > lastSellBlock) {
sellCount = 0;
}
if (sellCount < taxSellPerBlockLimit) {
(uint112 r0, uint112 r1, ) = IUniswapV2Pair(uniswapV2Pair).getReserves();
uint112 ethReserves = isToken0 ? r1 : r0;
uint112 tokenReserves = isToken0 ? r0 : r1;
uint256 maxTokenSwapByEthAmount = uniswapV2Router.getAmountIn(
_taxETHSwapLimit,
tokenReserves,
ethReserves
);
swapTokensForEth(
min(maxTokenSwapByEthAmount, min(contractTokenBalance, _taxSwapUpperLimit))
);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
sellCount++;
lastSellBlock = block.number;
}
}
} else {
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
// if buy
if (from == uniswapV2Pair) {
taxAmount = (amount * buyTax) / 100;
if (block.number == launchBlock) {
taxAmount = amount * sniperTax / 100;
}
require(!allowOnlyTxOrigin || tx.origin == to);
if (block.number > lastBuyBlock) {
buyCount = 0;
}
buyCount++;
lastBuyBlock = block.number;
require(buyCount < maxBuyCountPerBlock, "Exceeded maximum buycount per block.");
}
}
if (taxAmount > 0) {
_balances[address(this)] = _balances[address(this)].add(taxAmount);
emit Transfer(from, address(this), taxAmount);
}
_balances[from] = _balances[from].sub(amount);
_balances[to] = _balances[to].add(amount.sub(taxAmount));
emit Transfer(from, to, amount.sub(taxAmount));
}
function enableTrading() external onlyOwner {
require(!tradingEnabled, "Can call only once.");
launchTimestamp = block.timestamp;
launchBlock = block.number;
tradingEnabled = true;
swapEnabled = true;
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return (a > b) ? b : a;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
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
);
}
function updateTransferTax(uint256 newTax) external onlyOwner {
transferTax = newTax;
}
// lift against buying to multiple wallets from a contract
function setAllowOnlyTxOrigin(bool value) external onlyOwner {
allowOnlyTxOrigin = value;
}
function setTaxSwapLowerLimit(uint256 newLimit) external onlyOwner {
_taxSwapLowerLimit = newLimit;
}
function setTaxSwapUpperLimit(uint256 newLimit) external onlyOwner {
_taxSwapUpperLimit = newLimit;
}
function setTaxSellCountLimit(uint256 newNumber) external onlyOwner {
taxSellPerBlockLimit = newNumber;
}
function setMaxBuyCountPerBlock(uint256 newNumber) external onlyOwner {
maxBuyCountPerBlock = newNumber;
}
function setMaxWalletPercent(uint256 newPercent) external onlyOwner {
// 0.01% = 1
// 1% = 100
// 100% = 100_000
_maxWalletSize = (totalSupply() / 10000) * newPercent;
}
function setTaxETHSwapLimit(uint256 newLimit) external onlyOwner {
_taxETHSwapLimit = newLimit;
}
function setEverythingToNormal() external onlyOwner {
_maxWalletSize = _tTotal;
buyTax = 4;
sellTax = 4;
transferTax = 0;
maxBuyCountPerBlock = type(uint256).max;
allowOnlyTxOrigin = false;
_taxSwapLowerLimit = totalSupply() / 10_000; // 0.01% default value
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function setFees(uint256 _newBuyFee, uint256 _newSellFee) external onlyOwner {
buyTax = _newBuyFee;
sellTax = _newSellFee;
}
receive() external payable {}
function saveERC20(address _address) external onlyOwner {
uint256 _amount = IERC20(_address).balanceOf(address(this));
IERC20(_address).transfer(_taxWallet, _amount);
}
function saveETH() external onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function setTaxWallet(address newWallet) external onlyOwner {
_taxWallet = payable(newWallet);
}
function excludeFromFee(address account) external onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeFromFee(address account) external onlyOwner {
_isExcludedFromFee[account] = false;
}
// manual unclog
function manualSwap() external onlyOwner {
uint256 contractTokenBalance = balanceOf(address(this));
(uint112 r0, uint112 r1, ) = IUniswapV2Pair(uniswapV2Pair).getReserves();
uint112 ethReserves = isToken0 ? r1 : r0;
uint112 tokenReserves = isToken0 ? r0 : r1;
uint256 maxTokenSwapByEthAmount = uniswapV2Router.getAmountIn(
_taxETHSwapLimit,
tokenReserves,
ethReserves
);
swapTokensForEth(min(maxTokenSwapByEthAmount, min(contractTokenBalance, _taxSwapUpperLimit)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
function addLiquidity(uint256 tokenDesired, uint256 ethDesired) external payable onlyOwner {
require(msg.value >= ethDesired, "Send enough ETH for LP");
(uint112 reserve0, uint112 reserve1, ) = IUniswapV2Pair(uniswapV2Pair).getReserves();
uint256 wethReserve = isToken0 ? reserve1 : reserve0;
IWETH weth = IWETH(uniswapV2Router.WETH());
weth.deposit{value: msg.value}();
uint256 alreadyAddedEth;
uint256 alreadyAddedTokens;
if (wethReserve > 0) {
bool isEthReserveHigher = ethDesired > tokenDesired;
(uint256 higherReserve, uint256 lowerReserve) = isEthReserveHigher
? (ethDesired, tokenDesired)
: (tokenDesired, ethDesired);
uint256 ratioBaseUnit = 100_000;
uint256 ratio = (higherReserve * ratioBaseUnit) / lowerReserve;
if (isEthReserveHigher) {
// if they sent more eth than our base unit
if (wethReserve > ratio) {
uint256 tokenTransferNeeded = wethReserve / ratio;
IERC20(address(this)).transferFrom(msg.sender, uniswapV2Pair, tokenTransferNeeded);
alreadyAddedEth = wethReserve;
alreadyAddedTokens = tokenTransferNeeded;
} else {
weth.transfer(uniswapV2Pair, ratio - wethReserve);
IERC20(address(this)).transferFrom(msg.sender, uniswapV2Pair, ratioBaseUnit);
alreadyAddedEth = ratio;
alreadyAddedTokens = ratioBaseUnit;
}
} else {
// if they sent more eth than our base unit
if (wethReserve > ratioBaseUnit) {
uint256 tokenTransferNeeded = wethReserve * ratio;
IERC20(address(this)).transferFrom(msg.sender, uniswapV2Pair, tokenTransferNeeded);
alreadyAddedEth = wethReserve;
alreadyAddedTokens = tokenTransferNeeded;
} else {
IERC20(address(this)).transferFrom(msg.sender, uniswapV2Pair, ratio - wethReserve);
weth.transfer(uniswapV2Pair, ratioBaseUnit);
alreadyAddedEth = ratioBaseUnit;
alreadyAddedTokens = ratio;
}
}
IUniswapV2Pair(uniswapV2Pair).sync();
// lp is fixed to our desired ratio now
}
IERC20(address(this)).transferFrom(msg.sender, address(this), tokenDesired);
weth.approve(address(uniswapV2Router), msg.value);
_approve(address(this), address(uniswapV2Router), tokenDesired);
uniswapV2Router.addLiquidity(
address(weth),
address(this),
ethDesired - alreadyAddedEth,
tokenDesired - alreadyAddedTokens,
0,
0,
msg.sender,
block.timestamp
);
// send back reamining eth, if any
uint256 balanceLeft = weth.balanceOf(address(this));
if (balanceLeft > 0) {
weth.withdraw(balanceLeft);
payable(msg.sender).transfer(balanceLeft);
}
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris"
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.