ETH Price: $2,294.61 (-3.08%)

Contract

0x4c4AF8DBc524681930a27b2F1Af5bcC8062E6fB7

Overview

ETH Balance

0.000119232666551936 ETH

ETH Value

$0.27 (@ $2,294.61/ETH)

Token Holdings

Transaction Hash
Method
Block
From
To
Swap1255397052024-09-18 16:49:4725 mins ago1726678187IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000124433130.04698221
Swap1255396752024-09-18 16:48:4726 mins ago1726678127IN
0x4c4AF8DB...8062E6fB7
0.435121 ETH0.0000128466250.04719454
Swap1255390862024-09-18 16:29:0945 mins ago1726676949IN
0x4c4AF8DB...8062E6fB7
0.002 ETH0.0000071031510.03252944
Swap1255385872024-09-18 16:12:311 hr ago1726675951IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000066419640.02558067
Swap1255361962024-09-18 14:52:492 hrs ago1726671169IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000037449990.01747413
Swap1255350252024-09-18 14:13:473 hrs ago1726668827IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000021754820.01000056
Swap1255349362024-09-18 14:10:493 hrs ago1726668649IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000021384970.0098574
Swap1255348942024-09-18 14:09:253 hrs ago1726668565IN
0x4c4AF8DB...8062E6fB7
0.034618 ETH0.0000019987480.00969093
Swap1255347332024-09-18 14:04:033 hrs ago1726668243IN
0x4c4AF8DB...8062E6fB7
0.059497 ETH0.0000019706030.00879431
Swap1255326122024-09-18 12:53:214 hrs ago1726664001IN
0x4c4AF8DB...8062E6fB7
0.165726 ETH0.0000012032420.00429253
Swap1255326062024-09-18 12:53:094 hrs ago1726663989IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000008688550.00313131
Swap1255323912024-09-18 12:45:594 hrs ago1726663559IN
0x4c4AF8DB...8062E6fB7
0.172162 ETH0.0000011164970.00398243
Swap1255323162024-09-18 12:43:294 hrs ago1726663409IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000006449220.00292454
Swap1255322832024-09-18 12:42:234 hrs ago1726663343IN
0x4c4AF8DB...8062E6fB7
0.04517 ETH0.0000006684710.00287454
Swap1255291072024-09-18 10:56:316 hrs ago1726656991IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000003838710.00161443
Swap1255260752024-09-18 9:15:277 hrs ago1726650927IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000006249540.00218317
Swap1255260562024-09-18 9:14:497 hrs ago1726650889IN
0x4c4AF8DB...8062E6fB7
0.387458 ETH0.0000006506680.00217779
Swap1255255372024-09-18 8:57:318 hrs ago1726649851IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000004091230.00161496
Swap1255254612024-09-18 8:54:598 hrs ago1726649699IN
0x4c4AF8DB...8062E6fB7
0.000304 ETH0.0000004208290.001594
Swap1255252492024-09-18 8:47:558 hrs ago1726649275IN
0x4c4AF8DB...8062E6fB7
0.355 ETH0.0000001458630.00026402
Swap1255252312024-09-18 8:47:198 hrs ago1726649239IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000001336320.00026467
Swap1255252002024-09-18 8:46:178 hrs ago1726649177IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000004010860.00159551
Swap1255251612024-09-18 8:44:598 hrs ago1726649099IN
0x4c4AF8DB...8062E6fB7
0.000644 ETH0.0000004281880.00159664
Swap1255250802024-09-18 8:42:178 hrs ago1726648937IN
0x4c4AF8DB...8062E6fB7
0 ETH0.000000154560.00026922
Swap1255230492024-09-18 7:34:359 hrs ago1726644875IN
0x4c4AF8DB...8062E6fB7
0 ETH0.0000001534350.00034036
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
1255397052024-09-18 16:49:4725 mins ago1726678187
0x4c4AF8DB...8062E6fB7
0.434021165035786 ETH
1255397052024-09-18 16:49:4725 mins ago1726678187
0x4c4AF8DB...8062E6fB7
0.434021165035786 ETH
1255396752024-09-18 16:48:4726 mins ago1726678127
0x4c4AF8DB...8062E6fB7
0.435121 ETH
1255390862024-09-18 16:29:0945 mins ago1726676949
0x4c4AF8DB...8062E6fB7
0.002 ETH
1255361962024-09-18 14:52:492 hrs ago1726671169
0x4c4AF8DB...8062E6fB7
0.001025237384322 ETH
1255361962024-09-18 14:52:492 hrs ago1726671169
0x4c4AF8DB...8062E6fB7
0.001025237384322 ETH
1255350252024-09-18 14:13:473 hrs ago1726668827
0x4c4AF8DB...8062E6fB7
0.078037509354074 ETH
1255350252024-09-18 14:13:473 hrs ago1726668827
0x4c4AF8DB...8062E6fB7
0.078037509354074 ETH
1255349362024-09-18 14:10:493 hrs ago1726668649
0x4c4AF8DB...8062E6fB7
0.034507340840396 ETH
1255349362024-09-18 14:10:493 hrs ago1726668649
0x4c4AF8DB...8062E6fB7
0.034507340840396 ETH
1255348942024-09-18 14:09:253 hrs ago1726668565
0x4c4AF8DB...8062E6fB7
0.034618 ETH
1255347332024-09-18 14:04:033 hrs ago1726668243
0x4c4AF8DB...8062E6fB7
0.059497 ETH
1255326122024-09-18 12:53:214 hrs ago1726664001
0x4c4AF8DB...8062E6fB7
0.165726 ETH
1255326062024-09-18 12:53:094 hrs ago1726663989
0x4c4AF8DB...8062E6fB7
0.088416442015714 ETH
1255326062024-09-18 12:53:094 hrs ago1726663989
0x4c4AF8DB...8062E6fB7
0.088416442015714 ETH
1255323912024-09-18 12:45:594 hrs ago1726663559
0x4c4AF8DB...8062E6fB7
0.172162 ETH
1255323162024-09-18 12:43:294 hrs ago1726663409
0x4c4AF8DB...8062E6fB7
0.045079675191952 ETH
1255323162024-09-18 12:43:294 hrs ago1726663409
0x4c4AF8DB...8062E6fB7
0.045079675191952 ETH
1255322832024-09-18 12:42:234 hrs ago1726663343
0x4c4AF8DB...8062E6fB7
0.04517 ETH
1255291072024-09-18 10:56:316 hrs ago1726656991
0x4c4AF8DB...8062E6fB7
0.004967240635543 ETH
1255291072024-09-18 10:56:316 hrs ago1726656991
0x4c4AF8DB...8062E6fB7
0.004967240635543 ETH
1255260752024-09-18 9:15:277 hrs ago1726650927
0x4c4AF8DB...8062E6fB7
0.386536317262663 ETH
1255260752024-09-18 9:15:277 hrs ago1726650927
0x4c4AF8DB...8062E6fB7
0.386536317262663 ETH
1255260562024-09-18 9:14:497 hrs ago1726650889
0x4c4AF8DB...8062E6fB7
0.387458 ETH
1255255372024-09-18 8:57:318 hrs ago1726649851
0x4c4AF8DB...8062E6fB7
0.000303393289557 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WooRouterV2

Compiler Version
v0.8.14+commit.80d49f37

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 12 : WooRouterV2.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import "./interfaces/IWooPPV2.sol";
import "./interfaces/IWETH.sol";
import "./interfaces/IWooRouterV2.sol";

import "./libraries/TransferHelper.sol";

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

/// @title Woo Router V2 implementation.
/// @notice Router for stateless execution of swaps against Woo private pool.
contract WooRouterV2 is IWooRouterV2, Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    /* ----- Constant variables ----- */

    // Erc20 placeholder address for native tokens (e.g. eth, bnb, matic, etc)
    address constant ETH_PLACEHOLDER_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /* ----- State variables ----- */

    // Wrapper for native tokens (e.g. eth, bnb, matic, etc)
    // BSC WBNB: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c
    address public immutable override WETH;

    IWooPPV2 public override wooPool;

    mapping(address => bool) public isWhitelisted;

    address public quoteToken;

    /* ----- Callback Function ----- */

    receive() external payable {
        // only accept ETH from WETH or whitelisted external swaps.
        assert(msg.sender == WETH || isWhitelisted[msg.sender]);
    }

    /* ----- Query & swap APIs ----- */

    constructor(address _weth, address _pool) {
        require(_weth != address(0), "WooRouter: weth_ZERO_ADDR");
        WETH = _weth;
        if (_pool != address(0)) {
            setPool(_pool);
        }
    }

    /// @inheritdoc IWooRouterV2
    function querySwap(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view override returns (uint256 toAmount) {
        require(fromToken != address(0), "WooRouter: !fromToken");
        require(toToken != address(0), "WooRouter: !toToken");
        fromToken = (fromToken == ETH_PLACEHOLDER_ADDR) ? WETH : fromToken;
        toToken = (toToken == ETH_PLACEHOLDER_ADDR) ? WETH : toToken;
        toAmount = wooPool.query(fromToken, toToken, fromAmount);
    }

    function tryQuerySwap(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view override returns (uint256 toAmount) {
        if (fromToken == address(0) || toToken == address(0)) {
            return 0;
        }
        fromToken = (fromToken == ETH_PLACEHOLDER_ADDR) ? WETH : fromToken;
        toToken = (toToken == ETH_PLACEHOLDER_ADDR) ? WETH : toToken;
        toAmount = wooPool.tryQuery(fromToken, toToken, fromAmount);
    }

    /// @inheritdoc IWooRouterV2
    function swap(
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        address payable to,
        address rebateTo
    ) external payable override nonReentrant returns (uint256 realToAmount) {
        require(fromToken != address(0), "WooRouter: !fromToken");
        require(toToken != address(0), "WooRouter: !toToken");
        require(to != address(0), "WooRouter: !to");

        bool isFromETH = fromToken == ETH_PLACEHOLDER_ADDR;
        bool isToETH = toToken == ETH_PLACEHOLDER_ADDR;
        fromToken = isFromETH ? WETH : fromToken;
        toToken = isToETH ? WETH : toToken;

        // Step 1: transfer the source tokens to WooRouter
        if (isFromETH) {
            require(fromAmount <= msg.value, "WooRouter: fromAmount_INVALID");
            IWETH(WETH).deposit{value: msg.value}();
            TransferHelper.safeTransfer(WETH, address(wooPool), fromAmount);
        } else {
            TransferHelper.safeTransferFrom(fromToken, msg.sender, address(wooPool), fromAmount);
        }

        // Step 2: swap and transfer
        if (isToETH) {
            realToAmount = wooPool.swap(fromToken, toToken, fromAmount, minToAmount, address(this), rebateTo);
            IWETH(WETH).withdraw(realToAmount);
            TransferHelper.safeTransferETH(to, realToAmount);
        } else {
            realToAmount = wooPool.swap(fromToken, toToken, fromAmount, minToAmount, to, rebateTo);
        }

        // Step 3: firing event
        emit WooRouterSwap(
            SwapType.WooSwap,
            isFromETH ? ETH_PLACEHOLDER_ADDR : fromToken,
            isToETH ? ETH_PLACEHOLDER_ADDR : toToken,
            fromAmount,
            realToAmount,
            msg.sender,
            to,
            rebateTo
        );
    }

    /// @inheritdoc IWooRouterV2
    function externalSwap(
        address approveTarget,
        address swapTarget,
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        address payable to,
        bytes calldata data
    ) external payable override nonReentrant returns (uint256 realToAmount) {
        require(approveTarget != address(0), "WooRouter: approveTarget_ADDR_ZERO");
        require(swapTarget != address(0), "WooRouter: swapTarget_ADDR_ZERO");
        require(fromToken != address(0), "WooRouter: fromToken_ADDR_ZERO");
        require(toToken != address(0), "WooRouter: toToken_ADDR_ZERO");
        require(to != address(0), "WooRouter: to_ADDR_ZERO");
        require(isWhitelisted[approveTarget], "WooRouter: APPROVE_TARGET_NOT_ALLOWED");
        require(isWhitelisted[swapTarget], "WooRouter: SWAP_TARGET_NOT_ALLOWED");

        uint256 preBalance = _generalBalanceOf(toToken, address(this));
        _internalFallbackSwap(approveTarget, swapTarget, fromToken, fromAmount, data);
        uint256 postBalance = _generalBalanceOf(toToken, address(this));

        require(preBalance <= postBalance, "WooRouter: balance_ERROR");
        realToAmount = postBalance - preBalance;
        require(realToAmount >= minToAmount && realToAmount > 0, "WooRouter: realToAmount_NOT_ENOUGH");
        _generalTransfer(toToken, to, realToAmount);

        emit WooRouterSwap(SwapType.DodoSwap, fromToken, toToken, fromAmount, realToAmount, msg.sender, to, address(0));
    }

    /* ----- Admin functions ----- */

    /// @dev Rescue the specified funds when stuck happen
    /// @param stuckToken the stuck token address
    function inCaseTokenGotStuck(address stuckToken) external onlyOwner {
        if (stuckToken == ETH_PLACEHOLDER_ADDR) {
            TransferHelper.safeTransferETH(msg.sender, address(this).balance);
        } else {
            uint256 amount = IERC20(stuckToken).balanceOf(address(this));
            TransferHelper.safeTransfer(stuckToken, msg.sender, amount);
        }
    }

    /// @dev Rescue the specified funds when stuck happen
    /// @param stuckTokens the stuck tokens address
    function inCaseTokensGotStuck(address[] calldata stuckTokens) external onlyOwner {
        for (uint256 i = 0; i < stuckTokens.length; ++i) {
            address stuckToken = stuckTokens[i];
            if (stuckToken == ETH_PLACEHOLDER_ADDR) {
                TransferHelper.safeTransferETH(msg.sender, address(this).balance);
            } else {
                uint256 amount = IERC20(stuckToken).balanceOf(address(this));
                TransferHelper.safeTransfer(stuckToken, msg.sender, amount);
            }
        }
    }

    /// @dev Set wooPool from newPool
    /// @param newPool Wooracle address
    function setPool(address newPool) public onlyOwner {
        wooPool = IWooPPV2(newPool);
        quoteToken = wooPool.quoteToken();
        require(quoteToken != address(0), "WooRouter: quoteToken_ADDR_ZERO");
        emit WooPoolChanged(newPool);
    }

    /// @dev Add target address into whitelist
    /// @param target address that approved by WooRouter
    /// @param whitelisted approve to using WooRouter or not
    function setWhitelisted(address target, bool whitelisted) external onlyOwner {
        require(target != address(0), "WooRouter: target_ADDR_ZERO");
        isWhitelisted[target] = whitelisted;
    }

    /* ----- Private Function ----- */

    function _internalFallbackSwap(
        address approveTarget,
        address swapTarget,
        address fromToken,
        uint256 fromAmount,
        bytes calldata data
    ) private {
        require(isWhitelisted[approveTarget], "WooRouter: APPROVE_TARGET_NOT_ALLOWED");
        require(isWhitelisted[swapTarget], "WooRouter: SWAP_TARGET_NOT_ALLOWED");

        if (fromToken != ETH_PLACEHOLDER_ADDR) {
            TransferHelper.safeTransferFrom(fromToken, msg.sender, address(this), fromAmount);
            TransferHelper.safeApprove(fromToken, approveTarget, fromAmount);
            (bool success, ) = swapTarget.call{value: 0}(data);
            TransferHelper.safeApprove(fromToken, approveTarget, 0);
            require(success, "WooRouter: FALLBACK_SWAP_FAILED");
        } else {
            require(fromAmount <= msg.value, "WooRouter: fromAmount_INVALID");
            (bool success, ) = swapTarget.call{value: fromAmount}(data);
            require(success, "WooRouter: FALLBACK_SWAP_FAILED");
        }
    }

    function _generalTransfer(
        address token,
        address payable to,
        uint256 amount
    ) private {
        if (amount > 0) {
            if (token == ETH_PLACEHOLDER_ADDR) {
                TransferHelper.safeTransferETH(to, amount);
            } else {
                TransferHelper.safeTransfer(token, to, amount);
            }
        }
    }

    function _generalBalanceOf(address token, address who) private view returns (uint256) {
        return token == ETH_PLACEHOLDER_ADDR ? who.balance : IERC20(token).balanceOf(who);
    }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
}

File 3 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @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 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;

    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
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // 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;
    }
}

File 4 of 12 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 5 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 amount) external returns (bool);
}

File 6 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 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 {
    using Address for address;

    /**
     * @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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @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.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

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

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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 silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 7 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 8 of 12 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 9 of 12 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Wrapped ETH.
interface IWETH {
    /// @dev Deposit ETH into WETH
    function deposit() external payable;

    /// @dev Transfer WETH to receiver
    /// @param to address of WETH receiver
    /// @param value amount of WETH to transfer
    /// @return get true when succeed, else false
    function transfer(address to, uint256 value) external returns (bool);

    /// @dev Withdraw WETH to ETH
    function withdraw(uint256) external;
}

File 10 of 12 : IWooPPV2.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

/// @title Woo private pool for swap.
/// @notice Use this contract to directly interfact with woo's synthetic proactive
///         marketing making pool.
/// @author woo.network
interface IWooPPV2 {
    /* ----- Events ----- */

    event Deposit(address indexed token, address indexed sender, uint256 amount);
    event Withdraw(address indexed token, address indexed receiver, uint256 amount);
    event Migrate(address indexed token, address indexed receiver, uint256 amount);
    event AdminUpdated(address indexed addr, bool flag);
    event FeeAddrUpdated(address indexed newFeeAddr);
    event WooracleUpdated(address indexed newWooracle);
    event WooSwap(
        address indexed fromToken,
        address indexed toToken,
        uint256 fromAmount,
        uint256 toAmount,
        address from,
        address indexed to,
        address rebateTo,
        uint256 swapVol,
        uint256 swapFee
    );

    /* ----- External Functions ----- */

    /// @notice The quote token address (immutable).
    /// @return address of quote token
    function quoteToken() external view returns (address);

    /// @notice Gets the pool size of the specified token (swap liquidity).
    /// @param token the token address
    /// @return the pool size
    function poolSize(address token) external view returns (uint256);

    /// @notice Query the amount to swap `fromToken` to `toToken`, without checking the pool reserve balance.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @return toAmount the swapped amount of `toToken`
    function tryQuery(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view returns (uint256 toAmount);

    /// @notice Query the amount to swap `fromToken` to `toToken`, with checking the pool reserve balance.
    /// @dev tx reverts when 'toToken' balance is insufficient.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @return toAmount the swapped amount of `toToken`
    function query(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view returns (uint256 toAmount);

    /// @notice Swap `fromToken` to `toToken`.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @param minToAmount the minimum amount of `toToken` to receive
    /// @param to the destination address
    /// @param rebateTo the rebate address (optional, can be address ZERO)
    /// @return realToAmount the amount of toToken to receive
    function swap(
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        address to,
        address rebateTo
    ) external returns (uint256 realToAmount);

    /// @notice Deposit the specified token into the liquidity pool of WooPPV2.
    /// @param token the token to deposit
    /// @param amount the deposit amount
    function deposit(address token, uint256 amount) external;
}

File 11 of 12 : IWooRouterV2.sol
// SPDX-License-Identifier: MIT
pragma solidity =0.8.14;

/*

░██╗░░░░░░░██╗░█████╗░░█████╗░░░░░░░███████╗██╗
░██║░░██╗░░██║██╔══██╗██╔══██╗░░░░░░██╔════╝██║
░╚██╗████╗██╔╝██║░░██║██║░░██║█████╗█████╗░░██║
░░████╔═████║░██║░░██║██║░░██║╚════╝██╔══╝░░██║
░░╚██╔╝░╚██╔╝░╚█████╔╝╚█████╔╝░░░░░░██║░░░░░██║
░░░╚═╝░░░╚═╝░░░╚════╝░░╚════╝░░░░░░░╚═╝░░░░░╚═╝

*
* MIT License
* ===========
*
* Copyright (c) 2020 WooTrade
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import "../interfaces/IWooPPV2.sol";

/// @title Woo router interface (version 2)
/// @notice functions to interface with WooFi swap
interface IWooRouterV2 {
    /* ----- Type declarations ----- */

    enum SwapType {
        WooSwap,
        DodoSwap
    }

    /* ----- Events ----- */

    event WooRouterSwap(
        SwapType swapType,
        address indexed fromToken,
        address indexed toToken,
        uint256 fromAmount,
        uint256 toAmount,
        address from,
        address indexed to,
        address rebateTo
    );

    event WooPoolChanged(address newPool);

    /* ----- Router properties ----- */

    function WETH() external view returns (address);

    function wooPool() external view returns (IWooPPV2);

    /* ----- Main query & swap APIs ----- */

    /// @notice query the amount to swap fromToken -> toToken
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of fromToken to swap
    /// @return toAmount the predicted amount to receive
    function querySwap(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view returns (uint256 toAmount);

    /// @notice query the amount to swap fromToken -> toToken,
    ///     WITHOUT checking the reserve balance; so it
    ///     always returns the quoted amount (for reference).
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of fromToken to swap
    /// @return toAmount the predicted amount to receive
    function tryQuerySwap(
        address fromToken,
        address toToken,
        uint256 fromAmount
    ) external view returns (uint256 toAmount);

    /// @notice Swap `fromToken` to `toToken`.
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of `fromToken` to swap
    /// @param minToAmount the minimum amount of `toToken` to receive
    /// @param to the destination address
    /// @param rebateTo the rebate address (optional, can be 0)
    /// @return realToAmount the amount of toToken to receive
    function swap(
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        address payable to,
        address rebateTo
    ) external payable returns (uint256 realToAmount);

    /* ----- 3rd party DEX swap ----- */

    /// @notice swap fromToken -> toToken via an external 3rd swap
    /// @param approveTarget the contract address for token transfer approval
    /// @param swapTarget the contract address for swap
    /// @param fromToken the from token
    /// @param toToken the to token
    /// @param fromAmount the amount of fromToken to swap
    /// @param minToAmount the min amount of swapped toToken
    /// @param to the destination address
    /// @param data call data for external call
    function externalSwap(
        address approveTarget,
        address swapTarget,
        address fromToken,
        address toToken,
        uint256 fromAmount,
        uint256 minToAmount,
        address payable to,
        bytes calldata data
    ) external payable returns (uint256 realToAmount);
}

File 12 of 12 : TransferHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
    function safeApprove(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "TransferHelper::safeApprove: approve failed"
        );
    }

    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "TransferHelper::safeTransfer: transfer failed"
        );
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "TransferHelper::transferFrom: transferFrom failed"
        );
    }

    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, "TransferHelper::safeTransferETH: ETH transfer failed");
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_pool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newPool","type":"address"}],"name":"WooPoolChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IWooRouterV2.SwapType","name":"swapType","type":"uint8"},{"indexed":true,"internalType":"address","name":"fromToken","type":"address"},{"indexed":true,"internalType":"address","name":"toToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"fromAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"rebateTo","type":"address"}],"name":"WooRouterSwap","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"approveTarget","type":"address"},{"internalType":"address","name":"swapTarget","type":"address"},{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"externalSwap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"stuckToken","type":"address"}],"name":"inCaseTokenGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"stuckTokens","type":"address[]"}],"name":"inCaseTokensGotStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"querySwap","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"quoteToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPool","type":"address"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"setWhitelisted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"},{"internalType":"uint256","name":"minToAmount","type":"uint256"},{"internalType":"address payable","name":"to","type":"address"},{"internalType":"address","name":"rebateTo","type":"address"}],"name":"swap","outputs":[{"internalType":"uint256","name":"realToAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fromToken","type":"address"},{"internalType":"address","name":"toToken","type":"address"},{"internalType":"uint256","name":"fromAmount","type":"uint256"}],"name":"tryQuerySwap","outputs":[{"internalType":"uint256","name":"toAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wooPool","outputs":[{"internalType":"contract IWooPPV2","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b5060405162002b0938038062002b098339810160408190526200003491620002c9565b6200003f33620000c8565b600180556001600160a01b0382166200009f5760405162461bcd60e51b815260206004820152601960248201527f576f6f526f757465723a20776574685f5a45524f5f414444520000000000000060448201526064015b60405180910390fd5b6001600160a01b03808316608052811615620000c057620000c08162000118565b505062000326565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001226200024e565b600280546001600160a01b0319166001600160a01b03831690811790915560408051630217a4b760e41b8152905163217a4b70916004808201926020929091908290030181865afa1580156200017c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001a2919062000301565b600480546001600160a01b0319166001600160a01b039290921691821790556200020f5760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2071756f7465546f6b656e5f414444525f5a45524f00604482015260640162000096565b6040516001600160a01b03821681527f4577a21bd8e55848c574b7582f8e6cc6a7cf1c1958f36a9751eab6329d656b1e9060200160405180910390a150565b6000546001600160a01b03163314620002aa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000096565b565b80516001600160a01b0381168114620002c457600080fd5b919050565b60008060408385031215620002dd57600080fd5b620002e883620002ac565b9150620002f860208401620002ac565b90509250929050565b6000602082840312156200031457600080fd5b6200031f82620002ac565b9392505050565b60805161278162000388600039600081816101090152818161032101528181610bd501528181610c0401528181610c7e01528181610d0401528181610e61015281816112fa015281816113550152818161161a015261167501526127816000f3fe6080604052600436106100ec5760003560e01c80638da5cb5b1161008a578063ad5c464811610059578063ad5c46481461030f578063e1a4e72a14610343578063e94803f414610363578063f2fde38b1461038357600080fd5b80638da5cb5b146102775780639281aa0b146102a25780639d82e123146102c2578063a7394603146102e257600080fd5b80634437152a116100c65780634437152a1461020f578063715018a61461022f5780637dc2038214610244578063819580151461025757600080fd5b8063199b83fa14610157578063217a4b701461017d5780633af32abf146101cf57600080fd5b36610152573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016148061014457503360009081526003602052604090205460ff165b610150576101506122cd565b005b600080fd5b61016a61016536600461231e565b6103a3565b6040519081526020015b60405180910390f35b34801561018957600080fd5b506004546101aa9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610174565b3480156101db57600080fd5b506101ff6101ea366004612401565b60036020526000908152604090205460ff1681565b6040519015158152602001610174565b34801561021b57600080fd5b5061015061022a366004612401565b6108ae565b34801561023b57600080fd5b50610150610a4d565b61016a61025236600461241e565b610a61565b34801561026357600080fd5b5061015061027236600461248e565b61107a565b34801561028357600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101aa565b3480156102ae57600080fd5b506101506102bd366004612511565b6111ba565b3480156102ce57600080fd5b5061016a6102dd36600461254a565b61127b565b3480156102ee57600080fd5b506002546101aa9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561031b57600080fd5b506101aa7f000000000000000000000000000000000000000000000000000000000000000081565b34801561034f57600080fd5b5061015061035e366004612401565b611425565b34801561036f57600080fd5b5061016a61037e36600461254a565b611519565b34801561038f57600080fd5b5061015061039e366004612401565b6116fe565b60006103ad611798565b73ffffffffffffffffffffffffffffffffffffffff8a1661043b5760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a20617070726f76655461726765745f414444525f5a4560448201527f524f00000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff891661049e5760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a20737761705461726765745f414444525f5a45524f006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff88166105015760405162461bcd60e51b815260206004820152601e60248201527f576f6f526f757465723a2066726f6d546f6b656e5f414444525f5a45524f00006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff87166105645760405162461bcd60e51b815260206004820152601c60248201527f576f6f526f757465723a20746f546f6b656e5f414444525f5a45524f000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff84166105c75760405162461bcd60e51b815260206004820152601760248201527f576f6f526f757465723a20746f5f414444525f5a45524f0000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff8a1660009081526003602052604090205460ff166106625760405162461bcd60e51b815260206004820152602560248201527f576f6f526f757465723a20415050524f56455f5441524745545f4e4f545f414c60448201527f4c4f5745440000000000000000000000000000000000000000000000000000006064820152608401610432565b73ffffffffffffffffffffffffffffffffffffffff891660009081526003602052604090205460ff166106fd5760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a20535741505f5441524745545f4e4f545f414c4c4f5760448201527f45440000000000000000000000000000000000000000000000000000000000006064820152608401610432565b600061070988306117f1565b90506107198b8b8b8a88886118d6565b600061072589306117f1565b9050808211156107775760405162461bcd60e51b815260206004820152601860248201527f576f6f526f757465723a2062616c616e63655f4552524f5200000000000000006044820152606401610432565b61078182826125ba565b92508683101580156107935750600083115b6108055760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a207265616c546f416d6f756e745f4e4f545f454e4f5560448201527f47480000000000000000000000000000000000000000000000000000000000006064820152608401610432565b610810898785611c3b565b8573ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167f27c98e911efdd224f4002f6cd831c3ad0d2759ee176f9ee8466d95826af22a1c60018c8833600060405161088e9594939291906125d1565b60405180910390a450506108a160018055565b9998505050505050505050565b6108b6611c93565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117909155604080517f217a4b70000000000000000000000000000000000000000000000000000000008152905163217a4b70916004808201926020929091908290030181865afa15801561094d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109719190612646565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055610a015760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2071756f7465546f6b656e5f414444525f5a45524f006044820152606401610432565b60405173ffffffffffffffffffffffffffffffffffffffff821681527f4577a21bd8e55848c574b7582f8e6cc6a7cf1c1958f36a9751eab6329d656b1e9060200160405180910390a150565b610a55611c93565b610a5f6000611cfa565b565b6000610a6b611798565b73ffffffffffffffffffffffffffffffffffffffff8716610ace5760405162461bcd60e51b815260206004820152601560248201527f576f6f526f757465723a202166726f6d546f6b656e00000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff8616610b315760405162461bcd60e51b815260206004820152601360248201527f576f6f526f757465723a2021746f546f6b656e000000000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff8316610b945760405162461bcd60e51b815260206004820152600e60248201527f576f6f526f757465723a2021746f0000000000000000000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff87811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee9081149188161481610bd35788610bf5565b7f00000000000000000000000000000000000000000000000000000000000000005b985080610c025787610c24565b7f00000000000000000000000000000000000000000000000000000000000000005b97508115610d485734871115610c7c5760405162461bcd60e51b815260206004820152601d60248201527f576f6f526f757465723a2066726f6d416d6f756e745f494e56414c49440000006044820152606401610432565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610ce457600080fd5b505af1158015610cf8573d6000803e3d6000fd5b5050600254610d4393507f0000000000000000000000000000000000000000000000000000000000000000925073ffffffffffffffffffffffffffffffffffffffff16905089611d6f565b610d6f565b600254610d6f908a90339073ffffffffffffffffffffffffffffffffffffffff168a611eeb565b8015610ee1576002546040517f7dc2038200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301528a81166024830152604482018a90526064820189905230608483015286811660a483015290911690637dc203829060c4016020604051808303816000875af1158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f9190612663565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290529093507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b158015610eba57600080fd5b505af1158015610ece573d6000803e3d6000fd5b50505050610edc8584612068565b610fa0565b6002546040517f7dc2038200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301528a81166024830152604482018a905260648201899052878116608483015286811660a483015290911690637dc203829060c4016020604051808303816000875af1158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d9190612663565b92505b8473ffffffffffffffffffffffffffffffffffffffff1681610fc25788610fd8565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee5b73ffffffffffffffffffffffffffffffffffffffff1683610ff9578a61100f565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee5b73ffffffffffffffffffffffffffffffffffffffff167f27c98e911efdd224f4002f6cd831c3ad0d2759ee176f9ee8466d95826af22a1c60008b88338b60405161105d9594939291906125d1565b60405180910390a4505061107060018055565b9695505050505050565b611082611c93565b60005b818110156111b55760008383838181106110a1576110a161267c565b90506020020160208101906110b69190612401565b90507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff821601611104576110ff3347612068565b6111a4565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111959190612663565b90506111a2823383611d6f565b505b506111ae816126ab565b9050611085565b505050565b6111c2611c93565b73ffffffffffffffffffffffffffffffffffffffff82166112255760405162461bcd60e51b815260206004820152601b60248201527f576f6f526f757465723a207461726765745f414444525f5a45524f00000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b600073ffffffffffffffffffffffffffffffffffffffff841615806112b4575073ffffffffffffffffffffffffffffffffffffffff8316155b156112c15750600061141e565b73ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146112f8578361131a565b7f00000000000000000000000000000000000000000000000000000000000000005b935073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146113535782611375565b7f00000000000000000000000000000000000000000000000000000000000000005b6002546040517fce824f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015280841660248301526044820186905292955091169063ce824f19906064015b602060405180830381865afa1580156113f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141b9190612663565b90505b9392505050565b61142d611c93565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff821601611477576114743347612068565b50565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156114e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115089190612663565b9050611515823383611d6f565b5050565b600073ffffffffffffffffffffffffffffffffffffffff841661157e5760405162461bcd60e51b815260206004820152601560248201527f576f6f526f757465723a202166726f6d546f6b656e00000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff83166115e15760405162461bcd60e51b815260206004820152601360248201527f576f6f526f757465723a2021746f546f6b656e000000000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611618578361163a565b7f00000000000000000000000000000000000000000000000000000000000000005b935073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146116735782611695565b7f00000000000000000000000000000000000000000000000000000000000000005b6002546040517ff58a435f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015280841660248301526044820186905292955091169063f58a435f906064016113da565b611706611c93565b73ffffffffffffffffffffffffffffffffffffffff811661178f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610432565b61147481611cfa565b6002600154036117ea5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610432565b6002600155565b600073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146118b9576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015611890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b49190612663565b61141e565b5073ffffffffffffffffffffffffffffffffffffffff1631919050565b73ffffffffffffffffffffffffffffffffffffffff861660009081526003602052604090205460ff166119715760405162461bcd60e51b815260206004820152602560248201527f576f6f526f757465723a20415050524f56455f5441524745545f4e4f545f414c60448201527f4c4f5745440000000000000000000000000000000000000000000000000000006064820152608401610432565b73ffffffffffffffffffffffffffffffffffffffff851660009081526003602052604090205460ff16611a0c5760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a20535741505f5441524745545f4e4f545f414c4c4f5760448201527f45440000000000000000000000000000000000000000000000000000000000006064820152608401610432565b73ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611b2457611a4984333086611eeb565b611a54848785612158565b60008573ffffffffffffffffffffffffffffffffffffffff1660008484604051611a7f9291906126e3565b60006040518083038185875af1925050503d8060008114611abc576040519150601f19603f3d011682016040523d82523d6000602084013e611ac1565b606091505b50509050611ad185886000612158565b80611b1e5760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2046414c4c4241434b5f535741505f4641494c4544006044820152606401610432565b50611c33565b34831115611b745760405162461bcd60e51b815260206004820152601d60248201527f576f6f526f757465723a2066726f6d416d6f756e745f494e56414c49440000006044820152606401610432565b60008573ffffffffffffffffffffffffffffffffffffffff16848484604051611b9e9291906126e3565b60006040518083038185875af1925050503d8060008114611bdb576040519150601f19603f3d011682016040523d82523d6000602084013e611be0565b606091505b5050905080611c315760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2046414c4c4241434b5f535741505f4641494c4544006044820152606401610432565b505b505050505050565b80156111b5577fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff841601611c88576111b58282612068565b6111b5838383611d6f565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a5f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610432565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691611e0691906126f3565b6000604051808303816000865af19150503d8060008114611e43576040519150601f19603f3d011682016040523d82523d6000602084013e611e48565b606091505b5091509150818015611e72575080511580611e72575080806020019051810190611e72919061272e565b611ee45760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152608401610432565b5050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611f8a91906126f3565b6000604051808303816000865af19150503d8060008114611fc7576040519150601f19603f3d011682016040523d82523d6000602084013e611fcc565b606091505b5091509150818015611ff6575080511580611ff6575080806020019051810190611ff6919061272e565b611c335760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a20747260448201527f616e7366657246726f6d206661696c65640000000000000000000000000000006064820152608401610432565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff841690839060405161209f91906126f3565b60006040518083038185875af1925050503d80600081146120dc576040519150601f19603f3d011682016040523d82523d6000602084013e6120e1565b606091505b50509050806111b55760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610432565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905291516000928392908716916121ef91906126f3565b6000604051808303816000865af19150503d806000811461222c576040519150601f19603f3d011682016040523d82523d6000602084013e612231565b606091505b509150915081801561225b57508051158061225b57508080602001905181019061225b919061272e565b611ee45760405162461bcd60e51b815260206004820152602b60248201527f5472616e7366657248656c7065723a3a73616665417070726f76653a2061707060448201527f726f7665206661696c65640000000000000000000000000000000000000000006064820152608401610432565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461147457600080fd5b60008060008060008060008060006101008a8c03121561233d57600080fd5b8935612348816122fc565b985060208a0135612358816122fc565b975060408a0135612368816122fc565b965060608a0135612378816122fc565b955060808a0135945060a08a0135935060c08a0135612396816122fc565b925060e08a013567ffffffffffffffff808211156123b357600080fd5b818c0191508c601f8301126123c757600080fd5b8135818111156123d657600080fd5b8d60208285010111156123e857600080fd5b6020830194508093505050509295985092959850929598565b60006020828403121561241357600080fd5b813561141e816122fc565b60008060008060008060c0878903121561243757600080fd5b8635612442816122fc565b95506020870135612452816122fc565b945060408701359350606087013592506080870135612470816122fc565b915060a0870135612480816122fc565b809150509295509295509295565b600080602083850312156124a157600080fd5b823567ffffffffffffffff808211156124b957600080fd5b818501915085601f8301126124cd57600080fd5b8135818111156124dc57600080fd5b8660208260051b85010111156124f157600080fd5b60209290920196919550909350505050565b801515811461147457600080fd5b6000806040838503121561252457600080fd5b823561252f816122fc565b9150602083013561253f81612503565b809150509250929050565b60008060006060848603121561255f57600080fd5b833561256a816122fc565b9250602084013561257a816122fc565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156125cc576125cc61258b565b500390565b60a081016002871061260c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9581526020810194909452604084019290925273ffffffffffffffffffffffffffffffffffffffff90811660608401521660809091015290565b60006020828403121561265857600080fd5b815161141e816122fc565b60006020828403121561267557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036126dc576126dc61258b565b5060010190565b8183823760009101908152919050565b6000825160005b8181101561271457602081860181015185830152016126fa565b81811115612723576000828501525b509190910192915050565b60006020828403121561274057600080fd5b815161141e8161250356fea26469706673582212209035f73fa3f16f705c12594813de5283948ca9fe3fd9a556cd040aed8f973af964736f6c634300080e00330000000000000000000000004200000000000000000000000000000000000006000000000000000000000000d1778f9df3eee5473a9640f13682e3846f61febc

Deployed Bytecode

0x6080604052600436106100ec5760003560e01c80638da5cb5b1161008a578063ad5c464811610059578063ad5c46481461030f578063e1a4e72a14610343578063e94803f414610363578063f2fde38b1461038357600080fd5b80638da5cb5b146102775780639281aa0b146102a25780639d82e123146102c2578063a7394603146102e257600080fd5b80634437152a116100c65780634437152a1461020f578063715018a61461022f5780637dc2038214610244578063819580151461025757600080fd5b8063199b83fa14610157578063217a4b701461017d5780633af32abf146101cf57600080fd5b36610152573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000420000000000000000000000000000000000000616148061014457503360009081526003602052604090205460ff165b610150576101506122cd565b005b600080fd5b61016a61016536600461231e565b6103a3565b6040519081526020015b60405180910390f35b34801561018957600080fd5b506004546101aa9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610174565b3480156101db57600080fd5b506101ff6101ea366004612401565b60036020526000908152604090205460ff1681565b6040519015158152602001610174565b34801561021b57600080fd5b5061015061022a366004612401565b6108ae565b34801561023b57600080fd5b50610150610a4d565b61016a61025236600461241e565b610a61565b34801561026357600080fd5b5061015061027236600461248e565b61107a565b34801561028357600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff166101aa565b3480156102ae57600080fd5b506101506102bd366004612511565b6111ba565b3480156102ce57600080fd5b5061016a6102dd36600461254a565b61127b565b3480156102ee57600080fd5b506002546101aa9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561031b57600080fd5b506101aa7f000000000000000000000000420000000000000000000000000000000000000681565b34801561034f57600080fd5b5061015061035e366004612401565b611425565b34801561036f57600080fd5b5061016a61037e36600461254a565b611519565b34801561038f57600080fd5b5061015061039e366004612401565b6116fe565b60006103ad611798565b73ffffffffffffffffffffffffffffffffffffffff8a1661043b5760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a20617070726f76655461726765745f414444525f5a4560448201527f524f00000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff891661049e5760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a20737761705461726765745f414444525f5a45524f006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff88166105015760405162461bcd60e51b815260206004820152601e60248201527f576f6f526f757465723a2066726f6d546f6b656e5f414444525f5a45524f00006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff87166105645760405162461bcd60e51b815260206004820152601c60248201527f576f6f526f757465723a20746f546f6b656e5f414444525f5a45524f000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff84166105c75760405162461bcd60e51b815260206004820152601760248201527f576f6f526f757465723a20746f5f414444525f5a45524f0000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff8a1660009081526003602052604090205460ff166106625760405162461bcd60e51b815260206004820152602560248201527f576f6f526f757465723a20415050524f56455f5441524745545f4e4f545f414c60448201527f4c4f5745440000000000000000000000000000000000000000000000000000006064820152608401610432565b73ffffffffffffffffffffffffffffffffffffffff891660009081526003602052604090205460ff166106fd5760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a20535741505f5441524745545f4e4f545f414c4c4f5760448201527f45440000000000000000000000000000000000000000000000000000000000006064820152608401610432565b600061070988306117f1565b90506107198b8b8b8a88886118d6565b600061072589306117f1565b9050808211156107775760405162461bcd60e51b815260206004820152601860248201527f576f6f526f757465723a2062616c616e63655f4552524f5200000000000000006044820152606401610432565b61078182826125ba565b92508683101580156107935750600083115b6108055760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a207265616c546f416d6f756e745f4e4f545f454e4f5560448201527f47480000000000000000000000000000000000000000000000000000000000006064820152608401610432565b610810898785611c3b565b8573ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff167f27c98e911efdd224f4002f6cd831c3ad0d2759ee176f9ee8466d95826af22a1c60018c8833600060405161088e9594939291906125d1565b60405180910390a450506108a160018055565b9998505050505050505050565b6108b6611c93565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8316908117909155604080517f217a4b70000000000000000000000000000000000000000000000000000000008152905163217a4b70916004808201926020929091908290030181865afa15801561094d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109719190612646565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055610a015760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2071756f7465546f6b656e5f414444525f5a45524f006044820152606401610432565b60405173ffffffffffffffffffffffffffffffffffffffff821681527f4577a21bd8e55848c574b7582f8e6cc6a7cf1c1958f36a9751eab6329d656b1e9060200160405180910390a150565b610a55611c93565b610a5f6000611cfa565b565b6000610a6b611798565b73ffffffffffffffffffffffffffffffffffffffff8716610ace5760405162461bcd60e51b815260206004820152601560248201527f576f6f526f757465723a202166726f6d546f6b656e00000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff8616610b315760405162461bcd60e51b815260206004820152601360248201527f576f6f526f757465723a2021746f546f6b656e000000000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff8316610b945760405162461bcd60e51b815260206004820152600e60248201527f576f6f526f757465723a2021746f0000000000000000000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff87811673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee9081149188161481610bd35788610bf5565b7f00000000000000000000000042000000000000000000000000000000000000065b985080610c025787610c24565b7f00000000000000000000000042000000000000000000000000000000000000065b97508115610d485734871115610c7c5760405162461bcd60e51b815260206004820152601d60248201527f576f6f526f757465723a2066726f6d416d6f756e745f494e56414c49440000006044820152606401610432565b7f000000000000000000000000420000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015610ce457600080fd5b505af1158015610cf8573d6000803e3d6000fd5b5050600254610d4393507f0000000000000000000000004200000000000000000000000000000000000006925073ffffffffffffffffffffffffffffffffffffffff16905089611d6f565b610d6f565b600254610d6f908a90339073ffffffffffffffffffffffffffffffffffffffff168a611eeb565b8015610ee1576002546040517f7dc2038200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301528a81166024830152604482018a90526064820189905230608483015286811660a483015290911690637dc203829060c4016020604051808303816000875af1158015610e0b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2f9190612663565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290529093507f000000000000000000000000420000000000000000000000000000000000000673ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b158015610eba57600080fd5b505af1158015610ece573d6000803e3d6000fd5b50505050610edc8584612068565b610fa0565b6002546040517f7dc2038200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b811660048301528a81166024830152604482018a905260648201899052878116608483015286811660a483015290911690637dc203829060c4016020604051808303816000875af1158015610f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9d9190612663565b92505b8473ffffffffffffffffffffffffffffffffffffffff1681610fc25788610fd8565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee5b73ffffffffffffffffffffffffffffffffffffffff1683610ff9578a61100f565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee5b73ffffffffffffffffffffffffffffffffffffffff167f27c98e911efdd224f4002f6cd831c3ad0d2759ee176f9ee8466d95826af22a1c60008b88338b60405161105d9594939291906125d1565b60405180910390a4505061107060018055565b9695505050505050565b611082611c93565b60005b818110156111b55760008383838181106110a1576110a161267c565b90506020020160208101906110b69190612401565b90507fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff821601611104576110ff3347612068565b6111a4565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa158015611171573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111959190612663565b90506111a2823383611d6f565b505b506111ae816126ab565b9050611085565b505050565b6111c2611c93565b73ffffffffffffffffffffffffffffffffffffffff82166112255760405162461bcd60e51b815260206004820152601b60248201527f576f6f526f757465723a207461726765745f414444525f5a45524f00000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260036020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b600073ffffffffffffffffffffffffffffffffffffffff841615806112b4575073ffffffffffffffffffffffffffffffffffffffff8316155b156112c15750600061141e565b73ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146112f8578361131a565b7f00000000000000000000000042000000000000000000000000000000000000065b935073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146113535782611375565b7f00000000000000000000000042000000000000000000000000000000000000065b6002546040517fce824f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015280841660248301526044820186905292955091169063ce824f19906064015b602060405180830381865afa1580156113f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141b9190612663565b90505b9392505050565b61142d611c93565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff821601611477576114743347612068565b50565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190602401602060405180830381865afa1580156114e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115089190612663565b9050611515823383611d6f565b5050565b600073ffffffffffffffffffffffffffffffffffffffff841661157e5760405162461bcd60e51b815260206004820152601560248201527f576f6f526f757465723a202166726f6d546f6b656e00000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff83166115e15760405162461bcd60e51b815260206004820152601360248201527f576f6f526f757465723a2021746f546f6b656e000000000000000000000000006044820152606401610432565b73ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611618578361163a565b7f00000000000000000000000042000000000000000000000000000000000000065b935073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146116735782611695565b7f00000000000000000000000042000000000000000000000000000000000000065b6002546040517ff58a435f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff878116600483015280841660248301526044820186905292955091169063f58a435f906064016113da565b611706611c93565b73ffffffffffffffffffffffffffffffffffffffff811661178f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610432565b61147481611cfa565b6002600154036117ea5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610432565b6002600155565b600073ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146118b9576040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015611890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b49190612663565b61141e565b5073ffffffffffffffffffffffffffffffffffffffff1631919050565b73ffffffffffffffffffffffffffffffffffffffff861660009081526003602052604090205460ff166119715760405162461bcd60e51b815260206004820152602560248201527f576f6f526f757465723a20415050524f56455f5441524745545f4e4f545f414c60448201527f4c4f5745440000000000000000000000000000000000000000000000000000006064820152608401610432565b73ffffffffffffffffffffffffffffffffffffffff851660009081526003602052604090205460ff16611a0c5760405162461bcd60e51b815260206004820152602260248201527f576f6f526f757465723a20535741505f5441524745545f4e4f545f414c4c4f5760448201527f45440000000000000000000000000000000000000000000000000000000000006064820152608401610432565b73ffffffffffffffffffffffffffffffffffffffff841673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611b2457611a4984333086611eeb565b611a54848785612158565b60008573ffffffffffffffffffffffffffffffffffffffff1660008484604051611a7f9291906126e3565b60006040518083038185875af1925050503d8060008114611abc576040519150601f19603f3d011682016040523d82523d6000602084013e611ac1565b606091505b50509050611ad185886000612158565b80611b1e5760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2046414c4c4241434b5f535741505f4641494c4544006044820152606401610432565b50611c33565b34831115611b745760405162461bcd60e51b815260206004820152601d60248201527f576f6f526f757465723a2066726f6d416d6f756e745f494e56414c49440000006044820152606401610432565b60008573ffffffffffffffffffffffffffffffffffffffff16848484604051611b9e9291906126e3565b60006040518083038185875af1925050503d8060008114611bdb576040519150601f19603f3d011682016040523d82523d6000602084013e611be0565b606091505b5050905080611c315760405162461bcd60e51b815260206004820152601f60248201527f576f6f526f757465723a2046414c4c4241434b5f535741505f4641494c4544006044820152606401610432565b505b505050505050565b80156111b5577fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff841601611c88576111b58282612068565b6111b5838383611d6f565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a5f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610432565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691611e0691906126f3565b6000604051808303816000865af19150503d8060008114611e43576040519150601f19603f3d011682016040523d82523d6000602084013e611e48565b606091505b5091509150818015611e72575080511580611e72575080806020019051810190611e72919061272e565b611ee45760405162461bcd60e51b815260206004820152602d60248201527f5472616e7366657248656c7065723a3a736166655472616e736665723a20747260448201527f616e73666572206661696c6564000000000000000000000000000000000000006064820152608401610432565b5050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611f8a91906126f3565b6000604051808303816000865af19150503d8060008114611fc7576040519150601f19603f3d011682016040523d82523d6000602084013e611fcc565b606091505b5091509150818015611ff6575080511580611ff6575080806020019051810190611ff6919061272e565b611c335760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a20747260448201527f616e7366657246726f6d206661696c65640000000000000000000000000000006064820152608401610432565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff841690839060405161209f91906126f3565b60006040518083038185875af1925050503d80600081146120dc576040519150601f19603f3d011682016040523d82523d6000602084013e6120e1565b606091505b50509050806111b55760405162461bcd60e51b815260206004820152603460248201527f5472616e7366657248656c7065723a3a736166655472616e736665724554483a60448201527f20455448207472616e73666572206661696c65640000000000000000000000006064820152608401610432565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b30000000000000000000000000000000000000000000000000000000017905291516000928392908716916121ef91906126f3565b6000604051808303816000865af19150503d806000811461222c576040519150601f19603f3d011682016040523d82523d6000602084013e612231565b606091505b509150915081801561225b57508051158061225b57508080602001905181019061225b919061272e565b611ee45760405162461bcd60e51b815260206004820152602b60248201527f5472616e7366657248656c7065723a3a73616665417070726f76653a2061707060448201527f726f7665206661696c65640000000000000000000000000000000000000000006064820152608401610432565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461147457600080fd5b60008060008060008060008060006101008a8c03121561233d57600080fd5b8935612348816122fc565b985060208a0135612358816122fc565b975060408a0135612368816122fc565b965060608a0135612378816122fc565b955060808a0135945060a08a0135935060c08a0135612396816122fc565b925060e08a013567ffffffffffffffff808211156123b357600080fd5b818c0191508c601f8301126123c757600080fd5b8135818111156123d657600080fd5b8d60208285010111156123e857600080fd5b6020830194508093505050509295985092959850929598565b60006020828403121561241357600080fd5b813561141e816122fc565b60008060008060008060c0878903121561243757600080fd5b8635612442816122fc565b95506020870135612452816122fc565b945060408701359350606087013592506080870135612470816122fc565b915060a0870135612480816122fc565b809150509295509295509295565b600080602083850312156124a157600080fd5b823567ffffffffffffffff808211156124b957600080fd5b818501915085601f8301126124cd57600080fd5b8135818111156124dc57600080fd5b8660208260051b85010111156124f157600080fd5b60209290920196919550909350505050565b801515811461147457600080fd5b6000806040838503121561252457600080fd5b823561252f816122fc565b9150602083013561253f81612503565b809150509250929050565b60008060006060848603121561255f57600080fd5b833561256a816122fc565b9250602084013561257a816122fc565b929592945050506040919091013590565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156125cc576125cc61258b565b500390565b60a081016002871061260c577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9581526020810194909452604084019290925273ffffffffffffffffffffffffffffffffffffffff90811660608401521660809091015290565b60006020828403121561265857600080fd5b815161141e816122fc565b60006020828403121561267557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036126dc576126dc61258b565b5060010190565b8183823760009101908152919050565b6000825160005b8181101561271457602081860181015185830152016126fa565b81811115612723576000828501525b509190910192915050565b60006020828403121561274057600080fd5b815161141e8161250356fea26469706673582212209035f73fa3f16f705c12594813de5283948ca9fe3fd9a556cd040aed8f973af964736f6c634300080e0033

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

0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000d1778f9df3eee5473a9640f13682e3846f61febc

-----Decoded View---------------
Arg [0] : _weth (address): 0x4200000000000000000000000000000000000006
Arg [1] : _pool (address): 0xd1778F9DF3eee5473A9640f13682e3846f61fEbC

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004200000000000000000000000000000000000006
Arg [1] : 000000000000000000000000d1778f9df3eee5473a9640f13682e3846f61febc


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Chain Token Portfolio % Price Amount Value
ETH35.76%$0.9998991,155.3495$1,155.23
ETH8.93%$0.1627641,773.3766$288.64
ETH8.10%$2,294.430.1141$261.68
ETH1.03%$0.168811196.1765$33.12
ETH0.43%$1.1112.5$13.88
ETH0.22%$3.162.2455$7.1
ETH0.15%$14.8143$4.81
ETH0.07%$0.12163117.2939$2.1
ETH0.06%$1,453.730.00125$1.82
ETH0.06%$0.003047592.3425$1.8
ETH0.04%$0.000004262,354.6277$1.13
ETH0.03%$4.670.2318$1.08
ETH0.03%$1.320.6215$0.8203
ETH0.02%$0.9996120.7628$0.7625
ETH0.02%$0.05185310.0463$0.5209
ETH0.01%$59,8450.00000643$0.3848
ETH<0.01%$2,303.680.00012269$0.2826
ETH<0.01%$0.0489495.1252$0.2508
ETH<0.01%$0.5078420.3749$0.1903
ETH<0.01%$2,297.30.00007464$0.1714
ETH<0.01%$0.00000725,000$0.1635
ETH<0.01%$7.960.015$0.1194
ETH<0.01%$69.980.00162044$0.1133
ETH<0.01%$0.000598186.0438$0.1111
BSC15.23%$539.270.9123$491.96
BSC1.42%$0.99949145.7537$45.73
BSC0.79%$0.99994425.4389$25.44
BSC0.24%$0.16228847.7411$7.75
BSC0.01%$5.510.075$0.4132
BSC<0.01%$0.2987961.0805$0.3228
BSC<0.01%$0.0636534.5468$0.2894
BSC<0.01%$10.2887$0.2888
BSC<0.01%$0.7895750.3255$0.2569
BSC<0.01%$128.750.00165443$0.213
BSC<0.01%$2,305.730.0000578$0.1332
BSC<0.01%$10.420.012$0.1248
BSC<0.01%$1.690.0725$0.1224
POL6.58%$0.376118565.5746$212.72
POL0.75%$0.99976724.3417$24.34
POL0.65%$59,7410.00035073$20.95
POL0.37%$0.16144973.1813$11.82
POL0.16%$0.37695313.6626$5.15
POL0.07%$0.9997672.2143$2.21
POL0.03%$1.110.8408$0.9332
POL0.03%$0.9990720.845$0.8442
POL0.01%$0.7690370.5725$0.4402
POL0.01%$0.9968710.3507$0.3495
POL<0.01%$0.2988091.0615$0.3171
POL<0.01%$10.380.0178$0.1849
ARB2.78%$0.99976789.7403$89.72
ARB2.57%$0.161449513.9095$82.97
ARB0.77%$2,291.830.0108$24.82
ARB0.58%$2,297.930.00813219$18.69
ARB0.12%$0.9997673.7261$3.73
ARB0.08%$0.9994212.5486$2.55
ARB0.02%$0.1357473.688$0.5006
ARB0.01%$0.31881.3643$0.4349
ARB0.01%$1.110.3106$0.3447
ARB<0.01%$2,341.650.00010211$0.2391
ARB<0.01%$6.430.0289$0.1855
ARB<0.01%$0.0706532.0033$0.1415
ARB<0.01%$22.40.00580568$0.13
ARB<0.01%$2,709.490.00004318$0.1169
ARB<0.01%$0.9987640.1122$0.112
ARB<0.01%$0.2999560.356$0.1067
ZKSYNC6.14%$2,294.430.0865$198.39
AVAX2.48%$0.99994480.2116$80.21
AVAX0.15%$0.9999854.8619$4.86
AVAX0.09%$12.931$2.93
AVAX0.06%$23.140.0888$2.05
AVAX0.06%$0.3205866.2821$2.01
AVAX0.04%$11.2339$1.23
AVAX0.02%$0.995950.6775$0.6747
AVAX0.02%$59,7530.00000868$0.5186
AVAX0.01%$59,752.30.00000583$0.3483
AVAX<0.01%$0.2987961.0409$0.311
AVAX<0.01%$10.1739$0.174
AVAX<0.01%$136.060.00085185$0.1159
FTM1.31%$0.57536473.778$42.45
OP1.07%$0.99976734.541$34.53
OP0.06%$2,297.930.00080183$1.84
OP0.04%$0.9990721.2833$1.28
OP0.04%$0.9997671.1719$1.17
OP0.01%$0.985140.3731$0.3675
OP
Ether (ETH)
<0.01%$2,292.550.00011923$0.273347
OP<0.01%$10.380.0261$0.2712
OP<0.01%$1.340.1215$0.1628
OP<0.01%$0.2999560.438$0.1313
OP<0.01%$2,709.490.00004392$0.119
[ 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.