ETH Price: $3,295.56 (-0.52%)
Gas: 7 Gwei

Contract

0x1B83779b13a73d061ecF6dBC0cd0650571576AF6
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040186953382023-12-02 1:08:11241 days ago1701479291IN
 Create: SwapRouter
0 ETH0.0946668438.53393109

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
204115972024-07-29 10:23:3531 hrs ago1722248615
0x1B83779b...571576AF6
0.002 ETH
204115972024-07-29 10:23:3531 hrs ago1722248615
0x1B83779b...571576AF6
0.002 ETH
203904322024-07-26 11:29:474 days ago1721993387
0x1B83779b...571576AF6
0.01 ETH
203904322024-07-26 11:29:474 days ago1721993387
0x1B83779b...571576AF6
0.01 ETH
203814502024-07-25 5:23:475 days ago1721885027
0x1B83779b...571576AF6
0.0018 ETH
203814502024-07-25 5:23:475 days ago1721885027
0x1B83779b...571576AF6
0.0018 ETH
202224862024-07-03 0:44:5927 days ago1719967499
0x1B83779b...571576AF6
0.165 ETH
202224862024-07-03 0:44:5927 days ago1719967499
0x1B83779b...571576AF6
0.165 ETH
202153322024-07-02 0:44:2328 days ago1719881063
0x1B83779b...571576AF6
0.17145269 ETH
202153322024-07-02 0:44:2328 days ago1719881063
0x1B83779b...571576AF6
0.17145269 ETH
201377282024-06-21 4:32:4739 days ago1718944367
0x1B83779b...571576AF6
0.005 ETH
201377282024-06-21 4:32:4739 days ago1718944367
0x1B83779b...571576AF6
0.005 ETH
201081342024-06-17 1:08:5943 days ago1718586539
0x1B83779b...571576AF6
0.0005 ETH
201081342024-06-17 1:08:5943 days ago1718586539
0x1B83779b...571576AF6
0.0005 ETH
199922972024-05-31 20:48:1159 days ago1717188491
0x1B83779b...571576AF6
0.00999 ETH
199922972024-05-31 20:48:1159 days ago1717188491
0x1B83779b...571576AF6
0.00999 ETH
199511492024-05-26 2:44:3565 days ago1716691475
0x1B83779b...571576AF6
0.10317805 ETH
199511492024-05-26 2:44:3565 days ago1716691475
0x1B83779b...571576AF6
0.10317805 ETH
199505502024-05-26 0:44:3565 days ago1716684275
0x1B83779b...571576AF6
0.11838358 ETH
199505502024-05-26 0:44:3565 days ago1716684275
0x1B83779b...571576AF6
0.11838358 ETH
198753622024-05-15 12:24:3576 days ago1715775875
0x1B83779b...571576AF6
0.93941624 ETH
198753622024-05-15 12:24:3576 days ago1715775875
0x1B83779b...571576AF6
0.93941624 ETH
197835182024-05-02 16:05:4789 days ago1714665947
0x1B83779b...571576AF6
0.03 ETH
197835182024-05-02 16:05:4789 days ago1714665947
0x1B83779b...571576AF6
0.03 ETH
197653092024-04-30 3:02:2391 days ago1714446143
0x1B83779b...571576AF6
0.007 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SwapRouter

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : SwapRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "@openzeppelin/contracts/access/Ownable.sol";
import "../interfaces/ISwapRouter.sol";
import "../interfaces/ISwitchEvent.sol";
import "../interfaces/IUniswapFactory.sol";
import "./IWETH.sol";
import "../lib/UniswapExchangeLib.sol";
import "../lib/DataTypes.sol";

contract SwapRouter is Ownable, ISwapRouter {
    using UniswapExchangeLib for IUniswapExchange;
    using UniversalERC20 for IERC20;
    using SafeERC20 for IERC20;

    ISwitchEvent public switchEvent;
    uint256 public dexCount;
    uint256 public pathCount;
    uint256 public pathSplit;
    IWETH public weth; // chain's native token
    IWETH public otherToken; //could be weth on a non-eth chain or other mid token(like busd)
    address public paraswapProxy;
    address public augustusSwapper;
    address[] public factories;

    event SwitchEventSet(address switchEvent);
    event ParaswapProxySet(address paraswapProxy);
    event AugustusSwapperSet(address augustusSwapper);
    event WETHSet(address _weth);
    event OtherTokenSet(address _otherToken);
    event PathCountSet(uint256 _pathCount);
    event PathSplitSet(uint256 _pathSplit);
    event FactoriesSet(address[] _factories);

    constructor(
        address _weth,
        address _otherToken,
        uint256 _pathCount,
        uint256 _pathSplit,
        address[] memory _factories,
        address _switchEventAddress,
        address _paraswapProxy,
        address _augustusSwapper
    ) {
        switchEvent = ISwitchEvent(_switchEventAddress);
        paraswapProxy = _paraswapProxy;
        augustusSwapper = _augustusSwapper;

        weth = IWETH(_weth);
        otherToken = IWETH(_otherToken);
        pathCount = _pathCount;
        pathSplit = _pathSplit;
        dexCount = _factories.length;

        for (uint256 i; i < dexCount; ) {
            factories.push(_factories[i]);

            unchecked {
                i++;
            }
        }
    }

    /// @inheritdoc ISwapRouter
    function swap(SwapRequest calldata swapRequest)
        external
        payable
        override
        returns (uint256 unspent, uint256 returnAmount)
    {
        uint256 prevDstBal = swapRequest.dstToken.universalBalanceOf(
            address(this)
        );

        require(swapRequest.amountIn != 0, "zero");
        swapRequest.srcToken.universalTransferFrom(
            msg.sender,
            address(this),
            swapRequest.amountIn
        );

        uint256 prevSrcBal = swapRequest.srcToken.universalBalanceOf(
            address(this)
        ) - swapRequest.amountIn;

        uint256 spentAmount;
        // If amountIn is less than minimum, we couldn't use any aggregator
        if (swapRequest.amountIn >= swapRequest.amountMinSpend) {
            require(
                !swapRequest.useParaswap ||
                    _swapOnParaswap(
                        swapRequest.srcToken,
                        swapRequest.amountIn,
                        swapRequest.paraswapData
                    ) ||
                    !swapRequest.raiseError,
                "Paraswap swap failed"
            );

            _swapExternal(
                swapRequest.srcToken,
                swapRequest.splitSwapData,
                swapRequest.raiseError
            );

            uint256 currSrcBal = swapRequest.srcToken.universalBalanceOf(
                address(this)
            );
            require(currSrcBal >= prevSrcBal, "Too much swapped");
            spentAmount = prevSrcBal + swapRequest.amountIn - currSrcBal;
        }

        if (
            swapRequest.distribution.length != 0 &&
            swapRequest.distribution.length < dexCount * pathCount &&
            swapRequest.amountIn != spentAmount
        ) {
            _swapForSingleSwap(
                swapRequest.srcToken,
                swapRequest.dstToken,
                swapRequest.amountIn - spentAmount,
                swapRequest.distribution,
                swapRequest.raiseError
            );
        }

        uint256 finalSrcBal = swapRequest.srcToken.universalBalanceOf(
            address(this)
        );
        uint256 finalDstBal = swapRequest.dstToken.universalBalanceOf(
            address(this)
        );

        unspent = finalSrcBal - prevSrcBal;
        returnAmount = finalDstBal - prevDstBal;

        if (unspent != 0) {
            swapRequest.srcToken.universalTransfer(msg.sender, unspent);
        }

        if (returnAmount != 0) {
            swapRequest.dstToken.universalTransfer(msg.sender, returnAmount);
        }

        require(returnAmount >= swapRequest.amountOutMin);
    }

    function _swapOnParaswap(
        IERC20 token,
        uint256 amount,
        bytes memory callData
    ) internal returns (bool success) {
        if (callData.length == 0) {
            return true;
        }
        uint256 value;
        if (token.isETH()) {
            value = amount;
        } else {
            token.universalApprove(paraswapProxy, amount);
        }

        (success, ) = augustusSwapper.call{value: value}(callData);
    }

    function _swapExternal(
        IERC20 srcToken,
        DataTypes.SplitSwapInfo[] memory splitSwapData,
        bool raiseError
    ) internal {
        if (splitSwapData.length != 0) {
            uint256 len = splitSwapData.length;
            for (uint256 i; i < len; ) {
                try this.swapExternal(srcToken, splitSwapData[i]) {} catch {
                    require(!raiseError, "External swap failed");
                }

                unchecked {
                    i++;
                }
            }
        }
    }

    function swapExternal(
        IERC20 srcToken,
        DataTypes.SplitSwapInfo memory splitSwapData
    ) external {
        require(
            msg.sender == address(this),
            "Msg.sender can be contract it self"
        );

        if (splitSwapData.spender == address(0) && !srcToken.isETH()) {
            // Manually transfer instead of approve
            srcToken.universalTransfer(
                splitSwapData.swapContract,
                splitSwapData.amount
            );
        } else {
            srcToken.universalApprove(
                splitSwapData.spender,
                splitSwapData.amount
            );
        }
        (bool success, ) = splitSwapData.swapContract.call{
            value: srcToken.isETH() ? splitSwapData.amount : 0
        }(splitSwapData.swapData);

        require(success, "External swap failed");
    }

    function _swapForSingleSwap(
        IERC20 srcToken,
        IERC20 dstToken,
        uint256 amount,
        uint256[] memory distribution,
        bool raiseError
    ) private returns (uint256 returnAmount, uint256 parts) {
        uint256 lastNonZeroIndex = 0;
        uint256 len = distribution.length;
        for (uint256 i; i < len; ) {
            if (distribution[i] > 0) {
                parts += distribution[i];
                lastNonZeroIndex = i;
            }

            unchecked {
                i++;
            }
        }

        require(parts > 0 || !raiseError, "invalid distribution param");

        // break function to avoid stack too deep error
        returnAmount = _swapInternalForSingleSwap(
            distribution,
            amount,
            parts,
            lastNonZeroIndex,
            srcToken,
            dstToken
        );
        require(returnAmount > 0 || !raiseError, "Swap failed from dex");

        switchEvent.emitSwapped(
            msg.sender,
            address(this),
            IERC20(srcToken),
            IERC20(dstToken),
            amount,
            returnAmount,
            0
        );
    }

    function _swapInternalForSingleSwap(
        uint256[] memory distribution,
        uint256 amount,
        uint256 parts,
        uint256 lastNonZeroIndex,
        IERC20 fromToken,
        IERC20 dstToken
    ) internal returns (uint256 totalAmount) {
        uint256 remainingAmount = amount;
        uint256 swappedAmount = 0;
        uint256 len = distribution.length;
        for (uint256 i; i < len; i++) {
            if (distribution[i] == 0) {
                continue;
            }
            uint256 swapAmount = (amount * distribution[i]) / parts;
            if (i == lastNonZeroIndex) {
                swapAmount = remainingAmount;
            }
            remainingAmount -= swapAmount;
            if (i % pathCount == 0) {
                swappedAmount = _swap(
                    fromToken,
                    dstToken,
                    swapAmount,
                    IUniswapFactory(factories[i / pathCount])
                );
            } else if (i % pathCount == 1) {
                swappedAmount = _swapETH(
                    fromToken,
                    dstToken,
                    swapAmount,
                    IUniswapFactory(factories[i / pathCount])
                );
            } else {
                swappedAmount = _swapOtherToken(
                    fromToken,
                    dstToken,
                    swapAmount,
                    IUniswapFactory(factories[i / pathCount])
                );
            }
            totalAmount += swappedAmount;
        }
    }

    // Swap helpers
    function _swapInternal(
        IERC20 fromToken,
        IERC20 dstToken,
        uint256 amount,
        IUniswapFactory factory
    ) internal returns (uint256 returnAmount) {
        if (fromToken.isETH()) {
            weth.deposit{value: amount}();
        }

        IERC20 fromTokenReal = fromToken.isETH() ? weth : fromToken;
        IERC20 toTokenReal = dstToken.isETH() ? weth : dstToken;
        IUniswapExchange exchange = factory.getPair(fromTokenReal, toTokenReal);
        bool needSync;
        bool needSkim;
        (returnAmount, needSync, needSkim) = exchange.getReturn(
            fromTokenReal,
            toTokenReal,
            amount
        );
        if (needSync) {
            exchange.sync();
        } else if (needSkim) {
            exchange.skim(0x46Fd07da395799F113a7584563b8cB886F33c2bc);
        }

        fromTokenReal.universalTransfer(address(exchange), amount);
        if (uint160(address(fromTokenReal)) < uint160(address(toTokenReal))) {
            exchange.swap(0, returnAmount, address(this), "");
        } else {
            exchange.swap(returnAmount, 0, address(this), "");
        }

        if (dstToken.isETH()) {
            weth.withdraw(weth.balanceOf(address(this)));
        }
    }

    function _swapOverMid(
        IERC20 fromToken,
        IERC20 midToken,
        IERC20 dstToken,
        uint256 amount,
        IUniswapFactory factory
    ) internal returns (uint256 returnAmount) {
        returnAmount = _swapInternal(
            midToken,
            dstToken,
            _swapInternal(fromToken, midToken, amount, factory),
            factory
        );
    }

    function _swap(
        IERC20 fromToken,
        IERC20 dstToken,
        uint256 amount,
        IUniswapFactory factory
    ) internal returns (uint256 returnAmount) {
        returnAmount = _swapInternal(fromToken, dstToken, amount, factory);
    }

    function _swapETH(
        IERC20 fromToken,
        IERC20 dstToken,
        uint256 amount,
        IUniswapFactory factory
    ) internal returns (uint256 returnAmount) {
        returnAmount = _swapOverMid(fromToken, weth, dstToken, amount, factory);
    }

    function _swapOtherToken(
        IERC20 fromToken,
        IERC20 dstToken,
        uint256 amount,
        IUniswapFactory factory
    ) internal returns (uint256 returnAmount) {
        returnAmount = _swapOverMid(
            fromToken,
            otherToken,
            dstToken,
            amount,
            factory
        );
    }

    function setWETH(address _weth) external onlyOwner {
        weth = IWETH(_weth);
        emit WETHSet(_weth);
    }

    function setOtherToken(address _otherToken) external onlyOwner {
        otherToken = IWETH(_otherToken);
        emit OtherTokenSet(_otherToken);
    }

    function setPathCount(uint256 _pathCount) external onlyOwner {
        pathCount = _pathCount;
        emit PathCountSet(_pathCount);
    }

    function setPathSplit(uint256 _pathSplit) external onlyOwner {
        pathSplit = _pathSplit;
        emit PathSplitSet(_pathSplit);
    }

    function setFactories(address[] memory _factories) external onlyOwner {
        dexCount = _factories.length;
        for (uint256 i = 0; i < _factories.length; i++) {
            factories.push(_factories[i]);
        }
        emit FactoriesSet(_factories);
    }

    receive() external payable {}
}

File 2 of 16 : 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 16 : 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 4 of 16 : 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 5 of 16 : 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 6 of 16 : 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 7 of 16 : 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 8 of 16 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

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

abstract contract IWETH is IERC20 {
    function deposit() external virtual payable;
    function withdraw(uint256 amount) virtual external;
}

File 9 of 16 : ISwapRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

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

interface ISwapRouter {
    struct SwapRequest {
        IERC20 srcToken; // Source token address
        IERC20 dstToken; // Destination token address
        uint256 amountIn; // Source token amount to swap
        uint256 amountMinSpend; // Minimum token amount to be swapped by aggregator.
        //If this is lower than amountIn, it will skip dex aggregator swap.
        uint256 amountOutMin; // Minimum output amount in desitnation token.
        bool useParaswap; // Flag to use paraswap or not.
        bytes paraswapData; // Paraswap calldata
        DataTypes.SplitSwapInfo[] splitSwapData; // Split swap data array for using several dex aggregators
        uint256[] distribution; // internal swap params at uni v2 like amms.
        bool raiseError; // true to revert, false to continue without reverting.
    }

    /**
     * Swap source token to destination token by dex aggreagors and internal swap.
     * Sometimes, we couldn't swap all src token amount. This happens when dex aggreagator
     * payload amount is lower than amountIn.
     * @param swapRequest SwapRequest struct param
     * @return unspent unswapped source token amount
     * @return returnAmount received destination token amount
     */
    function swap(SwapRequest memory swapRequest)
        external
        payable
        returns (uint256 unspent, uint256 returnAmount);
}

File 10 of 16 : ISwitchEvent.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

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

interface ISwitchEvent {
    function emitSwapped(
        address from,
        address recipient,
        IERC20 fromToken,
        IERC20 destToken,
        uint256 fromAmount,
        uint256 destAmount,
        uint256 reward
    ) external;

    function emitParaswapSwapped(
        address from,
        IERC20 fromToken,
        uint256 fromAmount
    ) external;

    function emitCrosschainSwapRequest(
        bytes32 id,
        bytes32 bridgeTransferId,
        bytes32 bridge, // bridge slug
        address from, // user address
        address fromToken, // source token on sending chain
        address bridgeToken, // bridge token on sending chain
        address destToken, // dest token on receiving chain
        uint256 fromAmount, // source token amount on sending chain
        uint256 bridgeAmount, // swapped amount on sending chain
        uint256 dstAmount, // estimated amount of dest token on receiving chain
        DataTypes.SwapStatus status
    ) external;

    function emitCrosschainContractCallRequest(
        bytes32 id,
        bytes32 bridgeTransferId,
        bytes32 bridge, // bridge slug
        address from, // user address
        address toContractAddress, // The address of the contract to interact with
        address toApprovalAddress, // the approval address for contract call
        address fromToken, // source token on sending chain
        address callToken, // contract call token on receiving chain
        uint256 fromAmount, // source token amount on sending chain
        uint256 estimatedCallAmount, // estimated amount of contract call token on receiving chain
        DataTypes.ContractCallStatus status
    ) external;

    function emitCrosschainSwapDone(
        bytes32 id,
        bytes32 bridge,
        address from, // user address
        address bridgeToken, // source token on receiving chain
        address destToken, // dest token on receiving chain
        uint256 bridgeAmount, // bridge token amount on receiving chain
        uint256 destAmount, //dest token amount on receiving chain
        DataTypes.SwapStatus status
    ) external;

    function emitCrosschainContractCallDone(
        bytes32 id,
        bytes32 bridge,
        address from, // user address
        address toContractAddress, // The address of the contract to interact with
        address toApprovalAddress, // the approval address for contract call
        address bridgeToken, // source token on receiving chain
        address callToken, // call token on receiving chain
        uint256 bridgeAmount, // bridge token amount on receiving chain
        uint256 estimatedCallAmount, //dest token amount on receiving chain
        DataTypes.ContractCallStatus status
    ) external;

    function emitSingleChainContractCallDone(
        address from, // user address
        address toContractAddress, // The address of the contract to interact with
        address toApprovalAddress, // the approval address for contract call
        address fromToken, // source token on receiving chain
        address callToken, // call token on receiving chain
        uint256 fromAmount, // from token amount on receiving chain
        uint256 callAmount, //dest token amount on receiving chain
        DataTypes.ContractCallStatus status
    ) external;
}

File 11 of 16 : IUniswapExchange.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

interface IUniswapExchange {
    function getReserves() external view returns(uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;
}

File 12 of 16 : IUniswapFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

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

interface IUniswapFactory {
    function getPair(IERC20 tokenA, IERC20 tokenB) external view returns (IUniswapExchange pair);
}

File 13 of 16 : DataTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;
/**
 * @title DataTypes
 * @dev Definition of shared types
 */
library DataTypes {
    /// @notice Type for representing a swapping status type
    enum SwapStatus {
        Null,
        Succeeded,
        Failed,
        Fallback
    }

    enum ContractCallStatus {
        Null,
        Succeeded,
        Failed,
        Fallback
    }

    /// @notice Type for representing a paraswap usage status
    enum ParaswapUsageStatus {
        None,
        OnSrcChain,
        OnDestChain,
        Both
    }

    /// @notice Split Swap params
    struct SplitSwapInfo {
        uint256 amount;
        address swapContract;
        address spender;
        bytes swapData;
    }

    /// @notice Swap params
    struct SwapInfo {
        address srcToken;
        address dstToken;
    }

    struct ContractCallInfo {
        address toContractAddress; // The address of the contract to interact with.
        address toApprovalAddress; // the approval address for contract call
        address contractOutputsToken; // Some contract interactions will output a token (e.g. staking)
        uint32 toContractGasLimit; // The estimated gas used by the destination call.
        bytes toContractCallData; // The callData to be sent to the contract for the interaction on the destination chain.
    }

    struct ContractCallRequest {
        bytes32 id;
        bytes32 bridge;
        address srcToken;
        address bridgeToken;
        address callToken;
        address recipient;
        uint256 srcAmount;
        uint256 bridgeDstAmount;
        uint256 estimatedCallAmount;
        uint256[] dstDistribution;
        bytes dstParaswapData;
        ContractCallInfo callInfo;
        ParaswapUsageStatus paraswapUsageStatus;
    }
}

File 14 of 16 : Math.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 15 of 16 : UniswapExchangeLib.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

import "../interfaces/IUniswapExchange.sol";
import "./Math.sol";
import "./UniversalERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

library UniswapExchangeLib {
    using Math for uint256;
    using UniversalERC20 for IERC20;

    function getReturn(
        IUniswapExchange exchange,
        IERC20 fromToken,
        IERC20 destToken,
        uint amountIn
    )
        internal
        view
        returns (uint256 result, bool needSync, bool needSkim)
    {
        uint256 reserveIn = fromToken.universalBalanceOf(address(exchange));
        uint256 reserveOut = destToken.universalBalanceOf(address(exchange));
        (uint112 reserve0, uint112 reserve1,) = exchange.getReserves();
        if (fromToken > destToken) {
            (reserve0, reserve1) = (reserve1, reserve0);
        }
        needSync = (reserveIn < reserve0 || reserveOut < reserve1);
        needSkim = !needSync && (reserveIn > reserve0 || reserveOut > reserve1);

        uint256 amountInWithFee = amountIn * 997;
        uint256 numerator = amountInWithFee * Math.min(reserveOut, reserve1);
        uint256 denominator = Math.min(reserveIn, reserve0) * 1000 + amountInWithFee;
        result = (denominator == 0) ? 0 : numerator / denominator;
    }
}

File 16 of 16 : UniversalERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.9;

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

library UniversalERC20 {

    using SafeERC20 for IERC20;

    address private constant ZERO_ADDRESS = address(0x0000000000000000000000000000000000000000);
    address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

    function universalTransfer(
        IERC20 token,
        address to,
        uint256 amount
    )
        internal
        returns (bool)
    {
        if (amount == 0) {
            return true;
        }
        if (isETH(token)) {
            payable(to).transfer(amount);
            return true;
        } else {
            token.safeTransfer(to, amount);
            return true;
        }
    }

    function universalTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 amount
    )
        internal
    {
        if (amount == 0) {
            return;
        }

        if (isETH(token)) {
            require(from == msg.sender && msg.value >= amount, "Wrong useage of ETH.universalTransferFrom()");
            if (to != address(this)) {
                payable(to).transfer(amount);
            }
            // commented following lines for passing celer fee properly.
//            if (msg.value > amount) {
//                payable(msg.sender).transfer(msg.value - amount);
//            }
        } else {
            token.safeTransferFrom(from, to, amount);
        }
    }

    function universalTransferFromSenderToThis(
        IERC20 token,
        uint256 amount
    )
        internal
    {
        if (amount == 0) {
            return;
        }

        if (isETH(token)) {
            if (msg.value > amount) {
                // Return remainder if exist
                payable(msg.sender).transfer(msg.value - amount);
            }
        } else {
            token.safeTransferFrom(msg.sender, address(this), amount);
        }
    }

    function universalApprove(
        IERC20 token,
        address to,
        uint256 amount
    )
        internal
    {
        if (!isETH(token)) {
            if (amount == 0) {
                token.safeApprove(to, 0);
                return;
            }

            uint256 approvedAmount = token.allowance(address(this), to);
            if (approvedAmount > 0) {
                token.safeApprove(to, 0);
            }
            token.safeApprove(to, amount);
        }
    }

    function universalBalanceOf(IERC20 token, address who) internal view returns (uint256) {
        if (isETH(token)) {
            return who.balance;
        } else {
            return token.balanceOf(who);
        }
    }

    function isETH(IERC20 token) internal pure returns(bool) {
        return (address(token) == address(ZERO_ADDRESS) || address(token) == address(ETH_ADDRESS));
    }

    // function notExist(IERC20 token) internal pure returns(bool) {
    //     return (address(token) == address(-1));
    // }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "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":"_otherToken","type":"address"},{"internalType":"uint256","name":"_pathCount","type":"uint256"},{"internalType":"uint256","name":"_pathSplit","type":"uint256"},{"internalType":"address[]","name":"_factories","type":"address[]"},{"internalType":"address","name":"_switchEventAddress","type":"address"},{"internalType":"address","name":"_paraswapProxy","type":"address"},{"internalType":"address","name":"_augustusSwapper","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"augustusSwapper","type":"address"}],"name":"AugustusSwapperSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"_factories","type":"address[]"}],"name":"FactoriesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_otherToken","type":"address"}],"name":"OtherTokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"paraswapProxy","type":"address"}],"name":"ParaswapProxySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_pathCount","type":"uint256"}],"name":"PathCountSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_pathSplit","type":"uint256"}],"name":"PathSplitSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"switchEvent","type":"address"}],"name":"SwitchEventSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_weth","type":"address"}],"name":"WETHSet","type":"event"},{"inputs":[],"name":"augustusSwapper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dexCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"factories","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"otherToken","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paraswapProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pathCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pathSplit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_factories","type":"address[]"}],"name":"setFactories","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_otherToken","type":"address"}],"name":"setOtherToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pathCount","type":"uint256"}],"name":"setPathCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pathSplit","type":"uint256"}],"name":"setPathSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_weth","type":"address"}],"name":"setWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"contract IERC20","name":"srcToken","type":"address"},{"internalType":"contract IERC20","name":"dstToken","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountMinSpend","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"bool","name":"useParaswap","type":"bool"},{"internalType":"bytes","name":"paraswapData","type":"bytes"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"swapContract","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct DataTypes.SplitSwapInfo[]","name":"splitSwapData","type":"tuple[]"},{"internalType":"uint256[]","name":"distribution","type":"uint256[]"},{"internalType":"bool","name":"raiseError","type":"bool"}],"internalType":"struct ISwapRouter.SwapRequest","name":"swapRequest","type":"tuple"}],"name":"swap","outputs":[{"internalType":"uint256","name":"unspent","type":"uint256"},{"internalType":"uint256","name":"returnAmount","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"srcToken","type":"address"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"swapContract","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct DataTypes.SplitSwapInfo","name":"splitSwapData","type":"tuple"}],"name":"swapExternal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"switchEvent","outputs":[{"internalType":"contract ISwitchEvent","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b50604051620028f8380380620028f88339810160408190526200003491620001a1565b6200003f336200011e565b600180546001600160a01b03199081166001600160a01b03868116919091179092556007805482168584161790556008805482168484161790556005805482168b84161790556006805490911691891691909117905560038690556004859055835160025560005b6002548110156200010f576009858281518110620000c957620000c9620002e8565b60209081029190910181015182546001808201855560009485529290932090920180546001600160a01b0319166001600160a01b039093169290921790915501620000a7565b505050505050505050620002fe565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200018657600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600080610100898b031215620001bf57600080fd5b620001ca896200016e565b97506020620001db818b016200016e565b60408b015160608c015160808d0151929a5090985096506001600160401b03808211156200020857600080fd5b818c0191508c601f8301126200021d57600080fd5b8151818111156200023257620002326200018b565b8060051b604051601f19603f830116810181811085821117156200025a576200025a6200018b565b60405291825284820192508381018501918f8311156200027957600080fd5b938501935b82851015620002a25762000292856200016e565b845293850193928501926200027e565b809950505050505050620002b960a08a016200016e565b9250620002c960c08a016200016e565b9150620002d960e08a016200016e565b90509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b6125ea806200030e6000396000f3fe6080604052600436106101185760003560e01c80638da5cb5b116100a0578063b4c76fe011610064578063b4c76fe0146102e6578063b5e0243014610306578063ea15afc31461032e578063ecb178981461034e578063f2fde38b1461036e57600080fd5b80638da5cb5b1461025c57806390f3f2081461027a578063a85f329814610290578063ab304695146102b0578063ae551c66146102c657600080fd5b80635b18075e116100e75780635b18075e146101c35780635b769f3c146101e3578063672383c414610203578063715018a6146102235780638c821e901461023857600080fd5b806323a9495e146101245780633fc8cef314610146578063433b3c05146101835780634399fa56146101a357600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5061014461013f366004611efb565b61038e565b005b34801561015257600080fd5b50600554610166906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018f57600080fd5b50600654610166906001600160a01b031681565b3480156101af57600080fd5b50600154610166906001600160a01b031681565b3480156101cf57600080fd5b50600754610166906001600160a01b031681565b3480156101ef57600080fd5b506101446101fe366004611f29565b6103d2565b34801561020f57600080fd5b5061016661021e366004611efb565b610428565b34801561022f57600080fd5b50610144610452565b34801561024457600080fd5b5061024e60035481565b60405190815260200161017a565b34801561026857600080fd5b506000546001600160a01b0316610166565b34801561028657600080fd5b5061024e60045481565b34801561029c57600080fd5b506101446102ab366004611efb565b610466565b3480156102bc57600080fd5b5061024e60025481565b3480156102d257600080fd5b50600854610166906001600160a01b031681565b3480156102f257600080fd5b50610144610301366004611f29565b6104a3565b610319610314366004611f46565b6104f9565b6040805192835260208301919091520161017a565b34801561033a57600080fd5b50610144610349366004612016565b6108c2565b34801561035a57600080fd5b50610144610369366004612179565b61096c565b34801561037a57600080fd5b50610144610389366004611f29565b610b02565b610396610b7b565b60048190556040518181527f11e8ee12d79dc7314b845f4e82465af5bd3d2214081526061af36de8364eaa2e906020015b60405180910390a150565b6103da610b7b565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527f41408be49f75701fe4bb8484ce88d68f1d82e03cb4eb44263b6682ce2dbd32f0906020016103c7565b6009818154811061043857600080fd5b6000918252602090912001546001600160a01b0316905081565b61045a610b7b565b6104646000610bd5565b565b61046e610b7b565b60038190556040518181527f70f24e12a9db25e0d80cbcde19ffef47d6a7c52c1089db4c71e53ce1856577fc906020016103c7565b6104ab610b7b565b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527f17780f3919f73af11f29e4157534858a06c91294d64b679fe4e49340122cd322906020016103c7565b60008080610520306105116040870160208801611f29565b6001600160a01b031690610c25565b905060408401356105655760405162461bcd60e51b815260040161055c906020808252600490820152637a65726f60e01b604082015260600190565b60405180910390fd5b61058d3330604087013561057c6020890189611f29565b6001600160a01b0316929190610cc8565b600060408501356105a5306105116020890189611f29565b6105af91906121df565b905060008560600135866040013510610744576105d260c0870160a08801612204565b158061063557506106356105e96020880188611f29565b60408801356105fb60c08a018a612221565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dc092505050565b8061064f575061064d61014087016101208801612204565b155b6106925760405162461bcd60e51b815260206004820152601460248201527314185c985cddd85c081cddd85c0819985a5b195960621b604482015260640161055c565b6106cf6106a26020880188611f29565b6106af60e089018961226f565b6106b8916122b9565b6106ca6101408a016101208b01612204565b610e7d565b60006106e23061051160208a018a611f29565b9050828110156107275760405162461bcd60e51b815260206004820152601060248201526f151bdbc81b5d58da081cddd85c1c195960821b604482015260640161055c565b8061073660408901358561232d565b61074091906121df565b9150505b61075261010087018761226f565b158015915061077e575060035460025461076c9190612345565b61077a61010088018861226f565b9050105b801561078e575080866040013514155b1561081b576108186107a36020880188611f29565b6107b36040890160208a01611f29565b6107c18460408b01356121df565b6107cf6101008b018b61226f565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610813925050506101408c016101208d01612204565b610f5b565b50505b600061082e3061051160208a018a611f29565b905060006108463061051160408b0160208c01611f29565b905061085284836121df565b965061085e85826121df565b9550861561088a57610888338861087860208c018c611f29565b6001600160a01b03169190611113565b505b85156108a7576108a5338761087860408c0160208d01611f29565b505b87608001358610156108b857600080fd5b5050505050915091565b6108ca610b7b565b805160025560005b815181101561093c5760098282815181106108ef576108ef612364565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806109348161237a565b9150506108d2565b507fbbc63a7f378af7e269ef19f3fe0d08f044c91ee72930c0d045a58be58580f3d3816040516103c79190612395565b3330146109c65760405162461bcd60e51b815260206004820152602260248201527f4d73672e73656e6465722063616e20626520636f6e7472616374206974207365604482015261363360f11b606482015260840161055c565b60408101516001600160a01b03161580156109f057506109ee826001600160a01b031661118c565b155b15610a165760208101518151610a10916001600160a01b03851691611113565b50610a31565b60408101518151610a31916001600160a01b038516916111c5565b600081602001516001600160a01b0316610a53846001600160a01b031661118c565b610a5e576000610a61565b82515b8360600151604051610a73919061240e565b60006040518083038185875af1925050503d8060008114610ab0576040519150601f19603f3d011682016040523d82523d6000602084013e610ab5565b606091505b5050905080610afd5760405162461bcd60e51b8152602060048201526014602482015273115e1d195c9b985b081cddd85c0819985a5b195960621b604482015260640161055c565b505050565b610b0a610b7b565b6001600160a01b038116610b6f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161055c565b610b7881610bd5565b50565b6000546001600160a01b031633146104645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161055c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610c308361118c565b15610c4657506001600160a01b03811631610cc2565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015610c8757600080fd5b505afa158015610c9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbf919061242a565b90505b92915050565b80610cd257610dba565b610cdb8461118c565b15610da5576001600160a01b03831633148015610cf85750803410155b610d585760405162461bcd60e51b815260206004820152602b60248201527f57726f6e6720757365616765206f66204554482e756e6976657273616c54726160448201526a6e7366657246726f6d282960a81b606482015260840161055c565b6001600160a01b0382163014610da0576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610d9e573d6000803e3d6000fd5b505b610dba565b610dba6001600160a01b0385168484846112a0565b50505050565b6000815160001415610dd457506001610e76565b6000610de8856001600160a01b031661118c565b15610df4575082610e0e565b600754610e0e906001600160a01b038781169116866111c5565b6008546040516001600160a01b03909116908290610e2d90869061240e565b60006040518083038185875af1925050503d8060008114610e6a576040519150601f19603f3d011682016040523d82523d6000602084013e610e6f565b606091505b5090925050505b9392505050565b815115610afd57815160005b81811015610f5457306001600160a01b031663ecb1789886868481518110610eb357610eb3612364565b60200260200101516040518363ffffffff1660e01b8152600401610ed892919061246f565b600060405180830381600087803b158015610ef257600080fd5b505af1925050508015610f03575060015b610f4c578215610f4c5760405162461bcd60e51b8152602060048201526014602482015273115e1d195c9b985b081cddd85c0819985a5b195960621b604482015260640161055c565b600101610e89565b5050505050565b6000806000808551905060005b81811015610fc5576000878281518110610f8457610f84612364565b60200260200101511115610fbd57868181518110610fa457610fa4612364565b602002602001015184610fb7919061232d565b93508092505b600101610f68565b506000831180610fd3575084155b61101f5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420646973747269627574696f6e20706172616d000000000000604482015260640161055c565b61102d868885858d8d61130b565b9350600084118061103c575084155b61107f5760405162461bcd60e51b81526020600482015260146024820152730a6eec2e040ccc2d2d8cac840cce4deda40c8caf60631b604482015260640161055c565b600154604051630e47f70960e21b81523360048201523060248201526001600160a01b038b811660448301528a81166064830152608482018a905260a48201879052600060c48301529091169063391fdc249060e401600060405180830381600087803b1580156110ef57600080fd5b505af1158015611103573d6000803e3d6000fd5b5050505050509550959350505050565b60008161112257506001610e76565b61112b8461118c565b15611170576040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015611166573d6000803e3d6000fd5b5060019050610e76565b6111846001600160a01b03851684846114af565b506001610e76565b60006001600160a01b0382161580610cc257506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b6111ce8361118c565b610afd57806111ec57610afd6001600160a01b0384168360006114df565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b15801561123757600080fd5b505afa15801561124b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126f919061242a565b9050801561128c5761128c6001600160a01b0385168460006114df565b610dba6001600160a01b03851684846114df565b6040516001600160a01b0380851660248301528316604482015260648101829052610dba9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611603565b855160009086908290815b818110156114a1578a818151811061133057611330612364565b6020026020010151600014156113455761148f565b6000898c838151811061135a5761135a612364565b60200260200101518c61136d9190612345565b61137791906124d3565b9050888214156113845750835b61138e81866121df565b94506003548261139e91906124e7565b6113e9576113e28888836009600354876113b891906124d3565b815481106113c8576113c8612364565b6000918252602090912001546001600160a01b03166116d8565b9350611481565b6003546113f690836124e7565b6001141561143e576113e288888360096003548761141491906124d3565b8154811061142457611424612364565b6000918252602090912001546001600160a01b03166116ef565b61147e88888360096003548761145491906124d3565b8154811061146457611464612364565b6000918252602090912001546001600160a01b031661170c565b93505b61148b848761232d565b9550505b806114998161237a565b915050611316565b505050509695505050505050565b6040516001600160a01b038316602482015260448101829052610afd90849063a9059cbb60e01b906064016112d4565b8015806115685750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561152e57600080fd5b505afa158015611542573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611566919061242a565b155b6115d35760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161055c565b6040516001600160a01b038316602482015260448101829052610afd90849063095ea7b360e01b906064016112d4565b6000611658826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117299092919063ffffffff16565b905080516000148061167957508080602001905181019061167991906124fb565b610afd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161055c565b60006116e685858585611740565b95945050505050565b6005546000906116e69086906001600160a01b0316868686611bac565b6006546000906116e69086906001600160a01b0316868686611bac565b60606117388484600085611bcf565b949350505050565b6000611754856001600160a01b031661118c565b156117c357600560009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117a957600080fd5b505af11580156117bd573d6000803e3d6000fd5b50505050505b60006117d7866001600160a01b031661118c565b6117e157856117ee565b6005546001600160a01b03165b90506000611804866001600160a01b031661118c565b61180e578561181b565b6005546001600160a01b03165b60405163e6a4390560e01b81526001600160a01b038481166004830152808316602483015291925060009186169063e6a439059060440160206040518083038186803b15801561186a57600080fd5b505afa15801561187e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a29190612518565b90506000806118bc6001600160a01b03841686868b611caa565b91975092509050811561192157826001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561190457600080fd5b505af1158015611918573d6000803e3d6000fd5b50505050611995565b80156119955760405163bc25cf7760e01b81527346fd07da395799f113a7584563b8cb886f33c2bc60048201526001600160a01b0384169063bc25cf7790602401600060405180830381600087803b15801561197c57600080fd5b505af1158015611990573d6000803e3d6000fd5b505050505b6119a96001600160a01b038616848a611113565b50836001600160a01b0316856001600160a01b03161015611a3e5760405163022c0d9f60e01b8152600060048201819052602482018890523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015611a2157600080fd5b505af1158015611a35573d6000803e3d6000fd5b50505050611ab4565b60405163022c0d9f60e01b8152600481018790526000602482018190523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015611a9b57600080fd5b505af1158015611aaf573d6000803e3d6000fd5b505050505b611ac6896001600160a01b031661118c565b15611b9f576005546040516370a0823160e01b81523060048201526001600160a01b0390911690632e1a7d4d9082906370a082319060240160206040518083038186803b158015611b1657600080fd5b505afa158015611b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4e919061242a565b6040518263ffffffff1660e01b8152600401611b6c91815260200190565b600060405180830381600087803b158015611b8657600080fd5b505af1158015611b9a573d6000803e3d6000fd5b505050505b5050505050949350505050565b6000611bc58585611bbf89898888611740565b85611740565b9695505050505050565b606082471015611c305760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161055c565b600080866001600160a01b03168587604051611c4c919061240e565b60006040518083038185875af1925050503d8060008114611c89576040519150601f19603f3d011682016040523d82523d6000602084013e611c8e565b606091505b5091509150611c9f87838387611e45565b979650505050505050565b6000808080611cc26001600160a01b03881689610c25565b90506000611cd96001600160a01b0388168a610c25565b90506000808a6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611d1757600080fd5b505afa158015611d2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4f9190612551565b5091509150886001600160a01b03168a6001600160a01b03161115611d7057905b816001600160701b0316841080611d8f5750806001600160701b031683105b955085158015611db95750816001600160701b0316841180611db95750806001600160701b031683115b94506000611dc9896103e5612345565b90506000611de085846001600160701b0316611ebb565b611dea9083612345565b9050600082611e0288876001600160701b0316611ebb565b611e0e906103e8612345565b611e18919061232d565b90508015611e2f57611e2a81836124d3565b611e32565b60005b9950505050505050509450945094915050565b60608315611eb1578251611eaa576001600160a01b0385163b611eaa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161055c565b5081611738565b6117388383611ed1565b6000818310611eca5781610cbf565b5090919050565b815115611ee15781518083602001fd5b8060405162461bcd60e51b815260040161055c91906125a1565b600060208284031215611f0d57600080fd5b5035919050565b6001600160a01b0381168114610b7857600080fd5b600060208284031215611f3b57600080fd5b8135610e7681611f14565b600060208284031215611f5857600080fd5b813567ffffffffffffffff811115611f6f57600080fd5b82016101408185031215610e7657600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611fbb57611fbb611f82565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611fea57611fea611f82565b604052919050565b600067ffffffffffffffff82111561200c5761200c611f82565b5060051b60200190565b6000602080838503121561202957600080fd5b823567ffffffffffffffff81111561204057600080fd5b8301601f8101851361205157600080fd5b803561206461205f82611ff2565b611fc1565b81815260059190911b8201830190838101908783111561208357600080fd5b928401925b82841015611c9f57833561209b81611f14565b82529284019290840190612088565b6000608082840312156120bc57600080fd5b6120c4611f98565b9050813581526020808301356120d981611f14565b8282015260408301356120eb81611f14565b6040830152606083013567ffffffffffffffff8082111561210b57600080fd5b818501915085601f83011261211f57600080fd5b81358181111561213157612131611f82565b612143601f8201601f19168501611fc1565b9150808252868482850101111561215957600080fd5b808484018584013760008482840101525080606085015250505092915050565b6000806040838503121561218c57600080fd5b823561219781611f14565b9150602083013567ffffffffffffffff8111156121b357600080fd5b6121bf858286016120aa565b9150509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156121f1576121f16121c9565b500390565b8015158114610b7857600080fd5b60006020828403121561221657600080fd5b8135610e76816121f6565b6000808335601e1984360301811261223857600080fd5b83018035915067ffffffffffffffff82111561225357600080fd5b60200191503681900382131561226857600080fd5b9250929050565b6000808335601e1984360301811261228657600080fd5b83018035915067ffffffffffffffff8211156122a157600080fd5b6020019150600581901b360382131561226857600080fd5b60006122c761205f84611ff2565b80848252602080830192508560051b8501368111156122e557600080fd5b855b8181101561232157803567ffffffffffffffff8111156123075760008081fd5b61231336828a016120aa565b8652509382019382016122e7565b50919695505050505050565b60008219821115612340576123406121c9565b500190565b600081600019048311821515161561235f5761235f6121c9565b500290565b634e487b7160e01b600052603260045260246000fd5b600060001982141561238e5761238e6121c9565b5060010190565b6020808252825182820181905260009190848201906040850190845b818110156123d65783516001600160a01b0316835292840192918401916001016123b1565b50909695505050505050565b60005b838110156123fd5781810151838201526020016123e5565b83811115610dba5750506000910152565b600082516124208184602087016123e2565b9190910192915050565b60006020828403121561243c57600080fd5b5051919050565b6000815180845261245b8160208601602086016123e2565b601f01601f19169290920160200192915050565b600060018060a01b0380851683526040602084015283516040840152806020850151166060840152806040850151166080840152506060830151608060a08401526116e660c0840182612443565b634e487b7160e01b600052601260045260246000fd5b6000826124e2576124e26124bd565b500490565b6000826124f6576124f66124bd565b500690565b60006020828403121561250d57600080fd5b8151610e76816121f6565b60006020828403121561252a57600080fd5b8151610e7681611f14565b80516001600160701b038116811461254c57600080fd5b919050565b60008060006060848603121561256657600080fd5b61256f84612535565b925061257d60208501612535565b9150604084015163ffffffff8116811461259657600080fd5b809150509250925092565b602081526000610cbf602083018461244356fea2646970667358221220c9107b40b337e15c8c86ec360da0c81426e6bd202e2325a404ca1c9a5d467ede64736f6c63430008090033000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000100000000000000000000000000410f724847c92bc3cdacbcd4922f1d7833ec280a000000000000000000000000216b4b4ba9f3e719726886d34a177484278bfcae000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee5700000000000000000000000000000000000000000000000000000000000000030000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac000000000000000000000000115934131916c8b277dd010ee02de363c09d037c

Deployed Bytecode

0x6080604052600436106101185760003560e01c80638da5cb5b116100a0578063b4c76fe011610064578063b4c76fe0146102e6578063b5e0243014610306578063ea15afc31461032e578063ecb178981461034e578063f2fde38b1461036e57600080fd5b80638da5cb5b1461025c57806390f3f2081461027a578063a85f329814610290578063ab304695146102b0578063ae551c66146102c657600080fd5b80635b18075e116100e75780635b18075e146101c35780635b769f3c146101e3578063672383c414610203578063715018a6146102235780638c821e901461023857600080fd5b806323a9495e146101245780633fc8cef314610146578063433b3c05146101835780634399fa56146101a357600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5061014461013f366004611efb565b61038e565b005b34801561015257600080fd5b50600554610166906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018f57600080fd5b50600654610166906001600160a01b031681565b3480156101af57600080fd5b50600154610166906001600160a01b031681565b3480156101cf57600080fd5b50600754610166906001600160a01b031681565b3480156101ef57600080fd5b506101446101fe366004611f29565b6103d2565b34801561020f57600080fd5b5061016661021e366004611efb565b610428565b34801561022f57600080fd5b50610144610452565b34801561024457600080fd5b5061024e60035481565b60405190815260200161017a565b34801561026857600080fd5b506000546001600160a01b0316610166565b34801561028657600080fd5b5061024e60045481565b34801561029c57600080fd5b506101446102ab366004611efb565b610466565b3480156102bc57600080fd5b5061024e60025481565b3480156102d257600080fd5b50600854610166906001600160a01b031681565b3480156102f257600080fd5b50610144610301366004611f29565b6104a3565b610319610314366004611f46565b6104f9565b6040805192835260208301919091520161017a565b34801561033a57600080fd5b50610144610349366004612016565b6108c2565b34801561035a57600080fd5b50610144610369366004612179565b61096c565b34801561037a57600080fd5b50610144610389366004611f29565b610b02565b610396610b7b565b60048190556040518181527f11e8ee12d79dc7314b845f4e82465af5bd3d2214081526061af36de8364eaa2e906020015b60405180910390a150565b6103da610b7b565b600580546001600160a01b0319166001600160a01b0383169081179091556040519081527f41408be49f75701fe4bb8484ce88d68f1d82e03cb4eb44263b6682ce2dbd32f0906020016103c7565b6009818154811061043857600080fd5b6000918252602090912001546001600160a01b0316905081565b61045a610b7b565b6104646000610bd5565b565b61046e610b7b565b60038190556040518181527f70f24e12a9db25e0d80cbcde19ffef47d6a7c52c1089db4c71e53ce1856577fc906020016103c7565b6104ab610b7b565b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527f17780f3919f73af11f29e4157534858a06c91294d64b679fe4e49340122cd322906020016103c7565b60008080610520306105116040870160208801611f29565b6001600160a01b031690610c25565b905060408401356105655760405162461bcd60e51b815260040161055c906020808252600490820152637a65726f60e01b604082015260600190565b60405180910390fd5b61058d3330604087013561057c6020890189611f29565b6001600160a01b0316929190610cc8565b600060408501356105a5306105116020890189611f29565b6105af91906121df565b905060008560600135866040013510610744576105d260c0870160a08801612204565b158061063557506106356105e96020880188611f29565b60408801356105fb60c08a018a612221565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610dc092505050565b8061064f575061064d61014087016101208801612204565b155b6106925760405162461bcd60e51b815260206004820152601460248201527314185c985cddd85c081cddd85c0819985a5b195960621b604482015260640161055c565b6106cf6106a26020880188611f29565b6106af60e089018961226f565b6106b8916122b9565b6106ca6101408a016101208b01612204565b610e7d565b60006106e23061051160208a018a611f29565b9050828110156107275760405162461bcd60e51b815260206004820152601060248201526f151bdbc81b5d58da081cddd85c1c195960821b604482015260640161055c565b8061073660408901358561232d565b61074091906121df565b9150505b61075261010087018761226f565b158015915061077e575060035460025461076c9190612345565b61077a61010088018861226f565b9050105b801561078e575080866040013514155b1561081b576108186107a36020880188611f29565b6107b36040890160208a01611f29565b6107c18460408b01356121df565b6107cf6101008b018b61226f565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610813925050506101408c016101208d01612204565b610f5b565b50505b600061082e3061051160208a018a611f29565b905060006108463061051160408b0160208c01611f29565b905061085284836121df565b965061085e85826121df565b9550861561088a57610888338861087860208c018c611f29565b6001600160a01b03169190611113565b505b85156108a7576108a5338761087860408c0160208d01611f29565b505b87608001358610156108b857600080fd5b5050505050915091565b6108ca610b7b565b805160025560005b815181101561093c5760098282815181106108ef576108ef612364565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b03909216919091179055806109348161237a565b9150506108d2565b507fbbc63a7f378af7e269ef19f3fe0d08f044c91ee72930c0d045a58be58580f3d3816040516103c79190612395565b3330146109c65760405162461bcd60e51b815260206004820152602260248201527f4d73672e73656e6465722063616e20626520636f6e7472616374206974207365604482015261363360f11b606482015260840161055c565b60408101516001600160a01b03161580156109f057506109ee826001600160a01b031661118c565b155b15610a165760208101518151610a10916001600160a01b03851691611113565b50610a31565b60408101518151610a31916001600160a01b038516916111c5565b600081602001516001600160a01b0316610a53846001600160a01b031661118c565b610a5e576000610a61565b82515b8360600151604051610a73919061240e565b60006040518083038185875af1925050503d8060008114610ab0576040519150601f19603f3d011682016040523d82523d6000602084013e610ab5565b606091505b5050905080610afd5760405162461bcd60e51b8152602060048201526014602482015273115e1d195c9b985b081cddd85c0819985a5b195960621b604482015260640161055c565b505050565b610b0a610b7b565b6001600160a01b038116610b6f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161055c565b610b7881610bd5565b50565b6000546001600160a01b031633146104645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161055c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610c308361118c565b15610c4657506001600160a01b03811631610cc2565b6040516370a0823160e01b81526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b158015610c8757600080fd5b505afa158015610c9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cbf919061242a565b90505b92915050565b80610cd257610dba565b610cdb8461118c565b15610da5576001600160a01b03831633148015610cf85750803410155b610d585760405162461bcd60e51b815260206004820152602b60248201527f57726f6e6720757365616765206f66204554482e756e6976657273616c54726160448201526a6e7366657246726f6d282960a81b606482015260840161055c565b6001600160a01b0382163014610da0576040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610d9e573d6000803e3d6000fd5b505b610dba565b610dba6001600160a01b0385168484846112a0565b50505050565b6000815160001415610dd457506001610e76565b6000610de8856001600160a01b031661118c565b15610df4575082610e0e565b600754610e0e906001600160a01b038781169116866111c5565b6008546040516001600160a01b03909116908290610e2d90869061240e565b60006040518083038185875af1925050503d8060008114610e6a576040519150601f19603f3d011682016040523d82523d6000602084013e610e6f565b606091505b5090925050505b9392505050565b815115610afd57815160005b81811015610f5457306001600160a01b031663ecb1789886868481518110610eb357610eb3612364565b60200260200101516040518363ffffffff1660e01b8152600401610ed892919061246f565b600060405180830381600087803b158015610ef257600080fd5b505af1925050508015610f03575060015b610f4c578215610f4c5760405162461bcd60e51b8152602060048201526014602482015273115e1d195c9b985b081cddd85c0819985a5b195960621b604482015260640161055c565b600101610e89565b5050505050565b6000806000808551905060005b81811015610fc5576000878281518110610f8457610f84612364565b60200260200101511115610fbd57868181518110610fa457610fa4612364565b602002602001015184610fb7919061232d565b93508092505b600101610f68565b506000831180610fd3575084155b61101f5760405162461bcd60e51b815260206004820152601a60248201527f696e76616c696420646973747269627574696f6e20706172616d000000000000604482015260640161055c565b61102d868885858d8d61130b565b9350600084118061103c575084155b61107f5760405162461bcd60e51b81526020600482015260146024820152730a6eec2e040ccc2d2d8cac840cce4deda40c8caf60631b604482015260640161055c565b600154604051630e47f70960e21b81523360048201523060248201526001600160a01b038b811660448301528a81166064830152608482018a905260a48201879052600060c48301529091169063391fdc249060e401600060405180830381600087803b1580156110ef57600080fd5b505af1158015611103573d6000803e3d6000fd5b5050505050509550959350505050565b60008161112257506001610e76565b61112b8461118c565b15611170576040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015611166573d6000803e3d6000fd5b5060019050610e76565b6111846001600160a01b03851684846114af565b506001610e76565b60006001600160a01b0382161580610cc257506001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b6111ce8361118c565b610afd57806111ec57610afd6001600160a01b0384168360006114df565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b15801561123757600080fd5b505afa15801561124b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126f919061242a565b9050801561128c5761128c6001600160a01b0385168460006114df565b610dba6001600160a01b03851684846114df565b6040516001600160a01b0380851660248301528316604482015260648101829052610dba9085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611603565b855160009086908290815b818110156114a1578a818151811061133057611330612364565b6020026020010151600014156113455761148f565b6000898c838151811061135a5761135a612364565b60200260200101518c61136d9190612345565b61137791906124d3565b9050888214156113845750835b61138e81866121df565b94506003548261139e91906124e7565b6113e9576113e28888836009600354876113b891906124d3565b815481106113c8576113c8612364565b6000918252602090912001546001600160a01b03166116d8565b9350611481565b6003546113f690836124e7565b6001141561143e576113e288888360096003548761141491906124d3565b8154811061142457611424612364565b6000918252602090912001546001600160a01b03166116ef565b61147e88888360096003548761145491906124d3565b8154811061146457611464612364565b6000918252602090912001546001600160a01b031661170c565b93505b61148b848761232d565b9550505b806114998161237a565b915050611316565b505050509695505050505050565b6040516001600160a01b038316602482015260448101829052610afd90849063a9059cbb60e01b906064016112d4565b8015806115685750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561152e57600080fd5b505afa158015611542573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611566919061242a565b155b6115d35760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b606482015260840161055c565b6040516001600160a01b038316602482015260448101829052610afd90849063095ea7b360e01b906064016112d4565b6000611658826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166117299092919063ffffffff16565b905080516000148061167957508080602001905181019061167991906124fb565b610afd5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161055c565b60006116e685858585611740565b95945050505050565b6005546000906116e69086906001600160a01b0316868686611bac565b6006546000906116e69086906001600160a01b0316868686611bac565b60606117388484600085611bcf565b949350505050565b6000611754856001600160a01b031661118c565b156117c357600560009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117a957600080fd5b505af11580156117bd573d6000803e3d6000fd5b50505050505b60006117d7866001600160a01b031661118c565b6117e157856117ee565b6005546001600160a01b03165b90506000611804866001600160a01b031661118c565b61180e578561181b565b6005546001600160a01b03165b60405163e6a4390560e01b81526001600160a01b038481166004830152808316602483015291925060009186169063e6a439059060440160206040518083038186803b15801561186a57600080fd5b505afa15801561187e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a29190612518565b90506000806118bc6001600160a01b03841686868b611caa565b91975092509050811561192157826001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561190457600080fd5b505af1158015611918573d6000803e3d6000fd5b50505050611995565b80156119955760405163bc25cf7760e01b81527346fd07da395799f113a7584563b8cb886f33c2bc60048201526001600160a01b0384169063bc25cf7790602401600060405180830381600087803b15801561197c57600080fd5b505af1158015611990573d6000803e3d6000fd5b505050505b6119a96001600160a01b038616848a611113565b50836001600160a01b0316856001600160a01b03161015611a3e5760405163022c0d9f60e01b8152600060048201819052602482018890523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015611a2157600080fd5b505af1158015611a35573d6000803e3d6000fd5b50505050611ab4565b60405163022c0d9f60e01b8152600481018790526000602482018190523060448301526080606483015260848201526001600160a01b0384169063022c0d9f9060a401600060405180830381600087803b158015611a9b57600080fd5b505af1158015611aaf573d6000803e3d6000fd5b505050505b611ac6896001600160a01b031661118c565b15611b9f576005546040516370a0823160e01b81523060048201526001600160a01b0390911690632e1a7d4d9082906370a082319060240160206040518083038186803b158015611b1657600080fd5b505afa158015611b2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b4e919061242a565b6040518263ffffffff1660e01b8152600401611b6c91815260200190565b600060405180830381600087803b158015611b8657600080fd5b505af1158015611b9a573d6000803e3d6000fd5b505050505b5050505050949350505050565b6000611bc58585611bbf89898888611740565b85611740565b9695505050505050565b606082471015611c305760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161055c565b600080866001600160a01b03168587604051611c4c919061240e565b60006040518083038185875af1925050503d8060008114611c89576040519150601f19603f3d011682016040523d82523d6000602084013e611c8e565b606091505b5091509150611c9f87838387611e45565b979650505050505050565b6000808080611cc26001600160a01b03881689610c25565b90506000611cd96001600160a01b0388168a610c25565b90506000808a6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015611d1757600080fd5b505afa158015611d2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d4f9190612551565b5091509150886001600160a01b03168a6001600160a01b03161115611d7057905b816001600160701b0316841080611d8f5750806001600160701b031683105b955085158015611db95750816001600160701b0316841180611db95750806001600160701b031683115b94506000611dc9896103e5612345565b90506000611de085846001600160701b0316611ebb565b611dea9083612345565b9050600082611e0288876001600160701b0316611ebb565b611e0e906103e8612345565b611e18919061232d565b90508015611e2f57611e2a81836124d3565b611e32565b60005b9950505050505050509450945094915050565b60608315611eb1578251611eaa576001600160a01b0385163b611eaa5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161055c565b5081611738565b6117388383611ed1565b6000818310611eca5781610cbf565b5090919050565b815115611ee15781518083602001fd5b8060405162461bcd60e51b815260040161055c91906125a1565b600060208284031215611f0d57600080fd5b5035919050565b6001600160a01b0381168114610b7857600080fd5b600060208284031215611f3b57600080fd5b8135610e7681611f14565b600060208284031215611f5857600080fd5b813567ffffffffffffffff811115611f6f57600080fd5b82016101408185031215610e7657600080fd5b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff81118282101715611fbb57611fbb611f82565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715611fea57611fea611f82565b604052919050565b600067ffffffffffffffff82111561200c5761200c611f82565b5060051b60200190565b6000602080838503121561202957600080fd5b823567ffffffffffffffff81111561204057600080fd5b8301601f8101851361205157600080fd5b803561206461205f82611ff2565b611fc1565b81815260059190911b8201830190838101908783111561208357600080fd5b928401925b82841015611c9f57833561209b81611f14565b82529284019290840190612088565b6000608082840312156120bc57600080fd5b6120c4611f98565b9050813581526020808301356120d981611f14565b8282015260408301356120eb81611f14565b6040830152606083013567ffffffffffffffff8082111561210b57600080fd5b818501915085601f83011261211f57600080fd5b81358181111561213157612131611f82565b612143601f8201601f19168501611fc1565b9150808252868482850101111561215957600080fd5b808484018584013760008482840101525080606085015250505092915050565b6000806040838503121561218c57600080fd5b823561219781611f14565b9150602083013567ffffffffffffffff8111156121b357600080fd5b6121bf858286016120aa565b9150509250929050565b634e487b7160e01b600052601160045260246000fd5b6000828210156121f1576121f16121c9565b500390565b8015158114610b7857600080fd5b60006020828403121561221657600080fd5b8135610e76816121f6565b6000808335601e1984360301811261223857600080fd5b83018035915067ffffffffffffffff82111561225357600080fd5b60200191503681900382131561226857600080fd5b9250929050565b6000808335601e1984360301811261228657600080fd5b83018035915067ffffffffffffffff8211156122a157600080fd5b6020019150600581901b360382131561226857600080fd5b60006122c761205f84611ff2565b80848252602080830192508560051b8501368111156122e557600080fd5b855b8181101561232157803567ffffffffffffffff8111156123075760008081fd5b61231336828a016120aa565b8652509382019382016122e7565b50919695505050505050565b60008219821115612340576123406121c9565b500190565b600081600019048311821515161561235f5761235f6121c9565b500290565b634e487b7160e01b600052603260045260246000fd5b600060001982141561238e5761238e6121c9565b5060010190565b6020808252825182820181905260009190848201906040850190845b818110156123d65783516001600160a01b0316835292840192918401916001016123b1565b50909695505050505050565b60005b838110156123fd5781810151838201526020016123e5565b83811115610dba5750506000910152565b600082516124208184602087016123e2565b9190910192915050565b60006020828403121561243c57600080fd5b5051919050565b6000815180845261245b8160208601602086016123e2565b601f01601f19169290920160200192915050565b600060018060a01b0380851683526040602084015283516040840152806020850151166060840152806040850151166080840152506060830151608060a08401526116e660c0840182612443565b634e487b7160e01b600052601260045260246000fd5b6000826124e2576124e26124bd565b500490565b6000826124f6576124f66124bd565b500690565b60006020828403121561250d57600080fd5b8151610e76816121f6565b60006020828403121561252a57600080fd5b8151610e7681611f14565b80516001600160701b038116811461254c57600080fd5b919050565b60008060006060848603121561256657600080fd5b61256f84612535565b925061257d60208501612535565b9150604084015163ffffffff8116811461259657600080fd5b809150509250925092565b602081526000610cbf602083018461244356fea2646970667358221220c9107b40b337e15c8c86ec360da0c81426e6bd202e2325a404ca1c9a5d467ede64736f6c63430008090033

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

000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000100000000000000000000000000410f724847c92bc3cdacbcd4922f1d7833ec280a000000000000000000000000216b4b4ba9f3e719726886d34a177484278bfcae000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee5700000000000000000000000000000000000000000000000000000000000000030000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac000000000000000000000000115934131916c8b277dd010ee02de363c09d037c

-----Decoded View---------------
Arg [0] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [1] : _otherToken (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : _pathCount (uint256): 2
Arg [3] : _pathSplit (uint256): 2
Arg [4] : _factories (address[]): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f,0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac,0x115934131916C8b277DD010Ee02de363c09d037c
Arg [5] : _switchEventAddress (address): 0x410f724847C92Bc3CdACBCD4922F1D7833Ec280A
Arg [6] : _paraswapProxy (address): 0x216B4B4Ba9F3e719726886d34a177484278Bfcae
Arg [7] : _augustusSwapper (address): 0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57

-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [5] : 000000000000000000000000410f724847c92bc3cdacbcd4922f1d7833ec280a
Arg [6] : 000000000000000000000000216b4b4ba9f3e719726886d34a177484278bfcae
Arg [7] : 000000000000000000000000def171fe48cf0115b1d80b88dc8eab59176fee57
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [9] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [10] : 000000000000000000000000c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac
Arg [11] : 000000000000000000000000115934131916c8b277dd010ee02de363c09d037c


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
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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