Contract 0x0989fBCfBDFA3C54B2893fE16AD1E7A8D30C4458

 
 
Txn Hash
Method
Block
From
To
Value
0xcd19039b003a1d114da39c3af58fdf775a501bce6423a67b71eb31853878fb090xc8811424152767302022-08-04 15:36:113 days 6 hrs agoENS Name moonbagcapital.eth IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00793296 24.23329714
0xfb0a61618f99928718b08a103cdd712284117968978ff734199c6a8244add4b4Kill Order149666972022-06-15 9:04:3053 days 13 hrs agoENS Name moonbagcapital.eth IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01076235 124.94606434
0xaeba7d9a3e423d20e9663b4ebab37e3a1a83f36dfe8d75da627e9d2a35a352f70xc8811424149330662022-06-09 14:23:2059 days 8 hrs agoENS Name moonbagcapital.eth IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.02686038 82.05502021
0x9d379f6899bf02d1fb11428e29e573299ff810c681d15c9de917009aa20207f80xc8811424148968602022-06-03 11:31:1165 days 10 hrs agoENS Name moonbagcapital.eth IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01008821 30.81932881
0xbdcc810711a6be84314ed5923530be7c3feb0d2250bc5e877932b8cb3b8f59160xc8811424147523642022-05-11 3:05:3188 days 19 hrs ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01273856 41.1581252
0x9e9a6bb4a630019f5a3a6d679911ed0333fc931deb10ad57c06f1594f3547e8aKill Order147523422022-05-11 2:59:5088 days 19 hrs ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.0025713 28.83247379
0xd803b75cfb1793694c0c5c0a2ee704d7ff88fcbad7d96e2cc104dda947f09cb40xc8811424147513032022-05-10 22:59:5688 days 23 hrs ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c445814.7 Ether0.02403708 77.63290697
0x134768c9bbff778eb2be37d17f7770994b5116d60b8f41d4e598f19b8a550d230xc8811424147388562022-05-08 22:53:0190 days 23 hrs ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c445815 Ether0.00064795 19.37892229
0x620a5fce44c9f07049fe3534bc8d393864bf41e60105b757c0fd6c1198f739820xc8811424147388512022-05-08 22:51:5390 days 23 hrs ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c445815 Ether0.00061064 18.26310127
0xbf85135e309db0b78ae517af14733914874cfb441c07f2f314f34aa15b1b4b70Kill Order147322382022-05-07 21:45:2992 days 38 mins ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00288598 32.36098145
0x6015fb5790ed40eb5c3471a85d2e3ff1972d90db8719875a37643a4e6fa0e4940xc8811424147322042022-05-07 21:36:4392 days 47 mins ago0x586331e67ed4edea38ebafe8583c400b7df7f021 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c445815 Ether0.01018365 31.16773954
0x6cf8ad9000be4a876dd3961de3870f4317614f52e4101a546ee6bf9bd00eb0e10x62985954147286462022-05-07 8:12:1092 days 14 hrs ago0x9c21ca464a2ee450d05d605d74ad415c6baaa054 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00145027 30.0277141
0x4ec296a3682c96cafe6dc467d4f66bd9fd3c9858272a9bea4ff75ebff7e3fd880xc8811424146705922022-04-28 3:46:37101 days 18 hrs ago0x23d2ddae7a638ef8f07a482e31a7f08ba57c1277 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01739921 53.15042557
0xbe08dcd2fcdf5d6eaba9da1712f08ed8dd36a6ae28882c25a809dc5ff45519670xc8811424146651412022-04-27 7:23:30102 days 15 hrs ago0x23d2ddae7a638ef8f07a482e31a7f08ba57c1277 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00941244 28.75485658
0x227eb8275959c344e75bcf28971f3fc63f50af5c04dd8767627ed1167a4650da0xc8811424146508502022-04-25 1:14:30104 days 21 hrs ago0x23d2ddae7a638ef8f07a482e31a7f08ba57c1277 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01203521 36.76739693
0x4f2d238ca530bee7031d358cbc181ae4d067914254879856a8de9c3d9479b7c20xc8811424146431672022-04-23 20:15:52106 days 2 hrs ago0x23d2ddae7a638ef8f07a482e31a7f08ba57c1277 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01003074 30.64376591
0xc913aa92f6b9e8114e0ebe7a45d006dd259f4fcaa5744f7c41d35b7a64468a220xc8811424146391962022-04-23 5:22:07106 days 17 hrs ago0x23d2ddae7a638ef8f07a482e31a7f08ba57c1277 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00903864 26.24018589
0x8904581dff4d6d0d6865347cc528e9ff88c1ed374c01f1f0578da86d7b646bc60xc8811424145791252022-04-13 19:57:11116 days 2 hrs agoENS Name moonbagcapital.eth IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01490347 48.15105587
0x6aae269d2a76c79173c7e5a4e224492651f9b80ea0ba77d95d0a135e837aa51f0xc8811424145328792022-04-06 14:32:55123 days 7 hrs agoENS Name moonbagcapital.eth IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c445815 Ether0.02695466 82.49652674
0xabb63f4fdeb18000b5e1d6ab41dda10ceb54132b82de10dad4007b8d6b9f6f390xc8811424144827662022-03-29 18:37:15131 days 3 hrs ago0x990f7a79e5bc29e5863865d39262f755f6c9412a IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01177412 37.95094392
0x62f6d6763ab8b1c63686946fca17a26ad375b0d4b6282e72643684c348db00980xc8811424144827602022-03-29 18:36:31131 days 3 hrs ago0x990f7a79e5bc29e5863865d39262f755f6c9412a IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.01596507 46.73152566
0x1e1eaaffa0d6929bbbca61b77f76869305b327e0e09414f9c8f31a5e37f551580x62985954144810342022-03-29 12:16:21131 days 10 hrs ago0x9c21ca464a2ee450d05d605d74ad415c6baaa054 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00123703 25.6061152
0xe8a9d4d24eb439b5063ffe5acf87d510b2fdcd30fbffaafb30f758e761f2674b0x62985954144810342022-03-29 12:16:21131 days 10 hrs ago0x9c21ca464a2ee450d05d605d74ad415c6baaa054 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00123703 25.6061152
0x69971636f321a544f70c010d8a199681258ecc280af1addc1c3ae6e9a3794c150x62985954144810342022-03-29 12:16:21131 days 10 hrs ago0x9c21ca464a2ee450d05d605d74ad415c6baaa054 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00123703 25.6061152
0x38bf97733f4083d839f277b9b6003d7611999e2e26157b82f3cc155db5b0eca10x62985954144810342022-03-29 12:16:21131 days 10 hrs ago0x9c21ca464a2ee450d05d605d74ad415c6baaa054 IN  0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c44580 Ether0.00123672 25.6061152
[ Download CSV Export 
Latest 5 internal transactions
Parent Txn Hash Block From To Value
0x2690911a06bc1efb252c5240bbbc52be3c8458a6d400a67cade5ebbe9b7bf9a7147626342022-05-12 18:26:4587 days 3 hrs ago 0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c4458 Wrapped Ether116.48 Ether
0x2690911a06bc1efb252c5240bbbc52be3c8458a6d400a67cade5ebbe9b7bf9a7147626342022-05-12 18:26:4587 days 3 hrs ago 0xfa82f1ba00b0697227e2ad6c668abb4c50ca0b1f 0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c4458116.48 Ether
0xd803b75cfb1793694c0c5c0a2ee704d7ff88fcbad7d96e2cc104dda947f09cb4147513032022-05-10 22:59:5688 days 23 hrs ago 0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c4458 Wrapped Ether14.7 Ether
0x6015fb5790ed40eb5c3471a85d2e3ff1972d90db8719875a37643a4e6fa0e494147322042022-05-07 21:36:4392 days 47 mins ago 0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c4458 Wrapped Ether15 Ether
0x6aae269d2a76c79173c7e5a4e224492651f9b80ea0ba77d95d0a135e837aa51f145328792022-04-06 14:32:55123 days 7 hrs ago 0x0989fbcfbdfa3c54b2893fe16ad1e7a8d30c4458 Wrapped Ether15 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TZWAP

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : TZWAP.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

/**
*                                                                                  
..................................................................            
.                                                                .            
.  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  .            
.  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  .            
.  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  .            
.  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  .            
.  ::::::::::::::::::::--:.......:-==--:...::==::::::::::::::::  .            
.  ::::::::::::::::::--.    .:::.:--+=::::::--::-::::::::::::::  .            
.  :::::::::::::::::+:    ::.    .:--+=-===:..:--=-::::::::::::  .            
.  :::::::::::::::--     ..     .:-----=--. .:-=-:---::::::::::  .            
.  ::::::::::::::-.      .-::::.:+=====-=::---===--.:-:::::::::  .            
.  :::::::::::::-.   ...:...::::==+===::+=:-:::===:-=-==-::::::  .            
.  ::::::::::::=:.  :..:    ...---=-:::--=-:-=--::..:---+-:::::  .            
.  :::::::::::=:.. .::---...#+*@%%@-...:-==--=+*@@#-.:-=+::::::  .            
.  ::::::::::--..........::-%%#@=.%#    --=--:@[email protected]#.+.   +::::::  .            
.  ::::::::::=..........:--:.-=*#%@=   ..=-=:[email protected]#%@%%:.:-=::::::  .            
.  :::::::::-+=--:...:-:....-=========--:-=+**+:....::=-:::::::  .            
.  ::::::::--+==-:::-:..:::::------::--:..:::.-:.  ::::=-::::::  .            
.  ::::::::= ---. .:::..::::::--:-==--:::--:... ..     :+=:::::  .            
.  :::::::-: .:-:.:=++=-:::::::--=---------:.. ... .:--:*#-::::  .            
.  ::::::-=..  ::..-----=-::::---:--=---==--:..:. :---=*#=:::::  .            
.  :::::-: -   ....::.   .:::::=*####*****++====--++*##%-::::::  .            
.  ::::-.   :::....:.     .::::::+######################+::::::  .            
.  :::-.    .------:::::::::======+####################+:::::::  .            
.  ::-#=.     --++=-:=:::::-======++++*****+++++++=--:=::::::::  .            
.  ::#@@@%+:  ::  .-==-----*====::--:::-::   .:.:...:-=::::::::  .            
.  :[email protected]@@@@@@@#-   --:...--++=-+....:..-*=-....:-::::-%@%+::::::  .            
.  :%@@@@@@@@@:::...:-=+-:. .--::-::..:+=:.  :==-.:: @@@@@*-:::  .            
.  [email protected]@@@@@@@@+. .:..---:...:=:*@@@@@@@@@@@@@@@@@@@@[email protected]@@@@@@+::  .            
.  %@@@@@@@@@:..  .::::--:..:%@@@@@@@@@@@@@@@@@@@@@@#@@@@@@@@#-  .            
.  @@@@@@@@%-      .:::.:=#@=:%@@@#-.  -=:-=+*%@@@@@@@@@@@@@@@@  .            
.  @@@@@@@@@..        :#@@@@@%-:[email protected]@.   ..  =-+%@@@@@@@@@@@@@@@@. .            
.  @@@@@@@@@%:...     :@@@@@@@@@@@@@=  :.:%@@@@@@@@@@@@@@@@@@@@. .            
.  @@@@@@@@@@@%+-:-*#@@@@@@@@@@@@@@#-  .. [email protected]@@@@@@@@@@@@@@@@@@@. .            
.  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%. :. #@@@@@@@@@@@@@@@@@@@@. .            
.                                                                .            
..................................................................            

            ████████╗███████╗██╗    ██╗ █████╗ ██████╗ 
            ╚══██╔══╝╚══███╔╝██║    ██║██╔══██╗██╔══██╗
              ██║     ███╔╝ ██║ █╗ ██║███████║██████╔╝
              ██║    ███╔╝  ██║███╗██║██╔══██║██╔═══╝ 
              ██║   ███████╗╚███╔███╔╝██║  ██║██║     
              ╚═╝   ╚══════╝ ╚══╝╚══╝ ╚═╝  ╚═╝╚═╝     
                                                      
                TZWAP: On-chain TWAP Service
*/
import {Pausable} from '@openzeppelin/contracts/security/Pausable.sol';
import {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {I1inchAggregationRouterV4} from './interfaces/I1inchAggregationRouterV4.sol';
import {IChainlinkOracle} from './interfaces/IChainlinkOracle.sol';
import {ICustomPriceOracle} from './interfaces/ICustomPriceOracle.sol';
import {IWETH9} from './interfaces/IWETH9.sol';
import {IERC20} from'./interfaces/IERC20.sol';
import {ISafeERC20} from './interfaces/ISafeERC20.sol';


contract TZWAP is Ownable, Pausable {

  using ISafeERC20 for IERC20;

  I1inchAggregationRouterV4 public aggregationRouterV4;
  IWETH9 public weth;

  // Min TWAP interval in seconds
  uint public minInterval = 60;

  // Min number of intervals for a TWAP order
  uint public minNumOfIntervals = 3;

  // Precision for all % math
  uint public percentagePrecision =  10 ** 5;

  // Auto-incrementing of orders
  uint public orderCount;
  // TWAP orders mapped to auto-incrementing ID
  mapping (uint => TWAPOrder) public orders;
  // IDs of TWAP orders for a certain user address
  mapping (address => uint[]) public userOrders;
  // Fills for TWAP orders
  mapping (uint => Fill[]) public fills;
  // Token addresses mapped to oracles
  mapping (address => Oracle) public oracles;
  // Whitelisted addresses who can interact with fillOrder
  mapping (address => bool) public whitelist;

  // If true only whitelisted addresses can interact with fillOrder
  bool public isWhitelistActive;

  struct Oracle {
    // Address of oracle
    address oracleAddress;
    // Toggled to false if oracle is not chainlink
    bool isChainlink;
  }

  struct TWAPOrder {
    // Order creator
    address creator;
    // Token to swap from
    address srcToken;
    // Token to swap to
    address dstToken;
    // How often a swap should be made
    uint interval;
    // srcToken to swap per interval
    uint tickSize;
    // Total srcToken to swap
    uint total;
    // Min fees in % to be paid per swap interval
    uint minFees;
    // Max fees in % to be paid per swap interval
    uint maxFees;
    // Creation timestamp
    uint created;
    // Toggled to true when an order is killed
    bool killed;
  }
  
  struct Fill {
    // Address that called fill
    address filler;
    // Amount of ticks filled
    uint ticksFilled;
    // Amount of srcToken spent
    uint srcTokensSwapped;
    // Amount of dstToken received
    uint dstTokensReceived;
    // Fees collected
    uint fees;
    // Time of last fill
    uint timestamp;
  }

  // 1inch swaps structs

  struct swapParams {
    address caller;
    I1inchAggregationRouterV4.SwapDescription desc;
    bytes data;
  }

  struct unoswapParams {
    address srcToken;
    uint256 amount;
    uint256 minReturn;
    bytes32[] pools;
  }

  struct uniswapV3Params {
    uint256 amount;
    uint256 minReturn;
    uint256[] pools;
  }

  event LogNewOrder(uint id);
  event LogNewFill(uint id, uint fillIndex);
  event LogOrderKilled(uint id);

  constructor(
    address payable _aggregationRouterV4Address,
    address payable _wethAddress
  ) {
    aggregationRouterV4 = I1inchAggregationRouterV4(_aggregationRouterV4Address);
    weth = IWETH9(_wethAddress);
    isWhitelistActive = true;
  }

  receive() external payable {}

  /**
  * Creates a new TWAP order
  * @param order Order params
  * @return Whether order was created
  */
  function newOrder(
    TWAPOrder memory order
  )
  payable
  public
  whenNotPaused
  returns (bool) {
    require(order.srcToken != address(0), "Invalid srcToken address");
    require(order.dstToken != address(0), "Invalid dstToken address");
    require(order.interval >= minInterval, "Invalid interval");
    require(order.tickSize > 0, "Invalid tickSize");
    require(order.total > order.tickSize && order.total % order.tickSize == 0, "Invalid total");
    require(order.total / order.tickSize > minNumOfIntervals, "Number of intervals is too less");
    order.creator = msg.sender;
    order.created = block.timestamp;
    order.killed = false;

    if (order.srcToken == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) {
      require(msg.value == order.total, "Invalid msg value");
      weth.deposit{value: msg.value}();
      order.srcToken = address(weth);
    }
    else {
      require(IERC20(order.srcToken).transferFrom(msg.sender, address(this), order.total));
    }

    require(oracles[order.srcToken].oracleAddress != address(0) && oracles[order.dstToken].oracleAddress != address(0), "Oracle is missing");

    orders[orderCount++] = order;
    userOrders[msg.sender].push(orderCount - 1);
    emit LogNewOrder(orderCount - 1);

    return true;
  }

  /**
  * Fills an active order
  * @param id Order ID
  * @param swapType 0: swap() 1: unoswap() 2: uniswapV3SwapTo()
  * @param _swapParams Default 1inch swap
  * @param _unoswapParams 1inch swap through only sushi or uni v2
  * @param _uniswapV3Params 1inch swap through only uni v3
  * @return Whether order was filled
  */
  function fillOrder(
    uint id,
    uint swapType,
    swapParams calldata _swapParams,
    unoswapParams calldata _unoswapParams,
    uniswapV3Params calldata _uniswapV3Params
  )
  public
  whenNotPaused
  returns (uint) {
    if (isWhitelistActive)
      require(whitelist[msg.sender] == true, "Not whitelisted");

    require(orders[id].created != 0, "Invalid order");
    require(!orders[id].killed, "Order was killed");
    require(getSrcTokensSwappedForOrder(id) < orders[id].total, "Order is already filled");

    uint ticksToFill = getTicksToFill(id);

    require(ticksToFill > 0, "Interval must pass before next fill");

    // store it before we update array
    uint timeElapsed = getTimeElapsedSinceLastFill(id);

    fills[id].push(
      Fill({
        filler: msg.sender, 
        ticksFilled: ticksToFill, 
        srcTokensSwapped: 0, // Update after swap
        dstTokensReceived: 0, // Update after swap
        fees: 0, // Update after swap
        timestamp: block.timestamp
      })
    );

    _executeSwap(id, ticksToFill, swapType, _swapParams, _unoswapParams, _uniswapV3Params);

    _setFeesAndDistribute(id, timeElapsed);

    emit LogNewFill(id, fills[id].length - 1);

    return fills[id][fills[id].length - 1].fees;
  }

  /**
  * Execute post-swap checks and updates
  */
  function _ensureSwapValidityAndUpdate(
    uint id,
    uint256 srcTokensSwapped,
    uint256 dstTokensReceived
  )
  internal {
    // Estimate amount to receive using oracles
    uint srcTokenPriceInUsd;
    uint dstTokenPriceInUsd;

    if (oracles[orders[id].srcToken].isChainlink)
      srcTokenPriceInUsd = uint(IChainlinkOracle(oracles[orders[id].srcToken].oracleAddress).latestAnswer());
    else
      srcTokenPriceInUsd = ICustomPriceOracle(oracles[orders[id].srcToken].oracleAddress).getPriceInUSD();

    if (oracles[orders[id].dstToken].isChainlink)
      dstTokenPriceInUsd = uint(IChainlinkOracle(oracles[orders[id].dstToken].oracleAddress).latestAnswer());
    else
      dstTokenPriceInUsd = ICustomPriceOracle(oracles[orders[id].dstToken].oracleAddress).getPriceInUSD();

    // 10% max slippage
    uint srcTokenDecimals = IERC20(orders[id].srcToken).decimals();
    uint dstTokenDecimals = IERC20(orders[id].dstToken).decimals();
    uint minDstTokenReceived = (900 * srcTokensSwapped * srcTokenPriceInUsd * (10 ** dstTokenDecimals)) / (1000 * dstTokenPriceInUsd * (10 ** srcTokenDecimals));

    require(dstTokensReceived > minDstTokenReceived, "Tokens received are not enough");

    fills[id][fills[id].length - 1].srcTokensSwapped = srcTokensSwapped;
    fills[id][fills[id].length - 1].dstTokensReceived = dstTokensReceived;
  }

  /**
  * Set fees and distribute
  */
  function _setFeesAndDistribute(
    uint id,
    uint timeElapsed
  )
  internal {
    uint timeElapsedSinceCallable;

    if (fills[id].length > 1)
      timeElapsedSinceCallable = timeElapsed - orders[id].interval;
    else
      timeElapsedSinceCallable = timeElapsed;

    uint minFeesAmount = (fills[id][fills[id].length - 1].dstTokensReceived / fills[id][fills[id].length - 1].ticksFilled) * orders[id].minFees / percentagePrecision;
    uint maxFeesAmount = (fills[id][fills[id].length - 1].dstTokensReceived / fills[id][fills[id].length - 1].ticksFilled) * orders[id].maxFees / percentagePrecision;

    fills[id][fills[id].length - 1].fees = Math.min(maxFeesAmount, minFeesAmount * ((1000 + timeElapsedSinceCallable / 6) / 1000));
    // minFees + 0.1% every 6 secs

    IERC20(orders[id].dstToken).safeTransfer(
      msg.sender,
      fills[id][fills[id].length - 1].fees
    );

    IERC20(orders[id].dstToken).safeTransfer(
      orders[id].creator,
      fills[id][fills[id].length - 1].dstTokensReceived - fills[id][fills[id].length - 1].fees
    );
  }


  /**
  * Execute swap
  */
  function _executeSwap(
    uint id,
    uint ticksToFill,
    uint swapType,
    swapParams calldata _swapParams,
    unoswapParams calldata _unoswapParams,
    uniswapV3Params calldata _uniswapV3Params
  ) internal {
    uint preSwapSrcTokenBalance = IERC20(orders[id].srcToken).balanceOf(address(this));
    uint preSwapDstTokenBalance = IERC20(orders[id].dstToken).balanceOf(address(this));

    if (IERC20(orders[id].srcToken).allowance(address(this), address(aggregationRouterV4)) == 0)
      IERC20(orders[id].srcToken).safeIncreaseAllowance(address(aggregationRouterV4), 2**256 - 1);

    if (swapType == 0) aggregationRouterV4.swap(_swapParams.caller, _swapParams.desc, _swapParams.data);
    else if (swapType == 1) aggregationRouterV4.unoswap(_unoswapParams.srcToken, _unoswapParams.amount, _unoswapParams.minReturn, _unoswapParams.pools);
    else aggregationRouterV4.uniswapV3Swap(_uniswapV3Params.amount, _uniswapV3Params.minReturn, _uniswapV3Params.pools);

    uint256 srcTokensSwapped = preSwapSrcTokenBalance - IERC20(orders[id].srcToken).balanceOf(address(this));
    uint256 dstTokensReceived = IERC20(orders[id].dstToken).balanceOf(address(this)) - preSwapDstTokenBalance;

    _ensureSwapValidityAndUpdate(id, srcTokensSwapped, dstTokensReceived);

    require(srcTokensSwapped == ticksToFill * orders[id].tickSize, "Invalid amount");
    require(getSrcTokensSwappedForOrder(id) <= orders[id].total, "Overbought");
}

  /**
  * Kills an active order
  * @param id Order ID
  * @return Whether order was killed
  */
  function killOrder(
    uint id
  )
  public
  whenNotPaused
  returns (bool) {
    require(msg.sender == orders[id].creator, "Invalid sender");
    require(!orders[id].killed, "Order already killed");
    orders[id].killed = true;
    IERC20(orders[id].srcToken).safeTransfer(
      orders[id].creator, 
      orders[id].total - getSrcTokensSwappedForOrder(id)
    );
    emit LogOrderKilled(id);
    return true;
  }

  /**
  * Returns total DST tokens received for an order
  * @param id Order ID
  * @return Total DST tokens received for an order
  */
  function getDstTokensReceivedForOrder(uint id)
  public
  view
  returns (uint) {
    require(orders[id].created != 0, "Invalid order");
    uint dstTokensReceived = 0;
    for (uint i = 0; i < fills[id].length; i++) 
      dstTokensReceived += fills[id][i].dstTokensReceived;
    return dstTokensReceived;
  }

  /**
  * Returns seconds passed since last fill
  * @param id Order ID
  * @return number of seconds
  */
  function getTimeElapsedSinceLastFill(uint id)
  public
  view
  returns (uint) {
    uint timeElapsed;

    if (fills[id].length > 0) {
      timeElapsed = block.timestamp - fills[id][fills[id].length - 1].timestamp;
    } else
      timeElapsed = block.timestamp - orders[id].created;

    return timeElapsed;
  }

  /**
  * Returns total SRC tokens received for an order
  * @param id Order ID
  * @return Total SRC tokens received for an order
  */
  function getSrcTokensSwappedForOrder(uint id)
  public
  view
  returns (uint) {
    require(orders[id].created != 0, "Invalid order");
    uint srcTokensSwapped = 0;
    for (uint i = 0; i < fills[id].length; i++) 
      srcTokensSwapped += fills[id][i].srcTokensSwapped;
    return srcTokensSwapped;
  }

  /**
  * Returns total number of ticks filled of a certain order
  * @param id Order ID
  * @return number of ticks filled
  */
  function getTicksFilled(uint id)
  public
  view
  returns (uint) {
    require(orders[id].created != 0, "Invalid order");
    uint ticksFilled = 0;
    for (uint i = 0; i < fills[id].length; i++)
      ticksFilled += fills[id][i].ticksFilled;
    return ticksFilled;
  }

  /**
  * Get the number of ticks that is possible to fill
  * @param id Order ID
  * @return number of ticks that can be filled
  */
  function getTicksToFill(uint id)
  public view
  returns (uint) {
    uint timeElapsed = getTimeElapsedSinceLastFill(id);

    uint ticksToFill = timeElapsed / orders[id].interval;
    uint ticksFilled = getTicksFilled(id);
    uint maxTicksFillable = (orders[id].total / orders[id].tickSize) - ticksFilled;

    if (ticksToFill >= maxTicksFillable) return maxTicksFillable;
    else return ticksToFill;
  }

  /**
  * Get the required amount of token that is possible to swap
  * @param id Order ID
  * @return amount of srcToken that can be swapped
  */
  function getSrcTokensToSwap(uint id)
  public view
  returns (uint) {
    return getTicksToFill(id) * orders[id].tickSize;
  }

  /**
  * Returns whether an order is active
  * @param id Order ID
  * @return Whether order is active
  */
  function isOrderActive(uint id) 
  public
  view
  returns (bool) {
    return orders[id].created != 0 && 
      !orders[id].killed && 
      getSrcTokensSwappedForOrder(id) < orders[id].total;
  }

  function addOracle(address token, Oracle memory oracle)
  public
  onlyOwner
  {
    // This is required to make it impossible to exploit 1inch params even for contract owner
    require(oracles[token].oracleAddress == address(0), "Oracles cannot be updated");

    oracles[token] = oracle;
  }

  function toggleWhitelist(bool value)
  public
  onlyOwner
  {
    isWhitelistActive = value;
  }

  function addToWhitelist(address authorized)
  public
  onlyOwner
  {
    whitelist[authorized] = true;
  }

  function removeFromWhitelist(address authorized)
  public
  onlyOwner
  {
    whitelist[authorized] = false;
  }
}

File 2 of 12 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 3 of 12 : 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 4 of 12 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 5 of 12 : I1inchAggregationRouterV4.sol
// SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;

interface I1inchAggregationRouterV4 {
  struct SwapDescription {
    address srcToken;
    address dstToken;
    address srcReceiver;
    address dstReceiver;
    uint256 amount;
    uint256 minReturnAmount;
    uint256 flags;
    bytes permit;
  }

  event OrderFilledRFQ(bytes32 orderHash,uint256 makingAmount) ;

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

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

  function DOMAIN_SEPARATOR() external view returns (bytes32) ;

  function LIMIT_ORDER_RFQ_TYPEHASH() external view returns (bytes32) ;

  function cancelOrderRFQ(uint256 orderInfo) external;

  function destroy() external;

  function fillOrderRFQ(LimitOrderProtocolRFQ.OrderRFQ memory order,bytes memory signature,uint256 makingAmount,uint256 takingAmount) external payable returns (uint256 , uint256) ;

  function fillOrderRFQTo(LimitOrderProtocolRFQ.OrderRFQ memory order,bytes memory signature,uint256 makingAmount,uint256 takingAmount,address target) external payable returns (uint256 , uint256) ;

  function fillOrderRFQToWithPermit(LimitOrderProtocolRFQ.OrderRFQ memory order,bytes memory signature,uint256 makingAmount,uint256 takingAmount,address target,bytes memory permit) external  returns (uint256 , uint256) ;

  function invalidatorForOrderRFQ(address maker,uint256 slot) external view returns (uint256) ;

  function owner() external view returns (address) ;

  function renounceOwnership() external;

  function rescueFunds(address token,uint256 amount) external;

  function swap(address caller,SwapDescription memory desc,bytes memory data) external payable returns (uint256 returnAmount, uint256 gasLeft);

  function transferOwnership(address newOwner) external;

  function uniswapV3Swap(uint256 amount,uint256 minReturn,uint256[] memory pools) external payable returns (uint256 returnAmount) ;

  function uniswapV3SwapCallback(int256 amount0Delta,int256 amount1Delta,bytes memory ) external;

  function uniswapV3SwapTo(address recipient,uint256 amount,uint256 minReturn,uint256[] memory pools) external payable returns (uint256 returnAmount) ;

  function uniswapV3SwapToWithPermit(address recipient,address srcToken,uint256 amount,uint256 minReturn,uint256[] memory pools,bytes memory permit) external  returns (uint256 returnAmount) ;

  function unoswap(address srcToken,uint256 amount,uint256 minReturn,bytes32[] memory pools) external payable returns (uint256 returnAmount) ;

  function unoswapWithPermit(address srcToken,uint256 amount,uint256 minReturn,bytes32[] memory pools,bytes memory permit) external  returns (uint256 returnAmount) ;

  receive () external payable;
}

interface LimitOrderProtocolRFQ {
  struct OrderRFQ {
    uint256 info;
    address makerAsset;
    address takerAsset;
    address maker;
    address allowedSender;
    uint256 makingAmount;
    uint256 takingAmount;
  }
}

File 6 of 12 : IChainlinkOracle.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity >=0.7.0 <0.9.0;

interface IChainlinkOracle {
    function latestAnswer() external view returns (int256);
}

File 7 of 12 : ICustomPriceOracle.sol
// SPDX-License-Identifier: Unlicensed

pragma solidity >=0.7.0 <0.9.0;

interface ICustomPriceOracle {
    function getPriceInUSD() external returns (uint256);
}

File 8 of 12 : IWETH9.sol
// SPDX-License-Identifier: Apache-2.0

pragma solidity >=0.7.0 <0.9.0;

interface IWETH9 {
    function deposit() external payable;
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the decimals.
     */
    function decimals() external view returns (uint256);

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

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

File 10 of 12 : ISafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./IAddress.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 ISafeERC20 {
    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 11 of 12 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 12 of 12 : IAddress.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0)

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"_aggregationRouterV4Address","type":"address"},{"internalType":"address payable","name":"_wethAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fillIndex","type":"uint256"}],"name":"LogNewFill","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"LogNewOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"LogOrderKilled","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":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"components":[{"internalType":"address","name":"oracleAddress","type":"address"},{"internalType":"bool","name":"isChainlink","type":"bool"}],"internalType":"struct TZWAP.Oracle","name":"oracle","type":"tuple"}],"name":"addOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"authorized","type":"address"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"aggregationRouterV4","outputs":[{"internalType":"contract I1inchAggregationRouterV4","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"swapType","type":"uint256"},{"components":[{"internalType":"address","name":"caller","type":"address"},{"components":[{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"address","name":"srcReceiver","type":"address"},{"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 I1inchAggregationRouterV4.SwapDescription","name":"desc","type":"tuple"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct TZWAP.swapParams","name":"_swapParams","type":"tuple"},{"components":[{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturn","type":"uint256"},{"internalType":"bytes32[]","name":"pools","type":"bytes32[]"}],"internalType":"struct TZWAP.unoswapParams","name":"_unoswapParams","type":"tuple"},{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"minReturn","type":"uint256"},{"internalType":"uint256[]","name":"pools","type":"uint256[]"}],"internalType":"struct TZWAP.uniswapV3Params","name":"_uniswapV3Params","type":"tuple"}],"name":"fillOrder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"fills","outputs":[{"internalType":"address","name":"filler","type":"address"},{"internalType":"uint256","name":"ticksFilled","type":"uint256"},{"internalType":"uint256","name":"srcTokensSwapped","type":"uint256"},{"internalType":"uint256","name":"dstTokensReceived","type":"uint256"},{"internalType":"uint256","name":"fees","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getDstTokensReceivedForOrder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getSrcTokensSwappedForOrder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getSrcTokensToSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getTicksFilled","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getTicksToFill","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getTimeElapsedSinceLastFill","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"isOrderActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWhitelistActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"killOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minNumOfIntervals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"interval","type":"uint256"},{"internalType":"uint256","name":"tickSize","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"minFees","type":"uint256"},{"internalType":"uint256","name":"maxFees","type":"uint256"},{"internalType":"uint256","name":"created","type":"uint256"},{"internalType":"bool","name":"killed","type":"bool"}],"internalType":"struct TZWAP.TWAPOrder","name":"order","type":"tuple"}],"name":"newOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"oracles","outputs":[{"internalType":"address","name":"oracleAddress","type":"address"},{"internalType":"bool","name":"isChainlink","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"orderCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"orders","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"interval","type":"uint256"},{"internalType":"uint256","name":"tickSize","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"minFees","type":"uint256"},{"internalType":"uint256","name":"maxFees","type":"uint256"},{"internalType":"uint256","name":"created","type":"uint256"},{"internalType":"bool","name":"killed","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"percentagePrecision","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"authorized","type":"address"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"toggleWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userOrders","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052603c6003556003600455620186a06005553480156200002257600080fd5b50604051620060193803806200601983398181016040528101906200004891906200020a565b620000686200005c6200012760201b60201c565b6200012f60201b60201c565b60008060146101000a81548160ff02191690831515021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600c60006101000a81548160ff0219169083151502179055505050620002a4565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008151905062000204816200028a565b92915050565b6000806040838503121562000224576200022362000285565b5b60006200023485828601620001f3565b92505060206200024785828601620001f3565b9150509250929050565b60006200025e8262000265565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600080fd5b620002958162000251565b8114620002a157600080fd5b50565b615d6580620002b46000396000f3fe6080604052600436106101d15760003560e01c806372fac185116100f75780639b19251a11610095578063d6e4358511610064578063d6e435851461070d578063e43252d71461074a578063e5c59acc14610773578063f2fde38b146107b0576101d8565b80639b19251a1461061c578063a85c38ef14610659578063addd50991461069f578063c8811424146106dd576101d8565b8063856652e9116100d1578063856652e9146105605780638ab1d6811461059d5780638da5cb5b146105c65780639a98d723146105f1576101d8565b806372fac185146104b85780637dca72b7146104f557806380e3f1ad14610537576101d8565b80633fb19a531161016f578063629859541161013e57806362985954146103fe57806365c619a0146104275780637014758014610464578063715018a6146104a1576101d8565b80633fb19a53146103525780633fc8cef31461037d578063524513d6146103a85780635c975abb146103d3576101d8565b80632abaa90d116101ab5780632abaa90d146102705780632f70aba6146102ad5780633401e168146102ea5780633aa1fba014610315576101d8565b806310cab287146101dd578063189523831461021a5780632453ffa814610245576101d8565b366101d857005b600080fd5b3480156101e957600080fd5b5061020460048036038101906101ff9190614214565b6107d9565b6040516102119190615008565b60405180910390f35b34801561022657600080fd5b5061022f61080c565b60405161023c9190615008565b60405180910390f35b34801561025157600080fd5b5061025a610812565b6040516102679190615008565b60405180910390f35b34801561027c57600080fd5b5061029760048036038101906102929190614214565b610818565b6040516102a49190615008565b60405180910390f35b3480156102b957600080fd5b506102d460048036038101906102cf91906142ee565b6108d3565b6040516102e19190615008565b60405180910390f35b3480156102f657600080fd5b506102ff610d17565b60405161030c9190614c90565b60405180910390f35b34801561032157600080fd5b5061033c60048036038101906103379190614214565b610d3d565b6040516103499190615008565b60405180910390f35b34801561035e57600080fd5b50610367610de5565b6040516103749190615008565b60405180910390f35b34801561038957600080fd5b50610392610deb565b60405161039f9190614cab565b60405180910390f35b3480156103b457600080fd5b506103bd610e11565b6040516103ca9190614c75565b60405180910390f35b3480156103df57600080fd5b506103e8610e24565b6040516103f59190614c75565b60405180910390f35b34801561040a57600080fd5b50610425600480360381019061042091906140df565b610e3a565b005b34801561043357600080fd5b5061044e60048036038101906104499190614214565b611035565b60405161045b9190614c75565b60405180910390f35b34801561047057600080fd5b5061048b60048036038101906104869190614214565b6112b6565b6040516104989190615008565b60405180910390f35b3480156104ad57600080fd5b506104b6611394565b005b3480156104c457600080fd5b506104df60048036038101906104da9190614214565b61141c565b6040516104ec9190615008565b60405180910390f35b34801561050157600080fd5b5061051c6004803603810190610517919061426e565b6114fa565b60405161052e96959493929190614c14565b60405180910390f35b34801561054357600080fd5b5061055e6004803603810190610559919061415f565b611573565b005b34801561056c57600080fd5b506105876004803603810190610582919061411f565b61160c565b6040516105949190615008565b60405180910390f35b3480156105a957600080fd5b506105c460048036038101906105bf91906140b2565b61163d565b005b3480156105d257600080fd5b506105db611714565b6040516105e89190614a16565b60405180910390f35b3480156105fd57600080fd5b5061060661173d565b6040516106139190615008565b60405180910390f35b34801561062857600080fd5b50610643600480360381019061063e91906140b2565b611743565b6040516106509190614c75565b60405180910390f35b34801561066557600080fd5b50610680600480360381019061067b9190614214565b611763565b6040516106969a99989796959493929190614a5a565b60405180910390f35b3480156106ab57600080fd5b506106c660048036038101906106c191906140b2565b611824565b6040516106d4929190614b2d565b60405180910390f35b6106f760048036038101906106f291906141e6565b611875565b6040516107049190614c75565b60405180910390f35b34801561071957600080fd5b50610734600480360381019061072f9190614214565b6120f8565b6040516107419190614c75565b60405180910390f35b34801561075657600080fd5b50610771600480360381019061076c91906140b2565b612171565b005b34801561077f57600080fd5b5061079a60048036038101906107959190614214565b612248565b6040516107a79190615008565b60405180910390f35b3480156107bc57600080fd5b506107d760048036038101906107d291906140b2565b612326565b005b600060076000838152602001908152602001600020600401546107fb83610d3d565b6108059190615502565b9050919050565b60055481565b60065481565b6000806000600960008581526020019081526020016000208054905011156108a5576009600084815260200190815260200160002060016009600086815260200190815260200160002080549050610870919061555c565b8154811061088157610880615787565b5b9060005260206000209060060201600501544261089e919061555c565b90506108ca565b6007600084815260200190815260200160002060080154426108c7919061555c565b90505b80915050919050565b60006108dd610e24565b1561091d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091490614e08565b60405180910390fd5b600c60009054906101000a900460ff16156109c65760011515600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146109c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bc90614e88565b60405180910390fd5b5b600060076000888152602001908152602001600020600801541415610a20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1790614f48565b60405180910390fd5b6007600087815260200190815260200160002060090160009054906101000a900460ff1615610a84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7b90614d48565b60405180910390fd5b6007600087815260200190815260200160002060050154610aa48761141c565b10610ae4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610adb90614f68565b60405180910390fd5b6000610aef87610d3d565b905060008111610b34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2b90614d88565b60405180910390fd5b6000610b3f88610818565b9050600960008981526020019081526020016000206040518060c001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200184815260200160008152602001600081526020016000815260200142815250908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155606082015181600301556080820151816004015560a082015181600501555050610c4c88838989898961241e565b610c568882612c53565b7f1f91c68e5e487ae44284d7bb543bb2b2a08ab9eeedcaacfdbb05d139d2cbc476886001600960008c815260200190815260200160002080549050610c9b919061555c565b604051610ca9929190615023565b60405180910390a1600960008981526020019081526020016000206001600960008b815260200190815260200160002080549050610ce7919061555c565b81548110610cf857610cf7615787565b5b9060005260206000209060060201600401549250505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080610d4983610818565b90506000600760008581526020019081526020016000206003015482610d6f9190615360565b90506000610d7c85612248565b905060008160076000888152602001908152602001600020600401546007600089815260200190815260200160002060050154610db99190615360565b610dc3919061555c565b9050808310610dd85780945050505050610de0565b829450505050505b919050565b60035481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c60009054906101000a900460ff1681565b60008060149054906101000a900460ff16905090565b610e42613126565b73ffffffffffffffffffffffffffffffffffffffff16610e60611714565b73ffffffffffffffffffffffffffffffffffffffff1614610eb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ead90614ec8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7e90614f08565b60405180910390fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a81548160ff0219169083151502179055509050505050565b600061103f610e24565b1561107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107690614e08565b60405180910390fd5b6007600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111a90614e28565b60405180910390fd5b6007600083815260200190815260200160002060090160009054906101000a900460ff1615611187576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117e90614f28565b60405180910390fd5b60016007600084815260200190815260200160002060090160006101000a81548160ff0219169083151502179055506112766007600084815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166111f98461141c565b600760008681526020019081526020016000206005015461121a919061555c565b6007600086815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661312e9092919063ffffffff16565b7f385de1741c5fb03f2ddd3eaec93f254b96de98c5dfc112e95989dde06ed5c2d6826040516112a59190615008565b60405180910390a160019050919050565b60008060076000848152602001908152602001600020600801541415611311576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130890614f48565b60405180910390fd5b6000805b600960008581526020019081526020016000208054905081101561138a5760096000858152602001908152602001600020818154811061135857611357615787565b5b90600052602060002090600602016003015482611375919061530a565b91508080611382906156af565b915050611315565b5080915050919050565b61139c613126565b73ffffffffffffffffffffffffffffffffffffffff166113ba611714565b73ffffffffffffffffffffffffffffffffffffffff1614611410576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140790614ec8565b60405180910390fd5b61141a60006131b4565b565b60008060076000848152602001908152602001600020600801541415611477576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146e90614f48565b60405180910390fd5b6000805b60096000858152602001908152602001600020805490508110156114f0576009600085815260200190815260200160002081815481106114be576114bd615787565b5b906000526020600020906006020160020154826114db919061530a565b915080806114e8906156af565b91505061147b565b5080915050919050565b6009602052816000526040600020818154811061151657600080fd5b9060005260206000209060060201600091509150508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060050154905086565b61157b613126565b73ffffffffffffffffffffffffffffffffffffffff16611599611714565b73ffffffffffffffffffffffffffffffffffffffff16146115ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e690614ec8565b60405180910390fd5b80600c60006101000a81548160ff02191690831515021790555050565b6008602052816000526040600020818154811061162857600080fd5b90600052602060002001600091509150505481565b611645613126565b73ffffffffffffffffffffffffffffffffffffffff16611663611714565b73ffffffffffffffffffffffffffffffffffffffff16146116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090614ec8565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60045481565b600b6020528060005260406000206000915054906101000a900460ff1681565b60076020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030154908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900460ff1690508a565b600a6020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900460ff16905082565b600061187f610e24565b156118bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b690614e08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff161415611933576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192a90614ce8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16826040015173ffffffffffffffffffffffffffffffffffffffff1614156119a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199e90614e68565b60405180910390fd5b600354826060015110156119f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e790614ee8565b60405180910390fd5b6000826080015111611a37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2e90614ea8565b60405180910390fd5b81608001518260a00151118015611a615750600082608001518360a00151611a5f91906156f8565b145b611aa0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9790614e48565b60405180910390fd5b60045482608001518360a00151611ab79190615360565b11611af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aee90614fe8565b60405180910390fd5b33826000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050428261010001818152505060008261012001901515908115158152505073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff16826020015173ffffffffffffffffffffffffffffffffffffffff161415611cc0578160a001513414611bde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd590614fa8565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b158015611c4857600080fd5b505af1158015611c5c573d6000803e3d6000fd5b5050505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d61565b816020015173ffffffffffffffffffffffffffffffffffffffff166323b872dd33308560a001516040518463ffffffff1660e01b8152600401611d0593929190614af6565b602060405180830381600087803b158015611d1f57600080fd5b505af1158015611d33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d57919061418c565b611d6057600080fd5b5b600073ffffffffffffffffffffffffffffffffffffffff16600a6000846020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015611e975750600073ffffffffffffffffffffffffffffffffffffffff16600a6000846040015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b611ed6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ecd90614de8565b60405180910390fd5b816007600060066000815480929190611eee906156af565b91905055815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e0820151816007015561010082015181600801556101208201518160090160006101000a81548160ff021916908315150217905550905050600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600654612084919061555c565b90806001815401808255809150506001900390600052602060002001600090919091909150557fea4cfac72390cc8468db408bfef1590948a245bb7335778497567d7b87cf09cb60016006546120da919061555c565b6040516120e79190615008565b60405180910390a160019050919050565b60008060076000848152602001908152602001600020600801541415801561214157506007600083815260200190815260200160002060090160009054906101000a900460ff16155b801561216a575060076000838152602001908152602001600020600501546121688361141c565b105b9050919050565b612179613126565b73ffffffffffffffffffffffffffffffffffffffff16612197611714565b73ffffffffffffffffffffffffffffffffffffffff16146121ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e490614ec8565b60405180910390fd5b6001600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080600760008481526020019081526020016000206008015414156122a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229a90614f48565b60405180910390fd5b6000805b600960008581526020019081526020016000208054905081101561231c576009600085815260200190815260200160002081815481106122ea576122e9615787565b5b90600052602060002090600602016001015482612307919061530a565b91508080612314906156af565b9150506122a7565b5080915050919050565b61232e613126565b73ffffffffffffffffffffffffffffffffffffffff1661234c611714565b73ffffffffffffffffffffffffffffffffffffffff16146123a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239990614ec8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612412576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161240990614d28565b60405180910390fd5b61241b816131b4565b50565b60006007600088815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161248f9190614a16565b60206040518083038186803b1580156124a757600080fd5b505afa1580156124bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124df9190614241565b905060006007600089815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016125529190614a16565b60206040518083038186803b15801561256a57600080fd5b505afa15801561257e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a29190614241565b90506000600760008a815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401612639929190614a31565b60206040518083038186803b15801561265157600080fd5b505afa158015612665573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126899190614241565b141561273357612732600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600760008c815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166132789092919063ffffffff16565b5b600086141561282457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637c02520086600001602081019061278d91906140b2565b87806020019061279d91906151b5565b8880604001906127ad9190615152565b6040518563ffffffff1660e01b81526004016127cc9493929190614b56565b6040805180830381600087803b1580156127e557600080fd5b505af11580156127f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061281d91906142ae565b50506129dc565b600186141561291057600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e95b6c885600001602081019061287e91906140b2565b86602001358760400135888060600190612898919061508c565b6040518663ffffffff1660e01b81526004016128b8959493929190614bc6565b602060405180830381600087803b1580156128d257600080fd5b505af11580156128e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290a9190614241565b506129db565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e449022e8460000135856020013586806040019061296891906150ef565b6040518563ffffffff1660e01b8152600401612987949392919061504c565b602060405180830381600087803b1580156129a157600080fd5b505af11580156129b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129d99190614241565b505b5b6000600760008a815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612a4d9190614a16565b60206040518083038186803b158015612a6557600080fd5b505afa158015612a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a9d9190614241565b83612aa8919061555c565b9050600082600760008c815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401612b1c9190614a16565b60206040518083038186803b158015612b3457600080fd5b505afa158015612b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6c9190614241565b612b76919061555c565b9050612b838a8383613399565b600760008b81526020019081526020016000206004015489612ba59190615502565b8214612be6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bdd90614d68565b60405180910390fd5b600760008b815260200190815260200160002060050154612c068b61141c565b1115612c47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c3e90614dc8565b60405180910390fd5b50505050505050505050565b6000600160096000858152602001908152602001600020805490501115612c9d57600760008481526020019081526020016000206003015482612c96919061555c565b9050612ca1565b8190505b600060055460076000868152602001908152602001600020600601546009600087815260200190815260200160002060016009600089815260200190815260200160002080549050612cf3919061555c565b81548110612d0457612d03615787565b5b906000526020600020906006020160010154600960008881526020019081526020016000206001600960008a815260200190815260200160002080549050612d4c919061555c565b81548110612d5d57612d5c615787565b5b906000526020600020906006020160030154612d799190615360565b612d839190615502565b612d8d9190615360565b905060006005546007600087815260200190815260200160002060070154600960008881526020019081526020016000206001600960008a815260200190815260200160002080549050612de1919061555c565b81548110612df257612df1615787565b5b906000526020600020906006020160010154600960008981526020019081526020016000206001600960008b815260200190815260200160002080549050612e3a919061555c565b81548110612e4b57612e4a615787565b5b906000526020600020906006020160030154612e679190615360565b612e719190615502565b612e7b9190615360565b9050612eb8816103e8600686612e919190615360565b6103e8612e9e919061530a565b612ea89190615360565b84612eb39190615502565b613bfb565b6009600087815260200190815260200160002060016009600089815260200190815260200160002080549050612eee919061555c565b81548110612eff57612efe615787565b5b906000526020600020906006020160040181905550612fcd33600960008881526020019081526020016000206001600960008a815260200190815260200160002080549050612f4e919061555c565b81548110612f5f57612f5e615787565b5b9060005260206000209060060201600401546007600089815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661312e9092919063ffffffff16565b61311f6007600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600960008881526020019081526020016000206001600960008a81526020019081526020016000208054905061303d919061555c565b8154811061304e5761304d615787565b5b906000526020600020906006020160040154600960008981526020019081526020016000206001600960008b815260200190815260200160002080549050613096919061555c565b815481106130a7576130a6615787565b5b9060005260206000209060060201600301546130c3919061555c565b6007600089815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661312e9092919063ffffffff16565b5050505050565b600033905090565b6131af8363a9059cbb60e01b848460405160240161314d929190614b9d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613c14565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000818473ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30866040518363ffffffff1660e01b81526004016132b6929190614a31565b60206040518083038186803b1580156132ce57600080fd5b505afa1580156132e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133069190614241565b613310919061530a565b90506133938463095ea7b360e01b8584604051602401613331929190614b9d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613c14565b50505050565b600080600a60006007600088815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a900460ff161561354457600a60006007600088815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561350557600080fd5b505afa158015613519573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061353d91906141b9565b915061365f565b600a60006007600088815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e1aa60366040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561362457600080fd5b505af1158015613638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365c9190614241565b91505b600a60006007600088815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160149054906101000a900460ff161561380757600a60006007600088815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156137c857600080fd5b505afa1580156137dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061380091906141b9565b9050613922565b600a60006007600088815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e1aa60366040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156138e757600080fd5b505af11580156138fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061391f9190614241565b90505b60006007600087815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156139a057600080fd5b505afa1580156139b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139d89190614241565b905060006007600088815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015613a5857600080fd5b505afa158015613a6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613a909190614241565b9050600082600a613aa191906153e4565b846103e8613aaf9190615502565b613ab99190615502565b82600a613ac691906153e4565b8689610384613ad59190615502565b613adf9190615502565b613ae99190615502565b613af39190615360565b9050808611613b37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b2e90614d08565b60405180910390fd5b86600960008a81526020019081526020016000206001600960008c815260200190815260200160002080549050613b6e919061555c565b81548110613b7f57613b7e615787565b5b90600052602060002090600602016002018190555085600960008a81526020019081526020016000206001600960008c815260200190815260200160002080549050613bcb919061555c565b81548110613bdc57613bdb615787565b5b9060005260206000209060060201600301819055505050505050505050565b6000818310613c0a5781613c0c565b825b905092915050565b6000613c76826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613cdb9092919063ffffffff16565b9050600081511115613cd65780806020019051810190613c96919061418c565b613cd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ccc90614fc8565b60405180910390fd5b5b505050565b6060613cea8484600085613cf3565b90509392505050565b606082471015613d38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d2f90614da8565b60405180910390fd5b613d4185613e07565b613d80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613d7790614f88565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613da991906149ff565b60006040518083038185875af1925050503d8060008114613de6576040519150601f19603f3d011682016040523d82523d6000602084013e613deb565b606091505b5091509150613dfb828286613e2a565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60608315613e3a57829050613e8a565b600083511115613e4d5782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613e819190614cc6565b60405180910390fd5b9392505050565b600081359050613ea081615cd3565b92915050565b600081359050613eb581615cea565b92915050565b600081519050613eca81615cea565b92915050565b600081519050613edf81615d01565b92915050565b600060408284031215613efb57613efa6157f4565b5b613f0560406151de565b90506000613f1584828501613e91565b6000830152506020613f2984828501613ea6565b60208301525092915050565b60006101408284031215613f4c57613f4b6157f4565b5b613f576101406151de565b90506000613f6784828501613e91565b6000830152506020613f7b84828501613e91565b6020830152506040613f8f84828501613e91565b6040830152506060613fa384828501614088565b6060830152506080613fb784828501614088565b60808301525060a0613fcb84828501614088565b60a08301525060c0613fdf84828501614088565b60c08301525060e0613ff384828501614088565b60e08301525061010061400884828501614088565b6101008301525061012061401e84828501613ea6565b6101208301525092915050565b600060608284031215614041576140406157ef565b5b81905092915050565b6000606082840312156140605761405f6157ef565b5b81905092915050565b60006080828403121561407f5761407e6157ef565b5b81905092915050565b60008135905061409781615d18565b92915050565b6000815190506140ac81615d18565b92915050565b6000602082840312156140c8576140c7615817565b5b60006140d684828501613e91565b91505092915050565b600080606083850312156140f6576140f5615817565b5b600061410485828601613e91565b925050602061411585828601613ee5565b9150509250929050565b6000806040838503121561413657614135615817565b5b600061414485828601613e91565b925050602061415585828601614088565b9150509250929050565b60006020828403121561417557614174615817565b5b600061418384828501613ea6565b91505092915050565b6000602082840312156141a2576141a1615817565b5b60006141b084828501613ebb565b91505092915050565b6000602082840312156141cf576141ce615817565b5b60006141dd84828501613ed0565b91505092915050565b600061014082840312156141fd576141fc615817565b5b600061420b84828501613f35565b91505092915050565b60006020828403121561422a57614229615817565b5b600061423884828501614088565b91505092915050565b60006020828403121561425757614256615817565b5b60006142658482850161409d565b91505092915050565b6000806040838503121561428557614284615817565b5b600061429385828601614088565b92505060206142a485828601614088565b9150509250929050565b600080604083850312156142c5576142c4615817565b5b60006142d38582860161409d565b92505060206142e48582860161409d565b9150509250929050565b600080600080600060a0868803121561430a57614309615817565b5b600061431888828901614088565b955050602061432988828901614088565b945050604086013567ffffffffffffffff81111561434a57614349615808565b5b6143568882890161402b565b935050606086013567ffffffffffffffff81111561437757614376615808565b5b61438388828901614069565b925050608086013567ffffffffffffffff8111156143a4576143a3615808565b5b6143b08882890161404a565b9150509295509295909350565b6143c681615590565b82525050565b6143d581615590565b82525050565b60006143e78385615219565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561441a5761441961580d565b5b60208302925061442b83858461563c565b82840190509392505050565b6000614443838561522a565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156144765761447561580d565b5b60208302925061448783858461563c565b82840190509392505050565b61449c816155a2565b82525050565b60006144ae838561523b565b93506144bb83858461563c565b6144c48361581c565b840190509392505050565b60006144db838561524c565b93506144e883858461563c565b6144f18361581c565b840190509392505050565b600061450782615203565b614511818561525d565b935061452181856020860161564b565b80840191505092915050565b614536816155e2565b82525050565b614545816155f4565b82525050565b60006145568261520e565b6145608185615268565b935061457081856020860161564b565b6145798161581c565b840191505092915050565b6000614591601883615268565b915061459c8261583a565b602082019050919050565b60006145b4601e83615268565b91506145bf82615863565b602082019050919050565b60006145d7602683615268565b91506145e28261588c565b604082019050919050565b60006145fa601083615268565b9150614605826158db565b602082019050919050565b600061461d600e83615268565b915061462882615904565b602082019050919050565b6000614640602383615268565b915061464b8261592d565b604082019050919050565b6000614663602683615268565b915061466e8261597c565b604082019050919050565b6000614686600a83615268565b9150614691826159cb565b602082019050919050565b60006146a9601183615268565b91506146b4826159f4565b602082019050919050565b60006146cc601083615268565b91506146d782615a1d565b602082019050919050565b60006146ef600e83615268565b91506146fa82615a46565b602082019050919050565b6000614712600d83615268565b915061471d82615a6f565b602082019050919050565b6000614735601883615268565b915061474082615a98565b602082019050919050565b6000614758600f83615268565b915061476382615ac1565b602082019050919050565b600061477b601083615268565b915061478682615aea565b602082019050919050565b600061479e602083615268565b91506147a982615b13565b602082019050919050565b60006147c1601083615268565b91506147cc82615b3c565b602082019050919050565b60006147e4601983615268565b91506147ef82615b65565b602082019050919050565b6000614807601483615268565b915061481282615b8e565b602082019050919050565b600061482a600d83615268565b915061483582615bb7565b602082019050919050565b600061484d601783615268565b915061485882615be0565b602082019050919050565b6000614870601d83615268565b915061487b82615c09565b602082019050919050565b6000614893601183615268565b915061489e82615c32565b602082019050919050565b60006148b6602a83615268565b91506148c182615c5b565b604082019050919050565b60006148d9601f83615268565b91506148e482615caa565b602082019050919050565b600061010083016149036000840184615279565b61491060008601826143bd565b5061491e6020840184615279565b61492b60208601826143bd565b506149396040840184615279565b61494660408601826143bd565b506149546060840184615279565b61496160608601826143bd565b5061496f60808401846152f3565b61497c60808601826149e1565b5061498a60a08401846152f3565b61499760a08601826149e1565b506149a560c08401846152f3565b6149b260c08601826149e1565b506149c060e0840184615290565b85830360e08701526149d38382846144a2565b925050508091505092915050565b6149ea816155d8565b82525050565b6149f9816155d8565b82525050565b6000614a0b82846144fc565b915081905092915050565b6000602082019050614a2b60008301846143cc565b92915050565b6000604082019050614a4660008301856143cc565b614a5360208301846143cc565b9392505050565b600061014082019050614a70600083018d6143cc565b614a7d602083018c6143cc565b614a8a604083018b6143cc565b614a97606083018a6149f0565b614aa460808301896149f0565b614ab160a08301886149f0565b614abe60c08301876149f0565b614acb60e08301866149f0565b614ad96101008301856149f0565b614ae7610120830184614493565b9b9a5050505050505050505050565b6000606082019050614b0b60008301866143cc565b614b1860208301856143cc565b614b2560408301846149f0565b949350505050565b6000604082019050614b4260008301856143cc565b614b4f6020830184614493565b9392505050565b6000606082019050614b6b60008301876143cc565b8181036020830152614b7d81866148ef565b90508181036040830152614b928184866144cf565b905095945050505050565b6000604082019050614bb260008301856143cc565b614bbf60208301846149f0565b9392505050565b6000608082019050614bdb60008301886143cc565b614be860208301876149f0565b614bf560408301866149f0565b8181036060830152614c088184866143db565b90509695505050505050565b600060c082019050614c2960008301896143cc565b614c3660208301886149f0565b614c4360408301876149f0565b614c5060608301866149f0565b614c5d60808301856149f0565b614c6a60a08301846149f0565b979650505050505050565b6000602082019050614c8a6000830184614493565b92915050565b6000602082019050614ca5600083018461452d565b92915050565b6000602082019050614cc0600083018461453c565b92915050565b60006020820190508181036000830152614ce0818461454b565b905092915050565b60006020820190508181036000830152614d0181614584565b9050919050565b60006020820190508181036000830152614d21816145a7565b9050919050565b60006020820190508181036000830152614d41816145ca565b9050919050565b60006020820190508181036000830152614d61816145ed565b9050919050565b60006020820190508181036000830152614d8181614610565b9050919050565b60006020820190508181036000830152614da181614633565b9050919050565b60006020820190508181036000830152614dc181614656565b9050919050565b60006020820190508181036000830152614de181614679565b9050919050565b60006020820190508181036000830152614e018161469c565b9050919050565b60006020820190508181036000830152614e21816146bf565b9050919050565b60006020820190508181036000830152614e41816146e2565b9050919050565b60006020820190508181036000830152614e6181614705565b9050919050565b60006020820190508181036000830152614e8181614728565b9050919050565b60006020820190508181036000830152614ea18161474b565b9050919050565b60006020820190508181036000830152614ec18161476e565b9050919050565b60006020820190508181036000830152614ee181614791565b9050919050565b60006020820190508181036000830152614f01816147b4565b9050919050565b60006020820190508181036000830152614f21816147d7565b9050919050565b60006020820190508181036000830152614f41816147fa565b9050919050565b60006020820190508181036000830152614f618161481d565b9050919050565b60006020820190508181036000830152614f8181614840565b9050919050565b60006020820190508181036000830152614fa181614863565b9050919050565b60006020820190508181036000830152614fc181614886565b9050919050565b60006020820190508181036000830152614fe1816148a9565b9050919050565b60006020820190508181036000830152615001816148cc565b9050919050565b600060208201905061501d60008301846149f0565b92915050565b600060408201905061503860008301856149f0565b61504560208301846149f0565b9392505050565b600060608201905061506160008301876149f0565b61506e60208301866149f0565b8181036040830152615081818486614437565b905095945050505050565b600080833560016020038436030381126150a9576150a86157f9565b5b80840192508235915067ffffffffffffffff8211156150cb576150ca6157ea565b5b6020830192506020820236038313156150e7576150e6615803565b5b509250929050565b6000808335600160200384360303811261510c5761510b6157f9565b5b80840192508235915067ffffffffffffffff82111561512e5761512d6157ea565b5b60208301925060208202360383131561514a57615149615803565b5b509250929050565b6000808335600160200384360303811261516f5761516e6157f9565b5b80840192508235915067ffffffffffffffff821115615191576151906157ea565b5b6020830192506001820236038313156151ad576151ac615803565b5b509250929050565b600082356001610100038336030381126151d2576151d16157f9565b5b80830191505092915050565b60006151e86151f9565b90506151f4828261567e565b919050565b6000604051905090565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b60006152886020840184613e91565b905092915050565b600080833560016020038436030381126152ad576152ac615812565b5b83810192508235915060208301925067ffffffffffffffff8211156152d5576152d46157e5565b5b6001820236038413156152eb576152ea6157fe565b5b509250929050565b60006153026020840184614088565b905092915050565b6000615315826155d8565b9150615320836155d8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561535557615354615729565b5b828201905092915050565b600061536b826155d8565b9150615376836155d8565b92508261538657615385615758565b5b828204905092915050565b6000808291508390505b60018511156153db578086048111156153b7576153b6615729565b5b60018516156153c65780820291505b80810290506153d48561582d565b945061539b565b94509492505050565b60006153ef826155d8565b91506153fa836155d8565b92506154277fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461542f565b905092915050565b60008261543f57600190506154fb565b8161544d57600090506154fb565b8160018114615463576002811461546d5761549c565b60019150506154fb565b60ff84111561547f5761547e615729565b5b8360020a91508482111561549657615495615729565b5b506154fb565b5060208310610133831016604e8410600b84101617156154d15782820a9050838111156154cc576154cb615729565b5b6154fb565b6154de8484846001615391565b925090508184048111156154f5576154f4615729565b5b81810290505b9392505050565b600061550d826155d8565b9150615518836155d8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561555157615550615729565b5b828202905092915050565b6000615567826155d8565b9150615572836155d8565b92508282101561558557615584615729565b5b828203905092915050565b600061559b826155b8565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006155ed82615618565b9050919050565b60006155ff82615606565b9050919050565b60006156118261562a565b9050919050565b60006156238261562a565b9050919050565b6000615635826155b8565b9050919050565b82818337600083830152505050565b60005b8381101561566957808201518184015260208101905061564e565b83811115615678576000848401525b50505050565b6156878261581c565b810181811067ffffffffffffffff821117156156a6576156a56157b6565b5b80604052505050565b60006156ba826155d8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156156ed576156ec615729565b5b600182019050919050565b6000615703826155d8565b915061570e836155d8565b92508261571e5761571d615758565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f496e76616c696420737263546f6b656e20616464726573730000000000000000600082015250565b7f546f6b656e7320726563656976656420617265206e6f7420656e6f7567680000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f7264657220776173206b696c6c656400000000000000000000000000000000600082015250565b7f496e76616c696420616d6f756e74000000000000000000000000000000000000600082015250565b7f496e74657276616c206d7573742070617373206265666f7265206e657874206660008201527f696c6c0000000000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f4f766572626f7567687400000000000000000000000000000000000000000000600082015250565b7f4f7261636c65206973206d697373696e67000000000000000000000000000000600082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f496e76616c69642073656e646572000000000000000000000000000000000000600082015250565b7f496e76616c696420746f74616c00000000000000000000000000000000000000600082015250565b7f496e76616c696420647374546f6b656e20616464726573730000000000000000600082015250565b7f4e6f742077686974656c69737465640000000000000000000000000000000000600082015250565b7f496e76616c6964207469636b53697a6500000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f496e76616c696420696e74657276616c00000000000000000000000000000000600082015250565b7f4f7261636c65732063616e6e6f74206265207570646174656400000000000000600082015250565b7f4f7264657220616c7265616479206b696c6c6564000000000000000000000000600082015250565b7f496e76616c6964206f7264657200000000000000000000000000000000000000600082015250565b7f4f7264657220697320616c72656164792066696c6c6564000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f496e76616c6964206d73672076616c7565000000000000000000000000000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f4e756d626572206f6620696e74657276616c7320697320746f6f206c65737300600082015250565b615cdc81615590565b8114615ce757600080fd5b50565b615cf3816155a2565b8114615cfe57600080fd5b50565b615d0a816155ae565b8114615d1557600080fd5b50565b615d21816155d8565b8114615d2c57600080fd5b5056fea264697066735822122019c227779d481a3e77bcfff5445775566f54a307341d0de13e532f5f7cd5750f64736f6c634300080700330000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

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

0000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _aggregationRouterV4Address (address): 0x1111111254fb6c44bac0bed2854e76f90643097d
Arg [1] : _wethAddress (address): 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000001111111254fb6c44bac0bed2854e76f90643097d
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


Block Transaction Difficulty Gas Used Reward
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.

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