Contract 0x617dee16b86534a5d792a4d7a62fb491b544111e 10

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc757c525cbf8250c4d575c79fa897a4a1d776dd4a8a4f1fd2591dec029ec6688Swap336660872022-09-28 9:31:4413 secs ago0x2d7429e411ca430a6a85daace6d79ab8faf28fd4 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.42452237671584 MATIC0.00668761236
0x52b448c6ab2e92b87e61ddd92d76bd281e5922459f2b351ab12db1ef773a341cSwap336660852022-09-28 9:31:4017 secs ago0x16db65ff1a03f64c359efa65f50c2931cc2f22a5 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.0069876835
0xf559d036c5d5c364668866a93ed37f255a45413c4c5992e397e963a987e3d8b4Swap336660852022-09-28 9:31:4017 secs ago0x8c4ba39d75f4cae577219c717cd81653646cd43a IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.007359696 36
0xe1e8e9ff140a4586e33c3efbf7de5e9cf8ef046b22f6af2e6b45363481b3efcbSwap Executor1In...336660842022-09-28 9:31:3819 secs ago0x9bafc0336cdfa583f53cff3852a0e517569f9b86 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.004316790002 30.000000017
0x61d91e1b2a78227f75190fa671ff9cb522186251a12df57559bda1666864df6dSwap Simple Mode336660842022-09-28 9:31:3819 secs ago0xad16fd7db52ae1535f0437e33d2bb1747eee03d4 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.005083080002 30.000000017
0x100c72921d783f0ecddea65e0391984cecf85e7185c082783ed6ae4810a58c28Swap Executor1In...336660842022-09-28 9:31:3819 secs ago0x401ba5513e8d9ed48228cacd2f708fdfffd424c8 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.005186130002 30.000000017
0x7a62c707e1341d84279b4cd8195074c9fe48887d919461fcdc0c01d323fae482Swap336660832022-09-28 9:31:3621 secs ago0xe42a9e01f5ba1f6b3139fda4147ea3f8f9410837 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.00698635
0x139d27de2faa37eb7bd279ff61d340fd49b1b55fce421862ed487e9d8a3971c3Swap336660822022-09-28 9:31:3423 secs ago0x02c85ae79649ab941197ecb2b9bcc9c3cfd87ffe IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.55984480743282 MATIC0.00650142535
0x544d4b1c9bd237834ef1d149dff8cb6c9e11024f87a6d7c49ffa15d0ad83f937Swap336660822022-09-28 9:31:3423 secs ago0xaf895487ae10f4e8dd141e2a2996f9be419352d6 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.0069868435
0x1c350e77628143db28247567a8f32610bd43bb76a06e9a6ad66bffa431dc07cbSwap336660812022-09-28 9:31:3225 secs ago0x8e00cfdc46384d1877023f984c515386953875a9 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.007286436
0x32515134a45b6c105408b3d9cfa7172537c561b7c8243b793e5c27298143fd75Swap336660792022-09-28 9:31:2829 secs ago0xb7fda9fab3215b27978fbc701844df331216fd8a IN  0x617dee16b86534a5d792a4d7a62fb491b544111e140 MATIC0.006070590003 30.000000015
0x295926f5d4df76bdcbcb9341b598e4611c62a2d363d6a34f403c5a1695e58ef3Swap336660782022-09-28 9:31:2631 secs ago0xe9b0710c5f86ad46c0d94a75d57189701f34abf1 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.007973004 39
0xd17e0c4987fc3809aecffff83d77b018bd33b385cf2cbf1df35b0c757f592439Swap336660762022-09-28 9:31:2235 secs ago0x14755cfaddb66ea0c1c3fc5020ee16801df8df74 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.00758616838
0xb3645f9ac4ce029e763bc5d779dd98d496b4a4b1455184b86f7e576be6da373eSwap336660762022-09-28 9:31:2235 secs ago0x9d9afbfb917048f0b06bdc64b89a510adbb2cb64 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.73341895405709 MATIC0.00724538139
0xdfe05fb867d4b3860b25db24bd576b1b9019fac14a3449b514b0d916ca32ca69Swap336660732022-09-28 9:31:1641 secs ago0x9f7ef0e4d9651a74e71a6e0fecd3ac270847161c IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.7995342698699 MATIC0.00724584939
0x83cca1df8a111283bbc5d0699ef06f4a981005371ba758eda11e6c1591aec210Swap336660732022-09-28 9:31:1641 secs ago0xa266a937f4572f4b5d00674f73b246b1254ac603 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.97856785818716 MATIC0.00724491339
0x54b831fde1709f6705fe6afaa78a1eda2a259d4add02bc99a9860816f5f10ed0Swap336660712022-09-28 9:31:1245 secs ago0xee641b1a3a7126936b4825faa3ff63e7ad73325e IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.00798440
0x26c9fb0767bea15f4bcd99e5d0a9588fd67dabd11bf0c4e30baff1de34dfba7cSwap336660712022-09-28 9:31:1245 secs ago0x7d51700e5d1f3f6ee507891a7208186ad2a19fd6 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.43818370716107 MATIC0.007430240
0x66b356220cb078e554450e7842fb97072a99e7ceadc01d5e757c3c9a66253f52Swap336660682022-09-28 9:31:0651 secs ago0xaa6ae3606347107b60ce8fb66988ee257a272521 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.37394584035457 MATIC0.00706051438
0x4d6b085b8fe61076848cf79cb958404e9d17a497ecee0f488a2cbd2be75990a9Swap336660682022-09-28 9:31:0651 secs ago0x266d67e9e3c593f6f16fd23837bd187c61853257 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.00758571238
0x78bd9766197fe6d71f807fa39ca2262065fca709bac43a1dfb66c61530689085Swap336660662022-09-28 9:31:0255 secs ago0x3fc2902d9dd16141f7a13fc0e93353d2b332642b IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.007584838
0xe10f4b29d19305628d9d43dbdb8d934f3151e4e012896913dea7b42816541b6cSwap336660652022-09-28 9:31:0057 secs ago0xade8de8767072983f41418ceb4b1d69ae30a7f86 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.00758662438
0xb63b633b148b9ef048a0b999a8c43dbe53c6e137f85e239e71b9bf76daf9f4d8Swap336660622022-09-28 9:30:541 min ago0x19d52ad9742c77001af51db815c215f7dd244424 IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.00758571238
0x39bf13c467733d9804b5930fdab0aff25bc073d70a083e6dedc7851ab3a8ce88Swap336660612022-09-28 9:30:521 min ago0x5e9313cc8c5c2d8c2ccdcfbb38c6fd92bdedcb7f IN  0x617dee16b86534a5d792a4d7a62fb491b544111e0 MATIC0.0063364 31
0x720da18877c8847fb94d966c332a428f6fd9bd178e7c3ddad139485b1924ff2bSwap336660612022-09-28 9:30:521 min ago0xf9c9d501903b9d2c3650a9b9bc5c96cbc89a3cac IN  0x617dee16b86534a5d792a4d7a62fb491b544111e75.18482709852304 MATIC0.00687293537
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x23e36e94628218b5607c7bf58253a5ba6b20d25a90163fc2193dbfd29314eadd336660272022-09-28 9:29:402 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add74.999999999999 MATIC
0x4e5a3725d9b2ed0c1d571958318a34de43282ce5509ebf88311732e44d2fd2f0336660262022-09-28 9:29:382 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.25619152263923 MATIC
0xca87d60b049145c7c0cfe40301080043c1433a5dc6139efe4ad5dc5144725540336660252022-09-28 9:29:362 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.13857789223009 MATIC
0xbd9fbb6f3f8835a4f7a42a74e2b0d147279113251949b9a93c1d3f2f56cd0611336660202022-09-28 9:29:262 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.5903435450333 MATIC
0x6ad8ac9d63401b84c5ddbe1e627ea41b1cb02f8594ff21cc8faf04c238462b92336660202022-09-28 9:29:262 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.53185439994134 MATIC
0x11f45b9d0838d87ba9d87801ab29f463eb0d865437ec2c9889f8b3de16e0bc00336660172022-09-28 9:29:202 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.09636400115508 MATIC
0xc3b3b5e55c73b3d2c8bf9d49f5225912900f4ae00b8a59e4af5bd6bfc40c8846336660162022-09-28 9:29:182 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.08843524357945 MATIC
0xc1de141513ee5ca3aa587bb5021320b30b9a9019b2de0b9a583849dd3e6ccd1f336660152022-09-28 9:29:162 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add74.999999999999 MATIC
0xa5c3279314ec4915d733f7d165b6ecf2fc477c717cfb450a51e0119cc0530abb336660142022-09-28 9:29:142 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.03847344682417 MATIC
0xe8ec457f5a59f391b9ecb74afa122e544bed03697da257224c24c17b673f8b61336660142022-09-28 9:29:142 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.13086577502261 MATIC
0x659cdf7ede20632479f043992750b513dc8ae750215bc4b69c593e9b7e1ec52f336660112022-09-28 9:29:082 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.92056094417883 MATIC
0x7825660a9793124f29ea446f26c4e4400d32c57faaeeac6e67d2e6e345fe7404336660112022-09-28 9:29:082 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.96531713083283 MATIC
0xd72da4e11d1d379b99f70e1e9f8df65d4992fa53069fbaa750122ff0e6eb3113336660082022-09-28 9:29:022 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add74.999999999999 MATIC
0xb2ec35e740d3c822784ff7cf53ab0555078d8d60332ad651b5f5d768e25d6cc7336660052022-09-28 9:28:563 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.52798922096054 MATIC
0xa3d4f36574353c7b34bb0acd6aa0151617fb6854fc7775eb73f284aefe3fcc19336660052022-09-28 9:28:563 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.59762797551132 MATIC
0xd97709bf4dfd1872bb5a10c727bb4032cf790bac6a0cc3d980ef091b684fdeca336660022022-09-28 9:28:503 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.44498570139208 MATIC
0xab53ae96ed54b4e22b81fa81f37dc5f4d8eefc3ba39628f6a1bc01cccac654d5336660012022-09-28 9:28:483 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.1549557593243 MATIC
0xc4cd7aff3ef91f48785cd93252b86ed8b68d8e2d01c41616b5624ba82c0e7600336659992022-09-28 9:28:443 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.57306315545416 MATIC
0x8b0dc74e0eb409bf1170ee09f288e3ae586bbe5450eee34522fe29a404dd7ec8336659992022-09-28 9:28:443 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.86241300630292 MATIC
0x28ad1956a19b42c7aad1d4a32c1c034dae1331bfa3c65fe67ff8b2b94cc6098f336659962022-09-28 9:28:383 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.33340072356303 MATIC
0xb10877944a41fb1585aa9df434deac7b31ed528e0759a0e48bb2e9acefd9e13c336659962022-09-28 9:28:383 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.96517169708721 MATIC
0xe65c0751e172baaa26752772684cdd4bf8d42492e430725903191310eafa1e45336659922022-09-28 9:28:303 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add74.999999999999 MATIC
0xcbb86c9a35ed32f4db98c085ec8e30731698f7ad491b08d53314ee5464875a25336659902022-09-28 9:28:263 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.01065426259142 MATIC
0x647418de6d37039dc7a48b4c81f4fb16f2bf07cdf8782995879f9bb5026e549f336659902022-09-28 9:28:263 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.11694651855895 MATIC
0xfa0a5bc30228876fc50a964f11a638dc1be4f3f27447700ab29b2ac903546aef336659872022-09-28 9:28:203 mins ago 0x617dee16b86534a5d792a4d7a62fb491b544111e 0xaf0936b1dc49b5c7444ca838a5f32080fc043add75.7421451101895 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MetaAggregationRouter

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 13 : MetaAggregationRouter.sol
// SPDX-License-Identifier: MIT

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

pragma solidity 0.8.9;

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

import './dependency/Permitable.sol';
import './interfaces/IAggregationExecutor.sol';
import './interfaces/IAggregationExecutor1Inch.sol';
import './libraries/TransferHelper.sol';
import './libraries/RevertReasonParser.sol';

contract MetaAggregationRouter is Permitable, Ownable {
  using SafeERC20 for IERC20;

  address public immutable WETH;
  address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);

  uint256 private constant _PARTIAL_FILL = 0x01;
  uint256 private constant _REQUIRES_EXTRA_ETH = 0x02;
  uint256 private constant _SHOULD_CLAIM = 0x04;
  uint256 private constant _BURN_FROM_MSG_SENDER = 0x08;
  uint256 private constant _BURN_FROM_TX_ORIGIN = 0x10;
  uint256 private constant _SIMPLE_SWAP = 0x20;

  mapping(address => bool) public isWhitelist;

  struct SwapDescription {
    IERC20 srcToken;
    IERC20 dstToken;
    address[] srcReceivers;
    uint256[] srcAmounts;
    address dstReceiver;
    uint256 amount;
    uint256 minReturnAmount;
    uint256 flags;
    bytes permit;
  }

  struct SimpleSwapData {
    address[] firstPools;
    uint256[] firstSwapAmounts;
    bytes[] swapDatas;
    uint256 deadline;
    bytes destTokenFeeData;
  }

  event Swapped(
    address sender,
    IERC20 srcToken,
    IERC20 dstToken,
    address dstReceiver,
    uint256 spentAmount,
    uint256 returnAmount
  );

  event ClientData(bytes clientData);

  event Exchange(address pair, uint256 amountOut, address output);

  constructor(address _WETH) {
    WETH = _WETH;
  }

  receive() external payable {
    assert(msg.sender == WETH);
    // only accept ETH via fallback from the WETH contract
  }

  function rescueFunds(address token, uint256 amount) external onlyOwner {
    if (_isETH(IERC20(token))) {
      TransferHelper.safeTransferETH(msg.sender, amount);
    } else {
      TransferHelper.safeTransfer(token, msg.sender, amount);
    }
  }

  function updateWhitelist(address addr, bool value) external onlyOwner {
    isWhitelist[addr] = value;
  }

  function swapRouter1Inch(
    address router1Inch,
    bytes calldata router1InchData,
    SwapDescription calldata desc,
    bytes calldata clientData
  ) external payable returns (uint256 returnAmount, uint256 gasUsed) {
    uint256 gasBefore = gasleft();
    require(isWhitelist[router1Inch], 'not whitelist router');
    require(desc.minReturnAmount > 0, 'Min return should not be 0');
    require(
      desc.srcReceivers.length == desc.srcAmounts.length && desc.srcAmounts.length <= 1,
      'Invalid lengths for receiving src tokens'
    );

    uint256 val = msg.value;
    if (!_isETH(desc.srcToken)) {
      // transfer token to kyber router
      _permit(desc.srcToken, desc.amount, desc.permit);
      TransferHelper.safeTransferFrom(address(desc.srcToken), msg.sender, address(this), desc.amount);

      // approve token to 1inch router
      uint256 amount = _getBalance(desc.srcToken, address(this));
      desc.srcToken.safeIncreaseAllowance(router1Inch, amount);

      // transfer fee to feeTaker
      for (uint256 i = 0; i < desc.srcReceivers.length; i++) {
        TransferHelper.safeTransferFrom(address(desc.srcToken), msg.sender, desc.srcReceivers[i], desc.srcAmounts[i]);
      }
    } else {
      for (uint256 i = 0; i < desc.srcReceivers.length; i++) {
        val -= desc.srcAmounts[i];
        TransferHelper.safeTransferETH(desc.srcReceivers[i], desc.srcAmounts[i]);
      }
    }

    address dstReceiver = (desc.dstReceiver == address(0)) ? msg.sender : desc.dstReceiver;
    uint256 initialSrcBalance = (desc.flags & _PARTIAL_FILL != 0) ? _getBalance(desc.srcToken, msg.sender) : 0;
    uint256 initialDstBalance = _getBalance(desc.dstToken, dstReceiver);
    {
      // call to 1inch router contract
      (bool success, ) = router1Inch.call{value: val}(router1InchData);
      require(success, 'call to 1inch router fail');
    }

    // 1inch router return to msg.sender (mean fund will return to this address)
    uint256 stuckAmount = _getBalance(desc.dstToken, address(this));
    _doTransferERC20(desc.dstToken, dstReceiver, stuckAmount);

    // safe check here
    returnAmount = _getBalance(desc.dstToken, dstReceiver) - initialDstBalance;
    uint256 spentAmount = desc.amount;
    if (desc.flags & _PARTIAL_FILL != 0) {
      spentAmount = initialSrcBalance + desc.amount - _getBalance(desc.srcToken, msg.sender);
      require(returnAmount * desc.amount >= desc.minReturnAmount * spentAmount, 'Return amount is not enough');
    } else {
      require(returnAmount >= desc.minReturnAmount, 'Return amount is not enough');
    }

    emit Swapped(msg.sender, desc.srcToken, desc.dstToken, dstReceiver, spentAmount, returnAmount);
    emit Exchange(router1Inch, returnAmount, _isETH(desc.dstToken) ? WETH : address(desc.dstToken));
    emit ClientData(clientData);
    unchecked {
      gasUsed = gasBefore - gasleft();
    }
  }

  function swapExecutor1Inch(
    IAggregationExecutor1Inch caller,
    SwapDescriptionExecutor1Inch calldata desc,
    bytes calldata executor1InchData,
    bytes calldata clientData
  ) external payable returns (uint256 returnAmount, uint256 gasUsed) {
    uint256 gasBefore = gasleft();
    require(desc.minReturnAmount > 0, 'Min return should not be 0');
    require(executor1InchData.length > 0, 'data should not be empty');
    require(desc.srcReceivers.length == desc.srcAmounts.length, 'invalid src receivers length');

    bool srcETH = _isETH(desc.srcToken);
    if (desc.flags & _REQUIRES_EXTRA_ETH != 0) {
      require(msg.value > (srcETH ? desc.amount : 0), 'Invalid msg.value');
    } else {
      require(msg.value == (srcETH ? desc.amount : 0), 'Invalid msg.value');
    }
    uint256 val = msg.value;
    if (!srcETH) {
      _permit(desc.srcToken, desc.amount, desc.permit);

      // transfer to fee taker
      uint256 srcReceiversLength = desc.srcReceivers.length;
      for (uint256 i = 0; i < srcReceiversLength; ) {
        TransferHelper.safeTransferFrom(address(desc.srcToken), msg.sender, desc.srcReceivers[i], desc.srcAmounts[i]);
        unchecked {
          ++i;
        }
      }

      // transfer to 1inch srcReceiver
      TransferHelper.safeTransferFrom(address(desc.srcToken), msg.sender, desc.srcReceiver1Inch, desc.amount);
    } else {
      // transfer to 1inch srcReceiver
      uint256 srcReceiversLength = desc.srcReceivers.length;
      for (uint256 i = 0; i < srcReceiversLength; ) {
        val -= desc.srcAmounts[i];
        TransferHelper.safeTransferETH(desc.srcReceivers[i], desc.srcAmounts[i]);
        unchecked {
          ++i;
        }
      }
    }

    {
      bytes memory callData = abi.encodePacked(caller.callBytes.selector, bytes12(0), msg.sender, executor1InchData);
      // solhint-disable-next-line avoid-low-level-calls
      (bool success, bytes memory result) = address(caller).call{value: val}(callData);
      if (!success) {
        revert(RevertReasonParser.parse(result, 'callBytes failed: '));
      }
    }

    uint256 spentAmount = desc.amount;
    returnAmount = _getBalance(desc.dstToken, address(this));

    if (desc.flags & _PARTIAL_FILL != 0) {
      uint256 unspentAmount = _getBalance(desc.srcToken, address(this));
      if (unspentAmount > 0) {
        spentAmount = spentAmount - unspentAmount;
        _doTransferERC20(desc.srcToken, msg.sender, unspentAmount);
      }

      require(returnAmount * desc.amount >= desc.minReturnAmount * spentAmount, 'Return amount is not enough');
    } else {
      require(returnAmount >= desc.minReturnAmount, 'Return amount is not enough');
    }

    address dstReceiver = (desc.dstReceiver == address(0)) ? msg.sender : desc.dstReceiver;
    _doTransferERC20(desc.dstToken, dstReceiver, returnAmount);

    emit Swapped(msg.sender, desc.srcToken, desc.dstToken, dstReceiver, spentAmount, returnAmount);
    emit Exchange(address(caller), returnAmount, _isETH(desc.dstToken) ? WETH : address(desc.dstToken));
    emit ClientData(clientData);
    unchecked {
      gasUsed = gasBefore - gasleft();
    }
  }

  function swap(
    IAggregationExecutor caller,
    SwapDescription calldata desc,
    bytes calldata executorData,
    bytes calldata clientData
  ) external payable returns (uint256 returnAmount, uint256 gasUsed) {
    uint256 gasBefore = gasleft();
    require(desc.minReturnAmount > 0, 'Min return should not be 0');
    require(executorData.length > 0, 'executorData should be not zero');

    uint256 flags = desc.flags;

    // simple mode swap
    if (flags & _SIMPLE_SWAP != 0) return swapSimpleMode(caller, desc, executorData, clientData);

    {
      IERC20 srcToken = desc.srcToken;
      if (flags & _REQUIRES_EXTRA_ETH != 0) {
        require(msg.value > (_isETH(srcToken) ? desc.amount : 0), 'Invalid msg.value');
      } else {
        require(msg.value == (_isETH(srcToken) ? desc.amount : 0), 'Invalid msg.value');
      }

      require(desc.srcReceivers.length == desc.srcAmounts.length, 'Invalid lengths for receiving src tokens');

      if (flags & _SHOULD_CLAIM != 0) {
        require(!_isETH(srcToken), 'Claim token is ETH');
        _permit(srcToken, desc.amount, desc.permit);
        for (uint256 i = 0; i < desc.srcReceivers.length; i++) {
          TransferHelper.safeTransferFrom(address(srcToken), msg.sender, desc.srcReceivers[i], desc.srcAmounts[i]);
        }
      }

      if (_isETH(srcToken)) {
        // normally in case taking fee in srcToken and srcToken is the native token
        for (uint256 i = 0; i < desc.srcReceivers.length; i++) {
          TransferHelper.safeTransferETH(desc.srcReceivers[i], desc.srcAmounts[i]);
        }
      }
    }

    {
      address dstReceiver = (desc.dstReceiver == address(0)) ? msg.sender : desc.dstReceiver;
      uint256 initialSrcBalance = (flags & _PARTIAL_FILL != 0) ? _getBalance(desc.srcToken, msg.sender) : 0;
      IERC20 dstToken = desc.dstToken;
      uint256 initialDstBalance = _getBalance(dstToken, dstReceiver);

      _callWithEth(caller, executorData);

      uint256 spentAmount = desc.amount;
      returnAmount = _getBalance(dstToken, dstReceiver) - initialDstBalance;

      if (flags & _PARTIAL_FILL != 0) {
        spentAmount = initialSrcBalance + desc.amount - _getBalance(desc.srcToken, msg.sender);
        require(returnAmount * desc.amount >= desc.minReturnAmount * spentAmount, 'Return amount is not enough');
      } else {
        require(returnAmount >= desc.minReturnAmount, 'Return amount is not enough');
      }

      emit Swapped(msg.sender, desc.srcToken, dstToken, dstReceiver, spentAmount, returnAmount);
      emit Exchange(address(caller), returnAmount, _isETH(dstToken) ? WETH : address(dstToken));
      emit ClientData(clientData);
    }

    unchecked {
      gasUsed = gasBefore - gasleft();
    }
  }

  function swapSimpleMode(
    IAggregationExecutor caller,
    SwapDescription calldata desc,
    bytes calldata executorData,
    bytes calldata clientData
  ) public returns (uint256 returnAmount, uint256 gasUsed) {
    uint256 gasBefore = gasleft();

    require(!_isETH(desc.srcToken), 'src is eth, should use normal swap');
    _permit(desc.srcToken, desc.amount, desc.permit);

    uint256 totalSwapAmount = desc.amount;
    if (desc.srcReceivers.length > 0) {
      // take fee in tokenIn
      require(
        desc.srcReceivers.length == 1 && desc.srcReceivers.length == desc.srcAmounts.length,
        'Wrong number of src receivers'
      );
      TransferHelper.safeTransferFrom(address(desc.srcToken), msg.sender, desc.srcReceivers[0], desc.srcAmounts[0]);
      require(desc.srcAmounts[0] <= totalSwapAmount, 'invalid fee amount in src token');
      totalSwapAmount -= desc.srcAmounts[0];
    }
    address dstReceiver = (desc.dstReceiver == address(0)) ? msg.sender : desc.dstReceiver;
    uint256 initialDstBalance = _getBalance(desc.dstToken, dstReceiver);

    _swapMultiSequencesWithSimpleMode(
      caller,
      address(desc.srcToken),
      totalSwapAmount,
      address(desc.dstToken),
      dstReceiver,
      executorData
    );

    returnAmount = _getBalance(desc.dstToken, dstReceiver) - initialDstBalance;

    require(returnAmount >= desc.minReturnAmount, 'Return amount is not enough');
    emit Swapped(msg.sender, desc.srcToken, desc.dstToken, dstReceiver, desc.amount, returnAmount);
    emit Exchange(address(caller), returnAmount, _isETH(desc.dstToken) ? WETH : address(desc.dstToken));
    emit ClientData(clientData);

    unchecked {
      gasUsed = gasBefore - gasleft();
    }
  }

  function _doTransferERC20(
    IERC20 token,
    address to,
    uint256 amount
  ) internal {
    if (amount > 0) {
      if (_isETH(token)) {
        TransferHelper.safeTransferETH(to, amount);
      } else {
        TransferHelper.safeTransfer(address(token), to, amount);
      }
    }
  }

  // Only use this mode if the first pool of each sequence can receive tokenIn directly into the pool
  function _swapMultiSequencesWithSimpleMode(
    IAggregationExecutor caller,
    address tokenIn,
    uint256 totalSwapAmount,
    address tokenOut,
    address dstReceiver,
    bytes calldata data
  ) internal {
    SimpleSwapData memory swapData = abi.decode(data, (SimpleSwapData));
    require(swapData.deadline >= block.timestamp, 'ROUTER: Expired');
    require(
      swapData.firstPools.length == swapData.firstSwapAmounts.length &&
        swapData.firstPools.length == swapData.swapDatas.length,
      'invalid swap data length'
    );
    uint256 numberSeq = swapData.firstPools.length;
    for (uint256 i = 0; i < numberSeq; i++) {
      // collect amount to the first pool
      TransferHelper.safeTransferFrom(tokenIn, msg.sender, swapData.firstPools[i], swapData.firstSwapAmounts[i]);
      require(swapData.firstSwapAmounts[i] <= totalSwapAmount, 'invalid swap amount');
      totalSwapAmount -= swapData.firstSwapAmounts[i];
      {
        // solhint-disable-next-line avoid-low-level-calls
        // may take some native tokens for commission fee
        (bool success, bytes memory result) = address(caller).call(
          abi.encodeWithSelector(caller.swapSingleSequence.selector, swapData.swapDatas[i])
        );
        if (!success) {
          revert(RevertReasonParser.parse(result, 'swapSingleSequence failed: '));
        }
      }
    }
    {
      // solhint-disable-next-line avoid-low-level-calls
      // may take some native tokens for commission fee
      (bool success, bytes memory result) = address(caller).call(
        abi.encodeWithSelector(
          caller.finalTransactionProcessing.selector,
          tokenIn,
          tokenOut,
          dstReceiver,
          swapData.destTokenFeeData
        )
      );
      if (!success) {
        revert(RevertReasonParser.parse(result, 'finalTransactionProcessing failed: '));
      }
    }
  }

  function _getBalance(IERC20 token, address account) internal view returns (uint256) {
    if (_isETH(token)) {
      return account.balance;
    } else {
      return token.balanceOf(account);
    }
  }

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

  function _callWithEth(IAggregationExecutor caller, bytes calldata executorData) internal {
    // solhint-disable-next-line avoid-low-level-calls
    // may take some native tokens for commission fee
    uint256 ethAmount = _getBalance(IERC20(ETH_ADDRESS), address(this));
    if (ethAmount > msg.value) ethAmount = msg.value;
    (bool success, bytes memory result) = address(caller).call{value: ethAmount}(
      abi.encodeWithSelector(caller.callBytes.selector, executorData)
    );
    if (!success) {
      revert(RevertReasonParser.parse(result, 'callBytes failed: '));
    }
  }
}

File 2 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 3 of 13 : 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 4 of 13 : 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 5 of 13 : 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 6 of 13 : Permitable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol';

import '../libraries/RevertReasonParser.sol';

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

contract Permitable {
  event Error(string reason);

  function _permit(
    IERC20 token,
    uint256 amount,
    bytes calldata permit
  ) internal {
    if (permit.length == 32 * 7) {
      // solhint-disable-next-line avoid-low-level-calls
      (bool success, bytes memory result) = address(token).call(
        abi.encodePacked(IERC20Permit.permit.selector, permit)
      );
      if (!success) {
        string memory reason = RevertReasonParser.parse(result, 'Permit call failed: ');
        if (token.allowance(msg.sender, address(this)) < amount) {
          revert(reason);
        } else {
          emit Error(reason);
        }
      }
    }
  }
}

File 7 of 13 : IAggregationExecutor.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.12;

interface IAggregationExecutor {
  function callBytes(bytes calldata data) external payable; // 0xd9c45357

  // callbytes per swap sequence
  function swapSingleSequence(bytes calldata data) external;

  function finalTransactionProcessing(
    address tokenIn,
    address tokenOut,
    address to,
    bytes calldata destTokenFeeData
  ) external;
}

File 8 of 13 : IAggregationExecutor1Inch.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import '@openzeppelin/contracts/interfaces/IERC20.sol';

interface IAggregationExecutor1Inch {
  function callBytes(address msgSender, bytes calldata data) external payable; // 0x2636f7f8
}

interface IAggregationRouter1InchV4 {
  function swap(
    IAggregationExecutor1Inch caller,
    SwapDescription1Inch calldata desc,
    bytes calldata data
  ) external payable returns (uint256 returnAmount, uint256 gasLeft);
}

struct SwapDescription1Inch {
  IERC20 srcToken;
  IERC20 dstToken;
  address payable srcReceiver;
  address payable dstReceiver;
  uint256 amount;
  uint256 minReturnAmount;
  uint256 flags;
  bytes permit;
}

struct SwapDescriptionExecutor1Inch {
  IERC20 srcToken;
  IERC20 dstToken;
  address payable srcReceiver1Inch;
  address payable dstReceiver;
  address[] srcReceivers;
  uint256[] srcAmounts;
  uint256 amount;
  uint256 minReturnAmount;
  uint256 flags;
  bytes permit;
}

File 9 of 13 : TransferHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.5.16;

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

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

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

  function safeTransferETH(address to, uint256 value) internal {
    if (value == 0) return;
    (bool success, ) = to.call{value: value}(new bytes(0));
    require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
  }
}

File 10 of 13 : RevertReasonParser.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity >=0.7.6;

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

library RevertReasonParser {
  function parse(bytes memory data, string memory prefix) internal pure returns (string memory) {
    // https://solidity.readthedocs.io/en/latest/control-structures.html#revert
    // We assume that revert reason is abi-encoded as Error(string)

    // 68 = 4-byte selector 0x08c379a0 + 32 bytes offset + 32 bytes length
    if (data.length >= 68 && data[0] == '\x08' && data[1] == '\xc3' && data[2] == '\x79' && data[3] == '\xa0') {
      string memory reason;
      // solhint-disable no-inline-assembly
      assembly {
        // 68 = 32 bytes data length + 4-byte selector + 32 bytes offset
        reason := add(data, 68)
      }
      /*
                revert reason is padded up to 32 bytes with ABI encoder: Error(string)
                also sometimes there is extra 32 bytes of zeros padded in the end:
                https://github.com/ethereum/solidity/issues/10170
                because of that we can't check for equality and instead check
                that string length + extra 68 bytes is less than overall data length
            */
      require(data.length >= 68 + bytes(reason).length, 'Invalid revert reason');
      return string(abi.encodePacked(prefix, 'Error(', reason, ')'));
    }
    // 36 = 4-byte selector 0x4e487b71 + 32 bytes integer
    else if (data.length == 36 && data[0] == '\x4e' && data[1] == '\x48' && data[2] == '\x7b' && data[3] == '\x71') {
      uint256 code;
      // solhint-disable no-inline-assembly
      assembly {
        // 36 = 32 bytes data length + 4-byte selector
        code := mload(add(data, 36))
      }
      return string(abi.encodePacked(prefix, 'Panic(', _toHex(code), ')'));
    }

    return string(abi.encodePacked(prefix, 'Unknown(', _toHex(data), ')'));
  }

  function _toHex(uint256 value) private pure returns (string memory) {
    return _toHex(abi.encodePacked(value));
  }

  function _toHex(bytes memory data) private pure returns (string memory) {
    bytes16 alphabet = 0x30313233343536373839616263646566;
    bytes memory str = new bytes(2 + data.length * 2);
    str[0] = '0';
    str[1] = 'x';
    for (uint256 i = 0; i < data.length; i++) {
      str[2 * i + 2] = alphabet[uint8(data[i] >> 4)];
      str[2 * i + 3] = alphabet[uint8(data[i] & 0x0f)];
    }
    return string(str);
  }
}

File 11 of 13 : 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 12 of 13 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 13 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"clientData","type":"bytes"}],"name":"ClientData","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"Error","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pair","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOut","type":"uint256"},{"indexed":false,"internalType":"address","name":"output","type":"address"}],"name":"Exchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"srcToken","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"dstToken","type":"address"},{"indexed":false,"internalType":"address","name":"dstReceiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"spentAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"returnAmount","type":"uint256"}],"name":"Swapped","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IAggregationExecutor","name":"caller","type":"address"},{"components":[{"internalType":"contract IERC20","name":"srcToken","type":"address"},{"internalType":"contract IERC20","name":"dstToken","type":"address"},{"internalType":"address[]","name":"srcReceivers","type":"address[]"},{"internalType":"uint256[]","name":"srcAmounts","type":"uint256[]"},{"internalType":"address","name":"dstReceiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"}],"internalType":"struct MetaAggregationRouter.SwapDescription","name":"desc","type":"tuple"},{"internalType":"bytes","name":"executorData","type":"bytes"},{"internalType":"bytes","name":"clientData","type":"bytes"}],"name":"swap","outputs":[{"internalType":"uint256","name":"returnAmount","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IAggregationExecutor1Inch","name":"caller","type":"address"},{"components":[{"internalType":"contract IERC20","name":"srcToken","type":"address"},{"internalType":"contract IERC20","name":"dstToken","type":"address"},{"internalType":"address payable","name":"srcReceiver1Inch","type":"address"},{"internalType":"address payable","name":"dstReceiver","type":"address"},{"internalType":"address[]","name":"srcReceivers","type":"address[]"},{"internalType":"uint256[]","name":"srcAmounts","type":"uint256[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"}],"internalType":"struct SwapDescriptionExecutor1Inch","name":"desc","type":"tuple"},{"internalType":"bytes","name":"executor1InchData","type":"bytes"},{"internalType":"bytes","name":"clientData","type":"bytes"}],"name":"swapExecutor1Inch","outputs":[{"internalType":"uint256","name":"returnAmount","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"router1Inch","type":"address"},{"internalType":"bytes","name":"router1InchData","type":"bytes"},{"components":[{"internalType":"contract IERC20","name":"srcToken","type":"address"},{"internalType":"contract IERC20","name":"dstToken","type":"address"},{"internalType":"address[]","name":"srcReceivers","type":"address[]"},{"internalType":"uint256[]","name":"srcAmounts","type":"uint256[]"},{"internalType":"address","name":"dstReceiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"}],"internalType":"struct MetaAggregationRouter.SwapDescription","name":"desc","type":"tuple"},{"internalType":"bytes","name":"clientData","type":"bytes"}],"name":"swapRouter1Inch","outputs":[{"internalType":"uint256","name":"returnAmount","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"contract IAggregationExecutor","name":"caller","type":"address"},{"components":[{"internalType":"contract IERC20","name":"srcToken","type":"address"},{"internalType":"contract IERC20","name":"dstToken","type":"address"},{"internalType":"address[]","name":"srcReceivers","type":"address[]"},{"internalType":"uint256[]","name":"srcAmounts","type":"uint256[]"},{"internalType":"address","name":"dstReceiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturnAmount","type":"uint256"},{"internalType":"uint256","name":"flags","type":"uint256"},{"internalType":"bytes","name":"permit","type":"bytes"}],"internalType":"struct MetaAggregationRouter.SwapDescription","name":"desc","type":"tuple"},{"internalType":"bytes","name":"executorData","type":"bytes"},{"internalType":"bytes","name":"clientData","type":"bytes"}],"name":"swapSimpleMode","outputs":[{"internalType":"uint256","name":"returnAmount","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"updateWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b50604051620043a5380380620043a58339810160408190526200003491620000a1565b6200003f3362000051565b6001600160a01b0316608052620000d3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000b457600080fd5b81516001600160a01b0381168114620000cc57600080fd5b9392505050565b608051614294620001116000396000818160d00152818161021001528181610a770152818161128f015281816117550152611e6d01526142946000f3fe6080604052600436106100c05760003560e01c8063a72bd2f511610074578063ad5c46481161004e578063ad5c4648146101fe578063c683630d14610232578063f2fde38b1461027257600080fd5b8063a72bd2f5146101b8578063a7f5c104146101cb578063abcffc26146101eb57600080fd5b8063715018a6116100a5578063715018a61461015157806378e3214f146101665780638da5cb5b1461018657600080fd5b80630d392cd9146101045780631fb3e2351461012457600080fd5b366100ff57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100fd576100fd6136f4565b005b600080fd5b34801561011057600080fd5b506100fd61011f366004613746565b610292565b6101376101323660046137c8565b61033a565b604080519283526020830191909152015b60405180910390f35b34801561015d57600080fd5b506100fd610b0f565b34801561017257600080fd5b506100fd610181366004613878565b610b75565b34801561019257600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610148565b6101376101c63660046138bd565b610c0d565b3480156101d757600080fd5b506101376101e6366004613945565b611329565b6101376101f9366004613945565b6117ec565b34801561020a57600080fd5b506101a07f000000000000000000000000000000000000000000000000000000000000000081565b34801561023e57600080fd5b5061026261024d3660046139a8565b60016020526000908152604090205460ff1681565b6040519015158152602001610148565b34801561027e57600080fd5b506100fd61028d3660046139a8565b611f08565b6000546001600160a01b031633146102f15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0391909116600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60008060005a905060008860e00135116103965760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016102e8565b856103e35760405162461bcd60e51b815260206004820152601860248201527f646174612073686f756c64206e6f7420626520656d707479000000000000000060448201526064016102e8565b6103f060a08901896139c5565b90506103ff60808a018a6139c5565b90501461044e5760405162461bcd60e51b815260206004820152601c60248201527f696e76616c69642073726320726563656976657273206c656e6774680000000060448201526064016102e8565b600061048261046060208b018b6139a8565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b9050610100890135600216156104f7578061049e5760006104a4565b8860c001355b34116104f25760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b610557565b80610503576000610509565b8860c001355b34146105575760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b34816106525761058561056d60208c018c6139a8565b60c08c01356105806101208e018e613a2d565b611fea565b600061059460808c018c6139c5565b9050905060005b8181101561061d576106156105b360208e018e6139a8565b338e80608001906105c491906139c5565b858181106105d4576105d4613a92565b90506020020160208101906105e991906139a8565b8f8060a001906105f991906139c5565b8681811061060957610609613a92565b905060200201356121c0565b60010161059b565b5061064c61062e60208d018d6139a8565b338d604001602081019061064291906139a8565b8e60c001356121c0565b5061070a565b600061066160808c018c6139c5565b9050905060005b818110156107075761067d60a08d018d6139c5565b8281811061068d5761068d613a92565b905060200201358361069f9190613af0565b92506106ff6106b160808e018e6139c5565b838181106106c1576106c1613a92565b90506020020160208101906106d691906139a8565b6106e360a08f018f6139c5565b848181106106f3576106f3613a92565b90506020020135612339565b600101610668565b50505b604051600090610746907f2636f7f80000000000000000000000000000000000000000000000000000000090839033908e908e90602001613b07565b60405160208183030381529060405290506000808d6001600160a01b031684846040516107739190613bc4565b60006040518083038185875af1925050503d80600081146107b0576040519150601f19603f3d011682016040523d82523d6000602084013e6107b5565b606091505b509150915081610817576107fe816040518060400160405280601281526020017f63616c6c4279746573206661696c65643a20000000000000000000000000000081525061242a565b60405162461bcd60e51b81526004016102e89190613c0c565b50505060c08a013561083861083260408d0160208e016139a8565b30612849565b95506101008b0135600116156108f557600061085a61083260208e018e6139a8565b905080156108855761086c8183613af0565b915061088561087e60208e018e6139a8565b338361291a565b6108938260e08e0135613c1f565b6108a160c08e013589613c1f565b10156108ef5760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b50610949565b8a60e001358610156109495760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b60008061095c60808e0160608f016139a8565b6001600160a01b03161461097f5761097a60808d0160608e016139a8565b610981565b335b905061099d61099660408e0160208f016139a8565b828961291a565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8336109cc60208f018f6139a8565b8e60200160208101906109df91906139a8565b604080516001600160a01b03948516815292841660208401529083169082015290831660608201526080810184905260a0810189905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488d88610a598f602001602081019061046091906139a8565b610a75578e6020016020810190610a7091906139a8565b610a97565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff97798989604051610af2929190613c5c565b60405180910390a15a850395505050505050965096945050505050565b6000546001600160a01b03163314610b695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102e8565b610b73600061295a565b565b6000546001600160a01b03163314610bcf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102e8565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0383161415610c0257610bfe3382612339565b5050565b610bfe8233836129c2565b60008060005a6001600160a01b038a1660009081526001602052604090205490915060ff16610c7e5760405162461bcd60e51b815260206004820152601460248201527f6e6f742077686974656c69737420726f7574657200000000000000000000000060448201526064016102e8565b60008660c0013511610cd25760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016102e8565b610cdf60608701876139c5565b9050610cee60408801886139c5565b9050148015610d0c57506001610d0760608801886139c5565b905011155b610d7e5760405162461bcd60e51b815260206004820152602860248201527f496e76616c6964206c656e6774687320666f7220726563656976696e6720737260448201527f6320746f6b656e7300000000000000000000000000000000000000000000000060648201526084016102e8565b34610d8f61046060208901896139a8565b610e8a57610db6610da360208901896139a8565b60a08901356105806101008b018b613a2d565b610dd2610dc660208901896139a8565b33308a60a001356121c0565b6000610de461083260208a018a6139a8565b9050610e088b82610df860208c018c6139a8565b6001600160a01b03169190612b15565b60005b610e1860408a018a6139c5565b9050811015610e8357610e71610e3160208b018b6139a8565b33610e3f60408d018d6139c5565b85818110610e4f57610e4f613a92565b9050602002016020810190610e6491906139a8565b6105f960608e018e6139c5565b80610e7b81613c8b565b915050610e0b565b5050610f2a565b60005b610e9a60408901896139c5565b9050811015610f2857610eb060608901896139c5565b82818110610ec057610ec0613a92565b9050602002013582610ed29190613af0565b9150610f16610ee460408a018a6139c5565b83818110610ef457610ef4613a92565b9050602002016020810190610f0991906139a8565b6106e360608b018b6139c5565b80610f2081613c8b565b915050610e8d565b505b600080610f3d60a08a0160808b016139a8565b6001600160a01b031614610f6057610f5b60a0890160808a016139a8565b610f62565b335b9050600060e0890135600116610f79576000610f8f565b610f8f610f8960208b018b6139a8565b33612849565b90506000610fac610fa660408c0160208d016139a8565b84612849565b905060008d6001600160a01b0316858e8e604051610fcb929190613cc4565b60006040518083038185875af1925050503d8060008114611008576040519150601f19603f3d011682016040523d82523d6000602084013e61100d565b606091505b505090508061105e5760405162461bcd60e51b815260206004820152601960248201527f63616c6c20746f2031696e636820726f75746572206661696c0000000000000060448201526064016102e8565b50600061107461083260408d0160208e016139a8565b905061109061108960408d0160208e016139a8565b858361291a565b816110aa6110a460408e0160208f016139a8565b86612849565b6110b49190613af0565b975060a08b013560e08c013560011615611161576110d8610f8960208e018e6139a8565b6110e660a08e013586613cd4565b6110f09190613af0565b90506111008160c08e0135613c1f565b61110e60a08e01358b613c1f565b101561115c5760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b6111b5565b8b60c001358910156111b55760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8336111e460208f018f6139a8565b8e60200160208101906111f791906139a8565b604080516001600160a01b03948516815292841660208401529083169082015290871660608201526080810183905260a081018b905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488f8a6112718f602001602081019061046091906139a8565b61128d578e602001602081019061128891906139a8565b6112af565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff97798b8b60405161130a929190613c5c565b60405180910390a15a8703975050505050505050965096945050505050565b60008060005a905061134161046060208a018a6139a8565b156113b45760405162461bcd60e51b815260206004820152602260248201527f737263206973206574682c2073686f756c6420757365206e6f726d616c20737760448201527f617000000000000000000000000000000000000000000000000000000000000060648201526084016102e8565b6113d76113c460208a018a6139a8565b60a08a01356105806101008c018c613a2d565b60a088013560006113eb60408b018b6139c5565b905011156115815761140060408a018a6139c5565b9050600114801561142c575061141960608a018a6139c5565b905061142860408b018b6139c5565b9050145b6114785760405162461bcd60e51b815260206004820152601d60248201527f57726f6e67206e756d626572206f66207372632072656365697665727300000060448201526064016102e8565b6114da61148860208b018b6139a8565b3361149660408d018d6139c5565b60008181106114a7576114a7613a92565b90506020020160208101906114bc91906139a8565b6114c960608e018e6139c5565b600081811061060957610609613a92565b806114e860608b018b6139c5565b60008181106114f9576114f9613a92565b90506020020135111561154e5760405162461bcd60e51b815260206004820152601f60248201527f696e76616c69642066656520616d6f756e7420696e2073726320746f6b656e0060448201526064016102e8565b61155b60608a018a6139c5565b600081811061156c5761156c613a92565b905060200201358161157e9190613af0565b90505b60008061159460a08c0160808d016139a8565b6001600160a01b0316146115b7576115b260a08b0160808c016139a8565b6115b9565b335b905060006115d66115d060408d0160208e016139a8565b83612849565b90506116058c6115e960208e018e6139a8565b858e60200160208101906115fd91906139a8565b868f8f612c3f565b80611619610fa660408e0160208f016139a8565b6116239190613af0565b95508a60c001358610156116795760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8336116a860208e018e6139a8565b8d60200160208101906116bb91906139a8565b604080516001600160a01b039485168152928416602084015290831690820152908416606082015260a0808e01356080830152810188905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488c876117378e602001602081019061046091906139a8565b611753578d602001602081019061174e91906139a8565b611775565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff977988886040516117d0929190613c5c565b60405180910390a15a8403945050505050965096945050505050565b60008060005a905060008860c00135116118485760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016102e8565b856118955760405162461bcd60e51b815260206004820152601f60248201527f6578656375746f72446174612073686f756c64206265206e6f74207a65726f0060448201526064016102e8565b60e088013560208116156118bc576118b18a8a8a8a8a8a611329565b935093505050611efd565b60006118cb60208b018b6139a8565b9050600282161561195a5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03821614611901576000611907565b8960a001355b34116119555760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b6119d9565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0382161461198557600061198b565b8960a001355b34146119d95760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b6119e660608b018b6139c5565b90506119f560408c018c6139c5565b905014611a6a5760405162461bcd60e51b815260206004820152602860248201527f496e76616c6964206c656e6774687320666f7220726563656976696e6720737260448201527f6320746f6b656e7300000000000000000000000000000000000000000000000060648201526084016102e8565b6004821615611b6b5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0382161415611ae05760405162461bcd60e51b815260206004820152601260248201527f436c61696d20746f6b656e20697320455448000000000000000000000000000060448201526064016102e8565b611af78160a08c01356105806101008e018e613a2d565b60005b611b0760408c018c6139c5565b9050811015611b6957611b578233611b2260408f018f6139c5565b85818110611b3257611b32613a92565b9050602002016020810190611b4791906139a8565b8e80606001906105f991906139c5565b80611b6181613c8b565b915050611afa565b505b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0382161415611bff5760005b611ba060408c018c6139c5565b9050811015611bfd57611beb611bb960408d018d6139c5565b83818110611bc957611bc9613a92565b9050602002016020810190611bde91906139a8565b6106e360608e018e6139c5565b80611bf581613c8b565b915050611b93565b505b50600080611c1360a08c0160808d016139a8565b6001600160a01b031614611c3657611c3160a08b0160808c016139a8565b611c38565b335b9050600060018316611c4b576000611c5b565b611c5b610f8960208d018d6139a8565b90506000611c6f60408d0160208e016139a8565b90506000611c7d8285612849565b9050611c8a8e8d8d61305c565b60a08d013581611c9a8487612849565b611ca49190613af0565b98506001861615611d5457611cc58e6000016020810190610f8991906139a8565b8e60a0013585611cd59190613cd4565b611cdf9190613af0565b9050808e60c00135611cf19190613c1f565b8e60a001358a611d019190613c1f565b1015611d4f5760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b611da8565b8d60c00135891015611da85760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8338f6000016020810190611ddd91906139a8565b604080516001600160a01b03938416815291831660208301528287169082015290871660608201526080810183905260a081018b905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488f8a73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03871614611e6b5785611e8d565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff97798b8b604051611ee8929190613c5c565b60405180910390a150505050505a8203925050505b965096945050505050565b6000546001600160a01b03163314611f625760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102e8565b6001600160a01b038116611fde5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102e8565b611fe78161295a565b50565b60e08114156121ba57600080856001600160a01b031663d505accf60e01b858560405160200161201c93929190613cec565b60408051601f198184030181529082905261203691613bc4565b6000604051808303816000865af19150503d8060008114612073576040519150601f19603f3d011682016040523d82523d6000602084013e612078565b606091505b5091509150816121b75760006120c3826040518060400160405280601481526020017f5065726d69742063616c6c206661696c65643a2000000000000000000000000081525061242a565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290915086906001600160a01b0389169063dd62ed3e9060440160206040518083038186803b15801561212657600080fd5b505afa15801561213a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215e9190613d28565b101561217e578060405162461bcd60e51b81526004016102e89190613c0c565b7f08c379a0afcc32b1a39302f7cb8073359698411ab5fd6e3edb2c02c0b5fba8aa816040516121ad9190613c0c565b60405180910390a1505b50505b50505050565b806121ca576121ba565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052915160009283929088169161225c9190613bc4565b6000604051808303816000865af19150503d8060008114612299576040519150601f19603f3d011682016040523d82523d6000602084013e61229e565b606091505b50915091508180156122c85750805115806122c85750808060200190518101906122c89190613d41565b6121b75760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160448201527f494c45440000000000000000000000000000000000000000000000000000000060648201526084016102e8565b80612342575050565b604080516000808252602082019092526001600160a01b03841690839060405161236c9190613bc4565b60006040518083038185875af1925050503d80600081146123a9576040519150601f19603f3d011682016040523d82523d6000602084013e6123ae565b606091505b50509050806124255760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201527f4c4544000000000000000000000000000000000000000000000000000000000060648201526084016102e8565b505050565b6060604483511015801561249757508260008151811061244c5761244c613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0800000000000000000000000000000000000000000000000000000000000000145b80156124fc5750826001815181106124b1576124b1613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167fc300000000000000000000000000000000000000000000000000000000000000145b801561256157508260028151811061251657612516613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7900000000000000000000000000000000000000000000000000000000000000145b80156125c657508260038151811061257b5761257b613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167fa000000000000000000000000000000000000000000000000000000000000000145b15612658576044838101805190916125de9190613cd4565b8451101561262e5760405162461bcd60e51b815260206004820152601560248201527f496e76616c69642072657665727420726561736f6e000000000000000000000060448201526064016102e8565b8281604051602001612641929190613d8d565b604051602081830303815290604052915050612843565b825160241480156126c257508260008151811061267757612677613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f4e00000000000000000000000000000000000000000000000000000000000000145b80156127275750826001815181106126dc576126dc613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f4800000000000000000000000000000000000000000000000000000000000000145b801561278c57508260028151811061274157612741613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7b00000000000000000000000000000000000000000000000000000000000000145b80156127f15750826003815181106127a6576127a6613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7100000000000000000000000000000000000000000000000000000000000000145b1561281657602483015182612805826131a8565b604051602001612641929190613e0f565b81612820846131d0565b604051602001612831929190613e5b565b60405160208183030381529060405290505b92915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b038416141561288157506001600160a01b03811631612843565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b1580156128db57600080fd5b505afa1580156128ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129139190613d28565b9050612843565b80156124255773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b038416141561294f576124258282612339565b6124258383836129c2565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b806129cc57505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691612a569190613bc4565b6000604051808303816000865af19150503d8060008114612a93576040519150601f19603f3d011682016040523d82523d6000602084013e612a98565b606091505b5091509150818015612ac2575080511580612ac2575080806020019051810190612ac29190613d41565b612b0e5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016102e8565b5050505050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b158015612b7a57600080fd5b505afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb29190613d28565b612bbc9190613cd4565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790529091506121ba908590613475565b6000612c4d8284018461411a565b90504281606001511015612ca35760405162461bcd60e51b815260206004820152600f60248201527f524f555445523a2045787069726564000000000000000000000000000000000060448201526064016102e8565b602081015151815151148015612cbf5750604081015151815151145b612d0b5760405162461bcd60e51b815260206004820152601860248201527f696e76616c696420737761702064617461206c656e677468000000000000000060448201526064016102e8565b80515160005b81811015612f4557612d5f893385600001518481518110612d3457612d34613a92565b602002602001015186602001518581518110612d5257612d52613a92565b60200260200101516121c0565b8783602001518281518110612d7657612d76613a92565b60200260200101511115612dcc5760405162461bcd60e51b815260206004820152601360248201527f696e76616c6964207377617020616d6f756e740000000000000000000000000060448201526064016102e8565b82602001518181518110612de257612de2613a92565b602002602001015188612df59190613af0565b97506000808b6001600160a01b0316638b674f5d60e01b86604001518581518110612e2257612e22613a92565b6020026020010151604051602401612e3a9190613c0c565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051612ea59190613bc4565b6000604051808303816000865af19150503d8060008114612ee2576040519150601f19603f3d011682016040523d82523d6000602084013e612ee7565b606091505b509150915081612f30576107fe816040518060400160405280601b81526020017f7377617053696e676c6553657175656e6365206661696c65643a20000000000081525061242a565b50508080612f3d90613c8b565b915050612d11565b506000808a6001600160a01b031663774b6b7e60e01b8b8a8a8860800151604051602401612f7694939291906141fd565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051612fe19190613bc4565b6000604051808303816000865af19150503d806000811461301e576040519150601f19603f3d011682016040523d82523d6000602084013e613023565b606091505b50915091508161304f576107fe8160405180606001604052806023815260200161423c6023913961242a565b5050505050505050505050565b600061307c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee30612849565b9050348111156130895750345b600080856001600160a01b03168363d9c4535760e01b87876040516024016130b2929190613c5c565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161311d9190613bc4565b60006040518083038185875af1925050503d806000811461315a576040519150601f19603f3d011682016040523d82523d6000602084013e61315f565b606091505b5091509150816121b7576107fe816040518060400160405280601281526020017f63616c6c4279746573206661696c65643a20000000000000000000000000000081525061242a565b6060612843826040516020016131c091815260200190565b6040516020818303038152906040525b80516060907f303132333435363738396162636465660000000000000000000000000000000090600090613205906002613c1f565b613210906002613cd4565b67ffffffffffffffff81111561322857613228613d5e565b6040519080825280601f01601f191660200182016040528015613252576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061328957613289613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106132ec576132ec613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b845181101561346d5782600486838151811061333c5761333c613a92565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c60f81c6010811061337857613378613a92565b1a60f81b82613388836002613c1f565b613393906002613cd4565b815181106133a3576133a3613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350828582815181106133e5576133e5613a92565b60209101015160f81c600f166010811061340157613401613a92565b1a60f81b82613411836002613c1f565b61341c906003613cd4565b8151811061342c5761342c613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061346581613c8b565b91505061331e565b509392505050565b60006134ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661355a9092919063ffffffff16565b80519091501561242557808060200190518101906134e89190613d41565b6124255760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102e8565b60606135698484600085613573565b90505b9392505050565b6060824710156135eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102e8565b6001600160a01b0385163b6136425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102e8565b600080866001600160a01b0316858760405161365e9190613bc4565b60006040518083038185875af1925050503d806000811461369b576040519150601f19603f3d011682016040523d82523d6000602084013e6136a0565b606091505b50915091506136b08282866136bb565b979650505050505050565b606083156136ca57508161356c565b8251156136da5782518084602001fd5b8160405162461bcd60e51b81526004016102e89190613c0c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6001600160a01b0381168114611fe757600080fd5b8015158114611fe757600080fd5b6000806040838503121561375957600080fd5b823561376481613723565b9150602083013561377481613738565b809150509250929050565b60008083601f84011261379157600080fd5b50813567ffffffffffffffff8111156137a957600080fd5b6020830191508360208285010111156137c157600080fd5b9250929050565b600080600080600080608087890312156137e157600080fd5b86356137ec81613723565b9550602087013567ffffffffffffffff8082111561380957600080fd5b90880190610140828b03121561381e57600080fd5b9095506040880135908082111561383457600080fd5b6138408a838b0161377f565b9096509450606089013591508082111561385957600080fd5b5061386689828a0161377f565b979a9699509497509295939492505050565b6000806040838503121561388b57600080fd5b823561389681613723565b946020939093013593505050565b600061012082840312156138b757600080fd5b50919050565b600080600080600080608087890312156138d657600080fd5b86356138e181613723565b9550602087013567ffffffffffffffff808211156138fe57600080fd5b61390a8a838b0161377f565b9097509550604089013591508082111561392357600080fd5b61392f8a838b016138a4565b9450606089013591508082111561385957600080fd5b6000806000806000806080878903121561395e57600080fd5b863561396981613723565b9550602087013567ffffffffffffffff8082111561398657600080fd5b6139928a838b016138a4565b9650604089013591508082111561383457600080fd5b6000602082840312156139ba57600080fd5b813561356c81613723565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126139fa57600080fd5b83018035915067ffffffffffffffff821115613a1557600080fd5b6020019150600581901b36038213156137c157600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613a6257600080fd5b83018035915067ffffffffffffffff821115613a7d57600080fd5b6020019150368190038213156137c157600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613b0257613b02613ac1565b500390565b7fffffffff00000000000000000000000000000000000000000000000000000000861681527fffffffffffffffffffffffff0000000000000000000000000000000000000000851660048201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008460601b1660108201528183602483013760009101602401908152949350505050565b60005b83811015613bb3578181015183820152602001613b9b565b838111156121ba5750506000910152565b60008251613bd6818460208701613b98565b9190910192915050565b60008151808452613bf8816020860160208601613b98565b601f01601f19169290920160200192915050565b60208152600061356c6020830184613be0565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c5757613c57613ac1565b500290565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613cbd57613cbd613ac1565b5060010190565b8183823760009101908152919050565b60008219821115613ce757613ce7613ac1565b500190565b7fffffffff0000000000000000000000000000000000000000000000000000000084168152818360048301376000910160040190815292915050565b600060208284031215613d3a57600080fd5b5051919050565b600060208284031215613d5357600080fd5b815161356c81613738565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008351613d9f818460208801613b98565b7f4572726f722800000000000000000000000000000000000000000000000000009083019081528351613dd9816006840160208801613b98565b7f290000000000000000000000000000000000000000000000000000000000000060069290910191820152600701949350505050565b60008351613e21818460208801613b98565b7f50616e69632800000000000000000000000000000000000000000000000000009083019081528351613dd9816006840160208801613b98565b60008351613e6d818460208801613b98565b7f556e6b6e6f776e280000000000000000000000000000000000000000000000009083019081528351613ea7816008840160208801613b98565b7f290000000000000000000000000000000000000000000000000000000000000060089290910191820152600901949350505050565b60405160a0810167ffffffffffffffff81118282101715613f0057613f00613d5e565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715613f2f57613f2f613d5e565b604052919050565b600067ffffffffffffffff821115613f5157613f51613d5e565b5060051b60200190565b600082601f830112613f6c57600080fd5b81356020613f81613f7c83613f37565b613f06565b82815260059290921b84018101918181019086841115613fa057600080fd5b8286015b84811015613fc4578035613fb781613723565b8352918301918301613fa4565b509695505050505050565b600082601f830112613fe057600080fd5b81356020613ff0613f7c83613f37565b82815260059290921b8401810191818101908684111561400f57600080fd5b8286015b84811015613fc45780358352918301918301614013565b600082601f83011261403b57600080fd5b813567ffffffffffffffff81111561405557614055613d5e565b6140686020601f19601f84011601613f06565b81815284602083860101111561407d57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f8301126140ab57600080fd5b813560206140bb613f7c83613f37565b82815260059290921b840181019181810190868411156140da57600080fd5b8286015b84811015613fc457803567ffffffffffffffff8111156140fe5760008081fd5b61410c8986838b010161402a565b8452509183019183016140de565b60006020828403121561412c57600080fd5b813567ffffffffffffffff8082111561414457600080fd5b9083019060a0828603121561415857600080fd5b614160613edd565b82358281111561416f57600080fd5b61417b87828601613f5b565b82525060208301358281111561419057600080fd5b61419c87828601613fcf565b6020830152506040830135828111156141b457600080fd5b6141c08782860161409a565b604083015250606083013560608201526080830135828111156141e257600080fd5b6141ee8782860161402a565b60808301525095945050505050565b60006001600160a01b0380871683528086166020840152808516604084015250608060608301526142316080830184613be0565b969550505050505056fe66696e616c5472616e73616374696f6e50726f63657373696e67206661696c65643a20a26469706673582212200010293abbe26aadbf9a5fafd46017bb18bdc760e3849d69d5c92097ecc9646064736f6c634300080900330000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270

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

0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270

-----Decoded View---------------
Arg [0] : _WETH (address): 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270


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