Contract 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 4

 

Contract Overview

Balance:
0.2788172723538283 ETH

ETH Value:
$354.45 (@ $1,271.25/ETH)

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54Transfer With Sw...237039602022-09-09 5:37:4388 days 18 hrs ago0x3954c1c120054dbdb48ece11a528cc40cfb41059 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.00008772
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4edTransfer With Sw...237037262022-09-09 5:36:0588 days 18 hrs ago0x3954c1c120054dbdb48ece11a528cc40cfb41059 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.00008682
0x044ebee550185de072e714c7cb7e1549599fd0eb341351efd9f5b8d00f870b41Transfer With Sw...237017312022-09-09 5:22:2088 days 18 hrs ago0xf41ed4f4a2da834e1a2655d127aa5c6f4d8102f9 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0000966 ETH0.0001186
0xc0965da0588ef37f3a2b6f23b42cf7ccca58feb754d1355e066619761f7f241cTransfer With Sw...237010502022-09-09 5:17:1188 days 18 hrs ago0x75e483cca6dfe6f565f8fa3c906d5629d020da7e IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.00009012
0xa2b87efba8367d5966b84e741e98d5d148aa8328359c90022a64683bde2984dfTransfer With Sw...236614342022-09-08 23:09:2889 days 50 mins ago0x1978ff6f1c0a3760696169b001647f7f7d9600c8 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.082502150967258 ETH0.00021418
0x43715f604759b5c71a4f4c36863dd5aae0eadce1e8af39eeb562227bb4e7a118Transfer With Sw...236603382022-09-08 22:55:1889 days 1 hr ago0x8f9b5f6f6c4f4cd382fb3b491d5c14aebccd45c5 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0000534 ETH0.00014846
0xd2441c7befe0611d708b3338fcbeebfe4bc13f6c07cfa44d5baf845f5693747cTransfer With Sw...236516962022-09-08 21:09:5889 days 2 hrs ago0x85aced685b9df939c84a3629758dc0a68df00d4e IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0002206 ETH0.00019344
0x9ad97406dc63ca3c47a38cca180a29b31774bc06707fae7a5e657bcad58b8d47Transfer With Sw...236512242022-09-08 21:05:5889 days 2 hrs ago0x6cb390ca830cd821cc05a888f75dd34f8575e90a IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.7001206 ETH0.00026853
0x4f32603d947250ae39b598707b40d2388df2e5a429d3b52792ee461fbd0bcbeeTransfer With Sw...236486182022-09-08 20:39:4489 days 3 hrs ago0x654ed36a2422e0129c74a03d12a2eb099379bdd9 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.120340382567747 ETH0.0001716
0xe4dd97b65cd20f358ed842aea83e97a289ca38d9f2b406c492ef356afb7a531eTransfer With Sw...236386032022-09-08 19:18:1789 days 4 hrs ago0xcbbe23cad8537cdfb7e62702f1a118f9ea5a8b83 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0000534 ETH0.00016776
0xf0ed633f7cfaf4eaa4c233c3d874bc984f615d85d28c39dfadc93525bedcc9f8Transfer With Sw...236288712022-09-08 17:40:3089 days 6 hrs ago0x6d90919dec49a1239518cd7b7dc7e09f2f089330 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001254 ETH0.00022389
0xb9dce3ab14fd5ca699b66e1b4fbfdc9079c1de49627b8ef36b7344c67b2990f6Transfer With Sw...236254002022-09-08 17:11:0889 days 6 hrs ago0xd99ada49b09d2a36476794b78aeadb2f5058a9dc IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.0001794
0x615e9a4dfdbf9f0f9c3a0f9045708298e88399f3012dc4e1c50e7f23714d64b7Transfer With Sw...236252782022-09-08 17:10:1489 days 6 hrs ago0xd99ada49b09d2a36476794b78aeadb2f5058a9dc IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.00018198
0x9be637aac7441254662d2464b2d6765a5d0d9363558b24dea44a797d99207764Transfer With Sw...235829962022-09-08 13:07:3289 days 10 hrs ago0x4dcfc29b9b5de0d314cf7c2571e457b8af119081 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001254 ETH0.00007314
0xfe8bce2ea849f324088656474127d12d04f3c9c1f8dcc32f2379972ec29f62e0Transfer With Sw...235811152022-09-08 12:57:5589 days 11 hrs ago0x4dcfc29b9b5de0d314cf7c2571e457b8af119081 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.0000603
0x4460ec09dbd4c6ee8e6f9f5cd490610040f2615f4e9dd1bc8b940fd8f7f54ac1Transfer With Sw...235793212022-09-08 12:47:3589 days 11 hrs ago0xe6c6930502d2bd39ddfb2f0bf6775a9e9bd84af8 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.412206437490203 ETH0.00005208
0xfd983afea2d905b97aaf8cdafae5785d1c8be8b50b1865b6f59b8556378eec44Transfer With Sw...235757612022-09-08 12:27:4489 days 11 hrs ago0x31745ffae4b21b1251b62aec45e2f9da8dd302c3 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c71.3001206 ETH0.00008895
0x69b9b0f901abe2253f2717b0f9e567f972ac15925d3f531024205199bbd1a358Transfer With Sw...235749052022-09-08 12:22:5489 days 11 hrs ago0x654ed36a2422e0129c74a03d12a2eb099379bdd9 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.121203904573852 ETH0.00008684
0x5347b6873ae2b360b14f0a7d409d9f69d9c418b52e548679cfcd852bcebe7346Transfer With Sw...235716512022-09-08 12:05:5589 days 11 hrs ago0x1205ef29ca840e185bd374e080fef89ea21a95bc IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.005466783159374 ETH0.00004826
0x1fe3855f35a7fafbabeb6da63d8620bbc403e1c2335713ccb0ea8349b7f9b437Transfer With Sw...235704432022-09-08 11:57:4389 days 12 hrs ago0x1205ef29ca840e185bd374e080fef89ea21a95bc IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.005514516576374 ETH0.0000499
0xd61cf333e0c8182e1344b0f9e5d001d19ad634fe971924ba8b716ef17cd54bf1Transfer With Sw...235657242022-09-08 11:23:4689 days 12 hrs ago0x23cf62b21994d697eb2736fb96932a616f9cf7b6 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.12231156368 ETH0.00008348
0x99c6db0d268456e13e3a869a3c4bc885912558ecb8640a5dfb217827c808ff23Transfer With Sw...235633652022-09-08 11:07:5789 days 12 hrs ago0xa545bbf6b638f20f52f65ede718d1403a13f6697 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.319066761539554 ETH0.00008671
0x3f81fcf0db3f8b873d0cf43a9bd11d530adc4019b61927abc82396f389e916d7Transfer With Sw...235614402022-09-08 10:54:5989 days 13 hrs ago0x0c057aff99c65850563f2a4c13f24feca525a6b7 IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001254 ETH0.00009301
0x22682c01bcbbb6a9f8c36f018a5df53c5e25a1d580f331ba3e76361692ac3a90Transfer With Sw...235609582022-09-08 10:51:0789 days 13 hrs ago0xa40361b0a09f6936182ad0d29ec827bb66bbf8bc IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.00006181
0xdb35b6634dbc96d0992ad5b7b7bb79e3c7acb1d02766049b385d207f7fa9a98bTransfer With Sw...235584412022-09-08 10:33:3289 days 13 hrs ago0xa40361b0a09f6936182ad0d29ec827bb66bbf8bc IN  0xd3b2a3a3faef1501755b290089d4daafdb6167c70.0001206 ETH0.00006201
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xafb7aeca8d29e0d08649cabd520b6d430f89b40cd273a9a111c68b70a14b7400296053292022-10-11 18:43:0156 days 5 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 Tether: USDT Token0 ETH
0xafb7aeca8d29e0d08649cabd520b6d430f89b40cd273a9a111c68b70a14b7400296053292022-10-11 18:43:0156 days 5 hrs ago 0x3ad9d0648cdaa2426331e894e980d0a5ed16257f 0xd3b2a3a3faef1501755b290089d4daafdb6167c70 ETH
0x65833484794fc56f3d55ad5ad89361d28525302f81bcb11e3d10da6016bd55f1275724702022-09-30 9:36:5667 days 14 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 Tether: USDT Token0 ETH
0x65833484794fc56f3d55ad5ad89361d28525302f81bcb11e3d10da6016bd55f1275724702022-09-30 9:36:5667 days 14 hrs ago 0x3ad9d0648cdaa2426331e894e980d0a5ed16257f 0xd3b2a3a3faef1501755b290089d4daafdb6167c70 ETH
0x410bfd4aac1bae473aa1bd360b7ce5e78f2c68428cfa66723a04f816af42a532267741472022-09-26 9:24:5271 days 14 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 Tether: USDT Token0 ETH
0x410bfd4aac1bae473aa1bd360b7ce5e78f2c68428cfa66723a04f816af42a532267741472022-09-26 9:24:5271 days 14 hrs ago 0x3ad9d0648cdaa2426331e894e980d0a5ed16257f 0xd3b2a3a3faef1501755b290089d4daafdb6167c70 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c70x3954c1c120054dbdb48ece11a528cc40cfb410590.003520642279584603 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0x82af49447d8a07e3bd95bd0d56f35241523fbab1 0xd3b2a3a3faef1501755b290089d4daafdb6167c70.003520642279584603 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 Uniswap V3: Router0 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x49994fbb41c6b7c2f3066ca7301f25305de1234a0 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x49994fbb41c6b7c2f3066ca7301f25305de1234a0 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
0xcaf9d69264de15baf0a6ff59b07e8a077029a1e8c1038e26360d6c6b0081bc54237039602022-09-09 5:37:4388 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x49994fbb41c6b7c2f3066ca7301f25305de1234a0 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c70x3954c1c120054dbdb48ece11a528cc40cfb410590.000002075275719481 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0x82af49447d8a07e3bd95bd0d56f35241523fbab1 0xd3b2a3a3faef1501755b290089d4daafdb6167c70.000002075275719481 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 Uniswap V3: Router0 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0x82af49447d8a07e3bd95bd0d56f35241523fbab10 ETH
0x94561078f506518cde2c95f63042ef9c9019ae6a935f3e95797447da9b4fd4ed237037262022-09-09 5:36:0588 days 18 hrs ago 0xd3b2a3a3faef1501755b290089d4daafdb6167c7 0xff970a61a04b1ca14834a43f5de4533ebddb5cc80 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TransferSwapper

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 27 : TransferSwapper.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./lib/MessageSenderLib.sol";
import "./lib/MessageReceiverApp.sol";
import "./lib/MsgDataTypes.sol";
import "./FeeOperator.sol";
import "./SigVerifier.sol";
import "./Swapper.sol";
import "./interfaces/ICodec.sol";

/**
 * @author Chainhop Dex Team
 * @author Padoriku
 * @title An app that enables swapping on a chain, transferring to another chain and swapping
 * another time on the destination chain before sending the result tokens to a user
 */
contract TransferSwapper is MessageReceiverApp, Swapper, SigVerifier, FeeOperator, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using ECDSA for bytes32;

    struct TransferDescription {
        address receiver; // the receiving party (the user) of the final output token
        uint64 dstChainId; // destination chain id
        uint32 maxBridgeSlippage; // user defined maximum allowed slippage (pip) at bridge
        MsgDataTypes.BridgeSendType bridgeType; // type of the bridge to use
        uint64 nonce; // nonce is needed for de-dup tx at this contract and bridge
        bool nativeIn; // whether to check msg.value and wrap token before swapping/sending
        bool nativeOut; // whether to unwrap before sending the final token to user
        uint256 fee; // this fee is only executor fee. it does not include msg bridge fee
        uint256 feeDeadline; // the unix timestamp before which the fee is valid
        // sig of sha3("executor fee", srcChainId, dstChainId, amountIn, tokenIn, feeDeadline, fee)
        // see _verifyFee()
        bytes feeSig;
        // IMPORTANT: amountIn and tokenIn are completely ignored if src chain has a swap
        // these two fields are only meant for the scenario where no swaps are needed on src chain
        uint256 amountIn;
        address tokenIn;
        address dstTokenOut; // the final output token, emitted in event for display purpose only
        // in case of multi route swaps, whether to allow the successful swaps to go through
        // and sending the amountIn of the failed swaps back to user
        bool allowPartialFill;
    }

    struct Request {
        bytes32 id; // see _computeId()
        ICodec.SwapDescription[] swaps; // the swaps need to happen on the destination chain
        address receiver; // see TransferDescription.receiver
        bool nativeOut; // see TransferDescription.nativeOut
        uint256 fee; // see TransferDescription.fee
        bool allowPartialFill; // see TransferDescription.allowPartialFill
    }

    /**
     * @notice Denotes the status of a cross-chain transfer/swap request
     * @dev Partially filled requests are considered 'Succeeded'. There is no 'Failed' state as
     * it's only possible if everything reverts and there is no successful transaction
     * @param Null An empty status that should never be reached
     * @param Succeeded Transfer/swap has succeeded and funds are received by the receiver
     * @param Fallback Swaps have failed on the dst chain, and bridge tokens are refunded to receiver
     */
    enum RequestStatus {
        Null,
        Succeeded,
        Fallback
    }

    event NativeWrapUpdated(address nativeWrap);

    /**
     * @notice Emitted when requested dstChainId == srcChainId, no bridging
     * @param id see _computeId()
     * @param amountIn the input amount approved by the sender
     * @param tokenIn the input token approved by the sender
     * @param amountOut the output amount gained after swapping using the input tokens
     * @param tokenOut the output token gained after swapping using the input tokens
     */
    event DirectSwap(bytes32 id, uint256 amountIn, address tokenIn, uint256 amountOut, address tokenOut);

    /**
     * @notice Emitted when operations on src chain is done, the transfer is sent through the bridge
     * @param id see _computeId()
     * @param transferId the src transfer id produced by MessageSenderLib.sendMessageWithTransfer()
     * @param dstChainId destination chain id
     * @param srcAmount input amount approved by the sender
     * @param srcToken the input token approved by the sender
     * @param dstToken the final output token (after bridging and swapping) desired by the sender
     * @param bridgeOutReceiver the receiver (user or dst TransferSwapper) of the bridge token
     */
    event RequestSent(
        bytes32 id,
        bytes32 transferId,
        uint64 dstChainId,
        uint256 srcAmount,
        address srcToken,
        address dstToken,
        address bridgeOutReceiver
    );
    // emitted when operations on dst chain is done.
    // dstAmount is denominated by dstToken, refundAmount is denominated by bridge out token.
    // if refundAmount is a non-zero number, it means the "allow partial fill" option is turned on.

    /**
     * @notice Emitted when operations on dst chain is done.
     * @param id see _computeId()
     * @param dstAmount the final output token (after bridging and swapping) desired by the sender
     * @param refundAmount the amount refunded to the receiver in bridge token
     * @dev refundAmount may be fill by either a complete refund or when allowPartialFill is on and
     * some swaps fails in the swap routes
     * @param refundToken bridge out token
     * @param feeCollected the fee chainhop deducts from bridge out token
     * @param status see RequestStatus
     */
    event RequestDone(
        bytes32 id,
        uint256 dstAmount,
        uint256 refundAmount,
        address refundToken,
        uint256 feeCollected,
        RequestStatus status
    );

    /// @notice erc20 wrap of the gas token of this chain, e.g. WETH
    address public nativeWrap;

    /// @dev saves the sender addresses of direct bridge transfers so that when refund happens, this contract
    /// knows who to refund the tokens to
    mapping(bytes32 => address) public directBridgeSenders;

    constructor(
        address _messageBus,
        address _nativeWrap,
        address _signer,
        address _feeCollector,
        string[] memory _funcSigs,
        address[] memory _codecs,
        address[] memory _supportedDexList,
        string[] memory _supportedDexFuncs,
        bool _testMode
    )
        Swapper(_funcSigs, _codecs, _supportedDexList, _supportedDexFuncs)
        FeeOperator(_feeCollector)
        SigVerifier(_signer)
    {
        messageBus = _messageBus;
        nativeWrap = _nativeWrap;
        testMode = _testMode;
    }

    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * Source chain functions
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

    /**
     * @notice swaps if needed, then transfer the token to another chain along with an instruction on how to swap
     * on that chain
     * @param _dstTransferSwapper the address of the receiving party of the bridge token (TransferSwapper) on the destination chain
     * @dev this field has no effect if the there is no dst swaps as the bridged tokens are sent directly to _desc.receiver
     */
    function transferWithSwap(
        address _dstTransferSwapper,
        TransferDescription calldata _desc,
        ICodec.SwapDescription[] calldata _srcSwaps,
        ICodec.SwapDescription[] calldata _dstSwaps
    ) external payable nonReentrant {
        // a request needs to incur a swap, a transfer, or both. otherwise it's a nop and we revert early to save gas
        require(_srcSwaps.length != 0 || _desc.dstChainId != uint64(block.chainid), "nop");
        require(_srcSwaps.length != 0 || (_desc.amountIn != 0 && _desc.tokenIn != address(0)), "nop");

        uint256 amountIn = _desc.amountIn;
        address tokenIn = _desc.tokenIn;
        address tokenOut = _desc.tokenIn;
        ICodec[] memory codecs;

        if (_srcSwaps.length != 0) {
            (amountIn, tokenIn, tokenOut, codecs) = sanitizeSwaps(_srcSwaps);
            require(tokenIn == _desc.tokenIn, "tkin mm");
        }
        if (_desc.nativeIn) {
            require(tokenIn == nativeWrap, "tkin no nativeWrap");
            require(msg.value >= amountIn, "insfcnt amt"); // insufficient amount
            IWETH(nativeWrap).deposit{value: amountIn}();
        } else {
            IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
        }
        _swapAndSend(_dstTransferSwapper, amountIn, tokenIn, tokenOut, _srcSwaps, _dstSwaps, _desc, codecs);
    }

    function _swapAndSend(
        address _dstTransferSwapper,
        uint256 _amountIn,
        address _tokenIn,
        address _tokenOut,
        ICodec.SwapDescription[] memory _srcSwaps,
        ICodec.SwapDescription[] memory _dstSwaps,
        TransferDescription memory _desc,
        ICodec[] memory _codecs
    ) private {
        // swap if needed
        uint256 amountOut = _amountIn;
        if (_srcSwaps.length != 0) {
            bool ok;
            (ok, amountOut) = executeSwaps(_srcSwaps, _codecs);
            require(ok, "swap fail");
        }

        bytes32 id = _computeId(_desc.receiver, _desc.nonce);
        // direct send if needed
        if (_desc.dstChainId == uint64(block.chainid)) {
            emit DirectSwap(id, _amountIn, _tokenIn, amountOut, _tokenOut);
            _sendToken(_tokenOut, amountOut, _desc.receiver, _desc.nativeOut);
            return;
        }

        _verifyFee(_desc, _amountIn, _tokenIn);
        uint256 msgFee = msg.value;
        if (_desc.nativeIn) {
            msgFee = msg.value - _amountIn;
        }
        // transfer through bridge
        address bridgeOutReceiver = _dstSwaps.length > 0 ? _dstTransferSwapper : _desc.receiver;
        bytes32 transferId = _transfer(id, bridgeOutReceiver, _desc, _dstSwaps, amountOut, _tokenOut, msgFee);
        emit RequestSent(id, transferId, _desc.dstChainId, _amountIn, _tokenIn, _desc.dstTokenOut, bridgeOutReceiver);
    }

    function _transfer(
        bytes32 _id,
        address _bridgeOutReceiver,
        TransferDescription memory _desc,
        ICodec.SwapDescription[] memory _dstSwaps,
        uint256 _amount,
        address _token,
        uint256 _msgFee
    ) private returns (bytes32 transferId) {
        bytes memory requestMessage = _encodeRequestMessage(_id, _desc, _dstSwaps);
        transferId = MessageSenderLib.sendMessageWithTransfer(
            _bridgeOutReceiver,
            _token,
            _amount,
            _desc.dstChainId,
            _desc.nonce,
            _desc.maxBridgeSlippage,
            requestMessage,
            _desc.bridgeType,
            messageBus,
            _msgFee
        );
    }

    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * Destination chain functions
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

    /**
     * @notice Executes a swap if needed, then sends the output token to the receiver
     * @dev If allowPartialFill is off, this function reverts as soon as one swap in swap routes fails
     * @dev This function is called and is only callable by MessageBus. The transaction of such call is triggered by executor.
     * @dev Bridge contract *always* sends native token to its receiver (this contract) even though the _token field is always an ERC20 token
     * @param _token the token received by this contract
     * @param _amount the amount of token received by this contract
     * @return ok whether the processing is successful
     */
    function executeMessageWithTransfer(
        address, // _sender
        address _token,
        uint256 _amount,
        uint64, // _srcChainId
        bytes memory _message,
        address // _executor
    ) external payable override onlyMessageBus nonReentrant returns (ExecutionStatus) {
        Request memory m = abi.decode((_message), (Request));

        // handle the case where amount received is not enough to pay fee
        if (_amount < m.fee) {
            m.fee = _amount;
            emit RequestDone(m.id, 0, 0, _token, m.fee, RequestStatus.Succeeded);
            return ExecutionStatus.Success;
        } else {
            _amount = _amount - m.fee;
        }

        _wrapBridgeOutToken(_token, _amount);

        address tokenOut = _token;
        bool nativeOut = m.nativeOut;
        uint256 sumAmtOut = _amount;
        uint256 sumAmtFailed;

        if (m.swaps.length != 0) {
            ICodec[] memory codecs;
            address tokenIn;
            // swap first before sending the token out to user
            (, tokenIn, tokenOut, codecs) = sanitizeSwaps(m.swaps);
            require(tokenIn == _token, "tkin mm"); // tokenIn mismatch
            (sumAmtOut, sumAmtFailed) = executeSwapsWithOverride(m.swaps, codecs, _amount, m.allowPartialFill);
            // if at this stage the tx is not reverted, it means at least 1 swap in routes succeeded
            if (sumAmtFailed > 0) {
                _sendToken(_token, sumAmtFailed, m.receiver, false);
            }
        }

        _sendToken(tokenOut, sumAmtOut, m.receiver, nativeOut);
        // status is always success as long as this function call doesn't revert. partial fill is also considered success
        emit RequestDone(m.id, sumAmtOut, sumAmtFailed, _token, m.fee, RequestStatus.Succeeded);
        return ExecutionStatus.Success;
    }

    /**
     * @notice Sends the received token to the receiver
     * @dev Only called if executeMessageWithTransfer reverts
     * @dev Bridge contract *always* sends native token to its receiver (this contract) even though the _token field is always an ERC20 token
     * @param _token the token received by this contract
     * @param _amount the amount of token received by this contract
     * @return ok whether the processing is successful
     */
    function executeMessageWithTransferFallback(
        address, // _sender
        address _token,
        uint256 _amount,
        uint64, // _srcChainId
        bytes memory _message,
        address // _executor
    ) external payable override onlyMessageBus nonReentrant returns (ExecutionStatus) {
        Request memory m = abi.decode((_message), (Request));
        _wrapBridgeOutToken(_token, _amount);
        uint256 refundAmount = _amount - m.fee; // no need to check amount >= fee as it's already checked before
        _sendToken(_token, refundAmount, m.receiver, false);

        emit RequestDone(m.id, 0, refundAmount, _token, m.fee, RequestStatus.Fallback);
        return ExecutionStatus.Success;
    }

    /**
     * @notice Used to trigger refund when bridging fails due to large slippage
     * @dev only MessageBus can call this function, this requires the user to get sigs of the message from SGN
     * @dev Bridge contract *always* sends native token to its receiver (this contract) even though the _token field is always an ERC20 token
     * @param _token the token received by this contract
     * @param _amount the amount of token received by this contract
     * @return ok whether the processing is successful
     */
    function executeMessageWithTransferRefund(
        address _token,
        uint256 _amount,
        bytes calldata _message,
        address // _executor
    ) external payable override onlyMessageBus nonReentrant returns (ExecutionStatus) {
        Request memory m = abi.decode((_message), (Request));
        _wrapBridgeOutToken(_token, _amount);
        _sendToken(_token, _amount, m.receiver, false);
        emit RequestDone(m.id, 0, _amount, _token, m.fee, RequestStatus.Fallback);
        return ExecutionStatus.Success;
    }

    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     * Misc
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    function _computeId(address _receiver, uint64 _nonce) private view returns (bytes32) {
        return keccak256(abi.encodePacked(msg.sender, _receiver, uint64(block.chainid), _nonce));
    }

    function _wrapBridgeOutToken(address _token, uint256 _amount) private {
        // Wrapping the bridge token before doing anything. There is inefficiency in this function and _sendToken() only if the received the token
        // is native and the user wants native out. The wrapping then unwrapping process could be skipped. This inefficiency is tolerated for logic tidiness
        if (_token == nativeWrap) {
            // If the bridge out token is a native wrap, we need to check whether the actual received token is native token
            // Note Assumption: only the liquidity bridge is capable of sending a native wrap
            address bridge = IMessageBus(messageBus).liquidityBridge();
            // If bridge's nativeWrap is set, then bridge automatically unwraps the token and send it to this contract
            // Otherwise the received token in this contract is ERC20
            if (IBridge(bridge).nativeWrap() == nativeWrap) {
                IWETH(nativeWrap).deposit{value: _amount}();
            }
        }
    }

    function _sendToken(
        address _token,
        uint256 _amount,
        address _receiver,
        bool _nativeOut
    ) private {
        if (_nativeOut) {
            require(_token == nativeWrap, "tk no native");
            IWETH(nativeWrap).withdraw(_amount);
            (bool sent, ) = _receiver.call{value: _amount, gas: 50000}("");
            require(sent, "send fail");
        } else {
            IERC20(_token).safeTransfer(_receiver, _amount);
        }
    }

    function _encodeRequestMessage(
        bytes32 _id,
        TransferDescription memory _desc,
        ICodec.SwapDescription[] memory _swaps
    ) private pure returns (bytes memory message) {
        message = abi.encode(
            Request({
                id: _id,
                swaps: _swaps,
                receiver: _desc.receiver,
                nativeOut: _desc.nativeOut,
                fee: _desc.fee,
                allowPartialFill: _desc.allowPartialFill
            })
        );
    }

    function _verifyFee(
        TransferDescription memory _desc,
        uint256 _amountIn,
        address _tokenIn
    ) private view {
        bytes32 hash = keccak256(
            abi.encodePacked(
                "executor fee",
                uint64(block.chainid),
                _desc.dstChainId,
                _amountIn,
                _tokenIn,
                _desc.feeDeadline,
                _desc.fee
            )
        );
        bytes32 signHash = hash.toEthSignedMessageHash();
        verifySig(signHash, _desc.feeSig);
        require(_desc.feeDeadline > block.timestamp, "deadline exceeded");
    }

    function setNativeWrap(address _nativeWrap) external onlyOwner {
        nativeWrap = _nativeWrap;
        emit NativeWrapUpdated(_nativeWrap);
    }

    // This is needed to receive ETH when calling `IWETH.withdraw`
    receive() external payable {}
}

File 2 of 27 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

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

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    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");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 3 of 27 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

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

File 4 of 27 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 5 of 27 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 6 of 27 : MessageSenderLib.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity 0.8.12;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../interfaces/IBridge.sol";
import "../interfaces/IOriginalTokenVault.sol";
import "../interfaces/IOriginalTokenVaultV2.sol";
import "../interfaces/IPeggedTokenBridge.sol";
import "../interfaces/IPeggedTokenBridgeV2.sol";
import "../interfaces/IMessageBus.sol";
import "./MsgDataTypes.sol";

library MessageSenderLib {
    using SafeERC20 for IERC20;

    // ============== Internal library functions called by apps ==============

    /**
     * @notice Sends a message to an app on another chain via MessageBus without an associated transfer.
     * @param _receiver The address of the destination app contract.
     * @param _dstChainId The destination chain ID.
     * @param _message Arbitrary message bytes to be decoded by the destination app contract.
     * @param _messageBus The address of the MessageBus on this chain.
     * @param _fee The fee amount to pay to MessageBus.
     */
    function sendMessage(
        address _receiver,
        uint64 _dstChainId,
        bytes memory _message,
        address _messageBus,
        uint256 _fee
    ) internal {
        IMessageBus(_messageBus).sendMessage{value: _fee}(_receiver, _dstChainId, _message);
    }

    /**
     * @notice Sends a message to an app on another chain via MessageBus with an associated transfer.
     * @param _receiver The address of the destination app contract.
     * @param _token The address of the token to be sent.
     * @param _amount The amount of tokens to be sent.
     * @param _dstChainId The destination chain ID.
     * @param _nonce A number input to guarantee uniqueness of transferId. Can be timestamp in practice.
     * @param _maxSlippage The max slippage accepted, given as percentage in point (pip). Eg. 5000 means 0.5%.
     * Must be greater than minimalMaxSlippage. Receiver is guaranteed to receive at least (100% - max slippage percentage) * amount or the
     * transfer can be refunded. Only applicable to the {MsgDataTypes.BridgeSendType.Liquidity}.
     * @param _message Arbitrary message bytes to be decoded by the destination app contract.
     * @param _bridgeSendType One of the {MsgDataTypes.BridgeSendType} enum.
     * @param _messageBus The address of the MessageBus on this chain.
     * @param _fee The fee amount to pay to MessageBus.
     * @return The transfer ID.
     */
    function sendMessageWithTransfer(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage,
        bytes memory _message,
        MsgDataTypes.BridgeSendType _bridgeSendType,
        address _messageBus,
        uint256 _fee
    ) internal returns (bytes32) {
        (bytes32 transferId, address bridge) = sendTokenTransfer(
            _receiver,
            _token,
            _amount,
            _dstChainId,
            _nonce,
            _maxSlippage,
            _bridgeSendType,
            _messageBus
        );
        if (_message.length > 0) {
            IMessageBus(_messageBus).sendMessageWithTransfer{value: _fee}(
                _receiver,
                _dstChainId,
                bridge,
                transferId,
                _message
            );
        }
        return transferId;
    }

    /**
     * @notice Sends a token transfer via a bridge.
     * @param _receiver The address of the destination app contract.
     * @param _token The address of the token to be sent.
     * @param _amount The amount of tokens to be sent.
     * @param _dstChainId The destination chain ID.
     * @param _nonce A number input to guarantee uniqueness of transferId. Can be timestamp in practice.
     * @param _maxSlippage The max slippage accepted, given as percentage in point (pip). Eg. 5000 means 0.5%.
     * Must be greater than minimalMaxSlippage. Receiver is guaranteed to receive at least (100% - max slippage percentage) * amount or the
     * transfer can be refunded.
     * @param _bridgeSendType One of the {MsgDataTypes.BridgeSendType} enum.
     */
    function sendTokenTransfer(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage,
        MsgDataTypes.BridgeSendType _bridgeSendType,
        address _messageBus
    ) internal returns (bytes32 transferId, address bridge) {
        if (_bridgeSendType == MsgDataTypes.BridgeSendType.Liquidity) {
            bridge = IMessageBus(_messageBus).liquidityBridge();
            IERC20(_token).safeIncreaseAllowance(bridge, _amount);
            IBridge(bridge).send(_receiver, _token, _amount, _dstChainId, _nonce, _maxSlippage);
            transferId = computeLiqBridgeTransferId(_receiver, _token, _amount, _dstChainId, _nonce);
        } else if (_bridgeSendType == MsgDataTypes.BridgeSendType.PegDeposit) {
            bridge = IMessageBus(_messageBus).pegVault();
            IERC20(_token).safeIncreaseAllowance(bridge, _amount);
            IOriginalTokenVault(bridge).deposit(_token, _amount, _dstChainId, _receiver, _nonce);
            transferId = computePegV1DepositId(_receiver, _token, _amount, _dstChainId, _nonce);
        } else if (_bridgeSendType == MsgDataTypes.BridgeSendType.PegBurn) {
            bridge = IMessageBus(_messageBus).pegBridge();
            IERC20(_token).safeIncreaseAllowance(bridge, _amount);
            IPeggedTokenBridge(bridge).burn(_token, _amount, _receiver, _nonce);
            // handle cases where certain tokens do not spend allowance for role-based burn
            IERC20(_token).safeApprove(bridge, 0);
            transferId = computePegV1BurnId(_receiver, _token, _amount, _nonce);
        } else if (_bridgeSendType == MsgDataTypes.BridgeSendType.PegV2Deposit) {
            bridge = IMessageBus(_messageBus).pegVaultV2();
            IERC20(_token).safeIncreaseAllowance(bridge, _amount);
            transferId = IOriginalTokenVaultV2(bridge).deposit(_token, _amount, _dstChainId, _receiver, _nonce);
        } else if (_bridgeSendType == MsgDataTypes.BridgeSendType.PegV2Burn) {
            bridge = IMessageBus(_messageBus).pegBridgeV2();
            IERC20(_token).safeIncreaseAllowance(bridge, _amount);
            transferId = IPeggedTokenBridgeV2(bridge).burn(_token, _amount, _dstChainId, _receiver, _nonce);
            // handle cases where certain tokens do not spend allowance for role-based burn
            IERC20(_token).safeApprove(bridge, 0);
        } else if (_bridgeSendType == MsgDataTypes.BridgeSendType.PegV2BurnFrom) {
            bridge = IMessageBus(_messageBus).pegBridgeV2();
            IERC20(_token).safeIncreaseAllowance(bridge, _amount);
            transferId = IPeggedTokenBridgeV2(bridge).burnFrom(_token, _amount, _dstChainId, _receiver, _nonce);
            // handle cases where certain tokens do not spend allowance for role-based burn
            IERC20(_token).safeApprove(bridge, 0);
        } else {
            revert("bridge type not supported");
        }
    }

    function computeLiqBridgeTransferId(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _dstChainId,
        uint64 _nonce
    ) internal view returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(address(this), _receiver, _token, _amount, _dstChainId, _nonce, uint64(block.chainid))
            );
    }

    function computePegV1DepositId(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _dstChainId,
        uint64 _nonce
    ) internal view returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(address(this), _token, _amount, _dstChainId, _receiver, _nonce, uint64(block.chainid))
            );
    }

    function computePegV1BurnId(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _nonce
    ) internal view returns (bytes32) {
        return keccak256(abi.encodePacked(address(this), _token, _amount, _receiver, _nonce, uint64(block.chainid)));
    }
}

File 7 of 27 : MessageReceiverApp.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity 0.8.12;

import "../interfaces/IMessageReceiverApp.sol";
import "./MessageBusAddress.sol";

abstract contract MessageReceiverApp is IMessageReceiverApp, MessageBusAddress {
    // testMode is used for the ease of testing functions with the "onlyMessageBus" modifier.
    // WARNING: when testMode is true, ANYONE can call executeMessageXXX functions
    // this variable can only be set during contract construction and is always not set on mainnets
    bool public testMode;

    modifier onlyMessageBus() {
        if (!testMode) {
            require(msg.sender == messageBus, "caller is not message bus");
        }
        _;
    }

    /**
     * @notice Called by MessageBus (MessageBusReceiver) if the process is originated from MessageBus (MessageBusSender)'s
     *         sendMessageWithTransfer it is only called when the tokens are checked to be arrived at this contract's address.
     * @param _sender The address of the source app contract
     * @param _token The address of the token that comes out of the bridge
     * @param _amount The amount of tokens received at this contract through the cross-chain bridge.
     *        the contract that implements this contract can safely assume that the tokens will arrive before this
     *        function is called.
     * @param _srcChainId The source chain ID where the transfer is originated from
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessageWithTransfer(
        address _sender,
        address _token,
        uint256 _amount,
        uint64 _srcChainId,
        bytes calldata _message,
        address _executor
    ) external payable virtual override onlyMessageBus returns (ExecutionStatus) {}

    /**
     * @notice Only called by MessageBus (MessageBusReceiver) if
     *         1. executeMessageWithTransfer reverts, or
     *         2. executeMessageWithTransfer returns ExecutionStatus.Fail
     * @param _sender The address of the source app contract
     * @param _token The address of the token that comes out of the bridge
     * @param _amount The amount of tokens received at this contract through the cross-chain bridge.
     *        the contract that implements this contract can safely assume that the tokens will arrive before this
     *        function is called.
     * @param _srcChainId The source chain ID where the transfer is originated from
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessageWithTransferFallback(
        address _sender,
        address _token,
        uint256 _amount,
        uint64 _srcChainId,
        bytes calldata _message,
        address _executor
    ) external payable virtual override onlyMessageBus returns (ExecutionStatus) {}

    /**
     * @notice Called by MessageBus (MessageBusReceiver) to process refund of the original transfer from this contract
     * @param _token The token address of the original transfer
     * @param _amount The amount of the original transfer
     * @param _message The same message associated with the original transfer
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessageWithTransferRefund(
        address _token,
        uint256 _amount,
        bytes calldata _message,
        address _executor
    ) external payable virtual override onlyMessageBus returns (ExecutionStatus) {}

    /**
     * @notice Called by MessageBus (MessageBusReceiver)
     * @param _sender The address of the source app contract
     * @param _srcChainId The source chain ID where the transfer is originated from
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessage(
        address _sender,
        uint64 _srcChainId,
        bytes calldata _message,
        address _executor
    ) external payable virtual override onlyMessageBus returns (ExecutionStatus) {}
}

File 8 of 27 : MsgDataTypes.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity 0.8.12;

library MsgDataTypes {
    // bridge operation type at the sender side (src chain)
    enum BridgeSendType {
        Null,
        Liquidity,
        PegDeposit,
        PegBurn,
        PegV2Deposit,
        PegV2Burn,
        PegV2BurnFrom
    }

    // bridge operation type at the receiver side (dst chain)
    enum TransferType {
        Null,
        LqRelay, // relay through liquidity bridge
        LqWithdraw, // withdraw from liquidity bridge
        PegMint, // mint through pegged token bridge
        PegWithdraw, // withdraw from original token vault
        PegV2Mint, // mint through pegged token bridge v2
        PegV2Withdraw // withdraw from original token vault v2
    }

    enum MsgType {
        MessageWithTransfer,
        MessageOnly
    }

    enum TxStatus {
        Null,
        Success,
        Fail,
        Fallback,
        Pending // transient state within a transaction
    }

    struct TransferInfo {
        TransferType t;
        address sender;
        address receiver;
        address token;
        uint256 amount;
        uint64 wdseq; // only needed for LqWithdraw (refund)
        uint64 srcChainId;
        bytes32 refId;
        bytes32 srcTxHash; // src chain msg tx hash
    }

    struct RouteInfo {
        address sender;
        address receiver;
        uint64 srcChainId;
        bytes32 srcTxHash; // src chain msg tx hash
    }

    struct MsgWithTransferExecutionParams {
        bytes message;
        TransferInfo transfer;
        bytes[] sigs;
        address[] signers;
        uint256[] powers;
    }

    struct BridgeTransferParams {
        bytes request;
        bytes[] sigs;
        address[] signers;
        uint256[] powers;
    }
}

File 9 of 27 : FeeOperator.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

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

/**
 * @title Allows the owner to set fee collector and allows fee collectors to collect fees
 * @author Padoriku
 */
abstract contract FeeOperator is Ownable {
    using SafeERC20 for IERC20;

    address public feeCollector;

    event FeeCollectorUpdated(address from, address to);

    modifier onlyFeeCollector() {
        require(msg.sender == feeCollector, "not fee collector");
        _;
    }

    constructor(address _feeCollector) {
        feeCollector = _feeCollector;
    }

    function collectFee(address[] calldata _tokens, address _to) external onlyFeeCollector {
        for (uint256 i = 0; i < _tokens.length; i++) {
            // use zero address to denote native token
            if (_tokens[i] == address(0)) {
                uint256 bal = address(this).balance;
                (bool sent, ) = _to.call{value: bal, gas: 50000}("");
                require(sent, "send native failed");
            } else {
                uint256 balance = IERC20(_tokens[i]).balanceOf(address(this));
                IERC20(_tokens[i]).safeTransfer(_to, balance);
            }
        }
    }

    function setFeeCollector(address _feeCollector) external onlyOwner {
        address oldFeeCollector = feeCollector;
        feeCollector = _feeCollector;
        emit FeeCollectorUpdated(oldFeeCollector, _feeCollector);
    }
}

File 10 of 27 : SigVerifier.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title Allows owner to set signer, and verifies signatures
 * @author Padoriku
 */
contract SigVerifier is Ownable {
    using ECDSA for bytes32;

    address public signer;

    event SignerUpdated(address from, address to);

    constructor(address _signer) {
        signer = _signer;
    }

    function setSigner(address _signer) public onlyOwner {
        address oldSigner = signer;
        signer = _signer;
        emit SignerUpdated(oldSigner, _signer);
    }

    function verifySig(bytes32 _hash, bytes memory _feeSig) internal view {
        address _signer = _hash.recover(_feeSig);
        require(_signer == signer, "invalid signer");
    }
}

File 11 of 27 : Swapper.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./CodecRegistry.sol";
import "./interfaces/ICodec.sol";
import "./interfaces/IWETH.sol";
import "./DexRegistry.sol";

/**
 * @title Loads codecs for the swaps and performs swap actions
 * @author Padoriku
 */
contract Swapper is CodecRegistry, DexRegistry {
    using SafeERC20 for IERC20;

    constructor(
        string[] memory _funcSigs,
        address[] memory _codecs,
        address[] memory _supportedDexList,
        string[] memory _supportedDexFuncs
    ) DexRegistry(_supportedDexList, _supportedDexFuncs) CodecRegistry(_funcSigs, _codecs) {}

    /**
     * @dev Checks the input swaps for that tokenIn and tokenOut for every swap should be the same
     * @param _swaps the swaps the check
     * @return sumAmtIn the sum of all amountIns in the swaps
     * @return tokenIn the input token of the swaps
     * @return tokenOut the desired output token of the swaps
     * @return codecs a list of codecs which each of them corresponds to a swap
     */
    function sanitizeSwaps(ICodec.SwapDescription[] memory _swaps)
        internal
        view
        returns (
            uint256 sumAmtIn,
            address tokenIn,
            address tokenOut,
            ICodec[] memory codecs // _codecs[i] is for _swaps[i]
        )
    {
        address prevTokenIn;
        address prevTokenOut;
        codecs = loadCodecs(_swaps);

        for (uint256 i = 0; i < _swaps.length; i++) {
            require(dexRegistry[_swaps[i].dex][bytes4(_swaps[i].data)], "unsupported dex");
            (uint256 _amountIn, address _tokenIn, address _tokenOut) = codecs[i].decodeCalldata(_swaps[i]);
            require(prevTokenIn == address(0) || prevTokenIn == _tokenIn, "tkin mismatch");
            prevTokenIn = _tokenIn;
            require(prevTokenOut == address(0) || prevTokenOut == _tokenOut, "tko mismatch");
            prevTokenOut = _tokenOut;

            sumAmtIn += _amountIn;
            tokenIn = _tokenIn;
            tokenOut = _tokenOut;
        }
    }

    /**
     * @notice Executes the swaps, decode their return values and sums the returned amount
     * @dev This function is intended to be used on src chain only
     * @dev This function immediately fails (return false) if any swaps fail. There is no "partial fill" on src chain
     * @param _swaps swaps. this function assumes that the swaps are already sanitized
     * @param _codecs the codecs for each swap
     * @return ok whether the operation is successful
     * @return sumAmtOut the sum of all amounts gained from swapping
     */
    function executeSwaps(
        ICodec.SwapDescription[] memory _swaps,
        ICodec[] memory _codecs // _codecs[i] is for _swaps[i]
    ) internal returns (bool ok, uint256 sumAmtOut) {
        for (uint256 i = 0; i < _swaps.length; i++) {
            (uint256 amountIn, address tokenIn, address tokenOut) = _codecs[i].decodeCalldata(_swaps[i]);
            bytes memory data = _codecs[i].encodeCalldataWithOverride(_swaps[i].data, amountIn, address(this));
            IERC20(tokenIn).safeIncreaseAllowance(_swaps[i].dex, amountIn);
            uint256 balBefore = IERC20(tokenOut).balanceOf(address(this));
            (ok, ) = _swaps[i].dex.call(data);
            if (!ok) {
                return (false, 0);
            }
            uint256 balAfter = IERC20(tokenOut).balanceOf(address(this));
            sumAmtOut += balAfter - balBefore;
        }
    }

    /**
     * @notice Executes the swaps with override, redistributes amountIns for each swap route,
     * decode their return values and sums the returned amount
     * @dev This function is intended to be used on dst chain only
     * @param _swaps swaps to execute. this function assumes that the swaps are already sanitized
     * @param _codecs the codecs for each swap
     * @param _amountInOverride the amountIn to substitute the amountIns in swaps for
     * @dev _amountInOverride serves the purpose of correcting the estimated amountIns to actual bridge outs
     * @dev _amountInOverride is also distributed according to the weight of each original amountIn
     * @return sumAmtOut the sum of all amounts gained from swapping
     * @return sumAmtFailed the sum of all amounts that fails to swap
     */
    function executeSwapsWithOverride(
        ICodec.SwapDescription[] memory _swaps,
        ICodec[] memory _codecs, // _codecs[i] is for _swaps[i]
        uint256 _amountInOverride,
        bool _allowPartialFill
    ) internal returns (uint256 sumAmtOut, uint256 sumAmtFailed) {
        (uint256[] memory amountIns, address tokenIn, address tokenOut) = _redistributeAmountIn(
            _swaps,
            _amountInOverride,
            _codecs
        );
        uint256 balBefore = IERC20(tokenOut).balanceOf(address(this));
        // execute the swaps with adjusted amountIns
        for (uint256 i = 0; i < _swaps.length; i++) {
            bytes memory swapCalldata = _codecs[i].encodeCalldataWithOverride(
                _swaps[i].data,
                amountIns[i],
                address(this)
            );
            IERC20(tokenIn).safeIncreaseAllowance(_swaps[i].dex, amountIns[i]);
            (bool ok, ) = _swaps[i].dex.call(swapCalldata);
            require(ok || _allowPartialFill, "swap failed");
            if (!ok) {
                sumAmtFailed += amountIns[i];
            }
        }
        uint256 balAfter = IERC20(tokenOut).balanceOf(address(this));
        sumAmtOut = balAfter - balBefore;
        require(sumAmtOut > 0, "all swaps failed");
    }

    /// @notice distributes the _amountInOverride to the swaps base on how much each original amountIns weight
    function _redistributeAmountIn(
        ICodec.SwapDescription[] memory _swaps,
        uint256 _amountInOverride,
        ICodec[] memory _codecs
    )
        private
        view
        returns (
            uint256[] memory amountIns,
            address tokenIn,
            address tokenOut
        )
    {
        uint256 sumAmtIn;
        amountIns = new uint256[](_swaps.length);

        // compute sumAmtIn and collect amountIns
        for (uint256 i = 0; i < _swaps.length; i++) {
            uint256 amountIn;
            (amountIn, tokenIn, tokenOut) = _codecs[i].decodeCalldata(_swaps[i]);
            sumAmtIn += amountIn;
            amountIns[i] = amountIn;
        }

        // compute adjusted amountIns with regard to the weight of each amountIns in total amountIn
        for (uint256 i = 0; i < amountIns.length; i++) {
            amountIns[i] = (_amountInOverride * amountIns[i]) / sumAmtIn;
        }
    }
}

File 12 of 27 : ICodec.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface ICodec {
    struct SwapDescription {
        address dex; // the DEX to use for the swap, zero address implies no swap needed
        bytes data; // the data to call the dex with
    }

    function decodeCalldata(SwapDescription calldata swap)
        external
        view
        returns (
            uint256 amountIn,
            address tokenIn,
            address tokenOut
        );

    function encodeCalldataWithOverride(
        bytes calldata data,
        uint256 amountInOverride,
        address receiverOverride
    ) external pure returns (bytes memory swapCalldata);
}

File 13 of 27 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
     * ====
     *
     * [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 14 of 27 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 15 of 27 : IBridge.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface IBridge {
    function nativeWrap() external view returns (address);

    function send(
        address _receiver,
        address _token,
        uint256 _amount,
        uint64 _dstChainId,
        uint64 _nonce,
        uint32 _maxSlippage
    ) external;

    function relay(
        bytes calldata _relayRequest,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external;

    function transfers(bytes32 transferId) external view returns (bool);

    function withdraws(bytes32 withdrawId) external view returns (bool);

    function withdraw(
        bytes calldata _wdmsg,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external;

    /**
     * @notice Verifies that a message is signed by a quorum among the signers.
     * @param _msg signed message
     * @param _sigs list of signatures sorted by signer addresses in ascending order
     * @param _signers sorted list of current signers
     * @param _powers powers of current signers
     */
    function verifySigs(
        bytes memory _msg,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external view;
}

File 16 of 27 : IOriginalTokenVault.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface IOriginalTokenVault {
    /**
     * @notice Lock original tokens to trigger mint at a remote chain's PeggedTokenBridge
     * @param _token local token address
     * @param _amount locked token amount
     * @param _mintChainId destination chainId to mint tokens
     * @param _mintAccount destination account to receive minted tokens
     * @param _nonce user input to guarantee unique depositId
     */
    function deposit(
        address _token,
        uint256 _amount,
        uint64 _mintChainId,
        address _mintAccount,
        uint64 _nonce
    ) external;

    function records(bytes32 recordId) external view returns (bool);
}

File 17 of 27 : IOriginalTokenVaultV2.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface IOriginalTokenVaultV2 {
    /**
     * @notice Lock original tokens to trigger mint at a remote chain's PeggedTokenBridge
     * @param _token local token address
     * @param _amount locked token amount
     * @param _mintChainId destination chainId to mint tokens
     * @param _mintAccount destination account to receive minted tokens
     * @param _nonce user input to guarantee unique depositId
     */
    function deposit(
        address _token,
        uint256 _amount,
        uint64 _mintChainId,
        address _mintAccount,
        uint64 _nonce
    ) external returns (bytes32);

    function records(bytes32 recordId) external view returns (bool);
}

File 18 of 27 : IPeggedTokenBridge.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface IPeggedTokenBridge {
    /**
     * @notice Burn tokens to trigger withdrawal at a remote chain's OriginalTokenVault
     * @param _token local token address
     * @param _amount locked token amount
     * @param _withdrawAccount account who withdraw original tokens on the remote chain
     * @param _nonce user input to guarantee unique depositId
     */
    function burn(
        address _token,
        uint256 _amount,
        address _withdrawAccount,
        uint64 _nonce
    ) external;

    function records(bytes32 recordId) external view returns (bool);
}

File 19 of 27 : IPeggedTokenBridgeV2.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface IPeggedTokenBridgeV2 {
    /**
     * @notice Burn pegged tokens to trigger a cross-chain withdrawal of the original tokens at a remote chain's
     * OriginalTokenVault, or mint at another remote chain
     * @param _token The pegged token address.
     * @param _amount The amount to burn.
     * @param _toChainId If zero, withdraw from original vault; otherwise, the remote chain to mint tokens.
     * @param _toAccount The account to receive tokens on the remote chain
     * @param _nonce A number to guarantee unique depositId. Can be timestamp in practice.
     */
    function burn(
        address _token,
        uint256 _amount,
        uint64 _toChainId,
        address _toAccount,
        uint64 _nonce
    ) external returns (bytes32);

    // same with `burn` above, use openzeppelin ERC20Burnable interface
    function burnFrom(
        address _token,
        uint256 _amount,
        uint64 _toChainId,
        address _toAccount,
        uint64 _nonce
    ) external returns (bytes32);

    /**
     * @notice Mint tokens triggered by deposit at a remote chain's OriginalTokenVault.
     * @param _request The serialized Mint protobuf.
     * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by
     * +2/3 of the sigsVerifier's current signing power to be delivered.
     * @param _signers The sorted list of signers.
     * @param _powers The signing powers of the signers.
     */
    function mint(
        bytes calldata _request,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external returns (bytes32);

    function records(bytes32 recordId) external view returns (bool);
}

File 20 of 27 : IMessageBus.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

import "../lib/MsgDataTypes.sol";

interface IMessageBus {
    function liquidityBridge() external view returns (address);

    function pegBridge() external view returns (address);

    function pegBridgeV2() external view returns (address);

    function pegVault() external view returns (address);

    function pegVaultV2() external view returns (address);

    /**
     * @notice Calculates the required fee for the message.
     * @param _message Arbitrary message bytes to be decoded by the destination app contract.
     @ @return The required fee.
     */
    function calcFee(bytes calldata _message) external view returns (uint256);

    /**
     * @notice Sends a message to an app on another chain via MessageBus without an associated transfer.
     * A fee is charged in the native gas token.
     * @param _receiver The address of the destination app contract.
     * @param _dstChainId The destination chain ID.
     * @param _message Arbitrary message bytes to be decoded by the destination app contract.
     */
    function sendMessage(
        address _receiver,
        uint256 _dstChainId,
        bytes calldata _message
    ) external payable;

    /**
     * @notice Sends a message associated with a transfer to an app on another chain via MessageBus without an associated transfer.
     * A fee is charged in the native token.
     * @param _receiver The address of the destination app contract.
     * @param _dstChainId The destination chain ID.
     * @param _srcBridge The bridge contract to send the transfer with.
     * @param _srcTransferId The transfer ID.
     * @param _dstChainId The destination chain ID.
     * @param _message Arbitrary message bytes to be decoded by the destination app contract.
     */
    function sendMessageWithTransfer(
        address _receiver,
        uint256 _dstChainId,
        address _srcBridge,
        bytes32 _srcTransferId,
        bytes calldata _message
    ) external payable;

    /**
     * @notice Withdraws message fee in the form of native gas token.
     * @param _account The address receiving the fee.
     * @param _cumulativeFee The cumulative fee credited to the account. Tracked by SGN.
     * @param _sigs The list of signatures sorted by signing addresses in ascending order. A withdrawal must be
     * signed-off by +2/3 of the sigsVerifier's current signing power to be delivered.
     * @param _signers The sorted list of signers.
     * @param _powers The signing powers of the signers.
     */
    function withdrawFee(
        address _account,
        uint256 _cumulativeFee,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external;

    /**
     * @notice Execute a message with a successful transfer.
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _transfer The transfer info.
     * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by
     * +2/3 of the sigsVerifier's current signing power to be delivered.
     * @param _signers The sorted list of signers.
     * @param _powers The signing powers of the signers.
     */
    function executeMessageWithTransfer(
        bytes calldata _message,
        MsgDataTypes.TransferInfo calldata _transfer,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external payable;

    /**
     * @notice Execute a message with a refunded transfer.
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _transfer The transfer info.
     * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by
     * +2/3 of the sigsVerifier's current signing power to be delivered.
     * @param _signers The sorted list of signers.
     * @param _powers The signing powers of the signers.
     */
    function executeMessageWithTransferRefund(
        bytes calldata _message, // the same message associated with the original transfer
        MsgDataTypes.TransferInfo calldata _transfer,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external payable;

    /**
     * @notice Execute a message not associated with a transfer.
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _sigs The list of signatures sorted by signing addresses in ascending order. A relay must be signed-off by
     * +2/3 of the sigsVerifier's current signing power to be delivered.
     * @param _signers The sorted list of signers.
     * @param _powers The signing powers of the signers.
     */
    function executeMessage(
        bytes calldata _message,
        MsgDataTypes.RouteInfo calldata _route,
        bytes[] calldata _sigs,
        address[] calldata _signers,
        uint256[] calldata _powers
    ) external payable;
}

File 21 of 27 : IMessageReceiverApp.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.0;

interface IMessageReceiverApp {
    enum ExecutionStatus {
        Fail, // execution failed, finalized
        Success, // execution succeeded, finalized
        Retry // execution rejected, can retry later
    }

    /**
     * @notice Called by MessageBus (MessageBusReceiver) if the process is originated from MessageBus (MessageBusSender)'s
     *         sendMessageWithTransfer it is only called when the tokens are checked to be arrived at this contract's address.
     * @param _sender The address of the source app contract
     * @param _token The address of the token that comes out of the bridge
     * @param _amount The amount of tokens received at this contract through the cross-chain bridge.
     *        the contract that implements this contract can safely assume that the tokens will arrive before this
     *        function is called.
     * @param _srcChainId The source chain ID where the transfer is originated from
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessageWithTransfer(
        address _sender,
        address _token,
        uint256 _amount,
        uint64 _srcChainId,
        bytes calldata _message,
        address _executor
    ) external payable returns (ExecutionStatus);

    /**
     * @notice Only called by MessageBus (MessageBusReceiver) if
     *         1. executeMessageWithTransfer reverts, or
     *         2. executeMessageWithTransfer returns ExecutionStatus.Fail
     * @param _sender The address of the source app contract
     * @param _token The address of the token that comes out of the bridge
     * @param _amount The amount of tokens received at this contract through the cross-chain bridge.
     *        the contract that implements this contract can safely assume that the tokens will arrive before this
     *        function is called.
     * @param _srcChainId The source chain ID where the transfer is originated from
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessageWithTransferFallback(
        address _sender,
        address _token,
        uint256 _amount,
        uint64 _srcChainId,
        bytes calldata _message,
        address _executor
    ) external payable returns (ExecutionStatus);

    /**
     * @notice Called by MessageBus (MessageBusReceiver) to process refund of the original transfer from this contract
     * @param _token The token address of the original transfer
     * @param _amount The amount of the original transfer
     * @param _message The same message associated with the original transfer
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessageWithTransferRefund(
        address _token,
        uint256 _amount,
        bytes calldata _message,
        address _executor
    ) external payable returns (ExecutionStatus);

    /**
     * @notice Called by MessageBus (MessageBusReceiver)
     * @param _sender The address of the source app contract
     * @param _srcChainId The source chain ID where the transfer is originated from
     * @param _message Arbitrary message bytes originated from and encoded by the source app contract
     * @param _executor Address who called the MessageBus execution function
     */
    function executeMessage(
        address _sender,
        uint64 _srcChainId,
        bytes calldata _message,
        address _executor
    ) external payable returns (ExecutionStatus);
}

File 22 of 27 : MessageBusAddress.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity 0.8.12;

import "@openzeppelin/contracts/access/Ownable.sol";

abstract contract MessageBusAddress is Ownable {
    event MessageBusUpdated(address messageBus);

    address public messageBus;

    function setMessageBus(address _messageBus) public onlyOwner {
        messageBus = _messageBus;
        emit MessageBusUpdated(messageBus);
    }
}

File 23 of 27 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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 24 of 27 : 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 25 of 27 : CodecRegistry.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/ICodec.sol";

/**
 * @title A codec registry that maps swap function selectors to corresponding codec addresses
 * @author Padoriku
 */
abstract contract CodecRegistry is Ownable {
    // Initially supported swap functions
    // 0x3df02124 exchange(int128,int128,uint256,uint256)
    // 0xa6417ed6 exchange_underlying(int128,int128,uint256,uint256)
    // 0x44ee1986 exchange_underlying(int128,int128,uint256,uint256,address)
    // 0x38ed1739 swapExactTokensForTokens(uint256,uint256,address[],address,uint256)
    // 0xc04b8d59 exactInput((bytes,address,uint256,uint256,uint256))
    mapping(bytes4 => ICodec) public selector2codec;

    // not used programmatically, but added for contract transparency
    address[] public codecs;

    event CodecUpdated(bytes4 selector, address codec);

    constructor(string[] memory _funcSigs, address[] memory _codecs) {
        require(_funcSigs.length == _codecs.length, "len mm");
        for (uint256 i = 0; i < _funcSigs.length; i++) {
            bytes4 selector = bytes4(keccak256(bytes(_funcSigs[i])));
            _setCodec(selector, _codecs[i]);
        }
    }

    function setCodec(string calldata _funcSig, address _codec) public onlyOwner {
        bytes4 selector = bytes4(keccak256(bytes(_funcSig)));
        _setCodec(selector, _codec);
        emit CodecUpdated(selector, _codec);
    }

    function _setCodec(bytes4 _selector, address _codec) private {
        selector2codec[_selector] = ICodec(_codec);
        codecs.push(_codec);
    }

    function loadCodecs(ICodec.SwapDescription[] memory _swaps) internal view returns (ICodec[] memory) {
        ICodec[] memory _codecs = new ICodec[](_swaps.length);
        for (uint256 i = 0; i < _swaps.length; i++) {
            bytes4 selector = bytes4(_swaps[i].data);
            _codecs[i] = selector2codec[selector];
            require(address(_codecs[i]) != address(0), "cdc no found");
        }
        return (_codecs);
    }

    function getCodec(
        bytes4[] memory _selectors,
        ICodec[] memory _codecs,
        bytes4 _selector
    ) internal pure returns (ICodec) {
        for (uint256 i = 0; i < _codecs.length; i++) {
            if (_selector == _selectors[i]) {
                return _codecs[i];
            }
        }
        revert("cdc no found");
    }
}

File 26 of 27 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

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

interface IWETH is IERC20 {
    function deposit() external payable;

    function withdraw(uint256) external;
}

File 27 of 27 : DexRegistry.sol
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.8.12;

import "@openzeppelin/contracts/access/Ownable.sol";

/**
 * @title Manages a list supported dex
 * @author Padoriku
 */
abstract contract DexRegistry is Ownable {
    event SupportedDexUpdated(address dex, bytes4 selector, bool enabled);

    mapping(address => mapping(bytes4 => bool)) public dexRegistry;

    constructor(address[] memory _supportedDexList, string[] memory _supportedFuncs) {
        for (uint256 i = 0; i < _supportedDexList.length; i++) {
            bytes4 selector = bytes4(keccak256(bytes(_supportedFuncs[i])));
            _setSupportedDex(_supportedDexList[i], selector, true);
        }
    }

    function setSupportedDex(
        address _dex,
        bytes4 _selector,
        bool _enabled
    ) external onlyOwner {
        _setSupportedDex(_dex, _selector, _enabled);
        emit SupportedDexUpdated(_dex, _selector, _enabled);
    }

    function _setSupportedDex(
        address _dex,
        bytes4 _selector,
        bool _enabled
    ) private {
        bool enabled = dexRegistry[_dex][_selector];
        require(enabled != _enabled, "nop");
        dexRegistry[_dex][_selector] = _enabled;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 800,
    "details": {
      "yul": false
    }
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_messageBus","type":"address"},{"internalType":"address","name":"_nativeWrap","type":"address"},{"internalType":"address","name":"_signer","type":"address"},{"internalType":"address","name":"_feeCollector","type":"address"},{"internalType":"string[]","name":"_funcSigs","type":"string[]"},{"internalType":"address[]","name":"_codecs","type":"address[]"},{"internalType":"address[]","name":"_supportedDexList","type":"address[]"},{"internalType":"string[]","name":"_supportedDexFuncs","type":"string[]"},{"internalType":"bool","name":"_testMode","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"address","name":"codec","type":"address"}],"name":"CodecUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amountIn","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenOut","type":"address"}],"name":"DirectSwap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"FeeCollectorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"messageBus","type":"address"}],"name":"MessageBusUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nativeWrap","type":"address"}],"name":"NativeWrapUpdated","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":"bytes32","name":"id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"dstAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"refundAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"refundToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeCollected","type":"uint256"},{"indexed":false,"internalType":"enum TransferSwapper.RequestStatus","name":"status","type":"uint8"}],"name":"RequestDone","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"transferId","type":"bytes32"},{"indexed":false,"internalType":"uint64","name":"dstChainId","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"srcAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"srcToken","type":"address"},{"indexed":false,"internalType":"address","name":"dstToken","type":"address"},{"indexed":false,"internalType":"address","name":"bridgeOutReceiver","type":"address"}],"name":"RequestSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"SignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"dex","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"SupportedDexUpdated","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"codecs","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address","name":"_to","type":"address"}],"name":"collectFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"dexRegistry","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"directBridgeSenders","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint64","name":"_srcChainId","type":"uint64"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"_executor","type":"address"}],"name":"executeMessage","outputs":[{"internalType":"enum IMessageReceiverApp.ExecutionStatus","name":"","type":"uint8"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"","type":"address"}],"name":"executeMessageWithTransfer","outputs":[{"internalType":"enum IMessageReceiverApp.ExecutionStatus","name":"","type":"uint8"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint64","name":"","type":"uint64"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"","type":"address"}],"name":"executeMessageWithTransferFallback","outputs":[{"internalType":"enum IMessageReceiverApp.ExecutionStatus","name":"","type":"uint8"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"address","name":"","type":"address"}],"name":"executeMessageWithTransferRefund","outputs":[{"internalType":"enum IMessageReceiverApp.ExecutionStatus","name":"","type":"uint8"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"feeCollector","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageBus","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeWrap","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"name":"selector2codec","outputs":[{"internalType":"contract ICodec","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_funcSig","type":"string"},{"internalType":"address","name":"_codec","type":"address"}],"name":"setCodec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_messageBus","type":"address"}],"name":"setMessageBus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nativeWrap","type":"address"}],"name":"setNativeWrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dex","type":"address"},{"internalType":"bytes4","name":"_selector","type":"bytes4"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setSupportedDex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"testMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dstTransferSwapper","type":"address"},{"components":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint64","name":"dstChainId","type":"uint64"},{"internalType":"uint32","name":"maxBridgeSlippage","type":"uint32"},{"internalType":"enum MsgDataTypes.BridgeSendType","name":"bridgeType","type":"uint8"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"internalType":"bool","name":"nativeIn","type":"bool"},{"internalType":"bool","name":"nativeOut","type":"bool"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"feeDeadline","type":"uint256"},{"internalType":"bytes","name":"feeSig","type":"bytes"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"dstTokenOut","type":"address"},{"internalType":"bool","name":"allowPartialFill","type":"bool"}],"internalType":"struct TransferSwapper.TransferDescription","name":"_desc","type":"tuple"},{"components":[{"internalType":"address","name":"dex","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ICodec.SwapDescription[]","name":"_srcSwaps","type":"tuple[]"},{"components":[{"internalType":"address","name":"dex","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct ICodec.SwapDescription[]","name":"_dstSwaps","type":"tuple[]"}],"name":"transferWithSwap","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162005a5438038062005a5483398101604081905262000034916200062b565b858786868686818185856200004933620001f0565b8051825114620000765760405162461bcd60e51b81526004016200006d9062000796565b60405180910390fd5b60005b8251811015620000ef5760008382815181106200009a576200009a620007a8565b6020026020010151805190602001209050620000d981848481518110620000c557620000c5620007a8565b60200260200101516200024060201b60201c565b5080620000e681620007d4565b91505062000079565b50505060005b82518110156200016d576000828281518110620001165762000116620007a8565b602002602001015180519060200120905062000157848381518110620001405762000140620007a8565b6020026020010151826001620002b260201b60201c565b50806200016481620007d4565b915050620000f5565b5050600580546001600160a01b039788166001600160a01b03199182161790915560068054988816988216989098179097555050600160078190558054600880549f87169f9097169e909e17909555505050911515600160a01b026001600160a81b0319909916999091169890981796909617909655506200081f945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160e01b0319909116600090815260026020526040812080546001600160a01b039093166001600160a01b031993841681179091556003805460018101825592527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9091018054909216179055565b6001600160a01b03831660009081526004602090815260408083206001600160e01b03198616845290915290205460ff1680151582151514156200030a5760405162461bcd60e51b81526004016200006d906200080d565b506001600160a01b0390921660009081526004602090815260408083206001600160e01b0319909416835292905220805491151560ff19909216919091179055565b60006001600160a01b0382165b92915050565b6200036a816200034c565b81146200037657600080fd5b50565b805162000359816200035f565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b0382111715620003c457620003c462000386565b6040525050565b6000620003d760405190565b9050620003e582826200039c565b919050565b60006001600160401b0382111562000406576200040662000386565b5060209081020190565b60006001600160401b038211156200042c576200042c62000386565b601f19601f83011660200192915050565b60005b838110156200045a57818101518382015260200162000440565b838111156200046a576000848401525b50505050565b600062000487620004818462000410565b620003cb565b905082815260208101848484011115620004a457620004a4600080fd5b620004b18482856200043d565b509392505050565b600082601f830112620004cf57620004cf600080fd5b8151620004e184826020860162000470565b949350505050565b6000620004fa6200048184620003ea565b838152905060208082019084028301858111156200051b576200051b600080fd5b835b81811015620005615780516001600160401b03811115620005415762000541600080fd5b808601620005508982620004b9565b85525050602092830192016200051d565b5050509392505050565b600082601f830112620005815762000581600080fd5b8151620004e1848260208601620004e9565b6000620005a46200048184620003ea565b83815290506020808201908402830185811115620005c557620005c5600080fd5b835b81811015620005615780620005dd888262000379565b84525060209283019201620005c7565b600082601f830112620006035762000603600080fd5b8151620004e184826020860162000593565b8015156200036a565b8051620003598162000615565b60008060008060008060008060006101208a8c0312156200064f576200064f600080fd5b60006200065d8c8c62000379565b9950506020620006708c828d0162000379565b9850506040620006838c828d0162000379565b9750506060620006968c828d0162000379565b96505060808a01516001600160401b03811115620006b757620006b7600080fd5b620006c58c828d016200056b565b95505060a08a01516001600160401b03811115620006e657620006e6600080fd5b620006f48c828d01620005ed565b94505060c08a01516001600160401b03811115620007155762000715600080fd5b620007238c828d01620005ed565b93505060e08a01516001600160401b03811115620007445762000744600080fd5b620007528c828d016200056b565b925050610100620007668c828d016200061e565b9150509295985092959850929598565b60068152600060208201656c656e206d6d60d01b815291505b5060200190565b60208082528101620003598162000776565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415620007eb57620007eb620007be565b5060010190565b600381526000602082016206e6f760ec1b815291506200078f565b602080825281016200035981620007f2565b615225806200082f6000396000f3fe60806040526004361061018f5760003560e01c806391ec04b5116100d6578063c5bccca31161007f578063efcfd8f511610059578063efcfd8f514610451578063f2fde38b14610471578063fbf5d7631461049157600080fd5b8063c5bccca3146103fd578063cd9ea3421461041d578063d8318ae51461043e57600080fd5b8063a1c9d41e116100b0578063a1c9d41e14610387578063a42dce80146103bd578063c415b95c146103dd57600080fd5b806391ec04b51461030c5780639c649fdf14610354578063a1a227fa1461036757600080fd5b8063675df759116101385780637cd2bffc116101125780637cd2bffc146102bb57806382665a8f146102ce5780638da5cb5b146102ee57600080fd5b8063675df759146102665780636c19e78314610286578063715018a6146102a657600080fd5b8063547cad1211610169578063547cad12146102115780635ab7afc6146102335780635b5a66a71461024657600080fd5b80630bcb49821461019b578063238ac933146101c4578063457bfa2f146101f157600080fd5b3661019657005b600080fd5b6101ae6101a9366004613296565b6104d4565b6040516101bb9190613369565b60405180910390f35b3480156101d057600080fd5b506005546101e4906001600160a01b031681565b6040516101bb9190613380565b3480156101fd57600080fd5b506008546101e4906001600160a01b031681565b34801561021d57600080fd5b5061023161022c36600461338e565b6105cc565b005b6101ae6102413660046134b8565b61064d565b34801561025257600080fd5b5061023161026136600461338e565b61075d565b34801561027257600080fd5b5061023161028136600461358b565b6107d2565b34801561029257600080fd5b506102316102a136600461338e565b610847565b3480156102b257600080fd5b506102316108d0565b6101ae6102c93660046134b8565b610906565b3480156102da57600080fd5b506101e46102e93660046135db565b610b03565b3480156102fa57600080fd5b506000546001600160a01b03166101e4565b34801561031857600080fd5b506103476103273660046135fc565b600460209081526000928352604080842090915290825290205460ff1681565b6040516101bb9190613641565b6101ae61036236600461364f565b610b2d565b34801561037357600080fd5b506001546101e4906001600160a01b031681565b34801561039357600080fd5b506101e46103a23660046135db565b6009602052600090815260409020546001600160a01b031681565b3480156103c957600080fd5b506102316103d836600461338e565b610b74565b3480156103e957600080fd5b506006546101e4906001600160a01b031681565b34801561040957600080fd5b50610231610418366004613687565b610bf1565b34801561042957600080fd5b5060015461034790600160a01b900460ff1681565b61023161044c36600461373f565b610ced565b34801561045d57600080fd5b5061023161046c3660046137fc565b610f6f565b34801561047d57600080fd5b5061023161048c36600461338e565b611156565b34801561049d57600080fd5b506104c76104ac36600461383a565b6002602052600090815260409020546001600160a01b031681565b6040516101bb919061389d565b600154600090600160a01b900460ff1661051b576001546001600160a01b0316331461051b5760405162461bcd60e51b8152600401610512906138e2565b60405180910390fd5b6002600754141561053e5760405162461bcd60e51b815260040161051290613926565b6002600755600061055184860186613b10565b905061055d87876111b2565b61056e878783604001516000611338565b7f83fb878bc850fecc32634e2924a47daa8db823de1e2eb33084be9fd29f22c24581600001516000888a856080015160026040516105b196959493929190613b66565b60405180910390a16001915050600160075595945050505050565b6000546001600160a01b031633146105f65760405162461bcd60e51b815260040161051290613bf2565b600180546001600160a01b0319166001600160a01b0383169081179091556040517f3f8223bcd8b3b875473e9f9e14e1ad075451a2b5ffd31591655da9a01516bf5e9161064291613380565b60405180910390a150565b600154600090600160a01b900460ff1661068b576001546001600160a01b0316331461068b5760405162461bcd60e51b8152600401610512906138e2565b600260075414156106ae5760405162461bcd60e51b815260040161051290613926565b600260075582516000906106cb9085016020908101908601613e3b565b90506106d787876111b2565b60008160800151876106e99190613e8c565b90506106fc888284604001516000611338565b7f83fb878bc850fecc32634e2924a47daa8db823de1e2eb33084be9fd29f22c24582600001516000838b8660800151600260405161073f96959493929190613b66565b60405180910390a16001925050505b60016007559695505050505050565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161051290613bf2565b600880546001600160a01b0319166001600160a01b0383161790556040517fb878cd71628ac64b2df1872301925e01164824535b02e8601077749eeeb88c3d90610642908390613380565b6000546001600160a01b031633146107fc5760405162461bcd60e51b815260040161051290613bf2565b610807838383611468565b7f5e20184b00709d9f103306958e9fb9d509f78bec1829ca7080f2c43eb2ff21a883838360405161083a93929190613eb3565b60405180910390a1505050565b6000546001600160a01b031633146108715760405162461bcd60e51b815260040161051290613bf2565b600580546001600160a01b038381166001600160a01b03198316179092556040519116907f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb906108c49083908590613edb565b60405180910390a15050565b6000546001600160a01b031633146108fa5760405162461bcd60e51b815260040161051290613bf2565b61090460006114ff565b565b600154600090600160a01b900460ff16610944576001546001600160a01b031633146109445760405162461bcd60e51b8152600401610512906138e2565b600260075414156109675760405162461bcd60e51b815260040161051290613926565b600260075582516000906109849085016020908101908601613e3b565b905080608001518610156109e7576080810186905280516040517f83fb878bc850fecc32634e2924a47daa8db823de1e2eb33084be9fd29f22c245916109d59160009081908c908c90600190613ef6565b60405180910390a1600191505061074e565b60808101516109f69087613e8c565b9550610a0287876111b2565b6060810151602082015151889190889060009015610a915760606000610a2b876020015161154f565b90985093509150506001600160a01b03808216908e1614610a5e5760405162461bcd60e51b815260040161051290613f52565b610a728760200151838e8a60a0015161177d565b90945092508215610a8e57610a8e8d8489604001516000611338565b50505b610aa18483876040015186611338565b7f83fb878bc850fecc32634e2924a47daa8db823de1e2eb33084be9fd29f22c245856000015183838e89608001516001604051610ae396959493929190613f62565b60405180910390a160019550505050505060016007559695505050505050565b60038181548110610b1357600080fd5b6000918252602090912001546001600160a01b0316905081565b600154600090600160a01b900460ff16610b6b576001546001600160a01b03163314610b6b5760405162461bcd60e51b8152600401610512906138e2565b95945050505050565b6000546001600160a01b03163314610b9e5760405162461bcd60e51b815260040161051290613bf2565b600680546001600160a01b038381166001600160a01b03198316179092556040519116907f5d16ad41baeb009cd23eb8f6c7cde5c2e0cd5acf4a33926ab488875c37c37f38906108c49083908590613edb565b6000546001600160a01b03163314610c1b5760405162461bcd60e51b815260040161051290613bf2565b60008383604051610c2d929190613f90565b60405180910390209050610cae81836001600160e01b0319909116600090815260026020526040812080546001600160a01b039093166001600160a01b031993841681179091556003805460018101825592527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9091018054909216179055565b7f58ddcdb40971f55ad1b6a8a28067274a4ffc7e9d77c3ea14a17652faa705e1978183604051610cdf929190613f9d565b60405180910390a150505050565b60026007541415610d105760405162461bcd60e51b815260040161051290613926565b600260075582151580610d46575067ffffffffffffffff4616610d396040870160208801613fab565b67ffffffffffffffff1614155b610d625760405162461bcd60e51b815260040161051290613fe6565b82151580610d9a575061014085013515801590610d9a57506000610d8e6101808701610160880161338e565b6001600160a01b031614155b610db65760405162461bcd60e51b815260040161051290613fe6565b6101408501356000610dd06101808801610160890161338e565b90506000610de661018089016101608a0161338e565b905060608615610e4e57610e02610dfd888a613ff6565b61154f565b92965090945092509050610e1e6101808a016101608b0161338e565b6001600160a01b0316836001600160a01b031614610e4e5760405162461bcd60e51b815260040161051290613f52565b610e5e60c08a0160a08b01614003565b15610f1e576008546001600160a01b03848116911614610e905760405162461bcd60e51b815260040161051290614058565b83341015610eb05760405162461bcd60e51b81526004016105129061409c565b600860009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b158015610f0057600080fd5b505af1158015610f14573d6000803e3d6000fd5b5050505050610f33565b610f336001600160a01b038416333087611ac0565b610f5e8a858585610f448c8e613ff6565b610f4e8b8d613ff6565b8f610f589061423e565b88611b2d565b505060016007555050505050505050565b6006546001600160a01b03163314610f995760405162461bcd60e51b81526004016105129061427e565b60005b82811015611150576000848483818110610fb857610fb861428e565b9050602002016020810190610fcd919061338e565b6001600160a01b031614156110695760004790506000836001600160a01b03168261c35090604051610ffe906142a4565b600060405180830381858888f193505050503d806000811461103c576040519150601f19603f3d011682016040523d82523d6000602084013e611041565b606091505b50509050806110625760405162461bcd60e51b8152600401610512906142e3565b505061113e565b600084848381811061107d5761107d61428e565b9050602002016020810190611092919061338e565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016110bd9190613380565b602060405180830381865afa1580156110da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fe91906142f3565b905061113c83828787868181106111175761111761428e565b905060200201602081019061112c919061338e565b6001600160a01b03169190611c9c565b505b8061114881614314565b915050610f9c565b50505050565b6000546001600160a01b031633146111805760405162461bcd60e51b815260040161051290613bf2565b6001600160a01b0381166111a65760405162461bcd60e51b81526004016105129061438c565b6111af816114ff565b50565b6008546001600160a01b038381169116141561133457600154604080516320a6037160e21b815290516000926001600160a01b0316916382980dc49160048083019260209291908290030181865afa158015611212573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611236919061439c565b9050600860009054906101000a90046001600160a01b03166001600160a01b0316816001600160a01b031663457bfa2f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611295573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b9919061439c565b6001600160a01b0316141561133257600860009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561131857600080fd5b505af115801561132c573d6000803e3d6000fd5b50505050505b505b5050565b8015611454576008546001600160a01b0385811691161461136b5760405162461bcd60e51b8152600401610512906143f1565b600854604051632e1a7d4d60e01b81526001600160a01b0390911690632e1a7d4d9061139b908690600401614401565b600060405180830381600087803b1580156113b557600080fd5b505af11580156113c9573d6000803e3d6000fd5b505050506000826001600160a01b03168461c350906040516113ea906142a4565b600060405180830381858888f193505050503d8060008114611428576040519150601f19603f3d011682016040523d82523d6000602084013e61142d565b606091505b505090508061144e5760405162461bcd60e51b815260040161051290614443565b50611150565b6111506001600160a01b0385168385611c9c565b6001600160a01b03831660009081526004602090815260408083206001600160e01b03198616845290915290205460ff1680151582151514156114bd5760405162461bcd60e51b815260040161051290613fe6565b506001600160a01b0390921660009081526004602090815260408083206001600160e01b0319909416835292905220805491151560ff19909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000606060008061156287611cbb565b925060005b875181101561177357600460008983815181106115865761158661428e565b6020026020010151600001516001600160a01b03166001600160a01b0316815260200190815260200160002060008983815181106115c6576115c661428e565b6020026020010151602001516115db90614467565b6001600160e01b031916815260208101919091526040016000205460ff166116155760405162461bcd60e51b8152600401610512906144e0565b600080600086848151811061162c5761162c61428e565b60200260200101516001600160a01b031663358f0e1c8c86815181106116545761165461428e565b60200260200101516040518263ffffffff1660e01b8152600401611678919061454e565b606060405180830381865afa158015611695573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b9919061455f565b919450925090506001600160a01b03861615806116e75750816001600160a01b0316866001600160a01b0316145b6117035760405162461bcd60e51b8152600401610512906145d9565b90945084906001600160a01b038516158061172f5750806001600160a01b0316856001600160a01b0316145b61174b5760405162461bcd60e51b81526004016105129061461d565b935083611758838b61462d565b9950909750955081905061176b81614314565b915050611567565b5050509193509193565b600080600080600061179089888a611dfb565b9250925092506000816001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016117c49190613380565b602060405180830381865afa1580156117e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180591906142f3565b905060005b8a51811015611a135760008a82815181106118275761182761428e565b60200260200101516001600160a01b0316634c6da2698d848151811061184f5761184f61428e565b60200260200101516020015188858151811061186d5761186d61428e565b6020026020010151306040518463ffffffff1660e01b815260040161189493929190614645565b600060405180830381865afa1580156118b1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118d99190810190614672565b905061192f8c83815181106118f0576118f061428e565b60200260200101516000015187848151811061190e5761190e61428e565b6020026020010151876001600160a01b0316611fb09092919063ffffffff16565b60008c83815181106119435761194361428e565b6020026020010151600001516001600160a01b03168260405161196691906146cf565b6000604051808303816000865af19150503d80600081146119a3576040519150601f19603f3d011682016040523d82523d6000602084013e6119a8565b606091505b5050905080806119b55750895b6119d15760405162461bcd60e51b81526004016105129061470f565b806119fe578683815181106119e8576119e861428e565b6020026020010151886119fb919061462d565b97505b50508080611a0b90614314565b91505061180a565b506040516370a0823160e01b81526000906001600160a01b038416906370a0823190611a43903090600401613380565b602060405180830381865afa158015611a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8491906142f3565b9050611a908282613e8c565b965060008711611ab25760405162461bcd60e51b815260040161051290614753565b505050505094509492505050565b611150846323b872dd60e01b858585604051602401611ae193929190614763565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915261204d565b8351879015611b65576000611b4286846120dc565b9250905080611b635760405162461bcd60e51b8152600401610512906147bf565b505b6000611b7984600001518560800151612426565b90504667ffffffffffffffff16846020015167ffffffffffffffff161415611bf5577f0e248ac8be20725176a5f0ab093c5fbb964634d4675012f3d3ad66e69e56d5b7818a8a858b604051611bd29594939291906147cf565b60405180910390a1611bee878386600001518760c00151611338565b505061132c565b611c00848a8a61245e565b60a0840151349015611c1957611c168a34613e8c565b90505b600080875111611c2a578551611c2c565b8b5b90506000611c3f8483898b898f896124e7565b90507fbac7d3515b47f762d5edcc83b041c8ad43133089d06f60e3b8f307a66fcb6221848289602001518f8f8c610180015188604051611c85979695949392919061482b565b60405180910390a150505050505050505050505050565b6113328363a9059cbb60e01b8484604051602401611ae1929190614893565b60606000825167ffffffffffffffff811115611cd957611cd96133ca565b604051908082528060200260200182016040528015611d02578160200160208202803683370190505b50905060005b8351811015611df4576000848281518110611d2557611d2561428e565b602002602001015160200151611d3a90614467565b6001600160e01b0319811660009081526002602052604090205484519192506001600160a01b031690849084908110611d7557611d7561428e565b60200260200101906001600160a01b031690816001600160a01b03168152505060006001600160a01b0316838381518110611db257611db261428e565b60200260200101516001600160a01b03161415611de15760405162461bcd60e51b8152600401610512906148e2565b5080611dec81614314565b915050611d08565b5092915050565b60606000806000865167ffffffffffffffff811115611e1c57611e1c6133ca565b604051908082528060200260200182016040528015611e45578160200160208202803683370190505b50935060005b8751811015611f39576000868281518110611e6857611e6861428e565b60200260200101516001600160a01b031663358f0e1c8a8481518110611e9057611e9061428e565b60200260200101516040518263ffffffff1660e01b8152600401611eb4919061454e565b606060405180830381865afa158015611ed1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef5919061455f565b90965094509050611f06818461462d565b925080868381518110611f1b57611f1b61428e565b60209081029190910101525080611f3181614314565b915050611e4b565b5060005b8451811015611fa55781858281518110611f5957611f5961428e565b602002602001015188611f6c91906148f2565b611f769190614927565b858281518110611f8857611f8861428e565b602090810291909101015280611f9d81614314565b915050611f3d565b505093509350939050565b600081846001600160a01b031663dd62ed3e30866040518363ffffffff1660e01b8152600401611fe1929190613edb565b602060405180830381865afa158015611ffe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202291906142f3565b61202c919061462d565b90506111508463095ea7b360e01b8584604051602401611ae1929190614893565b60006120a2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661253b9092919063ffffffff16565b80519091501561133257808060200190518101906120c0919061493b565b6113325760405162461bcd60e51b8152600401610512906149b6565b60008060005b845181101561241d5760008060008684815181106121025761210261428e565b60200260200101516001600160a01b031663358f0e1c89868151811061212a5761212a61428e565b60200260200101516040518263ffffffff1660e01b815260040161214e919061454e565b606060405180830381865afa15801561216b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218f919061455f565b92509250925060008785815181106121a9576121a961428e565b60200260200101516001600160a01b0316634c6da2698a87815181106121d1576121d161428e565b60200260200101516020015186306040518463ffffffff1660e01b81526004016121fd93929190614645565b600060405180830381865afa15801561221a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122429190810190614672565b90506122768986815181106122595761225961428e565b6020908102919091010151516001600160a01b0385169086611fb0565b6040516370a0823160e01b81526000906001600160a01b038416906370a08231906122a5903090600401613380565b602060405180830381865afa1580156122c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122e691906142f3565b90508986815181106122fa576122fa61428e565b6020026020010151600001516001600160a01b03168260405161231d91906146cf565b6000604051808303816000865af19150503d806000811461235a576040519150601f19603f3d011682016040523d82523d6000602084013e61235f565b606091505b5050809850508761237c576000809750975050505050505061241f565b6040516370a0823160e01b81526000906001600160a01b038516906370a08231906123ab903090600401613380565b602060405180830381865afa1580156123c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ec91906142f3565b90506123f88282613e8c565b612402908961462d565b9750505050505050808061241590614314565b9150506120e2565b505b9250929050565b60003383468460405160200161243f9493929190614a0d565b6040516020818303038152906040528051906020012090505b92915050565b600046846020015184848761010001518860e0015160405160200161248896959493929190614a55565b60405160208183030381529060405280519060200120905060006124ab82612554565b90506124bc81866101200151612584565b42856101000151116124e05760405162461bcd60e51b815260040161051290614b19565b5050505050565b6000806124f58988886125c0565b905061252e8885878a602001518b608001518c60400151878e60600151600160009054906101000a90046001600160a01b03168c612635565b9998505050505050505050565b606061254a84846000856126ce565b90505b9392505050565b6000816040516020016125679190614b29565b604051602081830303815290604052805190602001209050919050565b60006125908383612792565b6005549091506001600160a01b038083169116146113325760405162461bcd60e51b815260040161051290614b98565b60606040518060c0016040528085815260200183815260200184600001516001600160a01b031681526020018460c00151151581526020018460e001518152602001846101a00151151581525060405160200161261d9190614c94565b60405160208183030381529060405290509392505050565b600080600061264a8d8d8d8d8d8d8c8c6127b6565b88519193509150156126be57846001600160a01b0316634289fbb3858f8d85878d6040518763ffffffff1660e01b815260040161268b959493929190614cc4565b6000604051808303818588803b1580156126a457600080fd5b505af11580156126b8573d6000803e3d6000fd5b50505050505b509b9a5050505050505050505050565b6060824710156126f05760405162461bcd60e51b815260040161051290614d65565b6001600160a01b0385163b6127175760405162461bcd60e51b815260040161051290614da9565b600080866001600160a01b0316858760405161273391906146cf565b60006040518083038185875af1925050503d8060008114612770576040519150601f19603f3d011682016040523d82523d6000602084013e612775565b606091505b5091509150612785828286612dfd565b925050505b949350505050565b60008060006127a18585612e36565b915091506127ae81612ea3565b509392505050565b60008060018460068111156127cd576127cd61331a565b14156128c757826001600160a01b03166382980dc46040518163ffffffff1660e01b8152600401602060405180830381865afa158015612811573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612835919061439c565b905061284b6001600160a01b038a16828a611fb0565b60405163a5977fbb60e01b81526001600160a01b0382169063a5977fbb90612881908d908d908d908d908d908d90600401614dc5565b600060405180830381600087803b15801561289b57600080fd5b505af11580156128af573d6000803e3d6000fd5b505050506128c08a8a8a8a8a612f88565b9150612df0565b60028460068111156128db576128db61331a565b14156129cc57826001600160a01b031663d8257d176040518163ffffffff1660e01b8152600401602060405180830381865afa15801561291f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612943919061439c565b90506129596001600160a01b038a16828a611fb0565b806001600160a01b031663234636248a8a8a8e8b6040518663ffffffff1660e01b815260040161298d959493929190614e14565b600060405180830381600087803b1580156129a757600080fd5b505af11580156129bb573d6000803e3d6000fd5b505050506128c08a8a8a8a8a612fc8565b60038460068111156129e0576129e061331a565b1415612ae457826001600160a01b031663dfa2dbaf6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612a24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a48919061439c565b9050612a5e6001600160a01b038a16828a611fb0565b604051636f3c863f60e11b81526001600160a01b0382169063de790c7e90612a90908c908c908f908c90600401614e56565b600060405180830381600087803b158015612aaa57600080fd5b505af1158015612abe573d6000803e3d6000fd5b50612ad8925050506001600160a01b038a16826000612fe7565b6128c08a8a8a8961309b565b6004846006811115612af857612af861331a565b1415612bed57826001600160a01b031663c66a9c5a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612b3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b60919061439c565b9050612b766001600160a01b038a16828a611fb0565b806001600160a01b031663234636248a8a8a8e8b6040518663ffffffff1660e01b8152600401612baa959493929190614e14565b6020604051808303816000875af1158015612bc9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128c091906142f3565b6005846006811115612c0157612c0161331a565b1415612d1257826001600160a01b03166395b12c276040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c69919061439c565b9050612c7f6001600160a01b038a16828a611fb0565b806001600160a01b031663a00293018a8a8a8e8b6040518663ffffffff1660e01b8152600401612cb3959493929190614e14565b6020604051808303816000875af1158015612cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf691906142f3565b9150612d0d6001600160a01b038a16826000612fe7565b612df0565b6006846006811115612d2657612d2661331a565b1415612dd857826001600160a01b03166395b12c276040518163ffffffff1660e01b8152600401602060405180830381865afa158015612d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8e919061439c565b9050612da46001600160a01b038a16828a611fb0565b806001600160a01b0316639e422c338a8a8a8e8b6040518663ffffffff1660e01b8152600401612cb3959493929190614e14565b60405162461bcd60e51b815260040161051290614ebf565b9850989650505050505050565b60608315612e0c57508161254d565b825115612e1c5782518084602001fd5b8160405162461bcd60e51b81526004016105129190614ecf565b600080825160411415612e6d5760208301516040840151606085015160001a612e61878285856130d8565b9450945050505061241f565b825160401415612e975760208301516040840151612e8c8683836131b8565b93509350505061241f565b5060009050600261241f565b6000816004811115612eb757612eb761331a565b1415612ec05750565b6001816004811115612ed457612ed461331a565b1415612ef25760405162461bcd60e51b815260040161051290614f14565b6002816004811115612f0657612f0661331a565b1415612f245760405162461bcd60e51b815260040161051290614f58565b6003816004811115612f3857612f3861331a565b1415612f565760405162461bcd60e51b815260040161051290614fa7565b6004816004811115612f6a57612f6a61331a565b14156111af5760405162461bcd60e51b815260040161051290614ff6565b600030868686868646604051602001612fa79796959493929190615006565b60405160208183030381529060405280519060200120905095945050505050565b600030858585898646604051602001612fa79796959493929190615081565b8015806130605750604051636eb1769f60e11b81526001600160a01b0384169063dd62ed3e9061301d9030908690600401613edb565b602060405180830381865afa15801561303a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061305e91906142f3565b155b61307c5760405162461bcd60e51b815260040161051290615137565b6113328363095ea7b360e01b8484604051602401611ae1929190614893565b60003084848785466040516020016130b896959493929190615147565b604051602081830303815290604052805190602001209050949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561310f57506000905060036131af565b8460ff16601b1415801561312757508460ff16601c14155b1561313857506000905060046131af565b60006001878787876040516000815260200160405260405161315d94939291906151ba565b6020604051602081039080840390855afa15801561317f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166131a8576000600192509250506131af565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8316816131ee60ff86901c601b61462d565b90506131fc878288856130d8565b935093505050935093915050565b60006001600160a01b038216612458565b6132248161320a565b81146111af57600080fd5b80356124588161321b565b80613224565b80356124588161323a565b60008083601f84011261326057613260600080fd5b50813567ffffffffffffffff81111561327b5761327b600080fd5b60208301915083600182028301111561241f5761241f600080fd5b6000806000806000608086880312156132b1576132b1600080fd5b60006132bd888861322f565b95505060206132ce88828901613240565b945050604086013567ffffffffffffffff8111156132ee576132ee600080fd5b6132fa8882890161324b565b9350935050606061330d8882890161322f565b9150509295509295909350565b634e487b7160e01b600052602160045260246000fd5b600381106111af576111af61331a565b8061334a81613330565b919050565b600061245882613340565b6133638161334f565b82525050565b60208101612458828461335a565b6133638161320a565b602081016124588284613377565b6000602082840312156133a3576133a3600080fd5b600061278a848461322f565b67ffffffffffffffff8116613224565b8035612458816133af565b634e487b7160e01b600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff82111715613406576134066133ca565b6040525050565b600061341860405190565b905061334a82826133e0565b600067ffffffffffffffff82111561343e5761343e6133ca565b601f19601f83011660200192915050565b82818337506000910152565b600061346e61346984613424565b61340d565b90508281526020810184848401111561348957613489600080fd5b6127ae84828561344f565b600082601f8301126134a8576134a8600080fd5b813561278a84826020860161345b565b60008060008060008060c087890312156134d4576134d4600080fd5b60006134e0898961322f565b96505060206134f189828a0161322f565b955050604061350289828a01613240565b945050606061351389828a016133bf565b935050608087013567ffffffffffffffff81111561353357613533600080fd5b61353f89828a01613494565b92505060a061355089828a0161322f565b9150509295509295509295565b6001600160e01b03198116613224565b80356124588161355d565b801515613224565b803561245881613578565b6000806000606084860312156135a3576135a3600080fd5b60006135af868661322f565b93505060206135c08682870161356d565b92505060406135d186828701613580565b9150509250925092565b6000602082840312156135f0576135f0600080fd5b600061278a8484613240565b6000806040838503121561361257613612600080fd5b600061361e858561322f565b925050602061362f8582860161356d565b9150509250929050565b801515613363565b602081016124588284613639565b60008060008060006080868803121561366a5761366a600080fd5b6000613676888861322f565b95505060206132ce888289016133bf565b60008060006040848603121561369f5761369f600080fd5b833567ffffffffffffffff8111156136b9576136b9600080fd5b6136c58682870161324b565b935093505060206135d18682870161322f565b60006101c082840312156136ee576136ee600080fd5b50919050565b60008083601f84011261370957613709600080fd5b50813567ffffffffffffffff81111561372457613724600080fd5b60208301915083602082028301111561241f5761241f600080fd5b6000806000806000806080878903121561375b5761375b600080fd5b6000613767898961322f565b965050602087013567ffffffffffffffff81111561378757613787600080fd5b61379389828a016136d8565b955050604087013567ffffffffffffffff8111156137b3576137b3600080fd5b6137bf89828a016136f4565b9450945050606087013567ffffffffffffffff8111156137e1576137e1600080fd5b6137ed89828a016136f4565b92509250509295509295509295565b60008060006040848603121561381457613814600080fd5b833567ffffffffffffffff81111561382e5761382e600080fd5b6136c5868287016136f4565b60006020828403121561384f5761384f600080fd5b600061278a848461356d565b60006124586001600160a01b038316613872565b90565b6001600160a01b031690565b60006124588261385b565b60006124588261387e565b61336381613889565b602081016124588284613894565b601981526000602082017f63616c6c6572206973206e6f74206d6573736167652062757300000000000000815291505b5060200190565b60208082528101612458816138ab565b601f81526000602082017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815291506138db565b60208082528101612458816138f2565b600067ffffffffffffffff821115613950576139506133ca565b5060209081020190565b60006040828403121561396f5761396f600080fd5b613979604061340d565b90506000613987848461322f565b825250602082013567ffffffffffffffff8111156139a7576139a7600080fd5b6139b384828501613494565b60208301525092915050565b60006139cd61346984613936565b838152905060208082019084028301858111156139ec576139ec600080fd5b835b81811015613a2d57803567ffffffffffffffff811115613a1057613a10600080fd5b808601613a1d898261395a565b85525050602092830192016139ee565b5050509392505050565b600082601f830112613a4b57613a4b600080fd5b813561278a8482602086016139bf565b600060c08284031215613a7057613a70600080fd5b613a7a60c061340d565b90506000613a888484613240565b825250602082013567ffffffffffffffff811115613aa857613aa8600080fd5b613ab484828501613a37565b6020830152506040613ac88482850161322f565b6040830152506060613adc84828501613580565b6060830152506080613af084828501613240565b60808301525060a0613b0484828501613580565b60a08301525092915050565b600060208284031215613b2557613b25600080fd5b813567ffffffffffffffff811115613b3f57613b3f600080fd5b61278a84828501613a5b565b80613363565b600061245861386f8381565b61336381613b51565b60c08101613b748289613b4b565b613b816020830188613b5d565b613b8e6040830187613b4b565b613b9b6060830186613377565b613ba86080830185613b4b565b613bb560a083018461335a565b979650505050505050565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910190815260006138db565b6020808252810161245881613bc0565b80516124588161323a565b80516124588161321b565b60005b83811015613c33578181015183820152602001613c1b565b838111156111505750506000910152565b6000613c5261346984613424565b905082815260208101848484011115613c6d57613c6d600080fd5b6127ae848285613c18565b600082601f830112613c8c57613c8c600080fd5b815161278a848260208601613c44565b600060408284031215613cb157613cb1600080fd5b613cbb604061340d565b90506000613cc98484613c0d565b825250602082015167ffffffffffffffff811115613ce957613ce9600080fd5b6139b384828501613c78565b6000613d0361346984613936565b83815290506020808201908402830185811115613d2257613d22600080fd5b835b81811015613a2d57805167ffffffffffffffff811115613d4657613d46600080fd5b808601613d538982613c9c565b8552505060209283019201613d24565b600082601f830112613d7757613d77600080fd5b815161278a848260208601613cf5565b805161245881613578565b600060c08284031215613da757613da7600080fd5b613db160c061340d565b90506000613dbf8484613c02565b825250602082015167ffffffffffffffff811115613ddf57613ddf600080fd5b613deb84828501613d63565b6020830152506040613dff84828501613c0d565b6040830152506060613e1384828501613d87565b6060830152506080613e2784828501613c02565b60808301525060a0613b0484828501613d87565b600060208284031215613e5057613e50600080fd5b815167ffffffffffffffff811115613e6a57613e6a600080fd5b61278a84828501613d92565b634e487b7160e01b600052601160045260246000fd5b600082821015613e9e57613e9e613e76565b500390565b6001600160e01b03198116613363565b60608101613ec18286613377565b613ece6020830185613ea3565b61278a6040830184613639565b60408101613ee98285613377565b61254d6020830184613377565b60c08101613f048289613b4b565b613f116020830188613b5d565b613b8e6040830187613b5d565b600781526000602082017f746b696e206d6d00000000000000000000000000000000000000000000000000815291506138db565b6020808252810161245881613f1e565b60c08101613f708289613b4b565b613b816020830188613b4b565b6000613f8a83858461344f565b50500190565b600061278a828486613f7d565b60408101613ee98285613ea3565b600060208284031215613fc057613fc0600080fd5b600061278a84846133bf565b600381526000602082016206e6f760ec1b815291506138db565b6020808252810161245881613fcc565b600061254d3684846139bf565b60006020828403121561401857614018600080fd5b600061278a8484613580565b601281526000602082017f746b696e206e6f206e6174697665577261700000000000000000000000000000815291506138db565b6020808252810161245881614024565b600b81526000602082017f696e7366636e7420616d74000000000000000000000000000000000000000000815291506138db565b6020808252810161245881614068565b63ffffffff8116613224565b8035612458816140ac565b600781106111af57600080fd5b8035612458816140c3565b60006101c082840312156140f1576140f1600080fd5b6140fc6101c061340d565b9050600061410a848461322f565b825250602061411b848483016133bf565b602083015250604061412f848285016140b8565b6040830152506060614143848285016140d0565b6060830152506080614157848285016133bf565b60808301525060a061416b84828501613580565b60a08301525060c061417f84828501613580565b60c08301525060e061419384828501613240565b60e0830152506101006141a884828501613240565b6101008301525061012082013567ffffffffffffffff8111156141cd576141cd600080fd5b6141d984828501613494565b610120830152506101406141ef84828501613240565b610140830152506101606142058482850161322f565b6101608301525061018061421b8482850161322f565b610180830152506101a061423184828501613580565b6101a08301525092915050565b600061245836836140db565b601181526000602082017f6e6f742066656520636f6c6c6563746f72000000000000000000000000000000815291506138db565b602080825281016124588161424a565b634e487b7160e01b600052603260045260246000fd5b60006124588261386f565b601281526000602082017f73656e64206e6174697665206661696c65640000000000000000000000000000815291506138db565b60208082528101612458816142af565b60006020828403121561430857614308600080fd5b600061278a8484613c02565b600060001982141561432857614328613e76565b5060010190565b602681526000602082017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181527f6464726573730000000000000000000000000000000000000000000000000000602082015291505b5060400190565b602080825281016124588161432f565b6000602082840312156143b1576143b1600080fd5b600061278a8484613c0d565b600c81526000602082017f746b206e6f206e61746976650000000000000000000000000000000000000000815291506138db565b60208082528101612458816143bd565b602081016124588284613b4b565b600981526000602082017f73656e64206661696c0000000000000000000000000000000000000000000000815291506138db565b602080825281016124588161440f565b600061245882516001600160e01b03191690565b6000614471825190565b6020830161447e81614453565b925060048210156144a5576144a06001600160e01b0319836004036008021b90565b831692505b5050919050565b600f81526000602082017f756e737570706f72746564206465780000000000000000000000000000000000815291506138db565b60208082528101612458816144ac565b60006144fa825190565b808452602084019350614511818560208601613c18565b601f01601f19169290920192915050565b805160009060408401906145368582613377565b5060208301518482036020860152610b6b82826144f0565b6020808252810161254d8184614522565b60008060006060848603121561457757614577600080fd5b60006145838686613c02565b935050602061459486828701613c0d565b92505060406135d186828701613c0d565b600d81526000602082017f746b696e206d69736d6174636800000000000000000000000000000000000000815291506138db565b60208082528101612458816145a5565b600c81526000602082017f746b6f206d69736d617463680000000000000000000000000000000000000000815291506138db565b60208082528101612458816145e9565b6000821982111561464057614640613e76565b500190565b6060808252810161465681866144f0565b90506146656020830185613b4b565b61278a6040830184613377565b60006020828403121561468757614687600080fd5b815167ffffffffffffffff8111156146a1576146a1600080fd5b61278a84828501613c78565b60006146b7825190565b6146c5818560208601613c18565b9290920192915050565b600061254d82846146ad565b600b81526000602082017f73776170206661696c6564000000000000000000000000000000000000000000815291506138db565b60208082528101612458816146db565b601081526000602082017f616c6c207377617073206661696c656400000000000000000000000000000000815291506138db565b602080825281016124588161471f565b606081016147718286613377565b61477e6020830185613377565b61278a6040830184613b4b565b600981526000602082017f73776170206661696c0000000000000000000000000000000000000000000000815291506138db565b602080825281016124588161478b565b60a081016147dd8288613b4b565b6147ea6020830187613b4b565b6147f76040830186613377565b6148046060830185613b4b565b6148116080830184613377565b9695505050505050565b67ffffffffffffffff8116613363565b60e08101614839828a613b4b565b6148466020830189613b4b565b614853604083018861481b565b6148606060830187613b4b565b61486d6080830186613377565b61487a60a0830185613377565b61488760c0830184613377565b98975050505050505050565b604081016148a18285613377565b61254d6020830184613b4b565b600c81526000602082017f636463206e6f20666f756e640000000000000000000000000000000000000000815291506138db565b60208082528101612458816148ae565b600081600019048311821515161561490c5761490c613e76565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261493657614936614911565b500490565b60006020828403121561495057614950600080fd5b600061278a8484613d87565b602a81526000602082017f5361666545524332303a204552433230206f7065726174696f6e20646964206e81527f6f7420737563636565640000000000000000000000000000000000000000000060208201529150614385565b602080825281016124588161495c565b60006124588260601b90565b6000612458826149c6565b6133636149e98261320a565b6149d2565b60006124588260c01b90565b61336367ffffffffffffffff82166149ee565b6000614a1982876149dd565b601482019150614a2982866149dd565b601482019150614a3982856149fa565b600882019150614a4982846149fa565b50600801949350505050565b7f6578656375746f722066656500000000000000000000000000000000000000008152600c016000614a8782896149fa565b600882019150614a9782886149fa565b600882019150614aa78287613b4b565b602082019150614ab782866149dd565b601482019150614ac78285613b4b565b602082019150614ad78284613b4b565b506020019695505050505050565b601181526000602082017f646561646c696e65206578636565646564000000000000000000000000000000815291506138db565b6020808252810161245881614ae5565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c016000614b5b8284613b4b565b50602001919050565b600e81526000602082017f696e76616c6964207369676e6572000000000000000000000000000000000000815291506138db565b6020808252810161245881614b64565b600061254d8383614522565b6000614bbe825190565b80845260208401935083602082028501614bd88560200190565b8060005b85811015614c0d5784840389528151614bf58582614ba8565b94506020830160209a909a0199925050600101614bdc565b5091979650505050505050565b805160009060c0840190614c2e8582613b4b565b5060208301518482036020860152614c468282614bb4565b9150506040830151614c5b6040860182613377565b506060830151614c6e6060860182613639565b506080830151614c816080860182613b4b565b5060a08301516127ae60a0860182613639565b6020808252810161254d8184614c1a565b600061245861386f67ffffffffffffffff841681565b61336381614ca5565b60a08101614cd28288613377565b614cdf6020830187614cbb565b614cec6040830186613377565b614cf96060830185613b4b565b8181036080830152613bb581846144f0565b602681526000602082017f416464726573733a20696e73756666696369656e742062616c616e636520666f81527f722063616c6c000000000000000000000000000000000000000000000000000060208201529150614385565b6020808252810161245881614d0b565b601d81526000602082017f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000815291506138db565b6020808252810161245881614d75565b63ffffffff8116613363565b60c08101614dd38289613377565b614de06020830188613377565b614ded6040830187613b4b565b614dfa606083018661481b565b614e07608083018561481b565b613bb560a0830184614db9565b60a08101614e228288613377565b614e2f6020830187613b4b565b614e3c604083018661481b565b614e496060830185613377565b614811608083018461481b565b60808101614e648287613377565b614e716020830186613b4b565b614e7e6040830185613377565b610b6b606083018461481b565b601981526000602082017f6272696467652074797065206e6f7420737570706f7274656400000000000000815291506138db565b6020808252810161245881614e8b565b6020808252810161254d81846144f0565b601881526000602082017f45434453413a20696e76616c6964207369676e61747572650000000000000000815291506138db565b6020808252810161245881614ee0565b601f81526000602082017f45434453413a20696e76616c6964207369676e6174757265206c656e67746800815291506138db565b6020808252810161245881614f24565b602281526000602082017f45434453413a20696e76616c6964207369676e6174757265202773272076616c815261756560f01b60208201529150614385565b6020808252810161245881614f68565b602281526000602082017f45434453413a20696e76616c6964207369676e6174757265202776272076616c815261756560f01b60208201529150614385565b6020808252810161245881614fb7565b6000615012828a6149dd565b60148201915061502282896149dd565b60148201915061503282886149dd565b6014820191506150428287613b4b565b60208201915061505282866149fa565b60088201915061506282856149fa565b60088201915061507282846149fa565b50600801979650505050505050565b600061508d828a6149dd565b60148201915061509d82896149dd565b6014820191506150ad8288613b4b565b6020820191506150bd82876149fa565b6008820191506150cd82866149dd565b60148201915061506282856149fa565b603681526000602082017f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f81527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060208201529150614385565b60208082528101612458816150dd565b600061515382896149dd565b60148201915061516382886149dd565b6014820191506151738287613b4b565b60208201915061518382866149dd565b60148201915061519382856149fa565b6008820191506151a382846149fa565b506008019695505050505050565b60ff8116613363565b608081016151c88287613b4b565b6151d560208301866151b1565b6151e26040830185613b4b565b610b6b6060830184613b4b56fea2646970667358221220c6cf4e5a29a314e599176babe9d70fd857592f11a371523adad76943148aa0db64736f6c634300080c00330000000000000000000000003ad9d0648cdaa2426331e894e980d0a5ed16257f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000026e6eaf3d3c5d4b8290aa7dd896140f383dff043000000000000000000000000f0761bb438cefca39a8fd1f27d75ccc7f6df92d800000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000043737761704578616374546f6b656e73466f72546f6b656e732875696e743235362c75696e743235362c616464726573735b5d2c616464726573732c75696e74323536290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002765786368616e676528696e743132382c696e743132382c75696e743235362c75696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a65786368616e67655f756e6465726c79696e6728696e743132382c696e743132382c75696e743235362c75696e743235362c616464726573732900000000000000000000000000000000000000000000000000000000000000000000000000336578616374496e707574282862797465732c616464726573732c75696e743235362c75696e743235362c75696e74323536292900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000042e6af231ba8ee39f1bf185d452061283bfb324b0000000000000000000000002687ba35446b7c00cf47839167bb57b2a4635cac0000000000000000000000002e492fde043d7e47c99a54765903b9d55705f85c00000000000000000000000049994fbb41c6b7c2f3066ca7301f25305de1234a00000000000000000000000000000000000000000000000000000000000000040000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b479975060000000000000000000000007f90122bf0700f9e7e1f688fe926940e8839f353000000000000000000000000f07d553b195080f84f582e88ecdd54baa122b279000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000043737761704578616374546f6b656e73466f72546f6b656e732875696e743235362c75696e743235362c616464726573735b5d2c616464726573732c75696e74323536290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002765786368616e676528696e743132382c696e743132382c75696e743235362c75696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a65786368616e67655f756e6465726c79696e6728696e743132382c696e743132382c75696e743235362c75696e743235362c616464726573732900000000000000000000000000000000000000000000000000000000000000000000000000336578616374496e707574282862797465732c616464726573732c75696e743235362c75696e743235362c75696e74323536292900000000000000000000000000

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

0000000000000000000000003ad9d0648cdaa2426331e894e980d0a5ed16257f00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000026e6eaf3d3c5d4b8290aa7dd896140f383dff043000000000000000000000000f0761bb438cefca39a8fd1f27d75ccc7f6df92d800000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000360000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000043737761704578616374546f6b656e73466f72546f6b656e732875696e743235362c75696e743235362c616464726573735b5d2c616464726573732c75696e74323536290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002765786368616e676528696e743132382c696e743132382c75696e743235362c75696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a65786368616e67655f756e6465726c79696e6728696e743132382c696e743132382c75696e743235362c75696e743235362c616464726573732900000000000000000000000000000000000000000000000000000000000000000000000000336578616374496e707574282862797465732c616464726573732c75696e743235362c75696e743235362c75696e74323536292900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000042e6af231ba8ee39f1bf185d452061283bfb324b0000000000000000000000002687ba35446b7c00cf47839167bb57b2a4635cac0000000000000000000000002e492fde043d7e47c99a54765903b9d55705f85c00000000000000000000000049994fbb41c6b7c2f3066ca7301f25305de1234a00000000000000000000000000000000000000000000000000000000000000040000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b479975060000000000000000000000007f90122bf0700f9e7e1f688fe926940e8839f353000000000000000000000000f07d553b195080f84f582e88ecdd54baa122b279000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000043737761704578616374546f6b656e73466f72546f6b656e732875696e743235362c75696e743235362c616464726573735b5d2c616464726573732c75696e74323536290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002765786368616e676528696e743132382c696e743132382c75696e743235362c75696e743235362900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a65786368616e67655f756e6465726c79696e6728696e743132382c696e743132382c75696e743235362c75696e743235362c616464726573732900000000000000000000000000000000000000000000000000000000000000000000000000336578616374496e707574282862797465732c616464726573732c75696e743235362c75696e743235362c75696e74323536292900000000000000000000000000

-----Decoded View---------------
Arg [0] : _messageBus (address): 0x3ad9d0648cdaa2426331e894e980d0a5ed16257f
Arg [1] : _nativeWrap (address): 0x82af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [2] : _signer (address): 0x26e6eaf3d3c5d4b8290aa7dd896140f383dff043
Arg [3] : _feeCollector (address): 0xf0761bb438cefca39a8fd1f27d75ccc7f6df92d8
Arg [4] : _funcSigs (string[]): swapExactTokensForTokens(uint256,uint256,address[],address,uint256),exchange(int128,int128,uint256,uint256),exchange_underlying(int128,int128,uint256,uint256,address),exactInput((bytes,address,uint256,uint256,uint256))
Arg [5] : _codecs (address[]): 0x42e6af231ba8ee39f1bf185d452061283bfb324b,0x2687ba35446b7c00cf47839167bb57b2a4635cac,0x2e492fde043d7e47c99a54765903b9d55705f85c,0x49994fbb41c6b7c2f3066ca7301f25305de1234a
Arg [6] : _supportedDexList (address[]): 0x1b02da8cb0d097eb8d57a175b88c7d8b47997506,0x7f90122bf0700f9e7e1f688fe926940e8839f353,0xf07d553b195080f84f582e88ecdd54baa122b279,0xe592427a0aece92de3edee1f18e0157c05861564
Arg [7] : _supportedDexFuncs (string[]): swapExactTokensForTokens(uint256,uint256,address[],address,uint256),exchange(int128,int128,uint256,uint256),exchange_underlying(int128,int128,uint256,uint256,address),exactInput((bytes,address,uint256,uint256,uint256))
Arg [8] : _testMode (bool): False

-----Encoded View---------------
55 Constructor Arguments found :
Arg [0] : 0000000000000000000000003ad9d0648cdaa2426331e894e980d0a5ed16257f
Arg [1] : 00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1
Arg [2] : 00000000000000000000000026e6eaf3d3c5d4b8290aa7dd896140f383dff043
Arg [3] : 000000000000000000000000f0761bb438cefca39a8fd1f27d75ccc7f6df92d8
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000360
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000400
Arg [7] : 00000000000000000000000000000000000000000000000000000000000004a0
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [13] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [15] : 737761704578616374546f6b656e73466f72546f6b656e732875696e74323536
Arg [16] : 2c75696e743235362c616464726573735b5d2c616464726573732c75696e7432
Arg [17] : 3536290000000000000000000000000000000000000000000000000000000000
Arg [18] : 0000000000000000000000000000000000000000000000000000000000000027
Arg [19] : 65786368616e676528696e743132382c696e743132382c75696e743235362c75
Arg [20] : 696e743235362900000000000000000000000000000000000000000000000000
Arg [21] : 000000000000000000000000000000000000000000000000000000000000003a
Arg [22] : 65786368616e67655f756e6465726c79696e6728696e743132382c696e743132
Arg [23] : 382c75696e743235362c75696e743235362c6164647265737329000000000000
Arg [24] : 0000000000000000000000000000000000000000000000000000000000000033
Arg [25] : 6578616374496e707574282862797465732c616464726573732c75696e743235
Arg [26] : 362c75696e743235362c75696e74323536292900000000000000000000000000
Arg [27] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [28] : 00000000000000000000000042e6af231ba8ee39f1bf185d452061283bfb324b
Arg [29] : 0000000000000000000000002687ba35446b7c00cf47839167bb57b2a4635cac
Arg [30] : 0000000000000000000000002e492fde043d7e47c99a54765903b9d55705f85c
Arg [31] : 00000000000000000000000049994fbb41c6b7c2f3066ca7301f25305de1234a
Arg [32] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [33] : 0000000000000000000000001b02da8cb0d097eb8d57a175b88c7d8b47997506
Arg [34] : 0000000000000000000000007f90122bf0700f9e7e1f688fe926940e8839f353
Arg [35] : 000000000000000000000000f07d553b195080f84f582e88ecdd54baa122b279
Arg [36] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Arg [37] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [38] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [39] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [40] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [41] : 00000000000000000000000000000000000000000000000000000000000001c0
Arg [42] : 0000000000000000000000000000000000000000000000000000000000000043
Arg [43] : 737761704578616374546f6b656e73466f72546f6b656e732875696e74323536
Arg [44] : 2c75696e743235362c616464726573735b5d2c616464726573732c75696e7432
Arg [45] : 3536290000000000000000000000000000000000000000000000000000000000
Arg [46] : 0000000000000000000000000000000000000000000000000000000000000027
Arg [47] : 65786368616e676528696e743132382c696e743132382c75696e743235362c75
Arg [48] : 696e743235362900000000000000000000000000000000000000000000000000
Arg [49] : 000000000000000000000000000000000000000000000000000000000000003a
Arg [50] : 65786368616e67655f756e6465726c79696e6728696e743132382c696e743132
Arg [51] : 382c75696e743235362c75696e743235362c6164647265737329000000000000
Arg [52] : 0000000000000000000000000000000000000000000000000000000000000033
Arg [53] : 6578616374496e707574282862797465732c616464726573732c75696e743235
Arg [54] : 362c75696e743235362c75696e74323536292900000000000000000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.