编译器
0.8.17+commit.8df45f5f
文件 1 的 16:AccountValidator.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC20Base.sol";
abstract contract AccountValidator is Ownable, ERC20Base {
mapping(address => bool) private _denied;
event AddressDenied(address indexed account, bool denied);
modifier notDenied(address account) {
require(!_denied[account], "Address denied");
_;
}
function _setIsDenied(address account, bool denied) internal {
_denied[account] = denied;
emit AddressDenied(account, denied);
}
function isAccountDenied(address account) public view returns (bool) {
return _denied[account];
}
function setIsAccountDenied(address account, bool denied) external onlyOwner {
require(_denied[account] != denied, "Already set");
_setIsDenied(account, denied);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override notDenied(from) notDenied(to) {
super._beforeTokenTransfer(from, to, amount);
}
}
文件 2 的 16:AntiWhale.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ERC20Base.sol";
abstract contract AntiWhale is Ownable, ERC20Base {
uint256 public maxTokenPerWallet;
mapping(address => bool) private _excluded;
event ExcludedFromAntiWhale(address indexed account, bool excluded);
event MaxTokenPerWalletUpdated(uint256 amount);
constructor(uint256 maxTokenPerWallet_) {
maxTokenPerWallet = maxTokenPerWallet_;
_setIsExcludedFromAntiWhale(_msgSender(), true);
_setIsExcludedFromAntiWhale(address(this), true);
}
function _setIsExcludedFromAntiWhale(address account, bool excluded) internal {
_excluded[account] = excluded;
emit ExcludedFromAntiWhale(account, excluded);
}
function isExcludedFromAntiWhale(address account) public view returns (bool) {
return _excluded[account];
}
function setIsExcludedFromAntiWhale(address account, bool excluded) external onlyOwner {
require(_excluded[account] != excluded, "Already set");
_setIsExcludedFromAntiWhale(account, excluded);
}
function setMaxTokenPerWallet(uint256 amount) external onlyOwner {
uint256 supply = totalSupply();
if (amount == 0) amount = supply;
require(amount > (supply * 5) / 1000, "Amount too low");
maxTokenPerWallet = amount;
emit MaxTokenPerWalletUpdated(amount);
}
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual override {
if (!isExcludedFromAntiWhale(to)) {
require(balanceOf(to) <= maxTokenPerWallet, "AntiWhale: balance too high");
}
super._afterTokenTransfer(from, to, amount);
}
}
文件 3 的 16: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;
}
}
文件 4 的 16:ERC20Base.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
abstract contract ERC20Base is Context, IERC20, IERC20Metadata {
mapping(address => mapping(address => uint256)) private _allowances;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name_, string memory symbol_, uint8 decimals_) {
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
}
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 _decimals;
}
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, allowance(owner, spender) + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(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 = balanceOf(from);
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
_executeTransfer(from, to, amount);
_afterTokenTransfer(from, to, 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 {}
function _executeTransfer(address from, address to, uint256 amount) internal virtual;
function totalSupply() public view virtual override returns (uint256);
function balanceOf(address account) public view virtual override returns (uint256);
}
文件 5 的 16:EnumerableSet.sol
pragma solidity ^0.8.0;
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping(bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
set._values[toDeleteIndex] = lastValue;
set._indexes[lastValue] = valueIndex;
}
set._values.pop();
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
assembly {
result := store
}
return result;
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
文件 6 的 16:FeeDistributor.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
contract FeeDistributor is Ownable {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private _collectors;
mapping(address => uint256) private _shares;
uint256 public totalFeeCollectorsShares;
event FeeCollectorAdded(address indexed account, uint256 share);
event FeeCollectorUpdated(address indexed account, uint256 oldShare, uint256 newShare);
event FeeCollectorRemoved(address indexed account);
event FeeCollected(address indexed receiver, uint256 amount);
function isFeeCollector(address account) public view returns (bool) {
return _collectors.contains(account);
}
function feeCollectorShare(address account) public view returns (uint256) {
return _shares[account];
}
function _addFeeCollector(address account, uint256 share) internal {
require(!_collectors.contains(account), "Already fee collector");
require(share > 0, "Invalid share");
_collectors.add(account);
_shares[account] = share;
totalFeeCollectorsShares += share;
emit FeeCollectorAdded(account, share);
}
function _removeFeeCollector(address account) internal {
require(_collectors.contains(account), "Not fee collector");
_collectors.remove(account);
totalFeeCollectorsShares -= _shares[account];
delete _shares[account];
emit FeeCollectorRemoved(account);
}
function addFeeCollector(address account, uint256 share) external onlyOwner {
_addFeeCollector(account, share);
}
function removeFeeCollector(address account) external onlyOwner {
_removeFeeCollector(account);
}
function updateFeeCollectorShare(address account, uint256 share) external onlyOwner {
require(_collectors.contains(account), "Not fee collector");
require(share > 0, "Invalid share");
uint256 oldShare = _shares[account];
totalFeeCollectorsShares -= oldShare;
_shares[account] = share;
totalFeeCollectorsShares += share;
emit FeeCollectorUpdated(account, oldShare, share);
}
function _distributeFees(uint256 amount) internal returns (bool) {
if (amount == 0) return false;
if (totalFeeCollectorsShares == 0) return false;
uint256 distributed = 0;
uint256 len = _collectors.length();
for (uint256 i = 0; i < len; i++) {
address collector = _collectors.at(i);
uint256 share = i == len - 1
? amount - distributed
: (amount * _shares[collector]) / totalFeeCollectorsShares;
payable(collector).transfer(share);
emit FeeCollected(collector, share);
distributed += share;
}
return true;
}
function distributeFees(uint256 amount) external onlyOwner {
require(amount <= address(this).balance, "Not enough balance");
_distributeFees(amount);
}
}
文件 7 的 16:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
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);
}
文件 8 的 16: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);
}
文件 9 的 16: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;
}
文件 10 的 16: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);
}
文件 11 的 16: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;
}
文件 12 的 16: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());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
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);
}
}
文件 13 的 16:Recover.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract Recover is Ownable {
event TokenRecovered(address indexed token, uint256 amount);
function recoverTokens(address token, uint256 amount) external onlyOwner {
require(amount > 0, "Invalid amount");
if (token == address(0)) {
payable(msg.sender).transfer(amount);
} else {
require(IERC20(token).transfer(msg.sender, amount));
}
emit TokenRecovered(token, amount);
}
}
文件 14 的 16:RewardToken.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "./ERC20Base.sol";
abstract contract RewardToken is Ownable, ERC20Base {
using EnumerableSet for EnumerableSet.AddressSet;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal;
uint256 private _rTotal;
uint256 private _tFeeTotal;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
EnumerableSet.AddressSet private _excluded;
event ExcludedFromRewards(address indexed account, bool excluded);
event TransferRewards(address indexed from, uint256 amount);
constructor(uint256 supply_) {
_tTotal = supply_;
_rTotal = (MAX - (MAX % _tTotal));
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function totalRewardFees() public view returns (uint256) {
return _tFeeTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_excluded.contains(account)) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function isExcludedFromRewards(address account) public view returns (bool) {
return _excluded.contains(account);
}
function _setIsExcludedFromRewards(address account, bool excluded) internal {
require(_excluded.contains(account) != excluded, "Already set");
if (excluded) {
if (_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_excluded.add(account);
} else {
_tOwned[account] = 0;
_excluded.remove(account);
}
emit ExcludedFromRewards(account, excluded);
}
function setIsExcludedFromRewards(address account, bool excluded) external onlyOwner {
_setIsExcludedFromRewards(account, excluded);
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount / currentRate;
}
function _executeTransfer(address from, address to, uint256 amount) internal virtual override {
_executeTokenTransfer(from, to, amount, amount / 100);
}
function _executeTokenTransfer(
address sender,
address recipient,
uint256 amount,
uint256 rewards
) internal {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(
amount,
rewards
);
require(_rOwned[sender] >= rAmount, "ERC20: transfer amount exceeds balance");
_rOwned[sender] -= rAmount;
_rOwned[recipient] += rTransferAmount;
if (_excluded.contains(sender)) {
require(_tOwned[sender] >= amount, "ERC20: transfer amount exceeds balance");
_tOwned[sender] -= amount;
}
if (_excluded.contains(recipient)) _tOwned[recipient] += tTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
if (rewards > 0) {
emit TransferRewards(sender, rewards);
}
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal -= rFee;
_tFeeTotal += tFee;
}
function _getValues(
uint256 tAmount,
uint256 tFee
) private view returns (uint256, uint256, uint256, uint256, uint256) {
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee, tAmount - tFee, tFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length(); i++) {
address addr = _excluded.at(i);
if (_rOwned[addr] > rSupply || _tOwned[addr] > tSupply) return (_rTotal, _tTotal);
rSupply -= _rOwned[addr];
tSupply -= _tOwned[addr];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
文件 15 的 16:RyiuToken.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./libraries/AccountValidator.sol";
import "./libraries/AntiWhale.sol";
import "./libraries/Recover.sol";
import "./libraries/TaxToken.sol";
contract RyiuToken is Ownable, AccountValidator, Recover, AntiWhale, TaxToken {
string private constant NAME = "RYIU Token";
string private constant SYMBOL = "RYIU";
uint8 private constant DECIMALS = 9;
uint256 private constant SUPPLY = 20 * 10 ** 6 * 10 ** 9;
constructor(
address swapRouter_,
FeeConfiguration memory feeConfiguration_
)
ERC20Base(NAME, SYMBOL, DECIMALS)
AntiWhale(SUPPLY / 100)
TaxToken(true, (SUPPLY * 5) / 10000 , swapRouter_, feeConfiguration_)
RewardToken(SUPPLY)
{
_setIsExcludedFromRewards(swapPair, true);
_setIsExcludedFromRewards(BURN_ADDRESS, true);
_setIsExcludedFromAntiWhale(swapPair, true);
_setIsExcludedFromAntiWhale(BURN_ADDRESS, true);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override (ERC20Base, AccountValidator) {
super._beforeTokenTransfer(from, to, amount);
}
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override(ERC20Base, AntiWhale) {
super._afterTokenTransfer(from, to, amount);
}
}
文件 16 的 16:TaxToken.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "./FeeDistributor.sol";
import "./RewardToken.sol";
abstract contract TaxToken is Ownable, FeeDistributor, RewardToken {
struct FeeConfiguration {
uint16 buyFees;
uint16 sellFees;
uint16 transferFees;
uint16 burnFeeRatio;
uint16 rewardsFeeRatio;
uint16 liquidityFeeRatio;
uint16 collectorsFeeRatio;
}
address public constant BURN_ADDRESS = address(0x000000000000000000000000000000000000dEaD);
uint16 public constant MAX_FEE = 2000;
uint16 public constant FEE_PRECISION = 10000;
IUniswapV2Router02 public swapRouter;
address public swapPair;
address public liquidityOwner;
bool private _processingFees;
bool public autoProcessFees;
uint256 public numTokensToSwap;
FeeConfiguration public feeConfiguration;
uint256 public tradeStartBlock;
mapping(address => bool) private _excludedFromFees;
mapping(address => bool) private _lpPools;
mapping(address => bool) private _bots;
event FeeConfigurationUpdated(FeeConfiguration configuration);
event SwapRouterUpdated(address indexed router, address indexed pair);
event ExcludedFromFees(address indexed account, bool excluded);
event SetLpPool(address indexed pairAddress, bool isLp);
event SetIsBot(address indexed account, bool isBot);
modifier lockTheSwap() {
_processingFees = true;
_;
_processingFees = false;
}
constructor(
bool autoProcessFees_,
uint256 numTokensToSwap_,
address swapRouter_,
FeeConfiguration memory feeConfiguration_
) {
numTokensToSwap = numTokensToSwap_;
autoProcessFees = autoProcessFees_;
liquidityOwner = _msgSender();
swapRouter = IUniswapV2Router02(swapRouter_);
swapPair = IUniswapV2Factory(swapRouter.factory()).createPair(address(this), swapRouter.WETH());
_lpPools[address(swapPair)] = true;
_setIsExcludedFromFees(_msgSender(), true);
_setIsExcludedFromFees(address(this), true);
_setFeeConfiguration(feeConfiguration_);
}
receive() external payable {}
function isExcludedFromFees(address account) public view returns (bool) {
return _excludedFromFees[account];
}
function _setIsExcludedFromFees(address account, bool excluded) internal {
require(_excludedFromFees[account] != excluded, "Already set");
_excludedFromFees[account] = excluded;
emit ExcludedFromFees(account, excluded);
}
function setIsExcludedFromFees(address account, bool excluded) external onlyOwner {
_setIsExcludedFromFees(account, excluded);
}
function isLpPool(address pairAddress) public view returns (bool) {
return _lpPools[pairAddress];
}
function setIsLpPool(address pairAddress, bool isLp) external onlyOwner {
require(_lpPools[pairAddress] != isLp, "Already set");
_lpPools[pairAddress] = isLp;
emit SetLpPool(pairAddress, isLp);
}
function isBot(address account) public view returns (bool) {
return _bots[account];
}
function _setIsBot(address account, bool bot) internal {
require(_bots[account] != bot, "Already set");
_bots[account] = bot;
emit SetIsBot(account, bot);
}
function setIsBot(address account, bool bot) external onlyOwner {
_setIsBot(account, bot);
}
function updateSwapRouter(address _newRouter) external onlyOwner {
require(_newRouter != address(0), "Invalid router");
swapRouter = IUniswapV2Router02(_newRouter);
IUniswapV2Factory factory = IUniswapV2Factory(swapRouter.factory());
require(address(factory) != address(0), "Invalid factory");
address weth = swapRouter.WETH();
swapPair = factory.getPair(address(this), weth);
if (swapPair == address(0)) {
swapPair = factory.createPair(address(this), weth);
}
require(swapPair != address(0), "Invalid pair address.");
emit SwapRouterUpdated(address(swapRouter), swapPair);
}
function _setFeeConfiguration(FeeConfiguration memory configuration) private {
require(configuration.buyFees <= MAX_FEE, "Invalid buy fee");
require(configuration.sellFees <= MAX_FEE, "Invalid sell fee");
require(configuration.transferFees <= MAX_FEE, "Invalid transfer fee");
uint16 totalShare = configuration.burnFeeRatio +
configuration.rewardsFeeRatio +
configuration.liquidityFeeRatio +
configuration.collectorsFeeRatio;
require(totalShare == 0 || totalShare == FEE_PRECISION, "Invalid fee share");
feeConfiguration = configuration;
emit FeeConfigurationUpdated(configuration);
}
function setFeeConfiguration(FeeConfiguration calldata configuration) external onlyOwner {
_setFeeConfiguration(configuration);
}
function _processFees(uint256 tokenAmount, uint256 minAmountOut) private lockTheSwap {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance >= tokenAmount) {
uint256 liquidityAmount = (tokenAmount * feeConfiguration.liquidityFeeRatio) /
(FEE_PRECISION - feeConfiguration.burnFeeRatio - feeConfiguration.rewardsFeeRatio);
uint256 liquidityTokens = liquidityAmount / 2;
uint256 collectorsAmount = tokenAmount - liquidityAmount;
uint256 liquifyAmount = liquidityAmount - liquidityTokens + collectorsAmount;
if (liquifyAmount > 0) {
uint256 initialBalance = address(this).balance;
_swapTokensForEth(liquifyAmount, minAmountOut);
uint256 swapBalance = address(this).balance - initialBalance;
uint256 liquidityETH = (swapBalance * liquidityTokens) / liquifyAmount;
if (liquidityETH > 0) {
_addLiquidity(liquidityTokens, liquidityETH);
}
}
_distributeFees(address(this).balance);
}
}
function processFees(uint256 amount, uint256 minAmountOut) external onlyOwner {
require(amount <= balanceOf(address(this)), "Amount too high");
_processFees(amount, minAmountOut);
}
function setAutoprocessFees(bool autoProcess) external onlyOwner {
require(autoProcessFees != autoProcess, "Already set");
autoProcessFees = autoProcess;
}
function setNumTokensToSwap(uint256 amount) external onlyOwner {
numTokensToSwap = amount;
}
function setLiquidityOwner(address newOwner) external onlyOwner {
liquidityOwner = newOwner;
}
function _swapTokensForEth(uint256 tokenAmount, uint256 minAmountOut) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = swapRouter.WETH();
_approve(address(this), address(swapRouter), tokenAmount);
swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
minAmountOut,
path,
address(this),
block.timestamp
);
}
function _addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(swapRouter), tokenAmount);
swapRouter.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0,
0,
liquidityOwner,
block.timestamp
);
}
function _executeTransfer(address from, address to, uint256 amount) internal override {
require(amount > 0, "Transfer <= 0");
uint256 taxFee = 0;
bool processFee = !_processingFees && autoProcessFees && tradeStartBlock > 0;
bool bot = _bots[from] || _bots[to];
if (!_processingFees) {
bool fromExcluded = isExcludedFromFees(from);
bool toExcluded = isExcludedFromFees(to);
bool fromLP = isLpPool(from);
bool toLP = isLpPool(to);
if (toLP && tradeStartBlock == 0) {
tradeStartBlock = block.number;
}
if (fromLP && !toLP && !toExcluded && to != address(swapRouter)) {
taxFee = feeConfiguration.buyFees;
if (!bot && block.number <= tradeStartBlock + 1) {
_setIsBot(to, true);
_setIsExcludedFromRewards(to, true);
bot = true;
}
} else if (toLP && !fromExcluded && !toExcluded) {
taxFee = feeConfiguration.sellFees;
} else if (!fromLP && !toLP && from != address(swapRouter) && !fromExcluded) {
taxFee = feeConfiguration.transferFees;
}
}
if (bot) {
taxFee = MAX_FEE;
}
if (processFee && taxFee > 0 && !_lpPools[from]) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance >= numTokensToSwap) {
_processFees(numTokensToSwap, 0);
}
}
if (taxFee > 0) {
uint256 taxAmount = (amount * taxFee) / FEE_PRECISION;
uint256 sendAmount = amount - taxAmount;
uint256 burnAmount = (taxAmount * feeConfiguration.burnFeeRatio) / FEE_PRECISION;
uint256 rewardAmount = (taxAmount * feeConfiguration.rewardsFeeRatio) / FEE_PRECISION;
if (rewardAmount > 0) {
taxAmount -= rewardAmount;
sendAmount += rewardAmount;
}
if (burnAmount > 0) {
taxAmount -= burnAmount;
_executeTokenTransfer(from, BURN_ADDRESS, burnAmount, 0);
}
if (taxAmount > 0) {
_executeTokenTransfer(from, address(this), taxAmount, 0);
}
if (sendAmount > 0) {
_executeTokenTransfer(from, to, sendAmount, rewardAmount);
}
} else {
_executeTokenTransfer(from, to, amount, 0);
}
}
}
{
"compilationTarget": {
"contracts/RyiuToken.sol": "RyiuToken"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"swapRouter_","type":"address"},{"components":[{"internalType":"uint16","name":"buyFees","type":"uint16"},{"internalType":"uint16","name":"sellFees","type":"uint16"},{"internalType":"uint16","name":"transferFees","type":"uint16"},{"internalType":"uint16","name":"burnFeeRatio","type":"uint16"},{"internalType":"uint16","name":"rewardsFeeRatio","type":"uint16"},{"internalType":"uint16","name":"liquidityFeeRatio","type":"uint16"},{"internalType":"uint16","name":"collectorsFeeRatio","type":"uint16"}],"internalType":"struct TaxToken.FeeConfiguration","name":"feeConfiguration_","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"denied","type":"bool"}],"name":"AddressDenied","type":"event"},{"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":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"excluded","type":"bool"}],"name":"ExcludedFromAntiWhale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"excluded","type":"bool"}],"name":"ExcludedFromFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"excluded","type":"bool"}],"name":"ExcludedFromRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeCollected","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"share","type":"uint256"}],"name":"FeeCollectorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"FeeCollectorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldShare","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newShare","type":"uint256"}],"name":"FeeCollectorUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint16","name":"buyFees","type":"uint16"},{"internalType":"uint16","name":"sellFees","type":"uint16"},{"internalType":"uint16","name":"transferFees","type":"uint16"},{"internalType":"uint16","name":"burnFeeRatio","type":"uint16"},{"internalType":"uint16","name":"rewardsFeeRatio","type":"uint16"},{"internalType":"uint16","name":"liquidityFeeRatio","type":"uint16"},{"internalType":"uint16","name":"collectorsFeeRatio","type":"uint16"}],"indexed":false,"internalType":"struct TaxToken.FeeConfiguration","name":"configuration","type":"tuple"}],"name":"FeeConfigurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MaxTokenPerWalletUpdated","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":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isBot","type":"bool"}],"name":"SetIsBot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pairAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"isLp","type":"bool"}],"name":"SetLpPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"router","type":"address"},{"indexed":true,"internalType":"address","name":"pair","type":"address"}],"name":"SwapRouterUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovered","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":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferRewards","type":"event"},{"inputs":[],"name":"BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_PRECISION","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"share","type":"uint256"}],"name":"addFeeCollector","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":[],"name":"autoProcessFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","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":[{"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":"uint256","name":"amount","type":"uint256"}],"name":"distributeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"feeCollectorShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeConfiguration","outputs":[{"internalType":"uint16","name":"buyFees","type":"uint16"},{"internalType":"uint16","name":"sellFees","type":"uint16"},{"internalType":"uint16","name":"transferFees","type":"uint16"},{"internalType":"uint16","name":"burnFeeRatio","type":"uint16"},{"internalType":"uint16","name":"rewardsFeeRatio","type":"uint16"},{"internalType":"uint16","name":"liquidityFeeRatio","type":"uint16"},{"internalType":"uint16","name":"collectorsFeeRatio","type":"uint16"}],"stateMutability":"view","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":[{"internalType":"address","name":"account","type":"address"}],"name":"isAccountDenied","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBot","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isExcludedFromAntiWhale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isExcludedFromFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isExcludedFromRewards","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isFeeCollector","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pairAddress","type":"address"}],"name":"isLpPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidityOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokenPerWallet","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":"numTokensToSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"}],"name":"processFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoProcess","type":"bool"}],"name":"setAutoprocessFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint16","name":"buyFees","type":"uint16"},{"internalType":"uint16","name":"sellFees","type":"uint16"},{"internalType":"uint16","name":"transferFees","type":"uint16"},{"internalType":"uint16","name":"burnFeeRatio","type":"uint16"},{"internalType":"uint16","name":"rewardsFeeRatio","type":"uint16"},{"internalType":"uint16","name":"liquidityFeeRatio","type":"uint16"},{"internalType":"uint16","name":"collectorsFeeRatio","type":"uint16"}],"internalType":"struct TaxToken.FeeConfiguration","name":"configuration","type":"tuple"}],"name":"setFeeConfiguration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"denied","type":"bool"}],"name":"setIsAccountDenied","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"bot","type":"bool"}],"name":"setIsBot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"excluded","type":"bool"}],"name":"setIsExcludedFromAntiWhale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"excluded","type":"bool"}],"name":"setIsExcludedFromFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"excluded","type":"bool"}],"name":"setIsExcludedFromRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pairAddress","type":"address"},{"internalType":"bool","name":"isLp","type":"bool"}],"name":"setIsLpPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setLiquidityOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setMaxTokenPerWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setNumTokensToSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"contract IUniswapV2Router02","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalFeeCollectorsShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradeStartBlock","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":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"share","type":"uint256"}],"name":"updateFeeCollectorShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newRouter","type":"address"}],"name":"updateSwapRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]