编译器
0.8.19+commit.7dd6d404
文件 1 的 11:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 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, 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 = _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;
unchecked {
_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:FRLY.sol
pragma solidity ^0.8.19;
import "../Token/GenesisToken.sol";
contract FRLY is GenesisToken {
constructor()
GenesisToken(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,
InitParams(
"Friendly.Tech",
"FRLY",
6,
10_000_000,
5,
100,
5,
500,
500,
0,
1,
2,
2,
0x0000000000000000000000000000000000000000,
0x6848A1FCf1a51Ef4b9448Af795E4A8532d58B40A,
10000
)
)
{}
}
文件 5 的 11:GenesisToken.sol
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
contract GenesisToken is ERC20, Ownable {
struct InitParams {
string name;
string symbol;
uint8 decimals;
uint256 totalSupply;
uint256 maxTradingAmount;
uint256 maxWalletAmount;
uint256 swapTokensAtAmount;
uint256 buyTotalFees;
uint256 sellTotalFees;
uint256 burnFee;
uint256 liquidityFee;
uint256 devFee;
uint256 revshareFee;
address devWallet;
address revshareWallet;
uint256 liquidityAmount;
}
uint8 private _decimals;
IUniswapV2Router02 public immutable swapV2Router;
address public swapV2Pair;
address public constant DEAD_ADDRESS = address(0xdead);
bool public swapEnabled = false;
bool private swapping;
address public revShareWallet;
address public devWallet;
uint256 public swapTokensAtAmount;
uint256 public maxWalletAmount;
uint256 private initMaxTradingAmount;
bool private limitsInEffect = true;
bool public tradingActive = false;
uint256 constant PERCENTAGE_BASE = 10000;
uint256 constant GEN_FEE = 30;
address constant GEN_WALLET = 0x91FEad7F2B2172e75FfCf4cAdFF5049c9270EE41;
uint256 public buyTotalFees;
uint256 public sellTotalFees;
uint256 public burnFee;
uint256 public liquidityFee;
uint256 public devFee;
uint256 public revshareFee;
uint256 public tokensForGen;
uint256 public totalFees;
uint256 public totalTaxTokens;
mapping(address => bool) public excludeFromLimits;
mapping(address => bool) public automatedMarketMakerPairs;
uint256 block0;
address private liquidOwner;
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiquidity
);
modifier onlyDev() {
require(msg.sender == devWallet);
_;
}
constructor(
address routerAddress,
InitParams memory params
) payable ERC20(params.name, params.symbol) {
IUniswapV2Router02 router = IUniswapV2Router02(routerAddress);
swapV2Router = router;
_decimals = params.decimals;
uint256 totalSupply_ = params.totalSupply * (10 ** _decimals);
swapTokensAtAmount =
(totalSupply_ * params.swapTokensAtAmount) /
PERCENTAGE_BASE;
initMaxTradingAmount =
(totalSupply_ * params.maxTradingAmount) /
PERCENTAGE_BASE;
maxWalletAmount =
(totalSupply_ * params.maxWalletAmount) /
PERCENTAGE_BASE;
burnFee = params.burnFee;
liquidityFee = params.liquidityFee;
devFee = params.devFee;
revshareFee = params.revshareFee;
totalFees = burnFee + liquidityFee + devFee + revshareFee;
revShareWallet = params.revshareWallet == address(0)
? msg.sender
: params.revshareWallet;
liquidOwner = msg.sender;
require(
params.buyTotalFees <= 500 && params.sellTotalFees <= 500,
"Buy/sell fees must be <= 5%"
);
buyTotalFees = params.buyTotalFees;
sellTotalFees = params.sellTotalFees;
if (buyTotalFees < GEN_FEE) buyTotalFees += GEN_FEE;
if (sellTotalFees < GEN_FEE) sellTotalFees += GEN_FEE;
devWallet = params.devWallet == address(0)
? msg.sender
: params.devWallet;
excludeFromLimits[owner()] = true;
excludeFromLimits[address(this)] = true;
excludeFromLimits[DEAD_ADDRESS] = true;
require(params.liquidityAmount <= PERCENTAGE_BASE);
uint256 liquidityAmount = (totalSupply_ * params.liquidityAmount) /
PERCENTAGE_BASE;
_mint(address(this), liquidityAmount);
if (liquidityAmount < totalSupply_) {
_mint(msg.sender, totalSupply_ - liquidityAmount);
}
_approve(address(this), address(swapV2Router), type(uint256).max);
}
function decimals() public view override returns (uint8) {
return _decimals;
}
receive() external payable {}
function maxTradingAmount() public view returns (uint amount) {
if (limitsInEffect) {
amount = initMaxTradingAmount;
if (tradingActive) {
amount +=
((block.number - block0) * totalSupply()) /
PERCENTAGE_BASE;
}
}
}
function updateSwapTokensAtAmount(
uint256 newAmount
) external onlyDev returns (bool) {
require(
newAmount >= (totalSupply() * 1) / 100000,
"Swap amount cannot be lower than 0.001% total supply."
);
require(
newAmount <= (totalSupply() * 5) / 1000,
"Swap amount cannot be higher than 0.5% total supply."
);
swapTokensAtAmount = newAmount;
return true;
}
function updateSwapEnabled(bool enabled) external onlyDev {
swapEnabled = enabled;
}
function setAutomatedMarketMakerPair(
address pair,
bool value
) public onlyDev {
require(
pair != swapV2Pair,
"The pair cannot be removed from automatedMarketMakerPairs"
);
_setAutomatedMarketMakerPair(pair, value);
}
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
function _transfer(
address from,
address to,
uint256 amount
) internal virtual override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
if (
limitsInEffect && !excludeFromLimits[from] && !excludeFromLimits[to]
) {
if (
!tradingActive &&
(automatedMarketMakerPairs[from] ||
automatedMarketMakerPairs[to])
) {
require(
excludeFromLimits[from] || excludeFromLimits[to],
"Trading is not active."
);
}
uint maxTradingAmount_ = maxTradingAmount();
if (maxTradingAmount_ * 100 > totalSupply()) {
limitsInEffect = false;
} else {
if (automatedMarketMakerPairs[from]) {
require(
amount <= maxTradingAmount_,
"Buy transfer amount exceeds the maxTradingAmount."
);
require(
amount + balanceOf(to) <= maxWalletAmount,
"Max wallet exceeded"
);
} else if (automatedMarketMakerPairs[to]) {
require(
amount <= maxTradingAmount_,
"Sell transfer amount exceeds the maxTradingAmount."
);
}
}
}
bool canSwap = totalTaxTokens >= swapTokensAtAmount;
if (
canSwap &&
swapEnabled &&
!swapping &&
!automatedMarketMakerPairs[from] &&
!excludeFromLimits[from] &&
!excludeFromLimits[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping &&
(automatedMarketMakerPairs[to] || automatedMarketMakerPairs[from]);
if (excludeFromLimits[from] || excludeFromLimits[to]) {
takeFee = false;
}
if (takeFee) {
(uint256 fees, uint256 geenFees) = _getFees(from, to, amount);
if (fees > 0) {
super._transfer(from, address(this), fees);
tokensForGen += geenFees;
amount -= fees;
totalTaxTokens += fees;
}
}
super._transfer(from, to, amount);
}
function _getFees(
address _from,
address _to,
uint256 _amount
) internal returns (uint256 fees, uint256 genFees) {
uint256 tradingFees_;
if (automatedMarketMakerPairs[_to]) {
tradingFees_ = sellTotalFees;
}
else if (automatedMarketMakerPairs[_from]) {
tradingFees_ = buyTotalFees;
}
if (tradingFees_ < GEN_FEE) tradingFees_ = GEN_FEE;
fees = (_amount * tradingFees_) / PERCENTAGE_BASE;
genFees = (fees * GEN_FEE) / tradingFees_;
}
function swapTokensForEth(uint256 tokenAmount) internal {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = swapV2Router.WETH();
swapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) internal {
swapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0,
0,
liquidOwner,
block.timestamp
);
}
function createPairAndAddLP() public payable onlyOwner {
if (swapV2Pair == address(0)) {
IUniswapV2Factory factory = IUniswapV2Factory(
swapV2Router.factory()
);
swapV2Pair = factory.createPair(address(this), swapV2Router.WETH());
}
_setAutomatedMarketMakerPair(address(swapV2Pair), true);
addLiquidity(balanceOf(address(this)), address(this).balance);
}
function enableTrading() public onlyOwner {
require(!tradingActive, "Trading is already open");
tradingActive = true;
swapEnabled = true;
block0 = block.number;
renounceOwnership();
}
function openTrading() external payable onlyOwner {
createPairAndAddLP();
enableTrading();
}
function swapBack() internal virtual {
uint256 contractBalance = balanceOf(address(this));
uint256 tokenToSwap_ = contractBalance;
uint256 tokensForGen_ = tokensForGen;
if (tokenToSwap_ > swapTokensAtAmount * 20) {
tokenToSwap_ = swapTokensAtAmount * 20;
tokensForGen_ = (tokensForGen * tokenToSwap_) / contractBalance;
}
if (tokenToSwap_ == 0) return;
uint256 tokensForFees_ = tokenToSwap_ - tokensForGen_;
uint256 tokensBurn_;
uint256 tokensLiquid_;
uint256 tokensRevshare_;
uint256 tokensDev_;
if (totalFees > 0) {
tokensBurn_ = (tokensForFees_ * burnFee) / totalFees;
tokensLiquid_ = (tokensForFees_ * liquidityFee) / totalFees;
tokensRevshare_ = (tokensForFees_ * revshareFee) / totalFees;
tokensDev_ = (tokensForFees_ * devFee) / totalFees;
tokensForFees_ =
tokensBurn_ +
tokensLiquid_ +
tokensRevshare_ +
tokensDev_;
}
tokensForGen_ = tokenToSwap_ - tokensForFees_;
uint256 tokensForAddLiquidity = tokensLiquid_ / 2;
uint256 totalTokensToSwap = tokenToSwap_ -
tokensForAddLiquidity -
tokensBurn_;
if (tokensBurn_ > 0) {
super._transfer(address(this), DEAD_ADDRESS, tokensBurn_);
}
if (totalTokensToSwap > 0) {
uint256 initEthBalance = address(this).balance;
swapTokensForEth(totalTokensToSwap);
uint256 ethBalance = address(this).balance - initEthBalance;
uint256 ethForGen = (ethBalance * tokensForGen_) /
totalTokensToSwap;
uint256 ethForRevshare = (ethBalance * tokensRevshare_) /
totalTokensToSwap;
uint256 ethForAddLiquidity = (ethBalance *
(tokensLiquid_ - tokensForAddLiquidity)) / totalTokensToSwap;
bool success;
if (ethForGen > 0) {
(success, ) = address(GEN_WALLET).call{value: ethForGen}("");
}
if (ethForRevshare > 0) {
(success, ) = address(revShareWallet).call{
value: ethForRevshare
}("");
}
if (tokensForAddLiquidity > 0 && ethForAddLiquidity > 0) {
addLiquidity(tokensForAddLiquidity, ethForAddLiquidity);
}
if (address(this).balance > 0) {
(success, ) = address(devWallet).call{
value: address(this).balance
}("");
}
}
tokensForGen = tokensForGen > tokensForGen_
? tokensForGen - tokensForGen_
: 0;
totalTaxTokens = 0;
}
function withdrawStuckToken(address _token, address _to) external onlyDev {
require(_token != address(0), "_token address cannot be 0");
ERC20 token = ERC20(_token);
token.transfer(_to, token.balanceOf(address(this)));
}
function withdrawStuckEth(address toAddr) external onlyDev {
(bool success, ) = toAddr.call{value: address(this).balance}("");
require(success);
}
}
文件 6 的 11: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);
}
文件 7 的 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);
}
文件 8 的 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;
}
文件 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());
}
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);
}
}
{
"compilationTarget": {
"contracts/CA/FRLY.sol": "FRLY"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pair","type":"address"},{"indexed":true,"internalType":"bool","name":"value","type":"bool"}],"name":"SetAutomatedMarketMakerPair","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":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEAD_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"","type":"address"}],"name":"automatedMarketMakerPairs","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":"burnFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTotalFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createPairAndAddLP","outputs":[],"stateMutability":"payable","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":[],"name":"devFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"devWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"excludeFromLimits","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"liquidityFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTradingAmount","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWalletAmount","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":"openTrading","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revShareWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"revshareFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sellTotalFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setAutomatedMarketMakerPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTokensAtAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapV2Pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapV2Router","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":"tokensForGen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalFees","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":"totalTaxTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradingActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"bool","name":"enabled","type":"bool"}],"name":"updateSwapEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"updateSwapTokensAtAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"toAddr","type":"address"}],"name":"withdrawStuckEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawStuckToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]