ETH Price: $2,526.51 (+1.25%)

Transaction Decoder

Block:
20512291 at Aug-12-2024 11:39:47 AM +UTC
Transaction Fee:
0.000466360088847475 ETH $1.18
Gas Used:
46,601 Gas / 10.007512475 Gwei

Emitted Events:

432 SWAG.Approval( owner=[Sender] 0xd955b4057eb2903b2b39f7e639bf678df94eb2f6, spender=0xED12310d...950166760, value=115792089237316195423570985008687907853269984665640564039457584007913129639935 )

Account State Difference:

  Address   Before After State Difference Code
0x36C7188D...eabb8eD43
(Titan Builder)
6.071663208203851677 Eth6.071726679827981669 Eth0.000063471624129992
0xd955b405...DF94eb2f6
0.029881880895830798 Eth
Nonce: 212
0.029415520806983323 Eth
Nonce: 213
0.000466360088847475

Execution Trace

SWAG.approve( spender=0xED12310d5a37326E6506209C4838146950166760, amount=115792089237316195423570985008687907853269984665640564039457584007913129639935 ) => ( True )
// Website: https://swagcoin.xyz
// Twitter: https://x.com/swagoneth
// Telegram: https://t.me/Swag_eth
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
abstract contract Context {
\tfunction _msgSender() internal view virtual returns (address) {
\t\treturn msg.sender;
\t}
\tfunction _msgData() internal view virtual returns (bytes calldata) {
\t\tthis; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
\t\treturn msg.data;
\t}
}
interface IUniswapV2Pair {
\tevent Approval(address indexed owner, address indexed spender, uint value);
\tevent Transfer(address indexed from, address indexed to, uint value);
\tfunction name() external pure returns (string memory);
\tfunction symbol() external pure returns (string memory);
\tfunction decimals() external pure returns (uint8);
\tfunction totalSupply() external view returns (uint);
\tfunction balanceOf(address owner) external view returns (uint);
\tfunction allowance(address owner, address spender) external view returns (uint);
\tfunction approve(address spender, uint value) external returns (bool);
\tfunction transfer(address to, uint value) external returns (bool);
\tfunction transferFrom(address from, address to, uint value) external returns (bool);
\tfunction DOMAIN_SEPARATOR() external view returns (bytes32);
\tfunction PERMIT_TYPEHASH() external pure returns (bytes32);
\tfunction nonces(address owner) external view returns (uint);
\tfunction permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
\tevent Mint(address indexed sender, uint amount0, uint amount1);
\tevent Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
\tevent Swap(address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to);
\tevent Sync(uint112 reserve0, uint112 reserve1);
\tfunction MINIMUM_LIQUIDITY() external pure returns (uint);
\tfunction factory() external view returns (address);
\tfunction token0() external view returns (address);
\tfunction token1() external view returns (address);
\tfunction getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
\tfunction price0CumulativeLast() external view returns (uint);
\tfunction price1CumulativeLast() external view returns (uint);
\tfunction kLast() external view returns (uint);
\tfunction mint(address to) external returns (uint liquidity);
\tfunction burn(address to) external returns (uint amount0, uint amount1);
\tfunction swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
\tfunction skim(address to) external;
\tfunction sync() external;
\tfunction initialize(address, address) external;
}
interface IUniswapV2Factory {
\tevent PairCreated(address indexed token0, address indexed token1, address pair, uint);
\tfunction feeTo() external view returns (address);
\tfunction feeToSetter() external view returns (address);
\tfunction getPair(address tokenA, address tokenB) external view returns (address pair);
\tfunction allPairs(uint) external view returns (address pair);
\tfunction allPairsLength() external view returns (uint);
\tfunction createPair(address tokenA, address tokenB) external returns (address pair);
\tfunction setFeeTo(address) external;
\tfunction setFeeToSetter(address) external;
}
interface IERC20 {
\t/**
\t * @dev Returns the amount of tokens in existence.
\t */
\tfunction totalSupply() external view returns (uint256);
\t/**
\t * @dev Returns the amount of tokens owned by `account`.
\t */
\tfunction balanceOf(address account) external view returns (uint256);
\t/**
\t * @dev Moves `amount` tokens from the caller's account to `recipient`.
\t *
\t * Returns a boolean value indicating whether the operation succeeded.
\t *
\t * Emits a {Transfer} event.
\t */
\tfunction transfer(address recipient, uint256 amount) external returns (bool);
\t/**
\t * @dev Returns the remaining number of tokens that `spender` will be
\t * allowed to spend on behalf of `owner` through {transferFrom}. This is
\t * zero by default.
\t *
\t * This value changes when {approve} or {transferFrom} are called.
\t */
\tfunction allowance(address owner, address spender) external view returns (uint256);
\t/**
\t * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
\t *
\t * Returns a boolean value indicating whether the operation succeeded.
\t *
\t * IMPORTANT: Beware that changing an allowance with this method brings the risk
\t * that someone may use both the old and the new allowance by unfortunate
\t * transaction ordering. One possible solution to mitigate this race
\t * condition is to first reduce the spender's allowance to 0 and set the
\t * desired value afterwards:
\t * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
\t *
\t * Emits an {Approval} event.
\t */
\tfunction approve(address spender, uint256 amount) external returns (bool);
\t/**
\t * @dev Moves `amount` tokens from `sender` to `recipient` using the
\t * allowance mechanism. `amount` is then deducted from the caller's
\t * allowance.
\t *
\t * Returns a boolean value indicating whether the operation succeeded.
\t *
\t * Emits a {Transfer} event.
\t */
\tfunction transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
\t/**
\t * @dev Emitted when `value` tokens are moved from one account (`from`) to
\t * another (`to`).
\t *
\t * Note that `value` may be zero.
\t */
\tevent Transfer(address indexed from, address indexed to, uint256 value);
\t/**
\t * @dev Emitted when the allowance of a `spender` for an `owner` is set by
\t * a call to {approve}. `value` is the new allowance.
\t */
\tevent Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
\t/**
\t * @dev Returns the name of the token.
\t */
\tfunction name() external view returns (string memory);
\t/**
\t * @dev Returns the symbol of the token.
\t */
\tfunction symbol() external view returns (string memory);
\t/**
\t * @dev Returns the decimals places of the token.
\t */
\tfunction decimals() external view returns (uint8);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
\tusing SafeMath for uint256;
\tmapping(address => uint256) private _balances;
\tmapping(address => mapping(address => uint256)) private _allowances;
\tuint256 private _totalSupply;
\tstring private _name;
\tstring private _symbol;
\t/**
\t * @dev Sets the values for {name} and {symbol}.
\t *
\t * The default value of {decimals} is 18. To select a different value for
\t * {decimals} you should overload it.
\t *
\t * All two of these values are immutable: they can only be set once during
\t * construction.
\t */
\tconstructor(string memory name_, string memory symbol_) {
\t\t_name = name_;
\t\t_symbol = symbol_;
\t}
\t/**
\t * @dev Returns the name of the token.
\t */
\tfunction name() public view virtual override returns (string memory) {
\t\treturn _name;
\t}
\t/**
\t * @dev Returns the symbol of the token, usually a shorter version of the
\t * name.
\t */
\tfunction symbol() public view virtual override returns (string memory) {
\t\treturn _symbol;
\t}
\t/**
\t * @dev Returns the number of decimals used to get its user representation.
\t * For example, if `decimals` equals `2`, a balance of `505` tokens should
\t * be displayed to a user as `5,05` (`505 / 10 ** 2`).
\t *
\t * Tokens usually opt for a value of 18, imitating the relationship between
\t * Ether and Wei. This is the value {ERC20} uses, unless this function is
\t * overridden;
\t *
\t * NOTE: This information is only used for _display_ purposes: it in
\t * no way affects any of the arithmetic of the contract, including
\t * {IERC20-balanceOf} and {IERC20-transfer}.
\t */
\tfunction decimals() public view virtual override returns (uint8) {
\t\treturn 18;
\t}
\t/**
\t * @dev See {IERC20-totalSupply}.
\t */
\tfunction totalSupply() public view virtual override returns (uint256) {
\t\treturn _totalSupply;
\t}
\t/**
\t * @dev See {IERC20-balanceOf}.
\t */
\tfunction balanceOf(address account) public view virtual override returns (uint256) {
\t\treturn _balances[account];
\t}
\t/**
\t * @dev See {IERC20-transfer}.
\t *
\t * Requirements:
\t *
\t * - `recipient` cannot be the zero address.
\t * - the caller must have a balance of at least `amount`.
\t */
\tfunction transfer(address recipient, uint256 amount) public virtual override returns (bool) {
\t\t_transfer(_msgSender(), recipient, amount);
\t\treturn true;
\t}
\t/**
\t * @dev See {IERC20-allowance}.
\t */
\tfunction allowance(address owner, address spender) public view virtual override returns (uint256) {
\t\treturn _allowances[owner][spender];
\t}
\t/**
\t * @dev See {IERC20-approve}.
\t *
\t * Requirements:
\t *
\t * - `spender` cannot be the zero address.
\t */
\tfunction approve(address spender, uint256 amount) public virtual override returns (bool) {
\t\t_approve(_msgSender(), spender, amount);
\t\treturn true;
\t}
\t/**
\t * @dev See {IERC20-transferFrom}.
\t *
\t * Emits an {Approval} event indicating the updated allowance. This is not
\t * required by the EIP. See the note at the beginning of {ERC20}.
\t *
\t * Requirements:
\t *
\t * - `sender` and `recipient` cannot be the zero address.
\t * - `sender` must have a balance of at least `amount`.
\t * - the caller must have allowance for ``sender``'s tokens of at least
\t * `amount`.
\t */
\tfunction transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
\t\t_transfer(sender, recipient, amount);
\t\t_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, 'ERC20: transfer amount exceeds allowance'));
\t\treturn true;
\t}
\t/**
\t * @dev Atomically increases the allowance granted to `spender` by the caller.
\t *
\t * This is an alternative to {approve} that can be used as a mitigation for
\t * problems described in {IERC20-approve}.
\t *
\t * Emits an {Approval} event indicating the updated allowance.
\t *
\t * Requirements:
\t *
\t * - `spender` cannot be the zero address.
\t */
\tfunction increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
\t\t_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
\t\treturn true;
\t}
\t/**
\t * @dev Atomically decreases the allowance granted to `spender` by the caller.
\t *
\t * This is an alternative to {approve} that can be used as a mitigation for
\t * problems described in {IERC20-approve}.
\t *
\t * Emits an {Approval} event indicating the updated allowance.
\t *
\t * Requirements:
\t *
\t * - `spender` cannot be the zero address.
\t * - `spender` must have allowance for the caller of at least
\t * `subtractedValue`.
\t */
\tfunction decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
\t\t_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, 'ERC20: decreased allowance below zero'));
\t\treturn true;
\t}
\t/**
\t * @dev Moves tokens `amount` from `sender` to `recipient`.
\t *
\t * This is internal function is equivalent to {transfer}, and can be used to
\t * e.g. implement automatic token fees, slashing mechanisms, etc.
\t *
\t * Emits a {Transfer} event.
\t *
\t * Requirements:
\t *
\t * - `sender` cannot be the zero address.
\t * - `recipient` cannot be the zero address.
\t * - `sender` must have a balance of at least `amount`.
\t */
\tfunction _transfer(address sender, address recipient, uint256 amount) internal virtual {
\t\trequire(sender != address(0), 'ERC20: transfer from the zero address');
\t\trequire(recipient != address(0), 'ERC20: transfer to the zero address');
\t\t_beforeTokenTransfer(sender, recipient, amount);
\t\t_balances[sender] = _balances[sender].sub(amount, 'ERC20: transfer amount exceeds balance');
\t\t_balances[recipient] = _balances[recipient].add(amount);
\t\temit Transfer(sender, recipient, amount);
\t}
\t/** @dev Creates `amount` tokens and assigns them to `account`, increasing
\t * the total supply.
\t *
\t * Emits a {Transfer} event with `from` set to the zero address.
\t *
\t * Requirements:
\t *
\t * - `account` cannot be the zero address.
\t */
\tfunction _mint(address account, uint256 amount) internal virtual {
\t\trequire(account != address(0), 'ERC20: mint to the zero address');
\t\t_beforeTokenTransfer(address(0), account, amount);
\t\t_totalSupply = _totalSupply.add(amount);
\t\t_balances[account] = _balances[account].add(amount);
\t\temit Transfer(address(0), account, amount);
\t}
\t/**
\t * @dev Destroys `amount` tokens from `account`, reducing the
\t * total supply.
\t *
\t * Emits a {Transfer} event with `to` set to the zero address.
\t *
\t * Requirements:
\t *
\t * - `account` cannot be the zero address.
\t * - `account` must have at least `amount` tokens.
\t */
\tfunction _burn(address account, uint256 amount) internal virtual {
\t\trequire(account != address(0), 'ERC20: burn from the zero address');
\t\t_beforeTokenTransfer(account, address(0), amount);
\t\t_balances[account] = _balances[account].sub(amount, 'ERC20: burn amount exceeds balance');
\t\t_totalSupply = _totalSupply.sub(amount);
\t\temit Transfer(account, address(0), amount);
\t}
\t/**
\t * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
\t *
\t * This internal function is equivalent to `approve`, and can be used to
\t * e.g. set automatic allowances for certain subsystems, etc.
\t *
\t * Emits an {Approval} event.
\t *
\t * Requirements:
\t *
\t * - `owner` cannot be the zero address.
\t * - `spender` cannot be the zero address.
\t */
\tfunction _approve(address owner, address spender, uint256 amount) internal virtual {
\t\trequire(owner != address(0), 'ERC20: approve from the zero address');
\t\trequire(spender != address(0), 'ERC20: approve to the zero address');
\t\t_allowances[owner][spender] = amount;
\t\temit Approval(owner, spender, amount);
\t}
\t/**
\t * @dev Hook that is called before any transfer of tokens. This includes
\t * minting and burning.
\t *
\t * Calling conditions:
\t *
\t * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
\t * will be to transferred to `to`.
\t * - when `from` is zero, `amount` tokens will be minted for `to`.
\t * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
\t * - `from` and `to` are never both zero.
\t *
\t * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
\t */
\tfunction _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
library SafeMath {
\t/**
\t * @dev Returns the addition of two unsigned integers, reverting on
\t * overflow.
\t *
\t * Counterpart to Solidity's `+` operator.
\t *
\t * Requirements:
\t *
\t * - Addition cannot overflow.
\t */
\tfunction add(uint256 a, uint256 b) internal pure returns (uint256) {
\t\tuint256 c = a + b;
\t\trequire(c >= a, 'SafeMath: addition overflow');
\t\treturn c;
\t}
\t/**
\t * @dev Returns the subtraction of two unsigned integers, reverting on
\t * overflow (when the result is negative).
\t *
\t * Counterpart to Solidity's `-` operator.
\t *
\t * Requirements:
\t *
\t * - Subtraction cannot overflow.
\t */
\tfunction sub(uint256 a, uint256 b) internal pure returns (uint256) {
\t\treturn sub(a, b, 'SafeMath: subtraction overflow');
\t}
\t/**
\t * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
\t * overflow (when the result is negative).
\t *
\t * Counterpart to Solidity's `-` operator.
\t *
\t * Requirements:
\t *
\t * - Subtraction cannot overflow.
\t */
\tfunction sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
\t\trequire(b <= a, errorMessage);
\t\tuint256 c = a - b;
\t\treturn c;
\t}
\t/**
\t * @dev Returns the multiplication of two unsigned integers, reverting on
\t * overflow.
\t *
\t * Counterpart to Solidity's `*` operator.
\t *
\t * Requirements:
\t *
\t * - Multiplication cannot overflow.
\t */
\tfunction mul(uint256 a, uint256 b) internal pure returns (uint256) {
\t\t// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
\t\t// benefit is lost if 'b' is also tested.
\t\t// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
\t\tif (a == 0) {
\t\t\treturn 0;
\t\t}
\t\tuint256 c = a * b;
\t\trequire(c / a == b, 'SafeMath: multiplication overflow');
\t\treturn c;
\t}
\t/**
\t * @dev Returns the integer division of two unsigned integers. Reverts on
\t * division by zero. The result is rounded towards zero.
\t *
\t * Counterpart to Solidity's `/` operator. Note: this function uses a
\t * `revert` opcode (which leaves remaining gas untouched) while Solidity
\t * uses an invalid opcode to revert (consuming all remaining gas).
\t *
\t * Requirements:
\t *
\t * - The divisor cannot be zero.
\t */
\tfunction div(uint256 a, uint256 b) internal pure returns (uint256) {
\t\treturn div(a, b, 'SafeMath: division by zero');
\t}
\t/**
\t * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
\t * division by zero. The result is rounded towards zero.
\t *
\t * Counterpart to Solidity's `/` operator. Note: this function uses a
\t * `revert` opcode (which leaves remaining gas untouched) while Solidity
\t * uses an invalid opcode to revert (consuming all remaining gas).
\t *
\t * Requirements:
\t *
\t * - The divisor cannot be zero.
\t */
\tfunction div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
\t\trequire(b > 0, errorMessage);
\t\tuint256 c = a / b;
\t\t// assert(a == b * c + a % b); // There is no case in which this doesn't hold
\t\treturn c;
\t}
\t/**
\t * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
\t * Reverts when dividing by zero.
\t *
\t * Counterpart to Solidity's `%` operator. This function uses a `revert`
\t * opcode (which leaves remaining gas untouched) while Solidity uses an
\t * invalid opcode to revert (consuming all remaining gas).
\t *
\t * Requirements:
\t *
\t * - The divisor cannot be zero.
\t */
\tfunction mod(uint256 a, uint256 b) internal pure returns (uint256) {
\t\treturn mod(a, b, 'SafeMath: modulo by zero');
\t}
\t/**
\t * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
\t * Reverts with custom message when dividing by zero.
\t *
\t * Counterpart to Solidity's `%` operator. This function uses a `revert`
\t * opcode (which leaves remaining gas untouched) while Solidity uses an
\t * invalid opcode to revert (consuming all remaining gas).
\t *
\t * Requirements:
\t *
\t * - The divisor cannot be zero.
\t */
\tfunction mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
\t\trequire(b != 0, errorMessage);
\t\treturn a % b;
\t}
}
contract Ownable is Context {
\taddress private _owner;
\tevent OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
\t/**
\t * @dev Initializes the contract setting the deployer as the initial owner.
\t */
\tconstructor() {
\t\taddress msgSender = _msgSender();
\t\t_owner = msgSender;
\t\temit OwnershipTransferred(address(0), msgSender);
\t}
\t/**
\t * @dev Returns the address of the current owner.
\t */
\tfunction owner() public view returns (address) {
\t\treturn _owner;
\t}
\t/**
\t * @dev Throws if called by any account other than the owner.
\t */
\tmodifier onlyOwner() {
\t\trequire(_owner == _msgSender(), 'Ownable: caller is not the owner');
\t\t_;
\t}
\t/**
\t * @dev Leaves the contract without owner. It will not be possible to call
\t * `onlyOwner` functions anymore. Can only be called by the current owner.
\t *
\t * NOTE: Renouncing ownership will leave the contract without an owner,
\t * thereby removing any functionality that is only available to the owner.
\t */
\tfunction renounceOwnership() public virtual onlyOwner {
\t\temit OwnershipTransferred(_owner, address(0));
\t\t_owner = address(0);
\t}
\t/**
\t * @dev Transfers ownership of the contract to a new account (`newOwner`).
\t * Can only be called by the current owner.
\t */
\tfunction transferOwnership(address newOwner) public virtual onlyOwner {
\t\trequire(newOwner != address(0), 'Ownable: new owner is the zero address');
\t\temit OwnershipTransferred(_owner, newOwner);
\t\t_owner = newOwner;
\t}
}
library SafeMathInt {
\tint256 private constant MIN_INT256 = int256(1) << 255;
\tint256 private constant MAX_INT256 = ~(int256(1) << 255);
\t/**
\t * @dev Multiplies two int256 variables and fails on overflow.
\t */
\tfunction mul(int256 a, int256 b) internal pure returns (int256) {
\t\tint256 c = a * b;
\t\t// Detect overflow when multiplying MIN_INT256 with -1
\t\trequire(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256));
\t\trequire((b == 0) || (c / b == a));
\t\treturn c;
\t}
\t/**
\t * @dev Division of two int256 variables and fails on overflow.
\t */
\tfunction div(int256 a, int256 b) internal pure returns (int256) {
\t\t// Prevent overflow when dividing MIN_INT256 by -1
\t\trequire(b != -1 || a != MIN_INT256);
\t\t// Solidity already throws when dividing by 0.
\t\treturn a / b;
\t}
\t/**
\t * @dev Subtracts two int256 variables and fails on overflow.
\t */
\tfunction sub(int256 a, int256 b) internal pure returns (int256) {
\t\tint256 c = a - b;
\t\trequire((b >= 0 && c <= a) || (b < 0 && c > a));
\t\treturn c;
\t}
\t/**
\t * @dev Adds two int256 variables and fails on overflow.
\t */
\tfunction add(int256 a, int256 b) internal pure returns (int256) {
\t\tint256 c = a + b;
\t\trequire((b >= 0 && c >= a) || (b < 0 && c < a));
\t\treturn c;
\t}
\t/**
\t * @dev Converts to absolute value, and fails on overflow.
\t */
\tfunction abs(int256 a) internal pure returns (int256) {
\t\trequire(a != MIN_INT256);
\t\treturn a < 0 ? -a : a;
\t}
\tfunction toUint256Safe(int256 a) internal pure returns (uint256) {
\t\trequire(a >= 0);
\t\treturn uint256(a);
\t}
}
library SafeMathUint {
\tfunction toInt256Safe(uint256 a) internal pure returns (int256) {
\t\tint256 b = int256(a);
\t\trequire(b >= 0);
\t\treturn b;
\t}
}
interface IUniswapV2Router01 {
\tfunction factory() external pure returns (address);
\tfunction WETH() external pure returns (address);
\tfunction 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);
\tfunction addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
\tfunction removeLiquidity(address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline) external returns (uint amountA, uint amountB);
\tfunction removeLiquidityETH(address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external returns (uint amountToken, uint amountETH);
\tfunction 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);
\tfunction 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);
\tfunction swapExactTokensForTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
\tfunction swapTokensForExactTokens(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
\tfunction swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts);
\tfunction swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
\tfunction swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts);
\tfunction swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts);
\tfunction quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
\tfunction getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
\tfunction getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
\tfunction getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
\tfunction getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
\tfunction removeLiquidityETHSupportingFeeOnTransferTokens(address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external returns (uint amountETH);
\tfunction 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);
\tfunction swapExactTokensForTokensSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
\tfunction swapExactETHForTokensSupportingFeeOnTransferTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable;
\tfunction swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
}
contract SWAG is ERC20, Ownable {
\tusing SafeMath for uint256;
\tIUniswapV2Router02 public immutable uniswapV2Router;
\taddress public immutable uniswapV2Pair;
\taddress public constant deadAddress = address(0xdead);
\tbool private swapping;
\taddress payable private marketingWallet;
\tuint256 public maxTransactionAmount;
\tuint256 public maxWallet;
    uint256 public taxSwap;
\tuint8 private _decimals;
\tbool public limitsInEffect = true;
\tbool public tradingActive = false;
\tbool public swapEnabled = false;
\tbool public rescueSwap = false;
\tuint256 public tradingActiveBlock;
\tuint256 public buyTotalFees;
\tuint256 public sellTotalFees;
\t/******************/
\t// exlcude from fees and max transaction amount
\tmapping(address => bool) private _isExcludedFromFees;
\tmapping(address => bool) public _isExcludedMaxTransactionAmount;
\t// store addresses that a automatic market maker pairs. Any transfer *to* these addresses
\t// could be subject to a maximum transfer amount
\tmapping(address => bool) public automatedMarketMakerPairs;
\tevent UpdateUniswapV2Router(address indexed newAddress, address indexed oldAddress);
\tevent ExcludeFromFees(address indexed account, bool isExcluded);
\tevent SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
\tevent marketingWalletUpdated(address indexed newWallet, address indexed oldWallet);
\tevent OwnerForcedSwapBack(uint256 timestamp);
\tconstructor() ERC20('Swag', 'SWAG') {
\t\taddress _owner = _msgSender();
\t\t_decimals = 9;
\t\tuint256 totalSupply = 1 * (10 ** 8) * (10 ** _decimals);
\t\tmaxTransactionAmount = (totalSupply * 1) / 100; // 1% maxTransactionAmountTxn
\t\tmaxWallet = (totalSupply * 1) / 100; // 1% maxWallet
        taxSwap = (totalSupply * 5) / 10000;
\t\tbuyTotalFees = 20;
\t\tsellTotalFees = 20;
\t\tmarketingWallet = payable(0xbCE81996DE52B9781208894b4C5c897bbB8F79D5); // set as marketing wallet
\t\taddress currentRouter;
\t\t//Adding Variables for all the routers for easier deployment for our customers.
\t\tif (block.chainid == 11155111) {
\t\t\tcurrentRouter = 0xC532a74256D3Db42D0Bf7a0400fEFDbad7694008; // Sepolia
\t\t} else if (block.chainid == 1 || block.chainid == 4) {
\t\t\tcurrentRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; //Mainnet
\t\t} else {
\t\t\trevert();
\t\t}
\t\t//End of Router Variables.
\t\tIUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(currentRouter);
\t\texcludeFromMaxTransaction(address(_uniswapV2Router), true);
\t\tuniswapV2Router = _uniswapV2Router;
\t\tuniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
\t\texcludeFromMaxTransaction(address(uniswapV2Pair), true);
\t\t_setAutomatedMarketMakerPair(address(uniswapV2Pair), true);
\t\t// exclude from paying fees or having max transaction amount
\t\texcludeFromFees(_owner, true);
\t\texcludeFromFees(address(this), true);
\t\texcludeFromFees(address(0xdead), true);
\t\texcludeFromMaxTransaction(_owner, true);
\t\texcludeFromMaxTransaction(address(this), true);
\t\texcludeFromMaxTransaction(address(0xdead), true);
\t\t/*
            _mint is an internal function in ERC20.sol that is only called here,
            and CANNOT be called ever again
        */
\t\t_mint(_owner, totalSupply);
\t\ttransferOwnership(_owner);
\t}
\treceive() external payable {}
\t// once enabled, can never be turned off
\tfunction enableTrading() external onlyOwner {
\t\ttradingActive = true;
\t\tswapEnabled = true;
\t\ttradingActiveBlock = block.number;
\t}
\t// remove limits after token is stable
\tfunction removeLimits() external onlyOwner returns (bool) {
        buyTotalFees = 0;
\t\tsellTotalFees = 0;
\t\tlimitsInEffect = false;
\t\treturn true;
\t}
\tfunction excludeFromMaxTransaction(address updAds, bool isEx) public onlyOwner {
\t\t_isExcludedMaxTransactionAmount[updAds] = isEx;
\t}
\tfunction decimals() public view override returns (uint8) {
\t\treturn _decimals;
\t}
\t// only use to disable contract sales if absolutely necessary (emergency use only)
\tfunction updateSwapEnabled(bool enabled) external onlyOwner {
\t\tswapEnabled = enabled;
\t}
\t// only use this to disable swapback and send tax in form of tokens
\tfunction updateRescueSwap(bool enabled) external onlyOwner {
\t\trescueSwap = enabled;
\t}
\tfunction excludeFromFees(address account, bool excluded) public onlyOwner {
\t\t_isExcludedFromFees[account] = excluded;
\t\temit ExcludeFromFees(account, excluded);
\t}
\tfunction setAutomatedMarketMakerPair(address pair, bool value) external onlyOwner {
\t\trequire(pair != uniswapV2Pair, 'The pair cannot be removed from automatedMarketMakerPairs');
\t\t_setAutomatedMarketMakerPair(pair, value);
\t}
\tfunction _setAutomatedMarketMakerPair(address pair, bool value) private {
\t\tautomatedMarketMakerPairs[pair] = value;
\t\temit SetAutomatedMarketMakerPair(pair, value);
\t}
\tfunction updateMarketingWallet(address payable newMarketingWallet) external onlyOwner {
\t\temit marketingWalletUpdated(newMarketingWallet, marketingWallet);
\t\tmarketingWallet = newMarketingWallet;
\t}
\tfunction isExcludedFromFees(address account) external view returns (bool) {
\t\treturn _isExcludedFromFees[account];
\t}
\tfunction _transfer(address from, address to, uint256 amount) internal override {
\t\trequire(from != address(0), 'ERC20: transfer from the zero address');
\t\trequire(to != address(0), 'ERC20: transfer to the zero address');
\t\tif (!tradingActive) {
\t\t\trequire(_isExcludedFromFees[from] || _isExcludedFromFees[to], 'Trading is not active.');
\t\t}
\t\tif (amount == 0) {
\t\t\tsuper._transfer(from, to, 0);
\t\t\treturn;
\t\t}
\t\tif (limitsInEffect) {
\t\t\tif (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !(_isExcludedFromFees[from] || _isExcludedFromFees[to]) && !swapping) {
\t\t\t\t//when buy
\t\t\t\tif (automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to]) {
\t\t\t\t\trequire(amount <= maxTransactionAmount, 'Buy transfer amount exceeds the maxTransactionAmount.');
\t\t\t\t\trequire(amount + balanceOf(to) <= maxWallet, 'Max wallet exceeded');
\t\t\t\t}
\t\t\t\t//when sell
\t\t\t\telse if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) {
\t\t\t\t\trequire(amount <= maxTransactionAmount, 'Sell transfer amount exceeds the maxTransactionAmount.');
\t\t\t\t} else {
\t\t\t\t\trequire(amount + balanceOf(to) <= maxWallet, 'Max wallet exceeded');
\t\t\t\t}
\t\t\t}
\t\t}
\t\tuint256 contractTokenBalance = balanceOf(address(this));
\t\tbool canSwap = contractTokenBalance > taxSwap;
\t\tif (canSwap && swapEnabled && !swapping && !automatedMarketMakerPairs[from] && !_isExcludedFromFees[from] && !_isExcludedFromFees[to]) {
\t\t\tswapping = true;
\t\t\tswapBack(amount);
\t\t\tswapping = false;
\t\t}
\t\tbool takeFee = !swapping;
\t\t// if any account belongs to _isExcludedFromFee account then remove the fee
\t\tif (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
\t\t\ttakeFee = false;
\t\t}
\t\tuint256 fees = 0;
\t\t// only take fees on buys/sells, do not take on wallet transfers
\t\tif (takeFee) {
\t\t\tif (automatedMarketMakerPairs[to]) {
\t\t\t\tif (sellTotalFees > 0) {
\t\t\t\t\tfees = amount.mul(sellTotalFees).div(100);
\t\t\t\t}
\t\t\t}
\t\t\t// on buy
\t\t\telse if (automatedMarketMakerPairs[from]) {
\t\t\t\tif (buyTotalFees > 0) {
\t\t\t\t\tfees = amount.mul(buyTotalFees).div(100);
\t\t\t\t}
\t\t\t}
\t\t\tif (fees > 0) {
\t\t\t\tsuper._transfer(from, address(this), fees);
\t\t\t}
\t\t\tamount -= fees;
\t\t}
\t\tsuper._transfer(from, to, amount);
\t}
\tfunction swapTokensForEth(uint256 tokenAmount) private {
\t\t// generate the uniswap pair path of token -> weth
\t\taddress[] memory path = new address[](2);
\t\tpath[0] = address(this);
\t\tpath[1] = uniswapV2Router.WETH();
\t\t_approve(address(this), address(uniswapV2Router), tokenAmount);
\t\t// make the swap
\t\ttry
\t\t\tuniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
\t\t\t\ttokenAmount,
\t\t\t\t0, // accept any amount of ETH
\t\t\t\tpath,
\t\t\t\taddress(this),
\t\t\t\tblock.timestamp
\t\t\t)
\t\t{} catch {}
\t}
\tfunction removeTax() public onlyOwner {
\t\tbuyTotalFees = 0;
\t\tsellTotalFees = 0;
\t}
\tfunction swapBack(uint256 amount) private {
\t\tuint256 contractBalance = balanceOf(address(this));
\t\tif (rescueSwap) {
\t\t\tif (contractBalance > 0) {
\t\t\t\tsuper._transfer(address(this), marketingWallet, contractBalance);
\t\t\t}
\t\t\treturn;
\t\t}
\t\tif (contractBalance == 0) {
\t\t\treturn;
\t\t}
\t\tuint256 amountToSwapForETH = taxSwap>amount?amount:taxSwap;
\t\tswapTokensForEth(amountToSwapForETH);
\t\tsendETHToFee(address(this).balance);
\t}
    function sendETHToFee(uint256 amount) private {
        marketingWallet.transfer(amount);
    }
    function manualSend() external {
        require(_msgSender() == marketingWallet);
        sendETHToFee(address(this).balance);
    }
    function manualSendToken() external {
        require(_msgSender() == marketingWallet);
        IERC20(address(this)).transfer(msg.sender, balanceOf(address(this)));
    }
}