Contract Address Details

0xD81ad778fb32EA7Bc4C660e3236100c70762CCfB

Token
DONASWAP (DONA)
Creator
0xd40618–536b02 at 0x69e985–ba5d9c
Balance
0 TT ($0.00 USD)
Tokens
Fetching tokens...
Last Balance Update
5445345
Contract name:
DONASWAP




Optimization enabled
true
Compiler version
v0.8.19+commit.7dd6d404




Optimization runs
200
EVM Version
default




Verified at
2023-10-14 15:27:30.788312Z

Contract source code

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Interface of the token standard as defined in the EIP.
*/
interface IToken {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:https://github.com/ethereum/solidity/issues/2691
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IDexFactory {
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;
}
interface IDexPair {
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;
}
interface IDexRouter01 {
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);
}
interface IDexRouter02 is IDexRouter01 {
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;
}
contract DONASWAP is IToken, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _reflections;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _totalSupply = 100000 * 10**6 * 10**9;
uint256 private _reflectionTotal = (MAX - (MAX % _totalSupply));
uint256 private _takeFeeTotal;
string private constant _name = "DONASWAP";
string private constant _symbol = "DONA";
uint8 private constant _decimals = 9;
uint256 public _taxFee = 5;
uint256 private _previousTaxFee = _taxFee;
uint256 public _liquidityFee = 5;
uint256 private _previousLiquidityFee = _liquidityFee;
IDexRouter02 public dexRouter;
address public dexPair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
uint256 public _maxTransactionAmount = 500 * 10**6 * 10**9;
uint256 private _tokensToAddToLiquidity = 50 * 10**6 * 10**9;
event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);
event SwapAndLiquifyEnabledUpdated(bool enabled);
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 nativeReceived,
uint256 tokensIntoLiquidity
);
modifier lockTheSwap {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor() {
_reflections[_msgSender()] = _reflectionTotal;
IDexRouter02 _dexRouter = IDexRouter02(0x6E682B51F8bb67294B522b75a1E79dDd4502cc94);
// Create a swap pair for this new token
dexPair = IDexFactory(_dexRouter.factory())
.createPair(address(this), _dexRouter.WETH());
// set the rest of the contract variables
dexRouter = _dexRouter;
//exclude owner and this contract from fee
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public pure returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public pure returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {Token-balanceOf} and {Token-transfer}.
*/
function decimals() public pure returns (uint8) {
return _decimals;
}
/**
* @dev See {Token-totalSupply}.
*/
function totalSupply() public pure returns (uint256) {
return _totalSupply;
}
/**
* @dev See {Token-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _balances[account];
return tokensfromreflection(_reflections[account]);
}
/**
* @dev See {Token-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), to, amount);
return true;
}
/**
* @dev See {Token-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {Token-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {Token-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {Token}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public override returns (bool) {
_transfer(from, to, amount);
_approve(from, _msgSender(), _allowances[from][_msgSender()].sub(amount, "Token: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IToken-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IToken-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "Token: decreased allowance below zero"));
return true;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _takeFeeTotal;
}
function minimumTokenAmountBeforeSwap() public view returns (uint256) {
return _tokensToAddToLiquidity;
}
function deliver(uint256 totalAmount) public {
address from = _msgSender();
require(!_isExcluded[from], "Excluded addresses cannot call this function");
(uint256 reflectionAmount,,,,,) = _getValues(totalAmount);
_reflections[from] = _reflections[from].sub(reflectionAmount);
_reflectionTotal = _reflectionTotal.sub(reflectionAmount);
_takeFeeTotal = _takeFeeTotal.add(totalAmount);
}
function reflectionFromToken(uint256 totalAmount, bool deductTransferFee) public view returns (uint256) {
require(totalAmount <= _totalSupply, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 reflectionAmount,,,,,) = _getValues(totalAmount);
return reflectionAmount;
} else {
(,uint256 reflectedTransferAmount,,,,) = _getValues(totalAmount);
return reflectedTransferAmount;
}
}
function tokensfromreflection(uint256 reflectionAmount) public view returns (uint256) {
require(reflectionAmount <= _reflectionTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return reflectionAmount.div(currentRate);
}
function excludeFromReward(address account) public onlyOwner {
require(!_isExcluded[account], "Account is not excluded");
require(_excluded.length <= 50, "Excluded list is too long!");
if (_reflections[account] > 0) {
_balances[account] = tokensfromreflection(_reflections[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeInReward(address account) external onlyOwner() {
require(_isExcluded[account], "Account is not excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
uint256 currentRate = _getRate();
_reflections[account] = _balances[account].mul(currentRate);
_balances[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _transferBothExcluded(address from, address to, uint256 totalAmount) private {
(uint256 reflectionAmount, uint256 reflectedTransferAmount, uint256 reflectionFee, uint256 totalTransferAmount, uint256 taxedFee, uint256 takeLiquidity) = _getValues(totalAmount);
_balances[from] = _balances[from].sub(totalAmount);
_reflections[from] = _reflections[from].sub(reflectionAmount);
_balances[to] = _balances[to].add(totalTransferAmount);
_reflections[to] = _reflections[to].add(reflectedTransferAmount);
_reflectFee(reflectionFee, taxedFee);
_takeLiquidity(takeLiquidity);
emit Transfer(from, to, totalTransferAmount);
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function setTaxFeePercent(uint256 taxFee) external onlyOwner {
_taxFee = taxFee;
}
function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner {
_liquidityFee = liquidityFee;
}
function setMaxTransactionAmount(uint256 maxTransactionAmount) external onlyOwner {
_maxTransactionAmount = maxTransactionAmount;
}
function setTokensToAddToLiquidity(uint256 minimumTokensBeforeSwap) external onlyOwner() {
_tokensToAddToLiquidity = minimumTokensBeforeSwap;
}
function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
swapAndLiquifyEnabled = _enabled;
emit SwapAndLiquifyEnabledUpdated(_enabled);
}
// recieve native currency from active router when swapping
receive() external payable {}
function _reflectFee(uint256 reflectionFee, uint256 taxedFee) private {
_reflectionTotal = _reflectionTotal.sub(reflectionFee);
_takeFeeTotal = _takeFeeTotal.add(taxedFee);
}
function _getValues(uint256 totalAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 totalTransferAmount, uint256 taxedFee, uint256 takeLiquidity) = _getTValues(totalAmount);
(uint256 reflectionAmount, uint256 reflectedTransferAmount, uint256 reflectionFee) = _getRValues(totalAmount, taxedFee, takeLiquidity, _getRate());
return (reflectionAmount, reflectedTransferAmount, reflectionFee, totalTransferAmount, taxedFee, takeLiquidity);
}
function _getTValues(uint256 totalAmount) private view returns (uint256, uint256, uint256) {
uint256 taxedFee = calculateTaxFee(totalAmount);
uint256 takeLiquidity = calculateLiquidityFee(totalAmount);
uint256 totalTransferAmount = totalAmount.sub(taxedFee).sub(takeLiquidity);
return (totalTransferAmount, taxedFee, takeLiquidity);
}
function _getRValues(uint256 totalAmount, uint256 taxedFee, uint256 takeLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 reflectionAmount = totalAmount.mul(currentRate);
uint256 reflectionFee = taxedFee.mul(currentRate);
uint256 reflectionsLiquidity = takeLiquidity.mul(currentRate);
uint256 reflectedTransferAmount = reflectionAmount.sub(reflectionFee).sub(reflectionsLiquidity);
return (reflectionAmount, reflectedTransferAmount, reflectionFee);
}
function _getRate() private view returns (uint256) {
(uint256 reflectionSupply, uint256 tokenSupply) = _getCurrentSupply();
return reflectionSupply.div(tokenSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 reflectionSupply = _reflectionTotal;
uint256 tokenSupply = _totalSupply;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_reflections[_excluded[i]] > reflectionSupply || _balances[_excluded[i]] > tokenSupply) return (_reflectionTotal, _totalSupply);
reflectionSupply = reflectionSupply.sub(_reflections[_excluded[i]]);
tokenSupply = tokenSupply.sub(_balances[_excluded[i]]);
}
if (reflectionSupply < _reflectionTotal.div(_totalSupply)) return (_reflectionTotal, _totalSupply);
return (reflectionSupply, tokenSupply);
}
function _takeLiquidity(uint256 takeLiquidity) private {
uint256 currentRate = _getRate();
uint256 reflectionsLiquidity = takeLiquidity.mul(currentRate);
_reflections[address(this)] = _reflections[address(this)].add(reflectionsLiquidity);
if(_isExcluded[address(this)])
_balances[address(this)] = _balances[address(this)].add(takeLiquidity);
}
function calculateTaxFee(uint256 _amount) private view returns (uint256) {
return _amount.mul(_taxFee).div(10**2);
}
function calculateLiquidityFee(uint256 _amount) private view returns (uint256) {
return _amount.mul(_liquidityFee).div(10**2);
}
function removeAllFee() private {
if(_taxFee == 0 && _liquidityFee == 0) return;
_previousTaxFee = _taxFee;
_previousLiquidityFee = _liquidityFee;
_taxFee = 0;
_liquidityFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_liquidityFee = _previousLiquidityFee;
}
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "Token: approve from the zero address");
require(spender != address(0), "Token: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Moves tokens `amount` from `from` to `to`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "Token: transfer from the zero address");
require(to != address(0), "Token: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner())
require(amount <= _maxTransactionAmount, "Transfer amount exceeds the maxTransactionAmount.");
// is the token balance of this contract address over the min number of
// tokens that we need to initiate a swap + liquidity lock?
// also, don't get caught in a circular liquidity event.
// also, don't swap & liquify if from is dex pair.
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTransactionAmount)
{
contractTokenBalance = _maxTransactionAmount;
}
bool overMinTokenBalance = contractTokenBalance >= _tokensToAddToLiquidity;
if (
overMinTokenBalance &&
!inSwapAndLiquify &&
from != dexPair &&
swapAndLiquifyEnabled
) {
contractTokenBalance = _tokensToAddToLiquidity;
// add liquidity
swapAndLiquify(contractTokenBalance);
}
// indicates if fee should be deducted from transfer
bool takeFee = true;
// if any account belongs to _isExcludedFromFee account then remove the fee
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
// transfer amount, it will take tax, burn, liquidity fee
_tokenTransfer(from, to, amount, takeFee);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
// split the contract balance into halves
uint256 half = contractTokenBalance.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current native balance.
// this is so that we can capture exactly the amount of native that the
// swap creates, and not make the liquidity event include any native that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for native currency
swapTokensForNative(half); // <- this breaks the native currency -> swap when swap and liquify is triggered
// how much native currency did we just swap into?
uint256 newBalance = address(this).balance.sub(initialBalance);
// add liquidity to swap
addLiquidity(otherHalf, newBalance);
emit SwapAndLiquify(half, newBalance, otherHalf);
}
function swapTokensForNative(uint256 tokenAmount) private {
// generate the swap pair path of token -> wrapped native currency
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = dexRouter.WETH();
_approve(address(this), address(dexRouter), tokenAmount);
// make the swap
dexRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of native currency
path,
address(this),
block.timestamp
);
}
function addLiquidity(uint256 tokenAmount, uint256 nativeAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(dexRouter), tokenAmount);
// add the liquidity
dexRouter.addLiquidityETH{value: nativeAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(this),
block.timestamp
);
}
// this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(address from, address to, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[from] && !_isExcluded[to]) {
_transferFromExcluded(from, to, amount);
} else if (!_isExcluded[from] && _isExcluded[to]) {
_transferToExcluded(from, to, amount);
} else if (_isExcluded[from] && _isExcluded[to]) {
_transferBothExcluded(from, to, amount);
} else {
_transferStandard(from, to, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address from, address to, uint256 totalAmount) private {
(uint256 reflectionAmount, uint256 reflectedTransferAmount, uint256 reflectionFee, uint256 totalTransferAmount, uint256 taxedFee, uint256 takeLiquidity) = _getValues(totalAmount);
_reflections[from] = _reflections[from].sub(reflectionAmount);
_reflections[to] = _reflections[to].add(reflectedTransferAmount);
_takeLiquidity(takeLiquidity);
_reflectFee(reflectionFee, taxedFee);
emit Transfer(from, to, totalTransferAmount);
}
function _transferToExcluded(address from, address to, uint256 totalAmount) private {
(uint256 reflectionAmount, uint256 reflectedTransferAmount, uint256 reflectionFee, uint256 totalTransferAmount, uint256 taxedFee, uint256 takeLiquidity) = _getValues(totalAmount);
_reflections[from] = _reflections[from].sub(reflectionAmount);
_balances[to] = _balances[to].add(totalTransferAmount);
_reflections[to] = _reflections[to].add(reflectedTransferAmount);
_takeLiquidity(takeLiquidity);
_reflectFee(reflectionFee, taxedFee);
emit Transfer(from, to, totalTransferAmount);
}
function _transferFromExcluded(address from, address to, uint256 totalAmount) private {
(uint256 reflectionAmount, uint256 reflectedTransferAmount, uint256 reflectionFee, uint256 totalTransferAmount, uint256 taxedFee, uint256 takeLiquidity) = _getValues(totalAmount);
_balances[from] = _balances[from].sub(totalAmount);
_reflections[from] = _reflections[from].sub(reflectionAmount);
_reflections[to] = _reflections[to].add(reflectedTransferAmount);
_takeLiquidity(takeLiquidity);
_reflectFee(reflectionFee, taxedFee);
emit Transfer(from, to, totalTransferAmount);
}
function setRouterAddress(address newRouter) public onlyOwner() {
IDexRouter02 _newRouter = IDexRouter02(newRouter);
dexPair = IDexFactory(_newRouter.factory()).createPair(address(this), _newRouter.WETH());
dexRouter = _newRouter;
}
function getNativeCurrencyQuantity() public view returns (uint256) {
return address(this).balance;
}
function getNativeCurrency() external onlyOwner() {
uint256 balance = address(this).balance;
payable(owner()).transfer(balance);
}
function rescueTokens(address _tokenContract, uint256 _amount) external onlyOwner {
IToken tokenContract = IToken(_tokenContract);
tokenContract.transfer(msg.sender, _amount);
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"MinTokensBeforeSwapUpdated","inputs":[{"type":"uint256","name":"minTokensBeforeSwap","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SwapAndLiquify","inputs":[{"type":"uint256","name":"tokensSwapped","internalType":"uint256","indexed":false},{"type":"uint256","name":"nativeReceived","internalType":"uint256","indexed":false},{"type":"uint256","name":"tokensIntoLiquidity","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"SwapAndLiquifyEnabledUpdated","inputs":[{"type":"bool","name":"enabled","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_liquidityFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_maxTransactionAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_taxFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deliver","inputs":[{"type":"uint256","name":"totalAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"dexPair","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IDexRouter02"}],"name":"dexRouter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"excludeFromFee","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"excludeFromReward","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"getNativeCurrency","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getNativeCurrencyQuantity","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"includeInFee","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"includeInReward","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExcludedFromFee","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExcludedFromReward","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"minimumTokenAmountBeforeSwap","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"reflectionFromToken","inputs":[{"type":"uint256","name":"totalAmount","internalType":"uint256"},{"type":"bool","name":"deductTransferFee","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rescueTokens","inputs":[{"type":"address","name":"_tokenContract","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLiquidityFeePercent","inputs":[{"type":"uint256","name":"liquidityFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxTransactionAmount","inputs":[{"type":"uint256","name":"maxTransactionAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRouterAddress","inputs":[{"type":"address","name":"newRouter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSwapAndLiquifyEnabled","inputs":[{"type":"bool","name":"_enabled","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTaxFeePercent","inputs":[{"type":"uint256","name":"taxFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTokensToAddToLiquidity","inputs":[{"type":"uint256","name":"minimumTokensBeforeSwap","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"swapAndLiquifyEnabled","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokensfromreflection","inputs":[{"type":"uint256","name":"reflectionAmount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalFees","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
            

Deployed ByteCode

0x60806040526004361061023f5760003560e01c80635342acb41161012e57806395d89b41116100ab578063e2ac4ec71161006f578063e2ac4ec71461071d578063ea2f0b3714610732578063f242ab4114610752578063f2fde38b14610772578063f3e6dd911461079257600080fd5b806395d89b411461064a578063a457c2d714610677578063a9059cbb14610697578063c49b9a80146106b7578063dd62ed3e146106d757600080fd5b8063715018a6116100f2578063715018a61461059e57806377a2048c146105b357806388f82020146105d35780638da5cb5b1461060c5780638ee88c531461062a57600080fd5b80635342acb4146104fc57806357376198146105355780636414f32a146105555780636bc87c3a1461056857806370a082311461057e57600080fd5b8063313ce567116101bc57806341cb87fc1161018057806341cb87fc1461045b578063437823ec1461047b5780634549b0391461049b5780634a74bb02146104bb57806352390c02146104dc57600080fd5b8063313ce567146103c95780633685d419146103e557806339509351146104055780633b124fe7146104255780633bd5d1731461043b57600080fd5b806313114a9d1161020357806313114a9d1461033857806318160ddd1461034d5780631e293c10146103695780632026493d1461038957806323b872dd146103a957600080fd5b806304beaeb81461024b578063061c82d01461027457806306fdde03146102965780630758d924146102d0578063095ea7b31461030857600080fd5b3661024657005b600080fd5b34801561025757600080fd5b5061026160105481565b6040519081526020015b60405180910390f35b34801561028057600080fd5b5061029461028f3660046124db565b6107a7565b005b3480156102a257600080fd5b506040805180820190915260088152670444f4e41535741560c41b60208201525b60405161026b91906124f4565b3480156102dc57600080fd5b50600e546102f0906001600160a01b031681565b6040516001600160a01b03909116815260200161026b565b34801561031457600080fd5b5061032861032336600461255a565b6107df565b604051901515815260200161026b565b34801561034457600080fd5b50600954610261565b34801561035957600080fd5b5068056bc75e2d63100000610261565b34801561037557600080fd5b506102946103843660046124db565b6107f6565b34801561039557600080fd5b506102946103a43660046124db565b610825565b3480156103b557600080fd5b506103286103c4366004612586565b610854565b3480156103d557600080fd5b506040516009815260200161026b565b3480156103f157600080fd5b506102946104003660046125c7565b6108bd565b34801561041157600080fd5b5061032861042036600461255a565b610ab4565b34801561043157600080fd5b50610261600a5481565b34801561044757600080fd5b506102946104563660046124db565b610aea565b34801561046757600080fd5b506102946104763660046125c7565b610bd4565b34801561048757600080fd5b506102946104963660046125c7565b610d79565b3480156104a757600080fd5b506102616104b63660046125f2565b610dc7565b3480156104c757600080fd5b50600f5461032890600160a81b900460ff1681565b3480156104e857600080fd5b506102946104f73660046125c7565b610e5b565b34801561050857600080fd5b506103286105173660046125c7565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561054157600080fd5b5061029461055036600461255a565b610ffb565b34801561056157600080fd5b5047610261565b34801561057457600080fd5b50610261600c5481565b34801561058a57600080fd5b506102616105993660046125c7565b61109e565b3480156105aa57600080fd5b506102946110fd565b3480156105bf57600080fd5b506102616105ce3660046124db565b611171565b3480156105df57600080fd5b506103286105ee3660046125c7565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561061857600080fd5b506000546001600160a01b03166102f0565b34801561063657600080fd5b506102946106453660046124db565b6111f5565b34801561065657600080fd5b50604080518082019091526004815263444f4e4160e01b60208201526102c3565b34801561068357600080fd5b5061032861069236600461255a565b611224565b3480156106a357600080fd5b506103286106b236600461255a565b611273565b3480156106c357600080fd5b506102946106d2366004612622565b611280565b3480156106e357600080fd5b506102616106f236600461263f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561072957600080fd5b50610294611302565b34801561073e57600080fd5b5061029461074d3660046125c7565b611377565b34801561075e57600080fd5b50600f546102f0906001600160a01b031681565b34801561077e57600080fd5b5061029461078d3660046125c7565b6113c2565b34801561079e57600080fd5b50601154610261565b6000546001600160a01b031633146107da5760405162461bcd60e51b81526004016107d19061266d565b60405180910390fd5b600a55565b60006107ec3384846114ac565b5060015b92915050565b6000546001600160a01b031633146108205760405162461bcd60e51b81526004016107d19061266d565b601055565b6000546001600160a01b0316331461084f5760405162461bcd60e51b81526004016107d19061266d565b601155565b60006108618484846115d0565b6108b384336108ae8560405180606001604052806028815260200161285b602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061186f565b6114ac565b5060019392505050565b6000546001600160a01b031633146108e75760405162461bcd60e51b81526004016107d19061266d565b6001600160a01b03811660009081526006602052604090205460ff166109495760405162461bcd60e51b81526020600482015260176024820152761058d8dbdd5b9d081a5cc81b9bdd08195e18db1d591959604a1b60448201526064016107d1565b60005b600754811015610ab057816001600160a01b031660078281548110610973576109736126a2565b6000918252602090912001546001600160a01b031603610a9e576007805461099d906001906126ce565b815481106109ad576109ad6126a2565b600091825260209091200154600780546001600160a01b0390921691839081106109d9576109d96126a2565b6000918252602082200180546001600160a01b0319166001600160a01b039390931692909217909155610a0a6118a9565b6001600160a01b038416600090815260036020526040902054909150610a3090826118cc565b6001600160a01b038416600090815260026020908152604080832093909355600381528282208290556006905220805460ff191690556007805480610a7757610a776126e1565b600082815260209020810160001990810180546001600160a01b0319169055019055505050565b80610aa8816126f7565b91505061094c565b5050565b3360008181526004602090815260408083206001600160a01b038716845290915281205490916107ec9185906108ae908661194e565b3360008181526006602052604090205460ff1615610b5f5760405162461bcd60e51b815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201526b3434b990333ab731ba34b7b760a11b60648201526084016107d1565b6000610b6a836119ad565b505050506001600160a01b038416600090815260026020526040902054919250610b96919050826119fc565b6001600160a01b038316600090815260026020526040902055600854610bbc90826119fc565b600855600954610bcc908461194e565b600955505050565b6000546001600160a01b03163314610bfe5760405162461bcd60e51b81526004016107d19061266d565b6000819050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c659190612710565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd69190612710565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d479190612710565b600f80546001600160a01b039283166001600160a01b031991821617909155600e805493909216921691909117905550565b6000546001600160a01b03163314610da35760405162461bcd60e51b81526004016107d19061266d565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600068056bc75e2d63100000831115610e225760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c790060448201526064016107d1565b81610e41576000610e32846119ad565b509395506107f0945050505050565b6000610e4c846119ad565b509295506107f0945050505050565b6000546001600160a01b03163314610e855760405162461bcd60e51b81526004016107d19061266d565b6001600160a01b03811660009081526006602052604090205460ff1615610ee85760405162461bcd60e51b81526020600482015260176024820152761058d8dbdd5b9d081a5cc81b9bdd08195e18db1d591959604a1b60448201526064016107d1565b60075460321015610f3b5760405162461bcd60e51b815260206004820152601a60248201527f4578636c75646564206c69737420697320746f6f206c6f6e672100000000000060448201526064016107d1565b6001600160a01b03811660009081526002602052604090205415610f95576001600160a01b038116600090815260026020526040902054610f7b90611171565b6001600160a01b0382166000908152600360205260409020555b6001600160a01b03166000818152600660205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319169091179055565b6000546001600160a01b031633146110255760405162461bcd60e51b81526004016107d19061266d565b60405163a9059cbb60e01b81523360048201526024810182905282906001600160a01b0382169063a9059cbb906044016020604051808303816000875af1158015611074573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611098919061272d565b50505050565b6001600160a01b03811660009081526006602052604081205460ff16156110db57506001600160a01b031660009081526003602052604090205490565b6001600160a01b0382166000908152600260205260409020546107f090611171565b6000546001600160a01b031633146111275760405162461bcd60e51b81526004016107d19061266d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006008548211156111d85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107d1565b60006111e26118a9565b90506111ee8382611a3e565b9392505050565b6000546001600160a01b0316331461121f5760405162461bcd60e51b81526004016107d19061266d565b600c55565b60006107ec33846108ae85604051806060016040528060258152602001612836602591393360009081526004602090815260408083206001600160a01b038d168452909152902054919061186f565b60006107ec3384846115d0565b6000546001600160a01b031633146112aa5760405162461bcd60e51b81526004016107d19061266d565b600f8054821515600160a81b0260ff60a81b199091161790556040517f53726dfcaf90650aa7eb35524f4d3220f07413c8d6cb404cc8c18bf5591bc159906112f790831515815260200190565b60405180910390a150565b6000546001600160a01b0316331461132c5760405162461bcd60e51b81526004016107d19061266d565b4761133f6000546001600160a01b031690565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610ab0573d6000803e3d6000fd5b6000546001600160a01b031633146113a15760405162461bcd60e51b81526004016107d19061266d565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146113ec5760405162461bcd60e51b81526004016107d19061266d565b6001600160a01b0381166114515760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107d1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03831661150e5760405162461bcd60e51b8152602060048201526024808201527f546f6b656e3a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107d1565b6001600160a01b03821661156f5760405162461bcd60e51b815260206004820152602260248201527f546f6b656e3a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107d1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166116345760405162461bcd60e51b815260206004820152602560248201527f546f6b656e3a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107d1565b6001600160a01b0382166116965760405162461bcd60e51b815260206004820152602360248201527f546f6b656e3a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107d1565b600081116116f85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107d1565b6000546001600160a01b0384811691161480159061172457506000546001600160a01b03838116911614155b15611795576010548111156117955760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546044820152703930b739b0b1ba34b7b720b6b7bab73a1760791b60648201526084016107d1565b60006117a03061109e565b905060105481106117b057506010545b601154811080159081906117ce5750600f54600160a01b900460ff16155b80156117e85750600f546001600160a01b03868116911614155b80156117fd5750600f54600160a81b900460ff165b1561181057601154915061181082611a80565b6001600160a01b03851660009081526005602052604090205460019060ff168061185257506001600160a01b03851660009081526005602052604090205460ff165b1561185b575060005b61186786868684611b27565b505050505050565b600081848411156118935760405162461bcd60e51b81526004016107d191906124f4565b5060006118a084866126ce565b95945050505050565b60008060006118b6611c4c565b90925090506118c58282611a3e565b9250505090565b6000826000036118de575060006107f0565b60006118ea838561274a565b9050826118f78583612761565b146111ee5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107d1565b60008061195b8385612783565b9050838110156111ee5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107d1565b60008060008060008060008060006119c48a611de8565b92509250925060008060006119e28d86866119dd6118a9565b611e2a565b919f909e50909c50959a5093985091965092945050505050565b60006111ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061186f565b60006111ee83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e7a565b600f805460ff60a01b1916600160a01b1790556000611aa0826002611a3e565b90506000611aae83836119fc565b905047611aba83611ea8565b6000611ac647836119fc565b9050611ad28382611ffa565b60408051858152602081018390529081018490527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a15050600f805460ff60a01b19169055505050565b80611b3457611b346120ab565b6001600160a01b03841660009081526006602052604090205460ff168015611b7557506001600160a01b03831660009081526006602052604090205460ff16155b15611b8a57611b858484846120d9565b611c36565b6001600160a01b03841660009081526006602052604090205460ff16158015611bcb57506001600160a01b03831660009081526006602052604090205460ff165b15611bdb57611b858484846121ff565b6001600160a01b03841660009081526006602052604090205460ff168015611c1b57506001600160a01b03831660009081526006602052604090205460ff165b15611c2b57611b858484846122a8565b611c368484846123ac565b8061109857611098600b54600a55600d54600c55565b600854600090819068056bc75e2d63100000825b600754811015611dab57826002600060078481548110611c8257611c826126a2565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611ced5750816003600060078481548110611cc657611cc66126a2565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611d095750506008549368056bc75e2d631000009350915050565b611d4f6002600060078481548110611d2357611d236126a2565b60009182526020808320909101546001600160a01b0316835282019290925260400190205484906119fc565b9250611d976003600060078481548110611d6b57611d6b6126a2565b60009182526020808320909101546001600160a01b0316835282019290925260400190205483906119fc565b915080611da3816126f7565b915050611c60565b50600854611dc29068056bc75e2d63100000611a3e565b821015611ddf5750506008549268056bc75e2d6310000092509050565b90939092509050565b600080600080611df7856123f0565b90506000611e0486612412565b90506000611e1c82611e1689866119fc565b906119fc565b979296509094509092505050565b6000808080611e3988866118cc565b90506000611e4788876118cc565b90506000611e5588886118cc565b90506000611e6782611e1686866119fc565b939b939a50919850919650505050505050565b60008183611e9b5760405162461bcd60e51b81526004016107d191906124f4565b5060006118a08486612761565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611edd57611edd6126a2565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611f36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5a9190612710565b81600181518110611f6d57611f6d6126a2565b6001600160a01b039283166020918202929092010152600e54611f9391309116846114ac565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611fcc908590600090869030904290600401612796565b600060405180830381600087803b158015611fe657600080fd5b505af1158015611867573d6000803e3d6000fd5b600e546120129030906001600160a01b0316846114ac565b600e5460405163f305d71960e01b8152306004820181905260248201859052600060448301819052606483015260848201524260a48201526001600160a01b039091169063f305d71990839060c40160606040518083038185885af115801561207f573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906120a49190612807565b5050505050565b600a541580156120bb5750600c54155b156120c257565b600a8054600b55600c8054600d5560009182905555565b6000806000806000806120eb876119ad565b6001600160a01b038f16600090815260036020526040902054959b5093995091975095509350915061211d90886119fc565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461214c90876119fc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461217b908661194e565b6001600160a01b03891660009081526002602052604090205561219d8161242e565b6121a784836124b7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121ec91815260200190565b60405180910390a3505050505050505050565b600080600080600080612211876119ad565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061224390876119fc565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054612279908461194e565b6001600160a01b03891660009081526003602090815260408083209390935560029052205461217b908661194e565b6000806000806000806122ba876119ad565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506122ec90886119fc565b6001600160a01b038a1660009081526003602090815260408083209390935560029052205461231b90876119fc565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054612351908461194e565b6001600160a01b038916600090815260036020908152604080832093909355600290522054612380908661194e565b6001600160a01b0389166000908152600260205260409020556123a384836124b7565b6121a78161242e565b6000806000806000806123be876119ad565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061214c90876119fc565b60006107f0606461240c600a54856118cc90919063ffffffff16565b90611a3e565b60006107f0606461240c600c54856118cc90919063ffffffff16565b60006124386118a9565b9050600061244683836118cc565b30600090815260026020526040902054909150612463908261194e565b3060009081526002602090815260408083209390935560069052205460ff16156124b257306000908152600360205260409020546124a1908461194e565b306000908152600360205260409020555b505050565b6008546124c490836119fc565b6008556009546124d4908261194e565b6009555050565b6000602082840312156124ed57600080fd5b5035919050565b600060208083528351808285015260005b8181101561252157858101830151858201604001528201612505565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461255757600080fd5b50565b6000806040838503121561256d57600080fd5b823561257881612542565b946020939093013593505050565b60008060006060848603121561259b57600080fd5b83356125a681612542565b925060208401356125b681612542565b929592945050506040919091013590565b6000602082840312156125d957600080fd5b81356111ee81612542565b801515811461255757600080fd5b6000806040838503121561260557600080fd5b823591506020830135612617816125e4565b809150509250929050565b60006020828403121561263457600080fd5b81356111ee816125e4565b6000806040838503121561265257600080fd5b823561265d81612542565b9150602083013561261781612542565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156107f0576107f06126b8565b634e487b7160e01b600052603160045260246000fd5b600060018201612709576127096126b8565b5060010190565b60006020828403121561272257600080fd5b81516111ee81612542565b60006020828403121561273f57600080fd5b81516111ee816125e4565b80820281158282048414176107f0576107f06126b8565b60008261277e57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156107f0576107f06126b8565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156127e65784516001600160a01b0316835293830193918301916001016127c1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008060006060848603121561281c57600080fd5b835192506020840151915060408401519050925092509256fe546f6b656e3a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f546f6b656e3a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f07a884939268377eca67a3b64013d4100d54c807322cf8770c52aa07c2c3d2664736f6c63430008130033