编译器
0.8.13+commit.abaa5c0e
文件 1 的 11:BurnTokenX.sol
pragma solidity 0.8.13;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
contract BurnTokenX is ERC20Burnable, Ownable {
uint256 constant _initial_supply = 1 * (10**12) * (10**18);
uint256 public tokensBurned;
address payable public _treasuryWallet;
address payable public _developmentWallet;
address payable public _buybackWallet;
uint256 public maxWalletSize = (_initial_supply * 15) / 10000;
uint256 public maxTransactionSize = (_initial_supply * 15) / 100000;
uint256 public swapThreshold = (_initial_supply * 135) / 1000000;
IUniswapV2Router02 public immutable uniswapV2Router;
address public immutable uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
uint256 liquidityLockTime = 0;
mapping(address => bool) public _isBlackListedBot;
mapping(address => bool) public _isExcludedFromFee;
mapping(address => bool) public _isExcludedFromMaxTransaction;
mapping(address => bool) public _isExcludedFromMaxWallet;
enum FeeType {
None,
Buy,
Sell
}
struct BuyFee {
uint16 liquidity;
uint16 treasury;
uint16 dev;
uint16 buyback;
}
struct SellFee {
uint16 liquidity;
uint16 treasury;
uint16 dev;
uint16 buyback;
}
BuyFee public buyFee;
SellFee public sellFee;
uint256 constant FEE_DENOM = 1000;
event botAddedToBlacklist(address account);
event botRemovedFromBlacklist(address account);
event excludedFromFee(address account);
event excludedFromMaxTransaction(address account);
event excludedFromMaxWallet(address account);
event includedInFee(address account);
event includedInMaxTransaction(address account);
event includedInMaxWallet(address account);
event treasuryWalletUpdated(address treasuryWallet);
event developmentWalletUpdated(address developmentWallet);
event buybackWalletUpdated(address buybackWallet);
event liquidityRemoved(uint256 amountToken, uint256 amountETH);
event swapThresholdUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
event MaxWalletSizeUpdated(uint256 maxWalletSize);
event MaxTransactionSizeUpdated(uint256 maxTransactionSize);
event LiquidityLockTimeUpdated(uint256 lockTime);
modifier lockTheSwap() {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor(
string memory name__,
string memory symbol__,
address treasury,
address development,
address buyback,
address[8] memory teamWallets
) ERC20(name__, symbol__) {
setSellFee(470, 0, 480, 0);
setBuyFee(470, 0, 480, 0);
require(treasury != address(0), "Treasury wallet cannot be 0x0");
require(development != address(0), "Development wallet cannot be 0x0");
require(buyback != address(0), "Buyback wallet cannot be 0x0");
_treasuryWallet = payable(treasury);
_developmentWallet = payable(development);
_buybackWallet = payable(buyback);
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router = _uniswapV2Router;
_mint(msg.sender, (_initial_supply * 14) / 100);
_mint(msg.sender, (_initial_supply * 5) / 100);
_mint(teamWallets[0], (_initial_supply * 15) / 10000);
_mint(teamWallets[1], (_initial_supply * 15) / 10000);
_mint(teamWallets[2], (_initial_supply * 15) / 10000);
_mint(teamWallets[3], (_initial_supply * 15) / 10000);
_mint(teamWallets[4], (_initial_supply * 10) / 10000);
_mint(teamWallets[5], (_initial_supply * 10) / 10000);
_mint(teamWallets[6], (_initial_supply * 10) / 10000);
_mint(teamWallets[7], (_initial_supply * 10) / 10000);
_mint(
0x000000000000000000000000000000000000dEaD,
(_initial_supply * 80) / 100
);
_isExcludedFromFee[msg.sender] = true;
_isExcludedFromMaxTransaction[msg.sender] = true;
_isExcludedFromMaxWallet[msg.sender] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromMaxTransaction[address(this)] = true;
_isExcludedFromMaxWallet[address(this)] = true;
_isExcludedFromFee[_treasuryWallet] = true;
_isExcludedFromMaxTransaction[_treasuryWallet] = true;
_isExcludedFromMaxWallet[_treasuryWallet] = true;
_isExcludedFromFee[_developmentWallet] = true;
_isExcludedFromMaxTransaction[_developmentWallet] = true;
_isExcludedFromMaxWallet[_developmentWallet] = true;
_isExcludedFromFee[_buybackWallet] = true;
_isExcludedFromMaxTransaction[_buybackWallet] = true;
_isExcludedFromMaxWallet[_buybackWallet] = true;
}
receive() external payable {}
function transfer(address to, uint256 amount)
public
override
returns (bool)
{
address _owner = _msgSender();
(bool takeFee, FeeType feeType) = checkFeeRequired(_owner, to);
checkTransferAllowed(_owner, to, amount, takeFee);
if (takeFee) {
uint256 contractBalance = balanceOf(address(this));
if (
contractBalance >= swapThreshold &&
!inSwapAndLiquify &&
swapAndLiquifyEnabled &&
_owner != uniswapV2Pair
) {
swapAndLiquify(swapThreshold);
}
uint256 fee = calculateFee(amount, feeType);
_transfer(_owner, address(this), fee);
_transfer(_owner, to, amount - fee);
} else {
_transfer(_owner, to, amount);
}
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public override returns (bool) {
address spender = _msgSender();
(bool takeFee, FeeType feeType) = checkFeeRequired(from, to);
checkTransferAllowed(from, to, amount, takeFee);
_spendAllowance(from, spender, amount);
if (takeFee) {
uint256 contractBalance = balanceOf(address(this));
if (
contractBalance >= swapThreshold &&
!inSwapAndLiquify &&
swapAndLiquifyEnabled &&
from != uniswapV2Pair
) {
swapAndLiquify(swapThreshold);
}
uint256 fee = calculateFee(amount, feeType);
_transfer(from, address(this), fee);
_transfer(from, to, amount - fee);
} else {
_transfer(from, to, amount);
}
return true;
}
function burn(uint256 amount) public override {
_burn(_msgSender(), amount);
tokensBurned += amount;
}
function burnFrom(address account, uint256 amount) public override {
_spendAllowance(account, _msgSender(), amount);
_burn(account, amount);
tokensBurned += amount;
}
function liquidityLockedUntil() external view returns (uint256) {
return liquidityLockTime;
}
function checkTransferAllowed(
address from,
address to,
uint256 amount,
bool takeFee
) internal view {
require(
!_isBlackListedBot[from] || !_isBlackListedBot[to],
"You are blacklisted"
);
if (to != uniswapV2Pair) {
require(
balanceOf(to) + amount < maxWalletSize ||
_isExcludedFromMaxWallet[to],
"Exceeds receivers maximum wallet size"
);
}
if (takeFee) {
require(
amount <= maxTransactionSize ||
(_isExcludedFromMaxTransaction[from] ||
_isExcludedFromMaxTransaction[to]),
"Transaction larger than allowed"
);
}
}
function checkFeeRequired(address from, address to)
internal
view
returns (bool, FeeType)
{
if (from == uniswapV2Pair && !_isExcludedFromFee[to]) {
return (true, FeeType.Buy);
} else if (to == uniswapV2Pair && !_isExcludedFromFee[from]) {
return (true, FeeType.Sell);
} else {
return (false, FeeType.None);
}
}
function calculateFee(uint256 amount, FeeType feeType)
internal
view
returns (uint256 fee)
{
uint256 feePercentage = 0;
if (feeType == FeeType.Buy) {
feePercentage =
buyFee.treasury +
buyFee.liquidity +
buyFee.dev +
buyFee.buyback;
} else if (feeType == FeeType.Sell) {
feePercentage =
sellFee.treasury +
sellFee.liquidity +
sellFee.dev +
sellFee.buyback;
}
fee = (amount * feePercentage) / FEE_DENOM;
return fee;
}
function swapAndLiquify(uint256 tokens) internal lockTheSwap {
uint256 feeDenominator = buyFee.treasury +
buyFee.liquidity +
buyFee.dev +
buyFee.buyback;
uint256 liquidityFee = (tokens * buyFee.liquidity) / feeDenominator;
swapTokensForEth(tokens - (liquidityFee / 2));
uint256 contractEth = address(this).balance;
uint256 ethDenominator = buyFee.treasury +
(buyFee.liquidity / 2) +
buyFee.dev +
buyFee.buyback;
uint256 treasuryEth = (contractEth * buyFee.treasury) / ethDenominator;
uint256 liquidityEth = (contractEth * (buyFee.liquidity / 2)) /
ethDenominator;
uint256 buybackEth = (contractEth * buyFee.buyback) / ethDenominator;
if (liquidityEth > 0) {
addLiquidity(liquidityFee / 2, liquidityEth);
}
_treasuryWallet.transfer(treasuryEth);
_buybackWallet.transfer(buybackEth);
_developmentWallet.transfer(address(this).balance);
emit SwapAndLiquify(tokens, contractEth, liquidityFee / 2);
}
function swapTokensForEth(uint256 tokenAmount) internal {
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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) internal {
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0,
0,
address(this),
block.timestamp
);
}
function setTreasuryWallet(address treasury) external onlyOwner {
require(treasury != address(0), "Treasury wallet cannot be 0x0");
_treasuryWallet = payable(treasury);
emit treasuryWalletUpdated(_treasuryWallet);
}
function setDevelopmentWallet(address development) external onlyOwner {
require(development != address(0), "Development wallet cannot be 0x0");
_developmentWallet = payable(development);
emit developmentWalletUpdated(_developmentWallet);
}
function setBuybackWallet(address buyback) external onlyOwner {
require(buyback != address(0), "Buyback wallet cannot be 0x0");
_buybackWallet = payable(buyback);
emit buybackWalletUpdated(_treasuryWallet);
}
function setSellFee(
uint16 liquidity,
uint16 treasury,
uint16 dev,
uint16 buyback
) public onlyOwner {
require(
liquidity + treasury + dev + buyback < FEE_DENOM,
"invalid fee structure"
);
sellFee.treasury = treasury;
sellFee.liquidity = liquidity;
sellFee.dev = dev;
sellFee.buyback = buyback;
}
function setBuyFee(
uint16 liquidity,
uint16 treasury,
uint16 dev,
uint16 buyback
) public onlyOwner {
require(
liquidity + treasury + dev + buyback < FEE_DENOM,
"invalid fee structure"
);
buyFee.treasury = treasury;
buyFee.liquidity = liquidity;
buyFee.dev = dev;
buyFee.buyback = buyback;
}
function setBothFees(
uint16 buy_liquidity,
uint16 buy_treasury,
uint16 buy_dev,
uint16 buy_buyback,
uint16 sell_liquidity,
uint16 sell_treasury,
uint16 sell_dev,
uint16 sell_buyback
) external onlyOwner {
setBuyFee(buy_liquidity, buy_treasury, buy_dev, buy_buyback);
setSellFee(sell_liquidity, sell_treasury, sell_dev, sell_buyback);
}
function setSwapThreshold(uint256 newSwapThreshold) external onlyOwner {
swapThreshold = newSwapThreshold;
emit swapThresholdUpdated(newSwapThreshold);
}
function setMaxTransactionSize(uint256 maxTxSize) external onlyOwner {
maxTransactionSize = maxTxSize;
emit MaxTransactionSizeUpdated(maxTransactionSize);
}
function setMaxWalletSize(uint256 maxWallet) external onlyOwner {
maxWalletSize = maxWallet;
emit MaxWalletSizeUpdated(maxWalletSize);
}
function addBotToBlacklist(address account) external onlyOwner {
require(!_isBlackListedBot[account], "Account is already blacklisted");
_isBlackListedBot[account] = true;
emit botAddedToBlacklist(account);
}
function removeBotFromBlacklist(address account) external onlyOwner {
require(_isBlackListedBot[account], "Account is not blacklisted");
_isBlackListedBot[account] = false;
emit botRemovedFromBlacklist(account);
}
function excludeFromFee(address account) external onlyOwner {
require(
!_isExcludedFromFee[account],
"Account is already excluded from fee"
);
_isExcludedFromFee[account] = true;
emit excludedFromFee(account);
}
function excludeFromMaxTransaction(address account) external onlyOwner {
require(
!_isExcludedFromMaxTransaction[account],
"Account is already excluded from max transaction"
);
_isExcludedFromMaxTransaction[account] = true;
emit excludedFromMaxTransaction(account);
}
function excludeFromMaxWallet(address account) external onlyOwner {
require(
!_isExcludedFromMaxWallet[account],
"Account is already excluded from max wallet"
);
_isExcludedFromMaxWallet[account] = true;
emit excludedFromMaxWallet(account);
}
function includeInFee(address account) external onlyOwner {
require(
_isExcludedFromFee[account],
"Account is already included in fee"
);
_isExcludedFromFee[account] = false;
emit includedInFee(account);
}
function includeInMaxTransaction(address account) external onlyOwner {
require(
_isExcludedFromMaxTransaction[account],
"Account is already included in max transaction"
);
_isExcludedFromMaxTransaction[account] = false;
emit includedInMaxTransaction(account);
}
function includeInMaxWallet(address account) external onlyOwner {
require(
_isExcludedFromMaxWallet[account],
"Account is already included in max wallet"
);
_isExcludedFromMaxWallet[account] = false;
emit includedInMaxWallet(account);
}
function updateLiquidityLock(uint256 lockTime) external onlyOwner {
require(
block.timestamp > liquidityLockTime,
"New liquidity lock time must be after the current lock time"
);
liquidityLockTime = lockTime;
emit LiquidityLockTimeUpdated(lockTime);
}
function removeLiquidityETH(
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external onlyOwner {
require(
block.timestamp > liquidityLockTime,
"Liquidity removal is locked"
);
(uint256 amountToken, uint256 amountETH) = uniswapV2Router
.removeLiquidityETH(
address(this),
liquidity,
amountTokenMin,
amountETHMin,
to,
deadline
);
emit liquidityRemoved(amountToken, amountETH);
}
function toggleSwapAndLiquifyEnabled() external onlyOwner {
swapAndLiquifyEnabled = !swapAndLiquifyEnabled;
emit SwapAndLiquifyEnabledUpdated(swapAndLiquifyEnabled);
}
function adminSwapAndLiquify(uint256 swapBalance) external onlyOwner {
swapAndLiquify(swapBalance);
}
function rescueEth() external payable onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function rescueTokens(address _stuckToken, uint256 _amount)
external
onlyOwner
{
IERC20(_stuckToken).transfer(msg.sender, _amount);
}
function rescueBurn(uint256 _amount) external onlyOwner {
_transfer(address(this), msg.sender, _amount);
}
}
文件 2 的 11:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 11:ERC20.sol
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, _allowances[owner][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = _allowances[owner][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
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 _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
文件 4 的 11:ERC20Burnable.sol
pragma solidity ^0.8.0;
import "../ERC20.sol";
import "../../../utils/Context.sol";
abstract contract ERC20Burnable is Context, ERC20 {
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public virtual {
_spendAllowance(account, _msgSender(), amount);
_burn(account, amount);
}
}
文件 5 的 11:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, 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 from,
address to,
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);
}
文件 6 的 11:IERC20Metadata.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
文件 7 的 11:IUniswapV2Factory.sol
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
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 createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
文件 8 的 11:IUniswapV2Pair.sol
pragma solidity >=0.5.0;
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
文件 9 的 11:IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
文件 10 的 11:IUniswapV2Router02.sol
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
文件 11 的 11:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
{
"compilationTarget": {
"contracts/BurnTokenX.sol": "BurnTokenX"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"name__","type":"string"},{"internalType":"string","name":"symbol__","type":"string"},{"internalType":"address","name":"treasury","type":"address"},{"internalType":"address","name":"development","type":"address"},{"internalType":"address","name":"buyback","type":"address"},{"internalType":"address[8]","name":"teamWallets","type":"address[8]"}],"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":false,"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"LiquidityLockTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxTransactionSize","type":"uint256"}],"name":"MaxTransactionSizeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"maxWalletSize","type":"uint256"}],"name":"MaxWalletSizeUpdated","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":false,"internalType":"uint256","name":"tokensSwapped","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensIntoLiquidity","type":"uint256"}],"name":"SwapAndLiquify","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"SwapAndLiquifyEnabledUpdated","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"botAddedToBlacklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"botRemovedFromBlacklist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"buybackWallet","type":"address"}],"name":"buybackWalletUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"developmentWallet","type":"address"}],"name":"developmentWalletUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"excludedFromFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"excludedFromMaxTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"excludedFromMaxWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"includedInFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"includedInMaxTransaction","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"includedInMaxWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amountToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountETH","type":"uint256"}],"name":"liquidityRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"minTokensBeforeSwap","type":"uint256"}],"name":"swapThresholdUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"treasuryWallet","type":"address"}],"name":"treasuryWalletUpdated","type":"event"},{"inputs":[],"name":"_buybackWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_developmentWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_isBlackListedBot","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_isExcludedFromFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_isExcludedFromMaxTransaction","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_isExcludedFromMaxWallet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_treasuryWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addBotToBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"swapBalance","type":"uint256"}],"name":"adminSwapAndLiquify","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":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buyFee","outputs":[{"internalType":"uint16","name":"liquidity","type":"uint16"},{"internalType":"uint16","name":"treasury","type":"uint16"},{"internalType":"uint16","name":"dev","type":"uint16"},{"internalType":"uint16","name":"buyback","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"excludeFromFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"excludeFromMaxTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"excludeFromMaxWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"includeInFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"includeInMaxTransaction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"includeInMaxWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityLockedUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTransactionSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWalletSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeBotFromBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rescueEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_stuckToken","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellFee","outputs":[{"internalType":"uint16","name":"liquidity","type":"uint16"},{"internalType":"uint16","name":"treasury","type":"uint16"},{"internalType":"uint16","name":"dev","type":"uint16"},{"internalType":"uint16","name":"buyback","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"buy_liquidity","type":"uint16"},{"internalType":"uint16","name":"buy_treasury","type":"uint16"},{"internalType":"uint16","name":"buy_dev","type":"uint16"},{"internalType":"uint16","name":"buy_buyback","type":"uint16"},{"internalType":"uint16","name":"sell_liquidity","type":"uint16"},{"internalType":"uint16","name":"sell_treasury","type":"uint16"},{"internalType":"uint16","name":"sell_dev","type":"uint16"},{"internalType":"uint16","name":"sell_buyback","type":"uint16"}],"name":"setBothFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"liquidity","type":"uint16"},{"internalType":"uint16","name":"treasury","type":"uint16"},{"internalType":"uint16","name":"dev","type":"uint16"},{"internalType":"uint16","name":"buyback","type":"uint16"}],"name":"setBuyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"buyback","type":"address"}],"name":"setBuybackWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"development","type":"address"}],"name":"setDevelopmentWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxTxSize","type":"uint256"}],"name":"setMaxTransactionSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxWallet","type":"uint256"}],"name":"setMaxWalletSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"liquidity","type":"uint16"},{"internalType":"uint16","name":"treasury","type":"uint16"},{"internalType":"uint16","name":"dev","type":"uint16"},{"internalType":"uint16","name":"buyback","type":"uint16"}],"name":"setSellFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newSwapThreshold","type":"uint256"}],"name":"setSwapThreshold","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury","type":"address"}],"name":"setTreasuryWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapAndLiquifyEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleSwapAndLiquifyEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokensBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"updateLiquidityLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]