Contract 0x617dee16b86534a5d792a4d7a62fb491b544111e 9

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc585371b054db20be772a54bbde187fc23c2c95b6ded5092c5f63801dbdb2e53Swap Simple Mode534761052023-01-09 8:43:4328 days 16 hrs ago0x3b1897657d4a37ba2aabdf31e5cc7d0d70521152 IN  KyberSwap: Meta Aggregation Router0 FTM0.015148239289
0xe37669316a89783ce99083078209de3d810b3b8b3e54cb9916c7eb3177dee79fSwap Simple Mode534759322023-01-09 8:40:1228 days 16 hrs ago0x8b07159bb01792e9060f2456c561a48137bbd9c6 IN  KyberSwap: Meta Aggregation Router0 FTM0.009122516073
0x8b2b86fb4a5bd01d5095feaebc9a61ab48bae683ce36c563bb4bfd319237a4cdSwap534756622023-01-09 8:33:5128 days 16 hrs ago0x7dc13b14000f10b43c29163563a31863b67525fc IN  KyberSwap: Meta Aggregation Router0 FTM0.014846676
0x50d84f0c010fc614b6aeed69e4b65b980d001d3497b05ffa9c4d420a079f4f34Swap534755702023-01-09 8:31:2528 days 16 hrs ago0x8b07159bb01792e9060f2456c561a48137bbd9c6 IN  KyberSwap: Meta Aggregation Router1 FTM0.016132423056
0x71a2246859c30c9a240469c5fd882ba624fd2f549c6ecbc3dde6abef4ebfa2b7Swap534753512023-01-09 8:24:2728 days 17 hrs ago0x7dc13b14000f10b43c29163563a31863b67525fc IN  KyberSwap: Meta Aggregation Router107.5 FTM0.029599168971
0x4554480ef42c6374aa7592fb3cf419410dc4a370bb7f15c012c0ccd944779434Swap534746162023-01-09 7:57:4428 days 17 hrs ago0x7dc13b14000f10b43c29163563a31863b67525fc IN  KyberSwap: Meta Aggregation Router0.15 FTM0.023338348755
0x20632c804cd8bbf11bdccf053e36ddf5cfd6feb9cc3abc0f8a975d6d5f190852Swap534736512023-01-09 7:34:1828 days 17 hrs ago0x1e5ea395c638c31c945d9ef03715ed7c02c2c5cd IN  KyberSwap: Meta Aggregation Router0 FTM0.033466408715
0xf929d2b215a791b13041303365e7944f4b9cfc50e7c861159073e71de65793e2Swap534736122023-01-09 7:32:5728 days 17 hrs ago0xedbc0ec0a3f564dc45fa7b6c379b3fbfdc09727a IN  KyberSwap: Meta Aggregation Router0 FTM0.032851672497
0xda63b6fd287033f352e51010d8b4b61cfe9a03250541c721e8f16e183e612555Swap534735182023-01-09 7:29:5328 days 17 hrs ago0x2342ec603e756635fc7b517f669021a4cb903c4e IN  KyberSwap: Meta Aggregation Router0 FTM0.015627096835
0xad4574b8dba6e5ec21cb96eff80d3ee6e42d9c78d75fc4c6c0274e957cd46482Swap Simple Mode534728972023-01-09 7:07:4328 days 18 hrs ago0x2278a9463774fc0b538b7d52087a00405ca9e1ac IN  KyberSwap: Meta Aggregation Router0 FTM0.006753794016
0x0a8f93a6308cfcea5d1e8df91b40b538ed8785fc923247f6f5698008bec9b256Swap534717012023-01-09 6:26:2928 days 18 hrs ago0x9387f71f3928ebe9ce8b3d8cf37a8fb52739ae7d IN  KyberSwap: Meta Aggregation Router0 FTM0.0070978904
0xae74dc58d22ba44a03d8c3f52175d79859a802d183b9668d9f31430c8c619d65Swap534715702023-01-09 6:24:0428 days 19 hrs ago0x8c128f336b479b142429a5f351af225457a987fa IN  KyberSwap: Meta Aggregation Router7,609.999999999999 FTM0.026755644774
0x1da77dc06b27479e175d2f4e5365978c2d913e8ac9a5c817caf49871b0433e32Swap534714842023-01-09 6:22:2928 days 19 hrs ago0x8c128f336b479b142429a5f351af225457a987fa IN  KyberSwap: Meta Aggregation Router7,609.999999999999 FTM0.624865997746
0xd58e0b212e0464bb5f629e59433d121e27904b890fbfce9c9abac41a3f8685faSwap Simple Mode534693162023-01-09 5:28:3228 days 19 hrs ago0x72c315f494e9b1127d5a94dd818c39cfa4f6bdb2 IN  KyberSwap: Meta Aggregation Router0 FTM0.03692678
0xfc977619bd4027ce63a463189197cda989b4111d302ca70f799c92c0472967beSwap Simple Mode534692682023-01-09 5:27:3628 days 19 hrs ago0x72c315f494e9b1127d5a94dd818c39cfa4f6bdb2 IN  KyberSwap: Meta Aggregation Router0 FTM0.03030071
0x767c6c1afa952acfe7fe23ac1ece65579e61b7220d70aa89474d806550b7befdSwap534684792023-01-09 5:13:1728 days 20 hrs ago0xb8227da726026e512f46da481e2c96fff27f9aae IN  KyberSwap: Meta Aggregation Router0 FTM0.016818694869
0x6f3963324f12026a9d5b55c2dd6bf3ba02e3832b77fd1eab0d8bd154d48883c6Swap534671262023-01-09 4:41:4228 days 20 hrs ago0x3b1897657d4a37ba2aabdf31e5cc7d0d70521152 IN  KyberSwap: Meta Aggregation Router184 FTM0.006556611275
0x31d43ade2e72be24e9d68b52a675162d2063614f183ed36b0bd8a9b2f8dc0063Swap534670992023-01-09 4:41:0128 days 20 hrs ago0x3b1897657d4a37ba2aabdf31e5cc7d0d70521152 IN  KyberSwap: Meta Aggregation Router0 FTM0.006994671026
0x40e9236a64db4c1b117f97b6914128a5ea750234675595ec9750a6435e1f4982Swap534670492023-01-09 4:39:4228 days 20 hrs ago0x3b1897657d4a37ba2aabdf31e5cc7d0d70521152 IN  KyberSwap: Meta Aggregation Router180 FTM0.015285928924
0x7a1f5772f83d50c70669158ae6b12ed2a709f84bea063c917650c0af22d9b87fSwap534610402023-01-09 2:12:5028 days 23 hrs ago0xe124ac1d71ab774f31b884fefafd126a66e5b935 IN  KyberSwap: Meta Aggregation Router0 FTM0.009416554137
0x005867d7f3e6ee1cf9ca4cd091ff0be8bf56e7f66272726e256b684af9946845Swap Simple Mode534582432023-01-09 1:21:4629 days 3 mins ago0x89cd44bf370e6889f3e1400002455d5916fd459e IN  KyberSwap: Meta Aggregation Router0 FTM0.047855435
0x5c10eda3d1807719d96af6c531b81a77f189779cafa2d933e1ef3fc5deb2eab9Swap534581352023-01-09 1:20:0029 days 5 mins ago0x89cd44bf370e6889f3e1400002455d5916fd459e IN  KyberSwap: Meta Aggregation Router180 FTM0.11461134
0xfc31111ee69a6607538ccf0f430ee274385a23b5bf4e64a4b3ad3ad08f9b01a8Swap Simple Mode534578582023-01-09 1:15:1529 days 9 mins ago0xf58d5b955b57312847c95f51a2c31fd54a224230 IN  KyberSwap: Meta Aggregation Router0 FTM0.141714764373
0x7c3887aabab56aa3a529ffa281cecf34f114934df6bcfac3b815cc3a839022f5Swap Simple Mode534574392023-01-09 1:00:4329 days 24 mins ago0x2278a9463774fc0b538b7d52087a00405ca9e1ac IN  KyberSwap: Meta Aggregation Router0 FTM0.007852532237
0x048c4767408dad651b38963f0ecf527268766ccd7585bd104ce4ba8227677dd1Swap534552262023-01-09 0:11:3729 days 1 hr ago0xc9bf8d03ba93288bb9bd7476a06a8747ab772588 IN  KyberSwap: Meta Aggregation Router98.03257529884311 FTM0.00707467525
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x3ae9e01dc637983ff82df0bf555eca41d7279e9f7707335435a3349241e9ed49535282512023-01-10 8:16:1027 days 17 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x9d8512bcfe3e0b652f41e83b2cec68e5a04a1693271dda6ee65df1b2f9fe9b1a535282292023-01-10 8:15:1327 days 17 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x12e76bdb170d7a6d378694ae910fdfc43557a3b4d6e8fca5ff6ccb1b5d43897d535243232023-01-10 5:47:3227 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x9badd515370801e9d3fd95a83c107cebcaed15c4487947c11bcd557fbe390157535241132023-01-10 5:39:3727 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x2d163914f9db57c7e4a1c77e82f2144b2d7e2debb55b2598d38cdb75de7c8202535241022023-01-10 5:39:1227 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x3b7871ca3b3fb7cb35c0d1af5fb88394e2dedb346e4d80d615f64072880d115f535240882023-01-10 5:38:3627 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x888123267b29ff638641e750b0424e64f68e2c3b5d4ffea502261de4d1ed5e35535240072023-01-10 5:35:4027 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.9992 FTM
0x359397e79f173813f4f110d6f2556b23c98ed73f1e35a59bff801523f35d9143535239992023-01-10 5:35:1927 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0x46542a0dab0b35b53d36d079556fc22544c31177b42fcfd4c78492415e087fc7535239532023-01-10 5:33:2827 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.09992 FTM
0xdeafeb9f1c710aca003dde8c48e2b84322da657d85d750dd54af757453fb3549535239372023-01-10 5:32:5827 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router0.009992 FTM
0x9c32286707aaccc31ddead69f70df08343684057a25bf99881467049155da4dd535239152023-01-10 5:32:1727 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router21.4828 FTM
0x4ad51bf523d40a63666e60d5beac59ad6eea50917e934e0473282ad108c9eb5f535238772023-01-10 5:30:3627 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router22.79185192 FTM
0x44b3a1a7bc61c43d980a657ac98779bcafec2a4d960e2b17b31fa8853e709d93535238612023-01-10 5:30:0327 days 19 hrs ago 0x864f01c5e46b0712643b956bca607bf883e0dbc5 KyberSwap: Meta Aggregation Router21.9824 FTM
0x50d84f0c010fc614b6aeed69e4b65b980d001d3497b05ffa9c4d420a079f4f34534755702023-01-09 8:31:2528 days 16 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c90.9945 FTM
0x50d84f0c010fc614b6aeed69e4b65b980d001d3497b05ffa9c4d420a079f4f34534755702023-01-09 8:31:2528 days 16 hrs ago KyberSwap: Meta Aggregation Router0xd7187e32da02429076e5601a97e7c4549c0309d50.0055 FTM
0x71a2246859c30c9a240469c5fd882ba624fd2f549c6ecbc3dde6abef4ebfa2b7534753512023-01-09 8:24:2728 days 17 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c9107.5 FTM
0x4554480ef42c6374aa7592fb3cf419410dc4a370bb7f15c012c0ccd944779434534746162023-01-09 7:57:4428 days 17 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c90.15 FTM
0xae74dc58d22ba44a03d8c3f52175d79859a802d183b9668d9f31430c8c619d65534715702023-01-09 6:24:0428 days 19 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c97,609.999999999999 FTM
0x1da77dc06b27479e175d2f4e5365978c2d913e8ac9a5c817caf49871b0433e32534714842023-01-09 6:22:2928 days 19 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c97,609.999999999999 FTM
0x6f3963324f12026a9d5b55c2dd6bf3ba02e3832b77fd1eab0d8bd154d48883c6534671262023-01-09 4:41:4228 days 20 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c9184 FTM
0x40e9236a64db4c1b117f97b6914128a5ea750234675595ec9750a6435e1f4982534670492023-01-09 4:39:4228 days 20 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c9180 FTM
0x5c10eda3d1807719d96af6c531b81a77f189779cafa2d933e1ef3fc5deb2eab9534581352023-01-09 1:20:0029 days 5 mins ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c9180 FTM
0x048c4767408dad651b38963f0ecf527268766ccd7585bd104ce4ba8227677dd1534552262023-01-09 0:11:3729 days 1 hr ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c998.03257529884311 FTM
0x543bccdb8ca3fb2fd2457a42844a3b88bab89cbb1bedfac9c68d8df9e27b6237534458032023-01-08 20:17:4629 days 5 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c9400 FTM
0xb61288cc179cb3c565b51bdd2f708a7baea0969c91d703e50fb4775227886269534432042023-01-08 18:52:1929 days 6 hrs ago KyberSwap: Meta Aggregation Router 0x41684b361557e9282e0373ca51260d9331e518c986.11133259227562 FTM
[ 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"}]

60a06040523480156200001157600080fd5b50604051620043a5380380620043a58339810160408190526200003491620000a1565b6200003f3362000051565b6001600160a01b0316608052620000d3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000b457600080fd5b81516001600160a01b0381168114620000cc57600080fd5b9392505050565b608051614294620001116000396000818160d00152818161021001528181610a770152818161128f015281816117550152611e6d01526142946000f3fe6080604052600436106100c05760003560e01c8063a72bd2f511610074578063ad5c46481161004e578063ad5c4648146101fe578063c683630d14610232578063f2fde38b1461027257600080fd5b8063a72bd2f5146101b8578063a7f5c104146101cb578063abcffc26146101eb57600080fd5b8063715018a6116100a5578063715018a61461015157806378e3214f146101665780638da5cb5b1461018657600080fd5b80630d392cd9146101045780631fb3e2351461012457600080fd5b366100ff57336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100fd576100fd6136f4565b005b600080fd5b34801561011057600080fd5b506100fd61011f366004613746565b610292565b6101376101323660046137c8565b61033a565b604080519283526020830191909152015b60405180910390f35b34801561015d57600080fd5b506100fd610b0f565b34801561017257600080fd5b506100fd610181366004613878565b610b75565b34801561019257600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610148565b6101376101c63660046138bd565b610c0d565b3480156101d757600080fd5b506101376101e6366004613945565b611329565b6101376101f9366004613945565b6117ec565b34801561020a57600080fd5b506101a07f000000000000000000000000000000000000000000000000000000000000000081565b34801561023e57600080fd5b5061026261024d3660046139a8565b60016020526000908152604090205460ff1681565b6040519015158152602001610148565b34801561027e57600080fd5b506100fd61028d3660046139a8565b611f08565b6000546001600160a01b031633146102f15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0391909116600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60008060005a905060008860e00135116103965760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016102e8565b856103e35760405162461bcd60e51b815260206004820152601860248201527f646174612073686f756c64206e6f7420626520656d707479000000000000000060448201526064016102e8565b6103f060a08901896139c5565b90506103ff60808a018a6139c5565b90501461044e5760405162461bcd60e51b815260206004820152601c60248201527f696e76616c69642073726320726563656976657273206c656e6774680000000060448201526064016102e8565b600061048261046060208b018b6139a8565b6001600160a01b031673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1490565b9050610100890135600216156104f7578061049e5760006104a4565b8860c001355b34116104f25760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b610557565b80610503576000610509565b8860c001355b34146105575760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b34816106525761058561056d60208c018c6139a8565b60c08c01356105806101208e018e613a2d565b611fea565b600061059460808c018c6139c5565b9050905060005b8181101561061d576106156105b360208e018e6139a8565b338e80608001906105c491906139c5565b858181106105d4576105d4613a92565b90506020020160208101906105e991906139a8565b8f8060a001906105f991906139c5565b8681811061060957610609613a92565b905060200201356121c0565b60010161059b565b5061064c61062e60208d018d6139a8565b338d604001602081019061064291906139a8565b8e60c001356121c0565b5061070a565b600061066160808c018c6139c5565b9050905060005b818110156107075761067d60a08d018d6139c5565b8281811061068d5761068d613a92565b905060200201358361069f9190613af0565b92506106ff6106b160808e018e6139c5565b838181106106c1576106c1613a92565b90506020020160208101906106d691906139a8565b6106e360a08f018f6139c5565b848181106106f3576106f3613a92565b90506020020135612339565b600101610668565b50505b604051600090610746907f2636f7f80000000000000000000000000000000000000000000000000000000090839033908e908e90602001613b07565b60405160208183030381529060405290506000808d6001600160a01b031684846040516107739190613bc4565b60006040518083038185875af1925050503d80600081146107b0576040519150601f19603f3d011682016040523d82523d6000602084013e6107b5565b606091505b509150915081610817576107fe816040518060400160405280601281526020017f63616c6c4279746573206661696c65643a20000000000000000000000000000081525061242a565b60405162461bcd60e51b81526004016102e89190613c0c565b50505060c08a013561083861083260408d0160208e016139a8565b30612849565b95506101008b0135600116156108f557600061085a61083260208e018e6139a8565b905080156108855761086c8183613af0565b915061088561087e60208e018e6139a8565b338361291a565b6108938260e08e0135613c1f565b6108a160c08e013589613c1f565b10156108ef5760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b50610949565b8a60e001358610156109495760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b60008061095c60808e0160608f016139a8565b6001600160a01b03161461097f5761097a60808d0160608e016139a8565b610981565b335b905061099d61099660408e0160208f016139a8565b828961291a565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8336109cc60208f018f6139a8565b8e60200160208101906109df91906139a8565b604080516001600160a01b03948516815292841660208401529083169082015290831660608201526080810184905260a0810189905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488d88610a598f602001602081019061046091906139a8565b610a75578e6020016020810190610a7091906139a8565b610a97565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff97798989604051610af2929190613c5c565b60405180910390a15a850395505050505050965096945050505050565b6000546001600160a01b03163314610b695760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102e8565b610b73600061295a565b565b6000546001600160a01b03163314610bcf5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102e8565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0383161415610c0257610bfe3382612339565b5050565b610bfe8233836129c2565b60008060005a6001600160a01b038a1660009081526001602052604090205490915060ff16610c7e5760405162461bcd60e51b815260206004820152601460248201527f6e6f742077686974656c69737420726f7574657200000000000000000000000060448201526064016102e8565b60008660c0013511610cd25760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016102e8565b610cdf60608701876139c5565b9050610cee60408801886139c5565b9050148015610d0c57506001610d0760608801886139c5565b905011155b610d7e5760405162461bcd60e51b815260206004820152602860248201527f496e76616c6964206c656e6774687320666f7220726563656976696e6720737260448201527f6320746f6b656e7300000000000000000000000000000000000000000000000060648201526084016102e8565b34610d8f61046060208901896139a8565b610e8a57610db6610da360208901896139a8565b60a08901356105806101008b018b613a2d565b610dd2610dc660208901896139a8565b33308a60a001356121c0565b6000610de461083260208a018a6139a8565b9050610e088b82610df860208c018c6139a8565b6001600160a01b03169190612b15565b60005b610e1860408a018a6139c5565b9050811015610e8357610e71610e3160208b018b6139a8565b33610e3f60408d018d6139c5565b85818110610e4f57610e4f613a92565b9050602002016020810190610e6491906139a8565b6105f960608e018e6139c5565b80610e7b81613c8b565b915050610e0b565b5050610f2a565b60005b610e9a60408901896139c5565b9050811015610f2857610eb060608901896139c5565b82818110610ec057610ec0613a92565b9050602002013582610ed29190613af0565b9150610f16610ee460408a018a6139c5565b83818110610ef457610ef4613a92565b9050602002016020810190610f0991906139a8565b6106e360608b018b6139c5565b80610f2081613c8b565b915050610e8d565b505b600080610f3d60a08a0160808b016139a8565b6001600160a01b031614610f6057610f5b60a0890160808a016139a8565b610f62565b335b9050600060e0890135600116610f79576000610f8f565b610f8f610f8960208b018b6139a8565b33612849565b90506000610fac610fa660408c0160208d016139a8565b84612849565b905060008d6001600160a01b0316858e8e604051610fcb929190613cc4565b60006040518083038185875af1925050503d8060008114611008576040519150601f19603f3d011682016040523d82523d6000602084013e61100d565b606091505b505090508061105e5760405162461bcd60e51b815260206004820152601960248201527f63616c6c20746f2031696e636820726f75746572206661696c0000000000000060448201526064016102e8565b50600061107461083260408d0160208e016139a8565b905061109061108960408d0160208e016139a8565b858361291a565b816110aa6110a460408e0160208f016139a8565b86612849565b6110b49190613af0565b975060a08b013560e08c013560011615611161576110d8610f8960208e018e6139a8565b6110e660a08e013586613cd4565b6110f09190613af0565b90506111008160c08e0135613c1f565b61110e60a08e01358b613c1f565b101561115c5760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b6111b5565b8b60c001358910156111b55760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8336111e460208f018f6139a8565b8e60200160208101906111f791906139a8565b604080516001600160a01b03948516815292841660208401529083169082015290871660608201526080810183905260a081018b905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488f8a6112718f602001602081019061046091906139a8565b61128d578e602001602081019061128891906139a8565b6112af565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff97798b8b60405161130a929190613c5c565b60405180910390a15a8703975050505050505050965096945050505050565b60008060005a905061134161046060208a018a6139a8565b156113b45760405162461bcd60e51b815260206004820152602260248201527f737263206973206574682c2073686f756c6420757365206e6f726d616c20737760448201527f617000000000000000000000000000000000000000000000000000000000000060648201526084016102e8565b6113d76113c460208a018a6139a8565b60a08a01356105806101008c018c613a2d565b60a088013560006113eb60408b018b6139c5565b905011156115815761140060408a018a6139c5565b9050600114801561142c575061141960608a018a6139c5565b905061142860408b018b6139c5565b9050145b6114785760405162461bcd60e51b815260206004820152601d60248201527f57726f6e67206e756d626572206f66207372632072656365697665727300000060448201526064016102e8565b6114da61148860208b018b6139a8565b3361149660408d018d6139c5565b60008181106114a7576114a7613a92565b90506020020160208101906114bc91906139a8565b6114c960608e018e6139c5565b600081811061060957610609613a92565b806114e860608b018b6139c5565b60008181106114f9576114f9613a92565b90506020020135111561154e5760405162461bcd60e51b815260206004820152601f60248201527f696e76616c69642066656520616d6f756e7420696e2073726320746f6b656e0060448201526064016102e8565b61155b60608a018a6139c5565b600081811061156c5761156c613a92565b905060200201358161157e9190613af0565b90505b60008061159460a08c0160808d016139a8565b6001600160a01b0316146115b7576115b260a08b0160808c016139a8565b6115b9565b335b905060006115d66115d060408d0160208e016139a8565b83612849565b90506116058c6115e960208e018e6139a8565b858e60200160208101906115fd91906139a8565b868f8f612c3f565b80611619610fa660408e0160208f016139a8565b6116239190613af0565b95508a60c001358610156116795760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8336116a860208e018e6139a8565b8d60200160208101906116bb91906139a8565b604080516001600160a01b039485168152928416602084015290831690820152908416606082015260a0808e01356080830152810188905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488c876117378e602001602081019061046091906139a8565b611753578d602001602081019061174e91906139a8565b611775565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff977988886040516117d0929190613c5c565b60405180910390a15a8403945050505050965096945050505050565b60008060005a905060008860c00135116118485760405162461bcd60e51b815260206004820152601a60248201527f4d696e2072657475726e2073686f756c64206e6f74206265203000000000000060448201526064016102e8565b856118955760405162461bcd60e51b815260206004820152601f60248201527f6578656375746f72446174612073686f756c64206265206e6f74207a65726f0060448201526064016102e8565b60e088013560208116156118bc576118b18a8a8a8a8a8a611329565b935093505050611efd565b60006118cb60208b018b6139a8565b9050600282161561195a5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03821614611901576000611907565b8960a001355b34116119555760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b6119d9565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0382161461198557600061198b565b8960a001355b34146119d95760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964206d73672e76616c756500000000000000000000000000000060448201526064016102e8565b6119e660608b018b6139c5565b90506119f560408c018c6139c5565b905014611a6a5760405162461bcd60e51b815260206004820152602860248201527f496e76616c6964206c656e6774687320666f7220726563656976696e6720737260448201527f6320746f6b656e7300000000000000000000000000000000000000000000000060648201526084016102e8565b6004821615611b6b5773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0382161415611ae05760405162461bcd60e51b815260206004820152601260248201527f436c61696d20746f6b656e20697320455448000000000000000000000000000060448201526064016102e8565b611af78160a08c01356105806101008e018e613a2d565b60005b611b0760408c018c6139c5565b9050811015611b6957611b578233611b2260408f018f6139c5565b85818110611b3257611b32613a92565b9050602002016020810190611b4791906139a8565b8e80606001906105f991906139c5565b80611b6181613c8b565b915050611afa565b505b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b0382161415611bff5760005b611ba060408c018c6139c5565b9050811015611bfd57611beb611bb960408d018d6139c5565b83818110611bc957611bc9613a92565b9050602002016020810190611bde91906139a8565b6106e360608e018e6139c5565b80611bf581613c8b565b915050611b93565b505b50600080611c1360a08c0160808d016139a8565b6001600160a01b031614611c3657611c3160a08b0160808c016139a8565b611c38565b335b9050600060018316611c4b576000611c5b565b611c5b610f8960208d018d6139a8565b90506000611c6f60408d0160208e016139a8565b90506000611c7d8285612849565b9050611c8a8e8d8d61305c565b60a08d013581611c9a8487612849565b611ca49190613af0565b98506001861615611d5457611cc58e6000016020810190610f8991906139a8565b8e60a0013585611cd59190613cd4565b611cdf9190613af0565b9050808e60c00135611cf19190613c1f565b8e60a001358a611d019190613c1f565b1015611d4f5760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b611da8565b8d60c00135891015611da85760405162461bcd60e51b815260206004820152601b60248201527f52657475726e20616d6f756e74206973206e6f7420656e6f756768000000000060448201526064016102e8565b7fd6d4f5681c246c9f42c203e287975af1601f8df8035a9251f79aab5c8f09e2f8338f6000016020810190611ddd91906139a8565b604080516001600160a01b03938416815291831660208301528287169082015290871660608201526080810183905260a081018b905260c00160405180910390a17fddac40937f35385a34f721af292e5a83fc5b840f722bff57c2fc71adba708c488f8a73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b03871614611e6b5785611e8d565b7f00000000000000000000000000000000000000000000000000000000000000005b604080516001600160a01b039485168152602081019390935292168183015290519081900360600190a17f095e66fa4dd6a6f7b43fb8444a7bd0edb870508c7abf639bc216efb0bcff97798b8b604051611ee8929190613c5c565b60405180910390a150505050505a8203925050505b965096945050505050565b6000546001600160a01b03163314611f625760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102e8565b6001600160a01b038116611fde5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016102e8565b611fe78161295a565b50565b60e08114156121ba57600080856001600160a01b031663d505accf60e01b858560405160200161201c93929190613cec565b60408051601f198184030181529082905261203691613bc4565b6000604051808303816000865af19150503d8060008114612073576040519150601f19603f3d011682016040523d82523d6000602084013e612078565b606091505b5091509150816121b75760006120c3826040518060400160405280601481526020017f5065726d69742063616c6c206661696c65643a2000000000000000000000000081525061242a565b6040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290915086906001600160a01b0389169063dd62ed3e9060440160206040518083038186803b15801561212657600080fd5b505afa15801561213a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215e9190613d28565b101561217e578060405162461bcd60e51b81526004016102e89190613c0c565b7f08c379a0afcc32b1a39302f7cb8073359698411ab5fd6e3edb2c02c0b5fba8aa816040516121ad9190613c0c565b60405180910390a1505b50505b50505050565b806121ca576121ba565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052915160009283929088169161225c9190613bc4565b6000604051808303816000865af19150503d8060008114612299576040519150601f19603f3d011682016040523d82523d6000602084013e61229e565b606091505b50915091508180156122c85750805115806122c85750808060200190518101906122c89190613d41565b6121b75760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160448201527f494c45440000000000000000000000000000000000000000000000000000000060648201526084016102e8565b80612342575050565b604080516000808252602082019092526001600160a01b03841690839060405161236c9190613bc4565b60006040518083038185875af1925050503d80600081146123a9576040519150601f19603f3d011682016040523d82523d6000602084013e6123ae565b606091505b50509050806124255760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201527f4c4544000000000000000000000000000000000000000000000000000000000060648201526084016102e8565b505050565b6060604483511015801561249757508260008151811061244c5761244c613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0800000000000000000000000000000000000000000000000000000000000000145b80156124fc5750826001815181106124b1576124b1613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167fc300000000000000000000000000000000000000000000000000000000000000145b801561256157508260028151811061251657612516613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7900000000000000000000000000000000000000000000000000000000000000145b80156125c657508260038151811061257b5761257b613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167fa000000000000000000000000000000000000000000000000000000000000000145b15612658576044838101805190916125de9190613cd4565b8451101561262e5760405162461bcd60e51b815260206004820152601560248201527f496e76616c69642072657665727420726561736f6e000000000000000000000060448201526064016102e8565b8281604051602001612641929190613d8d565b604051602081830303815290604052915050612843565b825160241480156126c257508260008151811061267757612677613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f4e00000000000000000000000000000000000000000000000000000000000000145b80156127275750826001815181106126dc576126dc613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f4800000000000000000000000000000000000000000000000000000000000000145b801561278c57508260028151811061274157612741613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7b00000000000000000000000000000000000000000000000000000000000000145b80156127f15750826003815181106127a6576127a6613a92565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f7100000000000000000000000000000000000000000000000000000000000000145b1561281657602483015182612805826131a8565b604051602001612641929190613e0f565b81612820846131d0565b604051602001612831929190613e5b565b60405160208183030381529060405290505b92915050565b600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b038416141561288157506001600160a01b03811631612843565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301528416906370a082319060240160206040518083038186803b1580156128db57600080fd5b505afa1580156128ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129139190613d28565b9050612843565b80156124255773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee6001600160a01b038416141561294f576124258282612339565b6124258383836129c2565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b806129cc57505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790529151600092839290871691612a569190613bc4565b6000604051808303816000865af19150503d8060008114612a93576040519150601f19603f3d011682016040523d82523d6000602084013e612a98565b606091505b5091509150818015612ac2575080511580612ac2575080806020019051810190612ac29190613d41565b612b0e5760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016102e8565b5050505050565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b158015612b7a57600080fd5b505afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bb29190613d28565b612bbc9190613cd4565b604080516001600160a01b038616602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790529091506121ba908590613475565b6000612c4d8284018461411a565b90504281606001511015612ca35760405162461bcd60e51b815260206004820152600f60248201527f524f555445523a2045787069726564000000000000000000000000000000000060448201526064016102e8565b602081015151815151148015612cbf5750604081015151815151145b612d0b5760405162461bcd60e51b815260206004820152601860248201527f696e76616c696420737761702064617461206c656e677468000000000000000060448201526064016102e8565b80515160005b81811015612f4557612d5f893385600001518481518110612d3457612d34613a92565b602002602001015186602001518581518110612d5257612d52613a92565b60200260200101516121c0565b8783602001518281518110612d7657612d76613a92565b60200260200101511115612dcc5760405162461bcd60e51b815260206004820152601360248201527f696e76616c6964207377617020616d6f756e740000000000000000000000000060448201526064016102e8565b82602001518181518110612de257612de2613a92565b602002602001015188612df59190613af0565b97506000808b6001600160a01b0316638b674f5d60e01b86604001518581518110612e2257612e22613a92565b6020026020010151604051602401612e3a9190613c0c565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051612ea59190613bc4565b6000604051808303816000865af19150503d8060008114612ee2576040519150601f19603f3d011682016040523d82523d6000602084013e612ee7565b606091505b509150915081612f30576107fe816040518060400160405280601b81526020017f7377617053696e676c6553657175656e6365206661696c65643a20000000000081525061242a565b50508080612f3d90613c8b565b915050612d11565b506000808a6001600160a01b031663774b6b7e60e01b8b8a8a8860800151604051602401612f7694939291906141fd565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051612fe19190613bc4565b6000604051808303816000865af19150503d806000811461301e576040519150601f19603f3d011682016040523d82523d6000602084013e613023565b606091505b50915091508161304f576107fe8160405180606001604052806023815260200161423c6023913961242a565b5050505050505050505050565b600061307c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee30612849565b9050348111156130895750345b600080856001600160a01b03168363d9c4535760e01b87876040516024016130b2929190613c5c565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161311d9190613bc4565b60006040518083038185875af1925050503d806000811461315a576040519150601f19603f3d011682016040523d82523d6000602084013e61315f565b606091505b5091509150816121b7576107fe816040518060400160405280601281526020017f63616c6c4279746573206661696c65643a20000000000000000000000000000081525061242a565b6060612843826040516020016131c091815260200190565b6040516020818303038152906040525b80516060907f303132333435363738396162636465660000000000000000000000000000000090600090613205906002613c1f565b613210906002613cd4565b67ffffffffffffffff81111561322857613228613d5e565b6040519080825280601f01601f191660200182016040528015613252576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061328957613289613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106132ec576132ec613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060005b845181101561346d5782600486838151811061333c5761333c613a92565b01602001517fff0000000000000000000000000000000000000000000000000000000000000016901c60f81c6010811061337857613378613a92565b1a60f81b82613388836002613c1f565b613393906002613cd4565b815181106133a3576133a3613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350828582815181106133e5576133e5613a92565b60209101015160f81c600f166010811061340157613401613a92565b1a60f81b82613411836002613c1f565b61341c906003613cd4565b8151811061342c5761342c613a92565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061346581613c8b565b91505061331e565b509392505050565b60006134ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661355a9092919063ffffffff16565b80519091501561242557808060200190518101906134e89190613d41565b6124255760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102e8565b60606135698484600085613573565b90505b9392505050565b6060824710156135eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102e8565b6001600160a01b0385163b6136425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102e8565b600080866001600160a01b0316858760405161365e9190613bc4565b60006040518083038185875af1925050503d806000811461369b576040519150601f19603f3d011682016040523d82523d6000602084013e6136a0565b606091505b50915091506136b08282866136bb565b979650505050505050565b606083156136ca57508161356c565b8251156136da5782518084602001fd5b8160405162461bcd60e51b81526004016102e89190613c0c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6001600160a01b0381168114611fe757600080fd5b8015158114611fe757600080fd5b6000806040838503121561375957600080fd5b823561376481613723565b9150602083013561377481613738565b809150509250929050565b60008083601f84011261379157600080fd5b50813567ffffffffffffffff8111156137a957600080fd5b6020830191508360208285010111156137c157600080fd5b9250929050565b600080600080600080608087890312156137e157600080fd5b86356137ec81613723565b9550602087013567ffffffffffffffff8082111561380957600080fd5b90880190610140828b03121561381e57600080fd5b9095506040880135908082111561383457600080fd5b6138408a838b0161377f565b9096509450606089013591508082111561385957600080fd5b5061386689828a0161377f565b979a9699509497509295939492505050565b6000806040838503121561388b57600080fd5b823561389681613723565b946020939093013593505050565b600061012082840312156138b757600080fd5b50919050565b600080600080600080608087890312156138d657600080fd5b86356138e181613723565b9550602087013567ffffffffffffffff808211156138fe57600080fd5b61390a8a838b0161377f565b9097509550604089013591508082111561392357600080fd5b61392f8a838b016138a4565b9450606089013591508082111561385957600080fd5b6000806000806000806080878903121561395e57600080fd5b863561396981613723565b9550602087013567ffffffffffffffff8082111561398657600080fd5b6139928a838b016138a4565b9650604089013591508082111561383457600080fd5b6000602082840312156139ba57600080fd5b813561356c81613723565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126139fa57600080fd5b83018035915067ffffffffffffffff821115613a1557600080fd5b6020019150600581901b36038213156137c157600080fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112613a6257600080fd5b83018035915067ffffffffffffffff821115613a7d57600080fd5b6020019150368190038213156137c157600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082821015613b0257613b02613ac1565b500390565b7fffffffff00000000000000000000000000000000000000000000000000000000861681527fffffffffffffffffffffffff0000000000000000000000000000000000000000851660048201527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008460601b1660108201528183602483013760009101602401908152949350505050565b60005b83811015613bb3578181015183820152602001613b9b565b838111156121ba5750506000910152565b60008251613bd6818460208701613b98565b9190910192915050565b60008151808452613bf8816020860160208601613b98565b601f01601f19169290920160200192915050565b60208152600061356c6020830184613be0565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c5757613c57613ac1565b500290565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613cbd57613cbd613ac1565b5060010190565b8183823760009101908152919050565b60008219821115613ce757613ce7613ac1565b500190565b7fffffffff0000000000000000000000000000000000000000000000000000000084168152818360048301376000910160040190815292915050565b600060208284031215613d3a57600080fd5b5051919050565b600060208284031215613d5357600080fd5b815161356c81613738565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008351613d9f818460208801613b98565b7f4572726f722800000000000000000000000000000000000000000000000000009083019081528351613dd9816006840160208801613b98565b7f290000000000000000000000000000000000000000000000000000000000000060069290910191820152600701949350505050565b60008351613e21818460208801613b98565b7f50616e69632800000000000000000000000000000000000000000000000000009083019081528351613dd9816006840160208801613b98565b60008351613e6d818460208801613b98565b7f556e6b6e6f776e280000000000000000000000000000000000000000000000009083019081528351613ea7816008840160208801613b98565b7f290000000000000000000000000000000000000000000000000000000000000060089290910191820152600901949350505050565b60405160a0810167ffffffffffffffff81118282101715613f0057613f00613d5e565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715613f2f57613f2f613d5e565b604052919050565b600067ffffffffffffffff821115613f5157613f51613d5e565b5060051b60200190565b600082601f830112613f6c57600080fd5b81356020613f81613f7c83613f37565b613f06565b82815260059290921b84018101918181019086841115613fa057600080fd5b8286015b84811015613fc4578035613fb781613723565b8352918301918301613fa4565b509695505050505050565b600082601f830112613fe057600080fd5b81356020613ff0613f7c83613f37565b82815260059290921b8401810191818101908684111561400f57600080fd5b8286015b84811015613fc45780358352918301918301614013565b600082601f83011261403b57600080fd5b813567ffffffffffffffff81111561405557614055613d5e565b6140686020601f19601f84011601613f06565b81815284602083860101111561407d57600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f8301126140ab57600080fd5b813560206140bb613f7c83613f37565b82815260059290921b840181019181810190868411156140da57600080fd5b8286015b84811015613fc457803567ffffffffffffffff8111156140fe5760008081fd5b61410c8986838b010161402a565b8452509183019183016140de565b60006020828403121561412c57600080fd5b813567ffffffffffffffff8082111561414457600080fd5b9083019060a0828603121561415857600080fd5b614160613edd565b82358281111561416f57600080fd5b61417b87828601613f5b565b82525060208301358281111561419057600080fd5b61419c87828601613fcf565b6020830152506040830135828111156141b457600080fd5b6141c08782860161409a565b604083015250606083013560608201526080830135828111156141e257600080fd5b6141ee8782860161402a565b60808301525095945050505050565b60006001600160a01b0380871683528086166020840152808516604084015250608060608301526142316080830184613be0565b969550505050505056fe66696e616c5472616e73616374696f6e50726f63657373696e67206661696c65643a20a26469706673582212200010293abbe26aadbf9a5fafd46017bb18bdc760e3849d69d5c92097ecc9646064736f6c6343000809003300000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83

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

00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83

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

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000021be370d5312f44cb42ce377bc9b8a0cef1a4c83


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
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.