ETH Price: $2,066.01 (+8.39%)
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Swap ETH For Tok...217728542025-02-04 11:31:47386 days ago1738668707IN
Dexed: Router
0.005 ETH0.000311431.83996503
Swap Tokens For ...217692422025-02-03 23:24:11387 days ago1738625051IN
Dexed: Router
0 ETH0.001020045.85959433
Swap ETH For Tok...217691772025-02-03 23:11:11387 days ago1738624271IN
Dexed: Router
0.004 ETH0.001411688.11277685
Swap Tokens For ...217688912025-02-03 22:13:35387 days ago1738620815IN
Dexed: Router
0 ETH0.0051202936.90838148
Swap ETH For Tok...217566592025-02-02 5:10:59388 days ago1738473059IN
Dexed: Router
0.1 ETH0.00034762.13491255
Swap Tokens For ...217444832025-01-31 12:23:35390 days ago1738326215IN
Dexed: Router
0 ETH0.000803064.37170477
Swap ETH For Tok...217442822025-01-31 11:42:47390 days ago1738323767IN
Dexed: Router
0.01 ETH0.000594193.98497481
Swap Tokens For ...217377432025-01-30 13:47:11391 days ago1738244831IN
Dexed: Router
0 ETH0.000912714.46504778
Swap ETH For Tok...217376362025-01-30 13:25:35391 days ago1738243535IN
Dexed: Router
0.01 ETH0.000802764.90004359
Swap Tokens For ...217324872025-01-29 20:10:47392 days ago1738181447IN
Dexed: Router
0 ETH0.001836618.79603863
Swap ETH For Tok...217324822025-01-29 20:09:47392 days ago1738181387IN
Dexed: Router
0.002 ETH0.001701919.26857152
Swap Tokens For ...217318622025-01-29 18:05:11392 days ago1738173911IN
Dexed: Router
0 ETH0.001063575.24002321
Swap ETH For Tok...217318562025-01-29 18:03:59392 days ago1738173839IN
Dexed: Router
0.005 ETH0.000727824.61132446
Swap Tokens For ...217311252025-01-29 15:37:23392 days ago1738165043IN
Dexed: Router
0 ETH0.000803315.54971092
Swap ETH For Tok...217311182025-01-29 15:35:59392 days ago1738164959IN
Dexed: Router
0.0001 ETH0.000784835.27729874
Swap ETH For Tok...217309852025-01-29 15:09:23392 days ago1738163363IN
Dexed: Router
0.000001 ETH0.000942525.68858382
Swap Tokens For ...217309542025-01-29 15:02:59392 days ago1738162979IN
Dexed: Router
0 ETH0.001372015.63838918
Swap Tokens For ...217309512025-01-29 15:02:23392 days ago1738162943IN
Dexed: Router
0 ETH0.00164435.54307299
Swap ETH For Tok...217309252025-01-29 14:57:11392 days ago1738162631IN
Dexed: Router
0.000001 ETH0.00092965.60654767
Swap Tokens For ...217309062025-01-29 14:53:23392 days ago1738162403IN
Dexed: Router
0 ETH0.001361345.59432046
Swap ETH For Tok...217308882025-01-29 14:49:47392 days ago1738162187IN
Dexed: Router
0.00001 ETH0.000852475.14135906
Swap Tokens For ...217308752025-01-29 14:47:11392 days ago1738162031IN
Dexed: Router
0 ETH0.001240345.09664862
Swap ETH For Tok...217308632025-01-29 14:44:35392 days ago1738161875IN
Dexed: Router
0.001 ETH0.000906075.46421188
Swap Tokens For ...217308552025-01-29 14:42:59392 days ago1738161779IN
Dexed: Router
0 ETH0.001115474.58355745
Swap ETH For Tok...217308392025-01-29 14:39:47392 days ago1738161587IN
Dexed: Router
0.001 ETH0.000799424.82106772
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Swap Exact ETH F...217728542025-02-04 11:31:47386 days ago1738668707
Dexed: Router
0.00495 ETH
Transfer217728542025-02-04 11:31:47386 days ago1738668707
Dexed: Router
0.00005 ETH
Transfer217692422025-02-03 23:24:11387 days ago1738625051
Dexed: Router
0.00297818 ETH
Swap Exact ETH F...217691772025-02-03 23:11:11387 days ago1738624271
Dexed: Router
0.00396 ETH
Transfer217691772025-02-03 23:11:11387 days ago1738624271
Dexed: Router
0.00004 ETH
Transfer217688912025-02-03 22:13:35387 days ago1738620815
Dexed: Router
0.00000927 ETH
Transfer217688912025-02-03 22:13:35387 days ago1738620815
Dexed: Router
0.00000009 ETH
Transfer217688912025-02-03 22:13:35387 days ago1738620815
Dexed: Router
0.00000937 ETH
Swap Exact ETH F...217566592025-02-02 5:10:59388 days ago1738473059
Dexed: Router
0.099 ETH
Transfer217566592025-02-02 5:10:59388 days ago1738473059
Dexed: Router
0.001 ETH
Transfer217444832025-01-31 12:23:35390 days ago1738326215
Dexed: Router
0.0100404 ETH
Transfer217444832025-01-31 12:23:35390 days ago1738326215
Dexed: Router
0.00010141 ETH
Transfer217444832025-01-31 12:23:35390 days ago1738326215
Dexed: Router
0.01014182 ETH
Swap Exact ETH F...217442822025-01-31 11:42:47390 days ago1738323767
Dexed: Router
0.0099 ETH
Transfer217442822025-01-31 11:42:47390 days ago1738323767
Dexed: Router
0.0001 ETH
Transfer217377432025-01-30 13:47:11391 days ago1738244831
Dexed: Router
0.00962632 ETH
Transfer217377432025-01-30 13:47:11391 days ago1738244831
Dexed: Router
0.00009723 ETH
Transfer217377432025-01-30 13:47:11391 days ago1738244831
Dexed: Router
0.00972356 ETH
Deposit217376362025-01-30 13:25:35391 days ago1738243535
Dexed: Router
0.0099 ETH
Transfer217376362025-01-30 13:25:35391 days ago1738243535
Dexed: Router
0.0001 ETH
Transfer217324872025-01-29 20:10:47392 days ago1738181447
Dexed: Router
0.00194845 ETH
Transfer217324872025-01-29 20:10:47392 days ago1738181447
Dexed: Router
0.00001968 ETH
Transfer217324872025-01-29 20:10:47392 days ago1738181447
Dexed: Router
0.00196813 ETH
Swap Exact ETH F...217324822025-01-29 20:09:47392 days ago1738181387
Dexed: Router
0.00198 ETH
Transfer217324822025-01-29 20:09:47392 days ago1738181387
Dexed: Router
0.00002 ETH
View All Internal Transactions
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DexedSwapServiceV1

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 1000 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol';
import "./interfaces/IWETH.sol";
import "./interfaces/Errors.sol";
import "./libraries/UniswapV2Library.sol";
import "./interfaces/IUniswapV2Pair.sol";

/**
 * @title DexedSwapServiceV1
 * @notice This contract enables swapping native ETH <-> ERC20 tokens via Uniswap V2, Uniswap V3, and KyberSwap,
 *         applying a fixed percentage fee (in ETH) on each swap.
 */
contract DexedSwapServiceV1 is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    /// @notice Address of WETH on Ethereum mainnet.
    address private constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;

    /// @notice Address of Uniswap V2 Router.
    IUniswapV2Router02 private constant uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);

    /// @notice Address of Uniswap V3 Router.
    ISwapRouter private constant uniswapV3Router = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);

    /// @notice Marketing address for receiving fees.
    address public marketingAddress;

    /// @notice Fee percentage, e.g. 100 means 1% fee.
    uint256 public feePercent = 100;

    /**
     * @notice Ensures msg.value is not zero.
     */
    modifier checkValue() {
        if (msg.value == 0) revert NoETHSent();
        _;
    }

    /**
     * @notice Ensures swap path array has at least 2 elements.
     */
    modifier checkPath(address[] calldata path) {
        if (path.length < 2) revert InvalidPath();
        _;
    }

    /**
     * @notice Constructor for DexedSwapServiceV1.
     * @param _marketingAddress Address to receive fees.
     */
    constructor(address _marketingAddress) Ownable(_marketingAddress) {
        _updateMarketingAddress(_marketingAddress);
    }

    /**
     * @notice Updates the marketing address.
     * @param _marketingAddress New marketing address.
     */
    function updateMarketingAddress(address _marketingAddress) external onlyOwner {
        _updateMarketingAddress(_marketingAddress);
    }

    /**
     * @notice Updates the fee percentage, up to a maximum of 5%.
     * @param _feePercent New fee percentage (100 = 1%, 10 = 0.1%, etc.).
     */
    function updateFeePercent(uint256 _feePercent) external onlyOwner {
        if (_feePercent > 500) revert FeeExceedsLimit();
        feePercent = _feePercent;
    }

    /**
     * @notice Swaps ETH -> Tokens on Uniswap V2, taking an ETH fee.
     * @param amountOutMin Minimum output tokens.
     * @param path Swap path (first = address(0) or WETH, last = token).
     * @param deadline Swap deadline.
     */
    function swapETHForTokensUniswapV2(
        uint256 amountOutMin,
        address[] calldata path,
        uint256 deadline
    ) external payable nonReentrant checkValue checkPath(path) {
        address[] memory realPath = _mapETHtoWETH(path);
        uint256 netAmount = _deductFee(msg.value);

        IUniswapV2Router02(uniswapV2Router).swapExactETHForTokens{value: netAmount}(
            amountOutMin,
            realPath,
            msg.sender,
            deadline
        );
    }

    /**
     * @notice Swaps Tokens -> ETH on Uniswap V2, taking a fee in ETH.
     * @param amountIn Amount of input tokens.
     * @param amountOutMin Minimum ETH out.
     * @param path Swap path (first = token, last = address(0) or WETH).
     * @param deadline Swap deadline.
     */
    function swapTokensForETHUniswapV2(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        uint256 deadline
    ) external nonReentrant checkPath(path) {
        address[] memory realPath = _mapETHtoWETH(path);

        IERC20(path[0]).safeTransferFrom(msg.sender, address(this), amountIn);
        IERC20(path[0]).safeIncreaseAllowance(address(uniswapV2Router), amountIn);

        uint256[] memory amounts = IUniswapV2Router02(uniswapV2Router).swapExactTokensForETH(
            amountIn,
            amountOutMin,
            realPath,
            address(this),
            deadline
        );

        uint256 ethOut = amounts[amounts.length - 1];
        uint256 netAmount = _deductFee(ethOut);

        (bool sent, ) = msg.sender.call{value: netAmount}("");
        if (!sent) revert TransferFailed();
    }

    /**
    * @notice Swaps a specific amount of an input token for ETH via a Uniswap V2 pair containing WETH.
    * @dev This function interacts directly with a Uniswap V2 pair to perform the swap. 
    * It expects the pair to consist of the input token and WETH, and will revert if this condition is not met.
    * Additionally, it verifies that the output amount meets the minimum requirement and correctly handles fee 
    * deduction.
    *
    * @param pair The address of the Uniswap V2 pair contract.
    * @param tokenIn The address of the token being swapped into the pair.
    * @param amountIn The amount of `tokenIn` to swap.
    * @param amountOutMin The minimum amount of ETH expected from the swap to avoid slippage.
    * @param sellTax Sell tax (1% = 100).
    *
    * @dev Reverts with `InvalidPath()` if the pair does not contain both the input token and WETH.
    * @dev Reverts with `InsufficientOutputAmount()` if the calculated output amount is less than `amountOutMin`.
    * @dev Reverts with `NoWETHSent()` if the received WETH balance is less than expected after swap.
    * @dev Reverts with `NoETHSent()` if sending ETH to the user fails.
    * 
    * @notice Ensure that the contract calling this function has approved the required `amountIn` of `tokenIn` 
    * to this contract before calling.
    */
    function swapTokensForETHViaPair(
        address pair,
        address tokenIn,
        uint256 amountIn,
        uint256 amountOutMin,
        uint16 sellTax
    ) external {
        IUniswapV2Pair pairContract = IUniswapV2Pair(pair);
        address token0 = pairContract.token0();
        address token1 = pairContract.token1();

        if ((token0 != tokenIn && token1 != tokenIn) || (token0 != WETH && token1 != WETH))
            revert InvalidPath();

        IERC20(tokenIn).safeTransferFrom(msg.sender, pair, amountIn);

        (uint112 reserve0, uint112 reserve1,) = pairContract.getReserves();
        (uint256 reserveIn, uint256 reserveOut) = (token0 == tokenIn)
            ? (reserve0, reserve1)
            : (reserve1, reserve0);
        uint256 amountOut = UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
        amountOut = amountOut - (amountOut * sellTax / 10000);
        if (amountOut < amountOutMin) revert InsufficientOutputAmount();

        (uint256 amount0Out, uint256 amount1Out) = (token0 == tokenIn)
            ? (uint256(0), amountOut)
            : (amountOut, uint256(0));
        pairContract.swap(amount0Out, amount1Out, address(this), new bytes(0));

        uint256 wethBal = IERC20(WETH).balanceOf(address(this));
        if (wethBal < amountOut) revert NoWETHSent();

        IWETH(WETH).withdraw(wethBal);
        uint256 netEthToUser = _deductFee(wethBal);

        (bool sent, ) = msg.sender.call{value: netEthToUser}("");
        if (!sent) revert NoETHSent();
    }

    /**
     * @notice Swaps ETH -> Token on Uniswap V3 using exactInputSingle.
     * @param params Encoded (tokenIn, tokenOut, fee, amountIn, minAmount).
     */
    function swapETHForTokensUniswapV3(
        bytes calldata params
    ) external payable nonReentrant checkValue {
        (address tokenIn, address tokenOut, uint24 fee, uint256 amountIn, uint256 minAmount) =
            abi.decode(params, (address, address, uint24, uint256, uint256));

        if (tokenIn != address(0)) revert InvalidAddress();

        uint256 netAmount = _deductFee(msg.value);
        if (amountIn > netAmount) revert TransferFailed();

        // Wrap netAmount in WETH
        IWETH(WETH).deposit{value: netAmount}();
        IWETH(WETH).approve(address(uniswapV3Router), netAmount);

        ISwapRouter.ExactInputSingleParams memory eisParams =
            ISwapRouter.ExactInputSingleParams({
                tokenIn: WETH,
                tokenOut: tokenOut,
                fee: fee,
                recipient: msg.sender,
                deadline: block.timestamp + 300,
                amountIn: amountIn,
                amountOutMinimum: minAmount,
                sqrtPriceLimitX96: 0
            });

        ISwapRouter(uniswapV3Router).exactInputSingle(eisParams);
    }

    /**
     * @notice Swaps Token -> ETH on Uniswap V3 using exactOutputSingle.
     * @param params Encoded (tokenIn, tokenOut, fee, amountOut).
     */
    function swapTokensForETHUniswapV3(
        bytes calldata params
    ) external nonReentrant {
        (address tokenIn, address tokenOut, uint24 fee, uint256 amountOut, uint256 amountIn) =
            abi.decode(params, (address, address, uint24, uint256, uint256));

        if (tokenOut != address(0)) revert InvalidAddress();

        // Transfer tokens from user
        IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
        IERC20(tokenIn).safeIncreaseAllowance(address(uniswapV3Router), amountIn);

        // Prepare params for exactOutputSingle
        ISwapRouter.ExactOutputSingleParams memory eosParams =
            ISwapRouter.ExactOutputSingleParams({
                tokenIn: tokenIn,
                tokenOut: WETH,
                fee: fee,
                recipient: address(this),
                deadline: block.timestamp + 1800,
                amountOut: amountOut,
                amountInMaximum: amountIn,
                sqrtPriceLimitX96: 0
            });

        ISwapRouter(uniswapV3Router).exactOutputSingle(eosParams);

        // Check WETH balance
        uint256 wethBalance = IERC20(WETH).balanceOf(address(this));
        if (wethBalance < amountOut) revert InsufficientOutputAmount();

        // Unwrap all
        IWETH(WETH).withdraw(wethBalance);

        // Deduct fee
        uint256 netAmount = _deductFee(wethBalance);

        // Send ETH to user
        (bool sent, ) = msg.sender.call{value: netAmount}("");
        if (!sent) revert TransferFailed();
    }

    /**
     * @notice Returns the amounts out for a swap on Uniswap V2 via `getAmountsOut`.
     * @dev For an ETH->Token or Token->ETH swap, replace the zero address with WETH in the path
     *      before calling this function.
     * @param amountIn Input amount.
     * @param path Swap path (length >= 2).
     * @return amounts Array of output amounts for each intermediate step.
     */
    function getAmountsOutUniswapV2(
        uint256 amountIn,
        address[] calldata path
    ) external view returns (uint[] memory amounts) {
        return IUniswapV2Router02(uniswapV2Router).getAmountsOut(amountIn, path);
    }

    /**
     * @notice Internal function that deducts fee from the given amount of ETH.
     * @param amount Amount of ETH.
     * @return netAmount Amount after deducting fee.
     */
    function _deductFee(uint256 amount) internal returns (uint256 netAmount) {
        uint256 fee = (amount * feePercent) / 10000;

        (bool sent, ) = marketingAddress.call{value: fee}("");
        if (!sent) revert TransferFailed();

        netAmount = amount - fee;
    }

    /**
     * @notice Updates the marketing address.
     * @param _marketingAddress New marketing address.
     */
    function _updateMarketingAddress(address _marketingAddress) internal {
        if (_marketingAddress == address(0)) revert InvalidAddress();
        marketingAddress = _marketingAddress;
    }

    /**
     * @notice Replaces any zero address in the path (ETH) with WETH, for Uniswap V2 swaps.
     * @param path Original path from user input.
     * @return newPath A copy where address(0) is replaced by WETH if found at start or end.
     */
    function _mapETHtoWETH(address[] calldata path) internal pure returns (address[] memory newPath) {
        newPath = new address[](path.length);
        for (uint i = 0; i < path.length; i++) {
            newPath[i] = path[i];
        }
        // If first element is zero address, replace with WETH
        if (newPath[0] == address(0)) {
            newPath[0] = WETH;
        }
        // If last element is zero address, replace with WETH
        uint lastIndex = newPath.length - 1;
        if (newPath[lastIndex] == address(0)) {
            newPath[lastIndex] = WETH;
        }
    }

    /**
     * @dev Allows receiving ETH from WETH withdraw.
     */
    receive() external payable {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @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.
 *
 * The initial owner is set to the address provided by the deployer. 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.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 4 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 5 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 13 of 18 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

File 15 of 18 : Errors.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.24;

/**
 * @dev Custom errors.
 */
error InvalidAddress();
error TransferFailed();
error InsufficientOutputAmount();
error NoETHSent();
error NoWETHSent();
error InvalidPath();
error FeeExceedsLimit();

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.24;

interface IUniswapV2Pair {
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (
        uint112 _reserve0,
        uint112 _reserve1,
        uint32 _blockTimestampLast
    );
    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWETH is IERC20 {
    function deposit() external payable;
    function withdraw(uint256 wad) external;
}

File 18 of 18 : UniswapV2Library.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.24;

library UniswapV2Library {
    // Классическая формула Uniswap V2 (без учёта fee-on-transfer внутри пула)
    function getAmountOut(
        uint256 amountIn,
        uint256 reserveIn,
        uint256 reserveOut
    ) internal pure returns (uint256 amountOut) {
        // В обычной Uniswap V2 (0.3% fee) множитель 997, здесь — 1000 - 3 = 997
        // Если фи другая — подставьте нужные числа
        uint256 amountInWithFee = amountIn * 997;
        uint256 numerator = amountInWithFee * reserveOut;
        uint256 denominator = reserveIn * 1000 + amountInWithFee;
        amountOut = numerator / denominator;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_marketingAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"FeeExceedsLimit","type":"error"},{"inputs":[],"name":"InsufficientOutputAmount","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidPath","type":"error"},{"inputs":[],"name":"NoETHSent","type":"error"},{"inputs":[],"name":"NoWETHSent","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"feePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOutUniswapV2","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketingAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapETHForTokensUniswapV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"params","type":"bytes"}],"name":"swapETHForTokensUniswapV3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapTokensForETHUniswapV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"params","type":"bytes"}],"name":"swapTokensForETHUniswapV3","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pair","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"uint16","name":"sellTax","type":"uint16"}],"name":"swapTokensForETHViaPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feePercent","type":"uint256"}],"name":"updateFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_marketingAddress","type":"address"}],"name":"updateMarketingAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052606460035534801561001557600080fd5b5060405161214238038061214283398101604081905261003491610119565b806001600160a01b03811661006357604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61006c81610080565b506001805561007a816100d0565b50610149565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381166100f75760405163e6c4247b60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561012b57600080fd5b81516001600160a01b038116811461014257600080fd5b9392505050565b611fea806101586000396000f3fe6080604052600436106100d65760003560e01c80638da5cb5b1161007f578063f05c5fed11610059578063f05c5fed14610214578063f2fde38b14610234578063f97b04e514610254578063fc7fb4991461027457600080fd5b80638da5cb5b146101955780639023e182146101c7578063a5ece941146101f457600080fd5b806362192f34116100b057806362192f3414610144578063715018a6146101575780637fd6f15c1461016c57600080fd5b80632369bf83146100e25780634215c1e91461010457806344dba3801461012457600080fd5b366100dd57005b600080fd5b3480156100ee57600080fd5b506101026100fd366004611876565b610287565b005b34801561011057600080fd5b5061010261011f36600461189a565b61029b565b34801561013057600080fd5b5061010261013f36600461194c565b610787565b6101026101523660046119a7565b6109ae565b34801561016357600080fd5b50610102610c55565b34801561017857600080fd5b5061018260035481565b6040519081526020015b60405180910390f35b3480156101a157600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161018c565b3480156101d357600080fd5b506101e76101e2366004611a1b565b610c69565b60405161018c9190611a67565b34801561020057600080fd5b506002546101af906001600160a01b031681565b34801561022057600080fd5b5061010261022f366004611aaa565b610d0d565b34801561024057600080fd5b5061010261024f366004611876565b610d56565b34801561026057600080fd5b5061010261026f3660046119a7565b610daf565b610102610282366004611ac3565b6110bd565b61028f6111d9565b6102988161121f565b50565b60008590506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103049190611b16565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036a9190611b16565b9050866001600160a01b0316826001600160a01b0316141580156103a05750866001600160a01b0316816001600160a01b031614155b806103f057506001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015906103f057506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214155b1561040e576040516320db826760e01b815260040160405180910390fd5b6104236001600160a01b038816338a89611275565b600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610464573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104889190611b56565b50915091506000808a6001600160a01b0316866001600160a01b0316146104b05782846104b3565b83835b6dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060006104e48b84846112f1565b90506127106104f761ffff8b1683611bbc565b6105019190611bd3565b61050b9082611bf5565b90508981101561052e576040516342301c2360e01b815260040160405180910390fd5b6000808d6001600160a01b0316896001600160a01b03161461055257826000610556565b6000835b604080516000815260208101918290527f022c0d9f0000000000000000000000000000000000000000000000000000000090915291935091506001600160a01b038b169063022c0d9f906105b39085908590309060248101611c1e565b600060405180830381600087803b1580156105cd57600080fd5b505af11580156105e1573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526000925073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc291506370a0823190602401602060405180830381865afa158015610637573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065b9190611c8a565b905083811015610697576040517fbc9fcb4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156106e457600080fd5b505af11580156106f8573d6000803e3d6000fd5b50505050600061070782611340565b604051909150600090339083908381818185875af1925050503d806000811461074c576040519150601f19603f3d011682016040523d82523d6000602084013e610751565b606091505b505090508061077357604051630b7cc7c360e11b815260040160405180910390fd5b505050505050505050505050505050505050565b61078f6113e1565b828260028110156107b3576040516320db826760e01b815260040160405180910390fd5b60006107bf8686611424565b905061080033308a898960008181106107da576107da611ca3565b90506020020160208101906107ef9190611876565b6001600160a01b0316929190611275565b610851737a250d5630b4cf539739df2c5dacb4c659f2488d898888600081811061082c5761082c611ca3565b90506020020160208101906108419190611876565b6001600160a01b031691906115e1565b6040517f18cbafe5000000000000000000000000000000000000000000000000000000008152600090737a250d5630b4cf539739df2c5dacb4c659f2488d906318cbafe5906108ac908c908c90879030908c90600401611cfe565b6000604051808303816000875af11580156108cb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108f39190810190611d3a565b9050600081600183516109069190611bf5565b8151811061091657610916611ca3565b60200260200101519050600061092b82611340565b604051909150600090339083908381818185875af1925050503d8060008114610970576040519150601f19603f3d011682016040523d82523d6000602084013e610975565b606091505b5050905080610997576040516312171d8360e31b815260040160405180910390fd5b505050505050506109a760018055565b5050505050565b6109b66113e1565b346000036109d757604051630b7cc7c360e11b815260040160405180910390fd5b6000808080806109e986880188611e07565b9398509196509450925090506001600160a01b03851615610a1d5760405163e6c4247b60e01b815260040160405180910390fd5b6000610a2834611340565b905080831115610a4b576040516312171d8360e31b815260040160405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610a9a57600080fd5b505af1158015610aae573d6000803e3d6000fd5b505060405163095ea7b360e01b815273e592427a0aece92de3edee1f18e0157c0586156460048201526024810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b3925060440190506020604051808303816000875af1158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611e6a565b50604080516101008101825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281526001600160a01b038716602082015262ffffff86169181019190915233606082015260009060808101610b9c4261012c611e8c565b815260200185815260200184815260200160006001600160a01b0316815250905073e592427a0aece92de3edee1f18e0157c058615646001600160a01b031663414bf389826040518263ffffffff1660e01b8152600401610bfd9190611f26565b6020604051808303816000875af1158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c409190611c8a565b5050505050505050610c5160018055565b5050565b610c5d6111d9565b610c676000611684565b565b6040517fd06ca61f000000000000000000000000000000000000000000000000000000008152606090737a250d5630b4cf539739df2c5dacb4c659f2488d9063d06ca61f90610cc090879087908790600401611f35565b600060405180830381865afa158015610cdd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d059190810190611d3a565b949350505050565b610d156111d9565b6101f4811115610d51576040517f25ef66ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600355565b610d5e6111d9565b6001600160a01b038116610da6576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b61029881611684565b610db76113e1565b600080808080610dc986880188611e07565b9398509196509450925090506001600160a01b03841615610dfd5760405163e6c4247b60e01b815260040160405180910390fd5b610e126001600160a01b038616333084611275565b610e3a6001600160a01b03861673e592427a0aece92de3edee1f18e0157c05861564836115e1565b60408051610100810182526001600160a01b038716815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2602082015262ffffff85169181019190915230606082015260009060808101610e9142610708611e8c565b815260200184815260200183815260200160006001600160a01b0316815250905073e592427a0aece92de3edee1f18e0157c058615646001600160a01b031663db3e2198826040518263ffffffff1660e01b8152600401610ef29190611f26565b6020604051808303816000875af1158015610f11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f359190611c8a565b506040516370a0823160e01b815230600482015260009073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a0823190602401602060405180830381865afa158015610f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fac9190611c8a565b905083811015610fcf576040516342301c2360e01b815260040160405180910390fd5b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561101c57600080fd5b505af1158015611030573d6000803e3d6000fd5b50505050600061103f82611340565b604051909150600090339083908381818185875af1925050503d8060008114611084576040519150601f19603f3d011682016040523d82523d6000602084013e611089565b606091505b50509050806110ab576040516312171d8360e31b815260040160405180910390fd5b505050505050505050610c5160018055565b6110c56113e1565b346000036110e657604051630b7cc7c360e11b815260040160405180910390fd5b8282600281101561110a576040516320db826760e01b815260040160405180910390fd5b60006111168686611424565b9050600061112334611340565b6040517f7ff36ab5000000000000000000000000000000000000000000000000000000008152909150737a250d5630b4cf539739df2c5dacb4c659f2488d90637ff36ab590839061117e908c90879033908c90600401611f7f565b60006040518083038185885af115801561119c573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526111c59190810190611d3a565b50505050506111d360018055565b50505050565b6000546001600160a01b03163314610c67576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610d9d565b6001600160a01b0381166112465760405163e6c4247b60e01b815260040160405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6040516001600160a01b0384811660248301528381166044830152606482018390526111d39186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506116e1565b600080611300856103e5611bbc565b9050600061130e8483611bbc565b905060008261131f876103e8611bbc565b6113299190611e8c565b90506113358183611bd3565b979650505050505050565b600080612710600354846113549190611bbc565b61135e9190611bd3565b6002546040519192506000916001600160a01b039091169083908381818185875af1925050503d80600081146113b0576040519150601f19603f3d011682016040523d82523d6000602084013e6113b5565b606091505b50509050806113d7576040516312171d8360e31b815260040160405180910390fd5b610d058285611bf5565b60026001540361141d576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b60608167ffffffffffffffff81111561143f5761143f611c08565b604051908082528060200260200182016040528015611468578160200160208202803683370190505b50905060005b828110156114cf5783838281811061148857611488611ca3565b905060200201602081019061149d9190611876565b8282815181106114af576114af611ca3565b6001600160a01b039092166020928302919091019091015260010161146e565b5060006001600160a01b0316816000815181106114ee576114ee611ca3565b60200260200101516001600160a01b03160361154d5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160008151811061152c5761152c611ca3565b60200260200101906001600160a01b031690816001600160a01b0316815250505b60006001825161155d9190611bf5565b905060006001600160a01b031682828151811061157c5761157c611ca3565b60200260200101516001600160a01b0316036115da5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28282815181106115b9576115b9611ca3565b60200260200101906001600160a01b031690816001600160a01b0316815250505b5092915050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa15801561164a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166e9190611c8a565b90506111d3848461167f8585611e8c565b61176b565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080602060008451602086016000885af180611704576040513d6000823e3d81fd5b50506000513d9150811561171c578060011415611729565b6001600160a01b0384163b155b156111d3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d9d565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b1790526117d18482611810565b6111d3576040516001600160a01b0384811660248301526000604483015261180691869182169063095ea7b3906064016112aa565b6111d384826116e1565b6000806000806020600086516020880160008a5af192503d91506000519050828015611855575081156118465780600114611855565b6000866001600160a01b03163b115b93505050505b92915050565b6001600160a01b038116811461029857600080fd5b60006020828403121561188857600080fd5b813561189381611861565b9392505050565b600080600080600060a086880312156118b257600080fd5b85356118bd81611861565b945060208601356118cd81611861565b93506040860135925060608601359150608086013561ffff811681146118f257600080fd5b809150509295509295909350565b60008083601f84011261191257600080fd5b50813567ffffffffffffffff81111561192a57600080fd5b6020830191508360208260051b850101111561194557600080fd5b9250929050565b60008060008060006080868803121561196457600080fd5b8535945060208601359350604086013567ffffffffffffffff81111561198957600080fd5b61199588828901611900565b96999598509660600135949350505050565b600080602083850312156119ba57600080fd5b823567ffffffffffffffff8111156119d157600080fd5b8301601f810185136119e257600080fd5b803567ffffffffffffffff8111156119f957600080fd5b856020828401011115611a0b57600080fd5b6020919091019590945092505050565b600080600060408486031215611a3057600080fd5b83359250602084013567ffffffffffffffff811115611a4e57600080fd5b611a5a86828701611900565b9497909650939450505050565b602080825282518282018190526000918401906040840190835b81811015611a9f578351835260209384019390920191600101611a81565b509095945050505050565b600060208284031215611abc57600080fd5b5035919050565b60008060008060608587031215611ad957600080fd5b84359350602085013567ffffffffffffffff811115611af757600080fd5b611b0387828801611900565b9598909750949560400135949350505050565b600060208284031215611b2857600080fd5b815161189381611861565b80516dffffffffffffffffffffffffffff81168114611b5157600080fd5b919050565b600080600060608486031215611b6b57600080fd5b611b7484611b33565b9250611b8260208501611b33565b9150604084015163ffffffff81168114611b9b57600080fd5b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761185b5761185b611ba6565b600082611bf057634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561185b5761185b611ba6565b634e487b7160e01b600052604160045260246000fd5b8481528360208201526001600160a01b0383166040820152608060608201526000825180608084015260005b81811015611c6757602081860181015160a0868401015201611c4a565b50600060a0828501015260a0601f19601f83011684010191505095945050505050565b600060208284031215611c9c57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020840193506020830160005b82811015611cf45781516001600160a01b0316865260209586019590910190600101611ccd565b5093949350505050565b85815284602082015260a060408201526000611d1d60a0830186611cb9565b6001600160a01b0394909416606083015250608001529392505050565b600060208284031215611d4c57600080fd5b815167ffffffffffffffff811115611d6357600080fd5b8201601f81018413611d7457600080fd5b805167ffffffffffffffff811115611d8e57611d8e611c08565b8060051b604051601f19603f830116810181811067ffffffffffffffff82111715611dbb57611dbb611c08565b604052918252602081840181019290810187841115611dd957600080fd5b6020850194505b83851015611dfc57845180825260209586019590935001611de0565b509695505050505050565b600080600080600060a08688031215611e1f57600080fd5b8535611e2a81611861565b94506020860135611e3a81611861565b9350604086013562ffffff81168114611e5257600080fd5b94979396509394606081013594506080013592915050565b600060208284031215611e7c57600080fd5b8151801515811461189357600080fd5b8082018082111561185b5761185b611ba6565b6001600160a01b0381511682526001600160a01b03602082015116602083015262ffffff60408201511660408301526060810151611ee860608401826001600160a01b03169052565b506080810151608083015260a081015160a083015260c081015160c083015260e0810151611f2160e08401826001600160a01b03169052565b505050565b610100810161185b8284611e9f565b838152604060208201819052810182905260008360608301825b85811015611dfc578235611f6281611861565b6001600160a01b0316825260209283019290910190600101611f4f565b848152608060208201526000611f986080830186611cb9565b6001600160a01b0394909416604083015250606001529291505056fea26469706673582212201f5d95ff350fbd48fa3cd972cb81a418bac8ec3d07f0893d8c013063f834d7dc64736f6c634300081c0033000000000000000000000000b8a7614e68b4fe36489f7a4d793d6d92474f4daa

Deployed Bytecode

0x6080604052600436106100d65760003560e01c80638da5cb5b1161007f578063f05c5fed11610059578063f05c5fed14610214578063f2fde38b14610234578063f97b04e514610254578063fc7fb4991461027457600080fd5b80638da5cb5b146101955780639023e182146101c7578063a5ece941146101f457600080fd5b806362192f34116100b057806362192f3414610144578063715018a6146101575780637fd6f15c1461016c57600080fd5b80632369bf83146100e25780634215c1e91461010457806344dba3801461012457600080fd5b366100dd57005b600080fd5b3480156100ee57600080fd5b506101026100fd366004611876565b610287565b005b34801561011057600080fd5b5061010261011f36600461189a565b61029b565b34801561013057600080fd5b5061010261013f36600461194c565b610787565b6101026101523660046119a7565b6109ae565b34801561016357600080fd5b50610102610c55565b34801561017857600080fd5b5061018260035481565b6040519081526020015b60405180910390f35b3480156101a157600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161018c565b3480156101d357600080fd5b506101e76101e2366004611a1b565b610c69565b60405161018c9190611a67565b34801561020057600080fd5b506002546101af906001600160a01b031681565b34801561022057600080fd5b5061010261022f366004611aaa565b610d0d565b34801561024057600080fd5b5061010261024f366004611876565b610d56565b34801561026057600080fd5b5061010261026f3660046119a7565b610daf565b610102610282366004611ac3565b6110bd565b61028f6111d9565b6102988161121f565b50565b60008590506000816001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103049190611b16565b90506000826001600160a01b031663d21220a76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610346573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036a9190611b16565b9050866001600160a01b0316826001600160a01b0316141580156103a05750866001600160a01b0316816001600160a01b031614155b806103f057506001600160a01b03821673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2148015906103f057506001600160a01b03811673c02aaa39b223fe8d0a0e5c4f27ead9083c756cc214155b1561040e576040516320db826760e01b815260040160405180910390fd5b6104236001600160a01b038816338a89611275565b600080846001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015610464573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104889190611b56565b50915091506000808a6001600160a01b0316866001600160a01b0316146104b05782846104b3565b83835b6dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060006104e48b84846112f1565b90506127106104f761ffff8b1683611bbc565b6105019190611bd3565b61050b9082611bf5565b90508981101561052e576040516342301c2360e01b815260040160405180910390fd5b6000808d6001600160a01b0316896001600160a01b03161461055257826000610556565b6000835b604080516000815260208101918290527f022c0d9f0000000000000000000000000000000000000000000000000000000090915291935091506001600160a01b038b169063022c0d9f906105b39085908590309060248101611c1e565b600060405180830381600087803b1580156105cd57600080fd5b505af11580156105e1573d6000803e3d6000fd5b50506040516370a0823160e01b81523060048201526000925073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc291506370a0823190602401602060405180830381865afa158015610637573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065b9190611c8a565b905083811015610697576040517fbc9fcb4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b1580156106e457600080fd5b505af11580156106f8573d6000803e3d6000fd5b50505050600061070782611340565b604051909150600090339083908381818185875af1925050503d806000811461074c576040519150601f19603f3d011682016040523d82523d6000602084013e610751565b606091505b505090508061077357604051630b7cc7c360e11b815260040160405180910390fd5b505050505050505050505050505050505050565b61078f6113e1565b828260028110156107b3576040516320db826760e01b815260040160405180910390fd5b60006107bf8686611424565b905061080033308a898960008181106107da576107da611ca3565b90506020020160208101906107ef9190611876565b6001600160a01b0316929190611275565b610851737a250d5630b4cf539739df2c5dacb4c659f2488d898888600081811061082c5761082c611ca3565b90506020020160208101906108419190611876565b6001600160a01b031691906115e1565b6040517f18cbafe5000000000000000000000000000000000000000000000000000000008152600090737a250d5630b4cf539739df2c5dacb4c659f2488d906318cbafe5906108ac908c908c90879030908c90600401611cfe565b6000604051808303816000875af11580156108cb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108f39190810190611d3a565b9050600081600183516109069190611bf5565b8151811061091657610916611ca3565b60200260200101519050600061092b82611340565b604051909150600090339083908381818185875af1925050503d8060008114610970576040519150601f19603f3d011682016040523d82523d6000602084013e610975565b606091505b5050905080610997576040516312171d8360e31b815260040160405180910390fd5b505050505050506109a760018055565b5050505050565b6109b66113e1565b346000036109d757604051630b7cc7c360e11b815260040160405180910390fd5b6000808080806109e986880188611e07565b9398509196509450925090506001600160a01b03851615610a1d5760405163e6c4247b60e01b815260040160405180910390fd5b6000610a2834611340565b905080831115610a4b576040516312171d8360e31b815260040160405180910390fd5b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610a9a57600080fd5b505af1158015610aae573d6000803e3d6000fd5b505060405163095ea7b360e01b815273e592427a0aece92de3edee1f18e0157c0586156460048201526024810185905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2935063095ea7b3925060440190506020604051808303816000875af1158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611e6a565b50604080516101008101825273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281526001600160a01b038716602082015262ffffff86169181019190915233606082015260009060808101610b9c4261012c611e8c565b815260200185815260200184815260200160006001600160a01b0316815250905073e592427a0aece92de3edee1f18e0157c058615646001600160a01b031663414bf389826040518263ffffffff1660e01b8152600401610bfd9190611f26565b6020604051808303816000875af1158015610c1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c409190611c8a565b5050505050505050610c5160018055565b5050565b610c5d6111d9565b610c676000611684565b565b6040517fd06ca61f000000000000000000000000000000000000000000000000000000008152606090737a250d5630b4cf539739df2c5dacb4c659f2488d9063d06ca61f90610cc090879087908790600401611f35565b600060405180830381865afa158015610cdd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610d059190810190611d3a565b949350505050565b610d156111d9565b6101f4811115610d51576040517f25ef66ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600355565b610d5e6111d9565b6001600160a01b038116610da6576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b61029881611684565b610db76113e1565b600080808080610dc986880188611e07565b9398509196509450925090506001600160a01b03841615610dfd5760405163e6c4247b60e01b815260040160405180910390fd5b610e126001600160a01b038616333084611275565b610e3a6001600160a01b03861673e592427a0aece92de3edee1f18e0157c05861564836115e1565b60408051610100810182526001600160a01b038716815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2602082015262ffffff85169181019190915230606082015260009060808101610e9142610708611e8c565b815260200184815260200183815260200160006001600160a01b0316815250905073e592427a0aece92de3edee1f18e0157c058615646001600160a01b031663db3e2198826040518263ffffffff1660e01b8152600401610ef29190611f26565b6020604051808303816000875af1158015610f11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f359190611c8a565b506040516370a0823160e01b815230600482015260009073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2906370a0823190602401602060405180830381865afa158015610f88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fac9190611c8a565b905083811015610fcf576040516342301c2360e01b815260040160405180910390fd5b604051632e1a7d4d60e01b81526004810182905273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc290632e1a7d4d90602401600060405180830381600087803b15801561101c57600080fd5b505af1158015611030573d6000803e3d6000fd5b50505050600061103f82611340565b604051909150600090339083908381818185875af1925050503d8060008114611084576040519150601f19603f3d011682016040523d82523d6000602084013e611089565b606091505b50509050806110ab576040516312171d8360e31b815260040160405180910390fd5b505050505050505050610c5160018055565b6110c56113e1565b346000036110e657604051630b7cc7c360e11b815260040160405180910390fd5b8282600281101561110a576040516320db826760e01b815260040160405180910390fd5b60006111168686611424565b9050600061112334611340565b6040517f7ff36ab5000000000000000000000000000000000000000000000000000000008152909150737a250d5630b4cf539739df2c5dacb4c659f2488d90637ff36ab590839061117e908c90879033908c90600401611f7f565b60006040518083038185885af115801561119c573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526111c59190810190611d3a565b50505050506111d360018055565b50505050565b6000546001600160a01b03163314610c67576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610d9d565b6001600160a01b0381166112465760405163e6c4247b60e01b815260040160405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6040516001600160a01b0384811660248301528381166044830152606482018390526111d39186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506116e1565b600080611300856103e5611bbc565b9050600061130e8483611bbc565b905060008261131f876103e8611bbc565b6113299190611e8c565b90506113358183611bd3565b979650505050505050565b600080612710600354846113549190611bbc565b61135e9190611bd3565b6002546040519192506000916001600160a01b039091169083908381818185875af1925050503d80600081146113b0576040519150601f19603f3d011682016040523d82523d6000602084013e6113b5565b606091505b50509050806113d7576040516312171d8360e31b815260040160405180910390fd5b610d058285611bf5565b60026001540361141d576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600155565b60608167ffffffffffffffff81111561143f5761143f611c08565b604051908082528060200260200182016040528015611468578160200160208202803683370190505b50905060005b828110156114cf5783838281811061148857611488611ca3565b905060200201602081019061149d9190611876565b8282815181106114af576114af611ca3565b6001600160a01b039092166020928302919091019091015260010161146e565b5060006001600160a01b0316816000815181106114ee576114ee611ca3565b60200260200101516001600160a01b03160361154d5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28160008151811061152c5761152c611ca3565b60200260200101906001600160a01b031690816001600160a01b0316815250505b60006001825161155d9190611bf5565b905060006001600160a01b031682828151811061157c5761157c611ca3565b60200260200101516001600160a01b0316036115da5773c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28282815181106115b9576115b9611ca3565b60200260200101906001600160a01b031690816001600160a01b0316815250505b5092915050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa15801561164a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166e9190611c8a565b90506111d3848461167f8585611e8c565b61176b565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080602060008451602086016000885af180611704576040513d6000823e3d81fd5b50506000513d9150811561171c578060011415611729565b6001600160a01b0384163b155b156111d3576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b0385166004820152602401610d9d565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663095ea7b360e01b1790526117d18482611810565b6111d3576040516001600160a01b0384811660248301526000604483015261180691869182169063095ea7b3906064016112aa565b6111d384826116e1565b6000806000806020600086516020880160008a5af192503d91506000519050828015611855575081156118465780600114611855565b6000866001600160a01b03163b115b93505050505b92915050565b6001600160a01b038116811461029857600080fd5b60006020828403121561188857600080fd5b813561189381611861565b9392505050565b600080600080600060a086880312156118b257600080fd5b85356118bd81611861565b945060208601356118cd81611861565b93506040860135925060608601359150608086013561ffff811681146118f257600080fd5b809150509295509295909350565b60008083601f84011261191257600080fd5b50813567ffffffffffffffff81111561192a57600080fd5b6020830191508360208260051b850101111561194557600080fd5b9250929050565b60008060008060006080868803121561196457600080fd5b8535945060208601359350604086013567ffffffffffffffff81111561198957600080fd5b61199588828901611900565b96999598509660600135949350505050565b600080602083850312156119ba57600080fd5b823567ffffffffffffffff8111156119d157600080fd5b8301601f810185136119e257600080fd5b803567ffffffffffffffff8111156119f957600080fd5b856020828401011115611a0b57600080fd5b6020919091019590945092505050565b600080600060408486031215611a3057600080fd5b83359250602084013567ffffffffffffffff811115611a4e57600080fd5b611a5a86828701611900565b9497909650939450505050565b602080825282518282018190526000918401906040840190835b81811015611a9f578351835260209384019390920191600101611a81565b509095945050505050565b600060208284031215611abc57600080fd5b5035919050565b60008060008060608587031215611ad957600080fd5b84359350602085013567ffffffffffffffff811115611af757600080fd5b611b0387828801611900565b9598909750949560400135949350505050565b600060208284031215611b2857600080fd5b815161189381611861565b80516dffffffffffffffffffffffffffff81168114611b5157600080fd5b919050565b600080600060608486031215611b6b57600080fd5b611b7484611b33565b9250611b8260208501611b33565b9150604084015163ffffffff81168114611b9b57600080fd5b809150509250925092565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761185b5761185b611ba6565b600082611bf057634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561185b5761185b611ba6565b634e487b7160e01b600052604160045260246000fd5b8481528360208201526001600160a01b0383166040820152608060608201526000825180608084015260005b81811015611c6757602081860181015160a0868401015201611c4a565b50600060a0828501015260a0601f19601f83011684010191505095945050505050565b600060208284031215611c9c57600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b600081518084526020840193506020830160005b82811015611cf45781516001600160a01b0316865260209586019590910190600101611ccd565b5093949350505050565b85815284602082015260a060408201526000611d1d60a0830186611cb9565b6001600160a01b0394909416606083015250608001529392505050565b600060208284031215611d4c57600080fd5b815167ffffffffffffffff811115611d6357600080fd5b8201601f81018413611d7457600080fd5b805167ffffffffffffffff811115611d8e57611d8e611c08565b8060051b604051601f19603f830116810181811067ffffffffffffffff82111715611dbb57611dbb611c08565b604052918252602081840181019290810187841115611dd957600080fd5b6020850194505b83851015611dfc57845180825260209586019590935001611de0565b509695505050505050565b600080600080600060a08688031215611e1f57600080fd5b8535611e2a81611861565b94506020860135611e3a81611861565b9350604086013562ffffff81168114611e5257600080fd5b94979396509394606081013594506080013592915050565b600060208284031215611e7c57600080fd5b8151801515811461189357600080fd5b8082018082111561185b5761185b611ba6565b6001600160a01b0381511682526001600160a01b03602082015116602083015262ffffff60408201511660408301526060810151611ee860608401826001600160a01b03169052565b506080810151608083015260a081015160a083015260c081015160c083015260e0810151611f2160e08401826001600160a01b03169052565b505050565b610100810161185b8284611e9f565b838152604060208201819052810182905260008360608301825b85811015611dfc578235611f6281611861565b6001600160a01b0316825260209283019290910190600101611f4f565b848152608060208201526000611f986080830186611cb9565b6001600160a01b0394909416604083015250606001529291505056fea26469706673582212201f5d95ff350fbd48fa3cd972cb81a418bac8ec3d07f0893d8c013063f834d7dc64736f6c634300081c0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000b8a7614e68b4fe36489f7a4d793d6d92474f4daa

-----Decoded View---------------
Arg [0] : _marketingAddress (address): 0xb8A7614e68B4fe36489F7A4d793d6d92474f4daA

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b8a7614e68b4fe36489f7a4d793d6d92474f4daa


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

Dexed.com - Discover and trade Ethereum gems

Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.