ETH Price: $3,237.50 (+2.10%)
Gas: 1 Gwei

Contract

0x3b6f1FE07CDAB8A43f39C3b99Ba8FF26e28DB8b4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Migrate201703772024-06-25 18:06:1130 days ago1719338771IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.006575916.61014163
Migrate199505432024-05-26 0:43:1161 days ago1716684191IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.002357613.04499543
Migrate195580722024-04-01 2:37:59116 days ago1711939079IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0184161417.04780548
Migrate195188342024-03-26 13:12:47121 days ago1711458767IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.024867740.32899486
Migrate192985652024-02-24 16:13:47152 days ago1708791227IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0269889331.71530906
Migrate191385352024-02-02 5:07:35175 days ago1706850455IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.011993619.5525941
Migrate190510672024-01-20 22:30:35187 days ago1705789835IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0139094120.48080727
Migrate190346142024-01-18 15:22:59189 days ago1705591379IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0315044935.59596541
Migrate189666892024-01-09 3:17:47199 days ago1704770267IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0160581515.67284179
Migrate189666692024-01-09 3:13:47199 days ago1704770027IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0106140915.07056484
Migrate188873652023-12-28 23:25:59210 days ago1703805959IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0105161916.33375671
Migrate188787862023-12-27 18:30:23211 days ago1703701823IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.020848733.49996481
Migrate188607872023-12-25 5:50:47214 days ago1703483447IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0081542812.68401201
Migrate188458372023-12-23 3:27:11216 days ago1703302031IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0371704424.40874362
Migrate187567172023-12-10 15:30:47228 days ago1702222247IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0274392125.0101769
Migrate187415602023-12-08 12:32:11230 days ago1702038731IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0297944438.63678477
Migrate187046242023-12-03 8:17:47236 days ago1701591467IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0169692327.67369628
Migrate185876892023-11-16 23:21:23252 days ago1700176883IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0371904231.5685398
Migrate185829682023-11-16 7:31:11253 days ago1700119871IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0242830127.11571488
Migrate185679222023-11-14 5:01:59255 days ago1699938119IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0124399421.19176282
Migrate185483052023-11-11 11:10:59258 days ago1699701059IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0120265319.6030855
Migrate185235382023-11-08 0:03:11261 days ago1699401791IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0431957526.07250461
Migrate184990612023-11-04 13:47:23264 days ago1699105643IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0116148718.66220749
Migrate184694712023-10-31 10:19:23269 days ago1698747563IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.014790616.46352487
Migrate184662352023-10-30 23:25:35269 days ago1698708335IN
0x3b6f1FE0...6e28DB8b4
0 ETH0.0292423332.65355505
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
201703772024-06-25 18:06:1130 days ago1719338771
0x3b6f1FE0...6e28DB8b4
135.95561212 ETH
201703772024-06-25 18:06:1130 days ago1719338771
0x3b6f1FE0...6e28DB8b4
135.95561212 ETH
195188342024-03-26 13:12:47121 days ago1711458767
0x3b6f1FE0...6e28DB8b4
78.15860684 ETH
195188342024-03-26 13:12:47121 days ago1711458767
0x3b6f1FE0...6e28DB8b4
78.15860684 ETH
192985652024-02-24 16:13:47152 days ago1708791227
0x3b6f1FE0...6e28DB8b4
149.17960071 ETH
192985652024-02-24 16:13:47152 days ago1708791227
0x3b6f1FE0...6e28DB8b4
149.17960071 ETH
191385352024-02-02 5:07:35175 days ago1706850455
0x3b6f1FE0...6e28DB8b4
65.57580874 ETH
191385352024-02-02 5:07:35175 days ago1706850455
0x3b6f1FE0...6e28DB8b4
65.57580874 ETH
190510672024-01-20 22:30:35187 days ago1705789835
0x3b6f1FE0...6e28DB8b4
0.09699999 ETH
190510672024-01-20 22:30:35187 days ago1705789835
0x3b6f1FE0...6e28DB8b4
0.09699999 ETH
190346142024-01-18 15:22:59189 days ago1705591379
0x3b6f1FE0...6e28DB8b4
7.0001701 ETH
190346142024-01-18 15:22:59189 days ago1705591379
0x3b6f1FE0...6e28DB8b4
7.0001701 ETH
188787862023-12-27 18:30:23211 days ago1703701823
0x3b6f1FE0...6e28DB8b4
0.30027239 ETH
188787862023-12-27 18:30:23211 days ago1703701823
0x3b6f1FE0...6e28DB8b4
0.30027239 ETH
188458372023-12-23 3:27:11216 days ago1703302031
0x3b6f1FE0...6e28DB8b4
36.10771227 ETH
188458372023-12-23 3:27:11216 days ago1703302031
0x3b6f1FE0...6e28DB8b4
36.10771227 ETH
187567172023-12-10 15:30:47228 days ago1702222247
0x3b6f1FE0...6e28DB8b4
1.97255178 ETH
187567172023-12-10 15:30:47228 days ago1702222247
0x3b6f1FE0...6e28DB8b4
1.97255178 ETH
187415602023-12-08 12:32:11230 days ago1702038731
0x3b6f1FE0...6e28DB8b4
15.00820431 ETH
187415602023-12-08 12:32:11230 days ago1702038731
0x3b6f1FE0...6e28DB8b4
15.00820431 ETH
187046242023-12-03 8:17:47236 days ago1701591467
0x3b6f1FE0...6e28DB8b4
39.72512165 ETH
187046242023-12-03 8:17:47236 days ago1701591467
0x3b6f1FE0...6e28DB8b4
39.72512165 ETH
185876892023-11-16 23:21:23252 days ago1700176883
0x3b6f1FE0...6e28DB8b4
439.64550016 ETH
185876892023-11-16 23:21:23252 days ago1700176883
0x3b6f1FE0...6e28DB8b4
439.64550016 ETH
185829682023-11-16 7:31:11253 days ago1700119871
0x3b6f1FE0...6e28DB8b4
17.25594989 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CometMigratorV2

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 17 : CometMigratorV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "./vendor/@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3FlashCallback.sol";
import "./vendor/@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import "./vendor/@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
import "./vendor/@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/AaveInterface.sol";
import "./interfaces/CTokenInterface.sol";
import "./interfaces/CometInterface.sol";
import "./interfaces/IWETH9.sol";

/**
 * @title Compound III Migrator v2
 * @notice A contract to help migrate a Compound II or Aave v2 position into a similar Compound III position.
 * @author Compound
 */
contract CometMigratorV2 is IUniswapV3FlashCallback {
  error Reentrancy(uint256 loc);
  error CompoundV2Error(uint256 loc, uint256 code);
  error SweepFailure(uint256 loc);
  error CTokenTransferFailure();
  error InvalidConfiguration(uint256 loc);
  error InvalidCallback(uint256 loc);
  error InvalidInputs(uint256 loc);
  error ERC20TransferFailure(uint256 loc);

  /** Events **/
  event Migrated(
    address indexed user,
    CompoundV2Position compoundV2Position,
    AaveV2Position aaveV2Position,
    uint256 flashAmount,
    uint256 flashAmountWithFee);

  event Sweep(
    address indexed sweeper,
    address indexed recipient,
    address indexed asset,
    uint256 amount);

  /// @notice Represents the configuration for executing a Uniswap swap.
  struct Swap {
    bytes path; // empty path if no swap is required (e.g. repaying USDC borrow)
    uint256 amountInMaximum; // Note: Can be set as `type(uint256).max`
  }

  /// @notice Represents an entire Compound II position (collateral + borrows) to migrate.
  struct CompoundV2Position {
    CompoundV2Collateral[] collateral;
    CompoundV2Borrow[] borrows;
    Swap[] swaps;
  }

  /// @notice Represents a given amount of Compound II collateral to migrate.
  struct CompoundV2Collateral {
    CTokenLike cToken;
    uint256 amount; // Note: This is the amount of the cToken
  }

  /// @notice Represents a given amount of Compound II borrow to migrate.
  struct CompoundV2Borrow {
    CTokenLike cToken;
    uint256 amount; // Note: This is the amount of the underlying, not the cToken
  }

  /// @notice Represents an entire Aave v2 position (collateral + borrows) to migrate.
  struct AaveV2Position {
    AaveV2Collateral[] collateral;
    AaveV2Borrow[] borrows;
    Swap[] swaps;
  }

  /// @notice Represents a given amount of Aave v2 collateral to migrate.
  struct AaveV2Collateral {
    ATokenLike aToken;
    uint256 amount;
  }

  /// @notice Represents a given amount of Aave v2 borrow to migrate.
  struct AaveV2Borrow {
    ADebtTokenLike aDebtToken; // Note: Aave has two separate debt tokens per asset: stable and variable rate
    uint256 amount;
  }

  /// @notice Represents all data required to continue operation after a flash loan is initiated.
  struct MigrationCallbackData {
    address user;
    uint256 flashAmount;
    CompoundV2Position compoundV2Position;
    AaveV2Position aaveV2Position;
  }

  /// @notice The Comet Ethereum mainnet USDC contract
  Comet public immutable comet;

  /// @notice The Uniswap pool used by this contract to source liquidity (i.e. flash loans).
  IUniswapV3Pool public immutable uniswapLiquidityPool;

  /// @notice True if borrow token is token 0 in the Uniswap liquidity pool, otherwise false if token 1.
  bool public immutable isUniswapLiquidityPoolToken0;

  /// @notice Uniswap router used for token swaps.
  ISwapRouter public immutable swapRouter;

  /// @notice The underlying borrow token (e.g. `USDC`).
  IERC20NonStandard public immutable baseToken;

  /// @notice The address of the `cETH` token.
  CTokenLike public immutable cETH;

  /// @notice The address of the `weth` token.
  IWETH9 public immutable weth;

  /// @notice The address of the Aave v2 LendingPool contract. This is the contract that all `withdraw` and `repay` transactions go through.
  ILendingPool public immutable aaveV2LendingPool;

  /// @notice Address to send swept tokens to, if for any reason they remain locked in this contract.
  address payable public immutable sweepee;

  /// @notice A reentrancy guard.
  uint256 public inMigration;

  /**
   * @notice Construct a new CometMigratorV2
   * @param comet_ The Comet Ethereum mainnet USDC contract.
   * @param baseToken_ The base token of the Compound III market (e.g. `USDC`).
   * @param cETH_ The address of the `cETH` token.
   * @param weth_ The address of the `WETH9` token.
   * @param aaveV2LendingPool_ The address of the Aave v2 LendingPool contract. This is the contract that all `withdraw` and `repay` transactions go through.
   * @param uniswapLiquidityPool_ The Uniswap pool used by this contract to source liquidity (i.e. flash loans).
   * @param swapRouter_ The Uniswap router for facilitating token swaps.
   * @param sweepee_ Sweep excess tokens to this address.
   **/
  constructor(
    Comet comet_,
    IERC20NonStandard baseToken_,
    CTokenLike cETH_,
    IWETH9 weth_,
    ILendingPool aaveV2LendingPool_,
    IUniswapV3Pool uniswapLiquidityPool_,
    ISwapRouter swapRouter_,
    address payable sweepee_
  ) {
    // **WRITE IMMUTABLE** `comet = comet_`
    comet = comet_;

    // **WRITE IMMUTABLE** `baseToken = baseToken_`
    baseToken = baseToken_;

    // **WRITE IMMUTABLE** `cETH = cETH_`
    cETH = cETH_;

    // **WRITE IMMUTABLE** `weth = weth_`
    weth = weth_;

    // **WRITE IMMUTABLE** `aaveV2LendingPool = aaveV2LendingPool_`
    aaveV2LendingPool = aaveV2LendingPool_;

    // **WRITE IMMUTABLE** `uniswapLiquidityPool = uniswapLiquidityPool_`
    uniswapLiquidityPool = uniswapLiquidityPool_;

    // **WRITE IMMUTABLE** `isUniswapLiquidityPoolToken0 = uniswapLiquidityPool.token0() == baseToken`
    isUniswapLiquidityPoolToken0 = uniswapLiquidityPool.token0() == address(baseToken);

    // **REQUIRE** `isUniswapLiquidityPoolToken0 || uniswapLiquidityPool.token1() == baseToken`
    if (!isUniswapLiquidityPoolToken0 && uniswapLiquidityPool.token1() != address(baseToken)) {
      revert InvalidConfiguration(0);
    }

    // **WRITE IMMUTABLE** `swapRouter = swapRouter_`
    swapRouter = swapRouter_;

    // **WRITE IMMUTABLE** `sweepee = sweepee_`
    sweepee = sweepee_;

    // **CALL** `baseToken.approve(address(swapRouter), type(uint256).max)`
    baseToken.approve(address(swapRouter), type(uint256).max);
  }

  /**
   * @notice This is the core function of this contract, migrating a position from Compound II to Compound III. We use a flash loan from Uniswap to provide liquidity to move the position.
   * @param compoundV2Position Structure containing the user’s Compound II collateral and borrow positions to migrate to Compound III. See notes below.
   * @param aaveV2Position Structure containing the user’s Aave v2 collateral and borrow positions to migrate to Compound III. See notes below.
   * @param flashAmount Amount of base asset to borrow from the Uniswap flash loan to facilitate the migration. See notes below.
   * @dev **N.B.** Collateral requirements may be different in Compound II and Compound III. This may lead to a migration failing or being less collateralized after the migration. There are fees associated with the flash loan, which may affect position or cause migration to fail.
   * @dev Note: each `collateral` market must be supported in Compound III.
   * @dev Note: `collateral` amounts of 0 are strictly ignored. Collateral amounts of max uint256 are set to the user's current balance.
   * @dev Note: `flashAmount` is provided by the user as a hint to the Migrator to know the maximum expected cost (in terms of the base asset) of the migration. If `flashAmount` is less than the total amount needed to migrate the user’s positions, the transaction will revert.
   **/
  function migrate(CompoundV2Position calldata compoundV2Position, AaveV2Position calldata aaveV2Position, uint256 flashAmount) external {
    // **REQUIRE** `inMigration == 0`
    if (inMigration != 0) {
      revert Reentrancy(0);
    }

    // **STORE** `inMigration += 1`
    inMigration += 1;

    // **BIND** `user = msg.sender`
    address user = msg.sender;

    // **REQUIRE** `compoundV2Position.borrows.length == compoundV2Position.swaps.length`
    if (compoundV2Position.borrows.length != compoundV2Position.swaps.length) {
      revert InvalidInputs(0);
    }

    // **REQUIRE** `aaveV2Position.borrows.length == aaveV2Position.swaps.length`
    if (aaveV2Position.borrows.length != aaveV2Position.swaps.length) {
      revert InvalidInputs(1);
    }

    // **BIND** `data = abi.encode(MigrationCallbackData{user, flashAmount, compoundV2Position, aaveV2Position, makerPositions})`
    bytes memory data = abi.encode(MigrationCallbackData({
      user: user,
      flashAmount: flashAmount,
      compoundV2Position: compoundV2Position,
      aaveV2Position: aaveV2Position
    }));

    // **CALL** `uniswapLiquidityPool.flash(address(this), isUniswapLiquidityPoolToken0 ? flashAmount : 0, isUniswapLiquidityPoolToken0 ? 0 : flashAmount, data)`
    uniswapLiquidityPool.flash(address(this), isUniswapLiquidityPoolToken0 ? flashAmount : 0, isUniswapLiquidityPoolToken0 ? 0 : flashAmount, data);

    // **STORE** `inMigration -= 1`
    inMigration -= 1;
  }

  /**
   * @notice This function handles a callback from the Uniswap Liquidity Pool after it has sent this contract the requested tokens. We are responsible for repaying those tokens, with a fee, before we return from this function call.
   * @param fee0 The fee for borrowing token0 from pool.
   * @param fee1 The fee for borrowing token1 from pool.
   * @param data The data encoded above, which is the ABI-encoding of `MigrationCallbackData`.
   **/
  function uniswapV3FlashCallback(uint256 fee0, uint256 fee1, bytes calldata data) external {
    // **REQUIRE** `inMigration == 1`
    if (inMigration != 1) {
      revert Reentrancy(1);
    }

    // **REQUIRE** `msg.sender == uniswapLiquidityPool`
    if (msg.sender != address(uniswapLiquidityPool)) {
      revert InvalidCallback(0);
    }

    // **BIND** `MigrationCallbackData{user, flashAmount, compoundV2Position, aaveV2Position, cdpPositions} = abi.decode(data, (MigrationCallbackData))`
    MigrationCallbackData memory migrationData = abi.decode(data, (MigrationCallbackData));

    // **BIND** `flashAmountWithFee = flashAmount + isUniswapLiquidityPoolToken0 ? fee0 : fee1`
    uint256 flashAmountWithFee = migrationData.flashAmount + ( isUniswapLiquidityPoolToken0 ? fee0 : fee1 );

    // **EXEC** `migrateCompoundV2Position(user, compoundV2Position)`
    migrateCompoundV2Position(migrationData.user, migrationData.compoundV2Position);

    // **EXEC** `migrateAaveV2Position(user, aaveV2Position)`
    migrateAaveV2Position(migrationData.user, migrationData.aaveV2Position);

    // **WHEN** `baseToken.balanceOf(address(this)) < flashAmountWithFee`:
    uint256 baseTokenBalance = baseToken.balanceOf(address(this));
    if (baseTokenBalance < flashAmountWithFee) {
      // **CALL** `comet.withdrawFrom(user, address(this), baseToken, flashAmountWithFee - baseToken.balanceOf(address(this)))`
      comet.withdrawFrom(migrationData.user, address(this), address(baseToken), flashAmountWithFee - baseTokenBalance);
    }

    // **CALL** `baseToken.transfer(address(uniswapLiquidityPool), flashAmountWithFee)`
    if (!doTransferOut(baseToken, address(uniswapLiquidityPool), flashAmountWithFee)) {
      revert ERC20TransferFailure(0);
    }

    // **EMIT** `Migrated(user, compoundV2Position, aaveV2Position, cdpPositions, flashAmount, flashAmountWithFee)`
    emit Migrated(migrationData.user, migrationData.compoundV2Position, migrationData.aaveV2Position, migrationData.flashAmount, flashAmountWithFee);
  }

  /**
   * @notice This internal helper function repays the user’s borrow positions on Compound II (executing swaps first if necessary) before migrating their collateral over to Compound III.
   * @param user Alias for the `msg.sender` of the original `migrate` call.
   * @param position Structure containing the user’s Compound II collateral and borrow positions to migrate to Compound III.
   **/
  function migrateCompoundV2Position(address user, CompoundV2Position memory position) internal {
    // **FOREACH** `(cToken, borrowAmount): CompoundV2Borrow, swap: Swap` in `position`:
    for (uint i = 0; i < position.borrows.length; i++) {
      CompoundV2Borrow memory borrow = position.borrows[i];

      uint256 repayAmount;
      // **WHEN** `borrowAmount == type(uint256).max)`:
      if (borrow.amount == type(uint256).max) {
        // **BIND READ** `repayAmount = cToken.borrowBalanceCurrent(user)`
        repayAmount = borrow.cToken.borrowBalanceCurrent(user);
      } else {
        // **BIND** `repayAmount = borrowAmount`
        repayAmount = borrow.amount;
      }

      // **WHEN** `swap.path.length > 0`:
      if (position.swaps[i].path.length > 0) {
        // **CALL** `ISwapRouter.exactOutput(ExactOutputParams({path: swap.path, recipient: address(this), amountOut: repayAmount, amountInMaximum: swap.amountInMaximum})`
        uint256 amountIn = swapRouter.exactOutput(
          ISwapRouter.ExactOutputParams({
              path: position.swaps[i].path,
              recipient: address(this),
              amountOut: repayAmount,
              amountInMaximum: position.swaps[i].amountInMaximum,
              deadline: block.timestamp
          })
        );
      }

      // **WHEN** `cToken == cETH`
      if (borrow.cToken == cETH) {
        CEther cToken = CEther(address(borrow.cToken));

        // **CALL** `weth.withdraw(repayAmount)`
        weth.withdraw(repayAmount);

        // **CALL** `cToken.repayBorrowBehalf{value: repayAmount}(user)
        cToken.repayBorrowBehalf{ value: repayAmount }(user);
      } else {
        CErc20 cToken = CErc20(address(borrow.cToken));

        // **CALL** `cToken.underlying().approve(address(cToken), repayAmount)`
        IERC20NonStandard(cToken.underlying()).approve(address(borrow.cToken), repayAmount);

        // **CALL** `cToken.repayBorrowBehalf(user, repayAmount)`
        uint256 err = cToken.repayBorrowBehalf(user, repayAmount);
        if (err != 0) {
          revert CompoundV2Error(0, err);
        }
      }
    }

    // **FOREACH** `(cToken, amount): CompoundV2Collateral` in `position.collateral`:
    for (uint i = 0; i < position.collateral.length; i++) {
      CompoundV2Collateral memory collateral = position.collateral[i];

      // **BIND** `cTokenAmount = amount == type(uint256).max ? cToken.balanceOf(user) : amount)`
      uint256 cTokenAmount = collateral.amount == type(uint256).max ? collateral.cToken.balanceOf(user) : collateral.amount;

      // **CALL** `cToken.transferFrom(user, address(this), cTokenAmount)`
      bool transferSuccess = collateral.cToken.transferFrom(
        user,
        address(this),
        cTokenAmount
      );
      if (!transferSuccess) {
        revert CTokenTransferFailure();
      }

      // **CALL** `cToken.redeem(cTokenAmount)`
      uint256 err = collateral.cToken.redeem(cTokenAmount);
      if (err != 0) {
        revert CompoundV2Error(1 + i, err);
      }

      // Note: Safe to use `exchangeRateStored` since `accrue` is already called in `redeem`
      // **BIND** `underlyingCollateralAmount = collateral.cToken.exchangeRateStored() * cTokenAmount / 1e18`
      uint256 underlyingCollateralAmount = collateral.cToken.exchangeRateStored() * cTokenAmount / 1e18;

      IERC20NonStandard underlying;

      // **WHEN** `cToken == cETH`:
      if (collateral.cToken == cETH) {
        // **CALL** `weth.deposit{value: underlyingCollateralAmount}()`
        weth.deposit{value: underlyingCollateralAmount}();

        // **BIND** `underlying = weth`
        underlying = weth;
      } else {
        // **BIND** `underlying = cToken.underlying()`
        underlying = IERC20NonStandard(CErc20(address(collateral.cToken)).underlying());
      }

      // **CALL** `underlying.approve(address(comet), underlyingCollateralAmount)`
      underlying.approve(address(comet), underlyingCollateralAmount);

      // **CALL** `comet.supplyTo(user, underlying, underlyingCollateralAmount)`
      comet.supplyTo(
        user,
        address(underlying),
        underlyingCollateralAmount
      );
    }
  }

  /**
   * @notice This internal helper function repays the user’s borrow positions on Aave v2 (executing swaps first if necessary) before migrating their collateral over to Compound III.
   * @param user Alias for the `msg.sender` of the original `migrate` call.
   * @param position Structure containing the user’s Aave v2 collateral and borrow positions to migrate to Compound III.
   **/
  function migrateAaveV2Position(address user, AaveV2Position memory position) internal {
    // **FOREACH** `(aDebtToken, borrowAmount): AaveV2Borrow, swap: Swap` in `position`:
    for (uint i = 0; i < position.borrows.length; i++) {
      AaveV2Borrow memory borrow = position.borrows[i];
      uint256 repayAmount;
      //  **WHEN** `borrowAmount == type(uint256).max)`:
      if (borrow.amount == type(uint256).max) {
        // **BIND READ** `repayAmount = aDebtToken.balanceOf(user)`
        repayAmount = borrow.aDebtToken.balanceOf(user);
      } else {
        //  **BIND** `repayAmount = borrowAmount`
        repayAmount = borrow.amount;
      }
      // **WHEN** `swap.path.length > 0`:
      if (position.swaps[i].path.length > 0) {
        // **CALL** `ISwapRouter.exactOutput(ExactOutputParams({path: swap.path, recipient: address(this), amountOut: repayAmount, amountInMaximum: swap.amountInMaximum})`
        uint256 amountIn = swapRouter.exactOutput(
          ISwapRouter.ExactOutputParams({
              path: position.swaps[i].path,
              recipient: address(this),
              amountOut: repayAmount,
              amountInMaximum: position.swaps[i].amountInMaximum,
              deadline: block.timestamp
          })
        );
      }

      // **BIND READ** `underlyingDebt = aDebtToken.UNDERLYING_ASSET_ADDRESS()`
      IERC20NonStandard underlyingDebt = IERC20NonStandard(borrow.aDebtToken.UNDERLYING_ASSET_ADDRESS());

      // **BIND READ** `rateMode = aDebtToken.DEBT_TOKEN_REVISION()`
      uint256 rateMode = borrow.aDebtToken.DEBT_TOKEN_REVISION();

      // **CALL** `underlyingDebt.approve(address(aaveV2LendingPool), repayAmount)`
      underlyingDebt.approve(address(aaveV2LendingPool), repayAmount);

      // **CALL** `aaveV2LendingPool.repay(underlyingDebt, repayAmount, rateMode, user)`
      aaveV2LendingPool.repay(address(underlyingDebt), repayAmount, rateMode, user);
    }

    // **FOREACH** `(aToken, amount): AaveV2Collateral` in `position.collateral`:
    for (uint i = 0; i < position.collateral.length; i++) {
      AaveV2Collateral memory collateral = position.collateral[i];

      // **BIND** `aTokenAmount = amount == type(uint256).max ? aToken.balanceOf(user) : amount)`
      uint256 aTokenAmount = collateral.amount == type(uint256).max ? collateral.aToken.balanceOf(user) : collateral.amount;

      // **CALL** `aToken.transferFrom(user, address(this), aTokenAmount)`
      collateral.aToken.transferFrom(
        user,
        address(this),
        aTokenAmount
      );

      // **BIND READ** `underlyingCollateral = aToken.UNDERLYING_ASSET_ADDRESS()`
      IERC20NonStandard underlyingCollateral = IERC20NonStandard(collateral.aToken.UNDERLYING_ASSET_ADDRESS());

      // **CALL** `aaveV2LendingPool.withdraw(underlyingCollateral, aTokenAmount, address(this))`
      aaveV2LendingPool.withdraw(address(underlyingCollateral), aTokenAmount, address(this));

      // **CALL** `underlyingCollateral.approve(address(comet), aTokenAmount)`
      underlyingCollateral.approve(address(comet), aTokenAmount);

      // **CALL** `comet.supplyTo(user, underlyingCollateral, aTokenAmount)`
      comet.supplyTo(
        user,
        address(underlyingCollateral),
        aTokenAmount
      );
    }
  }

  /**
    * @notice Similar to ERC-20 transfer, except it also properly handles `transfer` from non-standard ERC-20 tokens.
    * @param asset The ERC-20 token to transfer out.
    * @param to The recipient of the token transfer.
    * @param amount The amount of the token to transfer.
    * @return Boolean indicating the success of the transfer.
    * @dev Note: This wrapper safely handles non-standard ERC-20 tokens that do not return a value. See here: https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
    **/
  function doTransferOut(IERC20NonStandard asset, address to, uint amount) internal returns (bool) {
      asset.transfer(to, amount);

      bool success;
      assembly {
          switch returndatasize()
              case 0 {                      // This is a non-standard ERC-20
                  success := not(0)          // set success to true
              }
              case 32 {                     // This is a compliant ERC-20
                  returndatacopy(0, 0, 32)
                  success := mload(0)        // Set `success = returndata` of override external call
              }
              default {                     // This is an excessively non-compliant ERC-20, revert.
                  revert(0, 0)
              }
      }
      return success;
  }

  /**
   * @notice Sends any tokens in this contract to the sweepee address. This contract should never hold tokens, so this is just to fix any anomalistic situations where tokens end up locked in the contract.
   * @param token The token to sweep
   **/
  function sweep(IERC20NonStandard token) external {
    // **REQUIRE** `inMigration == 0`
    if (inMigration != 0) {
      revert Reentrancy(2);
    }

    // **WHEN** `token == 0x0000000000000000000000000000000000000000`:
    if (token == IERC20NonStandard(0x0000000000000000000000000000000000000000)) {
      // **EXEC** `sweepee.send(address(this).balance)`
      uint256 amount = address(this).balance;
      if (!sweepee.send(amount)) {
        revert SweepFailure(0);
      }

      // **EMIT** `Sweep(msg.sender, sweepee, address(0), address(this).balance)`
      emit Sweep(msg.sender, sweepee, address(0), amount);
    } else {
      // **CALL** `token.transfer(sweepee, token.balanceOf(address(this)))`
      uint256 amount = token.balanceOf(address(this));
      if (!doTransferOut(token, sweepee, amount)) {
        revert SweepFailure(1);
      }

      // **EMIT** `Sweep(msg.sender, sweepee, address(token), token.balanceOf(address(this)))`
      emit Sweep(msg.sender, sweepee, address(token), amount);
    }
  }

  receive() external payable {
    // NO-OP
  }
}

File 2 of 17 : AaveInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

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

interface ATokenLike is IERC20 {
  /**
   * @dev Returns the address of the underlying asset of this aToken (E.g. WETH for aWETH)
   **/
  function UNDERLYING_ASSET_ADDRESS() external view returns (address);
}

interface ADebtTokenLike is IERC20 {
    function approveDelegation(address delegatee, uint256 amount) external;
    function DEBT_TOKEN_REVISION() external view returns (uint);
    function UNDERLYING_ASSET_ADDRESS() external view returns (address);
}

interface ILendingPool {
  /**
   * @dev Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
   * E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
   * @param asset The address of the underlying asset to withdraw
   * @param amount The underlying amount to be withdrawn
   *   - Send the value type(uint256).max in order to withdraw the whole aToken balance
   * @param to Address that will receive the underlying, same as msg.sender if the user
   *   wants to receive it on his own wallet, or a different address if the beneficiary is a
   *   different wallet
   * @return The final amount withdrawn
   **/
  function withdraw(
    address asset,
    uint256 amount,
    address to
  ) external returns (uint256);

  /**
   * @dev Allows users to borrow a specific `amount` of the reserve underlying asset, provided that the borrower
   * already deposited enough collateral, or he was given enough allowance by a credit delegator on the
   * corresponding debt token (StableDebtToken or VariableDebtToken)
   * - E.g. User borrows 100 USDC passing as `onBehalfOf` his own address, receiving the 100 USDC in his wallet
   *   and 100 stable/variable debt tokens, depending on the `interestRateMode`
   * @param asset The address of the underlying asset to borrow
   * @param amount The amount to be borrowed
   * @param interestRateMode The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
   * @param referralCode Code used to register the integrator originating the operation, for potential rewards.
   *   0 if the action is executed directly by the user, without any middle-man
   * @param onBehalfOf Address of the user who will receive the debt. Should be the address of the borrower itself
   * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
   * if he has been given credit delegation allowance
   **/
  function borrow(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    uint16 referralCode,
    address onBehalfOf
  ) external;

  /**
   * @notice Repays a borrowed `amount` on a specific reserve, burning the equivalent debt tokens owned
   * - E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the `onBehalfOf` address
   * @param asset The address of the borrowed underlying asset previously borrowed
   * @param amount The amount to repay
   * - Send the value type(uint256).max in order to repay the whole debt for `asset` on the specific `debtMode`
   * @param rateMode The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
   * @param onBehalfOf Address of the user who will get his debt reduced/removed. Should be the address of the
   * user calling the function if he wants to reduce/remove his own debt, or the address of any other
   * other borrower whose debt should be removed
   * @return The final amount repaid
   **/
  function repay(
    address asset,
    uint256 amount,
    uint256 rateMode,
    address onBehalfOf
  ) external returns (uint256);
}

File 3 of 17 : CTokenInterface.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

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

interface CTokenLike {
  error TransferComptrollerRejection(uint256);

  function balanceOf(address holder) external returns (uint);
  function borrow(uint amount) external returns (uint);
  function transfer(address dst, uint256 amt) external returns (bool);
  function transferFrom(address from, address to, uint256 amount) external returns (bool);
  function redeem(uint redeemTokens) external returns (uint);
  function borrowBalanceCurrent(address account) external returns (uint);
  function approve(address spender, uint256 amount) external returns (bool);
  function exchangeRateCurrent() external returns (uint);
  function exchangeRateStored() external view returns (uint);
}

interface CErc20 is CTokenLike {
  function underlying() external returns (address);
  function mint(uint mintAmount) external returns (uint);
  function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint);
}

interface CEther is CTokenLike {
  function repayBorrowBehalf(address borrower) external payable;
}

File 4 of 17 : CometInterface.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.16;

interface Comet {
    error Absurd();
    error AlreadyInitialized();
    error BadAsset();
    error BadDecimals();
    error BadDiscount();
    error BadMinimum();
    error BadPrice();
    error BorrowTooSmall();
    error BorrowCFTooLarge();
    error InsufficientReserves();
    error LiquidateCFTooLarge();
    error NoSelfTransfer();
    error NotCollateralized();
    error NotForSale();
    error NotLiquidatable();
    error Paused();
    error SupplyCapExceeded();
    error TimestampTooLarge();
    error TooManyAssets();
    error TooMuchSlippage();
    error TransferInFailed();
    error TransferOutFailed();
    error Unauthorized();
    error BadAmount();
    error BadNonce();
    error BadSignatory();
    error InvalidValueS();
    error InvalidValueV();
    error SignatureExpired();

    struct AssetInfo {
        uint8 offset;
        address asset;
        address priceFeed;
        uint64 scale;
        uint64 borrowCollateralFactor;
        uint64 liquidateCollateralFactor;
        uint64 liquidationFactor;
        uint128 supplyCap;
    }

    event Supply(address indexed from, address indexed dst, uint amount);
    event Transfer(address indexed from, address indexed to, uint amount);
    event Withdraw(address indexed src, address indexed to, uint amount);

    event SupplyCollateral(address indexed from, address indexed dst, address indexed asset, uint amount);
    event TransferCollateral(address indexed from, address indexed to, address indexed asset, uint amount);
    event WithdrawCollateral(address indexed src, address indexed to, address indexed asset, uint amount);

    /// @notice Event emitted when a borrow position is absorbed by the protocol
    event AbsorbDebt(address indexed absorber, address indexed borrower, uint basePaidOut, uint usdValue);

    /// @notice Event emitted when a user's collateral is absorbed by the protocol
    event AbsorbCollateral(address indexed absorber, address indexed borrower, address indexed asset, uint collateralAbsorbed, uint usdValue);

    /// @notice Event emitted when a collateral asset is purchased from the protocol
    event BuyCollateral(address indexed buyer, address indexed asset, uint baseAmount, uint collateralAmount);

    /// @notice Event emitted when an action is paused/unpaused
    event PauseAction(bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused);

    /// @notice Event emitted when reserves are withdrawn by the governor
    event WithdrawReserves(address indexed to, uint amount);

    function supply(address asset, uint amount) external;
    function supplyTo(address dst, address asset, uint amount) external;
    function supplyFrom(address from, address dst, address asset, uint amount) external;

    function transfer(address dst, uint amount) external returns (bool);
    function transferFrom(address src, address dst, uint amount) external returns (bool);

    function transferAsset(address dst, address asset, uint amount) external;
    function transferAssetFrom(address src, address dst, address asset, uint amount) external;

    function withdraw(address asset, uint amount) external;
    function withdrawTo(address to, address asset, uint amount) external;
    function withdrawFrom(address src, address to, address asset, uint amount) external;

    function approveThis(address manager, address asset, uint amount) external;
    function withdrawReserves(address to, uint amount) external;

    function absorb(address absorber, address[] calldata accounts) external;
    function buyCollateral(address asset, uint minAmount, uint baseAmount, address recipient) external;
    function quoteCollateral(address asset, uint baseAmount) external view returns (uint);

    function getAssetInfo(uint8 i) external view returns (AssetInfo memory);
    function getAssetInfoByAddress(address asset) external view returns (AssetInfo memory);
    function getReserves() external view returns (int);
    function getPrice(address priceFeed) external view returns (uint);

    function isBorrowCollateralized(address account) external view returns (bool);
    function isLiquidatable(address account) external view returns (bool);

    function totalSupply() external view returns (uint256);
    function totalBorrow() external view returns (uint256);
    function balanceOf(address owner) external view returns (uint256);
    function borrowBalanceOf(address account) external view returns (uint256);

    function pause(bool supplyPaused, bool transferPaused, bool withdrawPaused, bool absorbPaused, bool buyPaused) external;
    function isSupplyPaused() external view returns (bool);
    function isTransferPaused() external view returns (bool);
    function isWithdrawPaused() external view returns (bool);
    function isAbsorbPaused() external view returns (bool);
    function isBuyPaused() external view returns (bool);

    function accrueAccount(address account) external;
    function getSupplyRate(uint utilization) external view returns (uint64);
    function getBorrowRate(uint utilization) external view returns (uint64);
    function getUtilization() external view returns (uint);

    function governor() external view returns (address);
    function pauseGuardian() external view returns (address);
    function baseToken() external view returns (address);
    function baseTokenPriceFeed() external view returns (address);
    function extensionDelegate() external view returns (address);

    /// @dev uint64
    function supplyKink() external view returns (uint);
    /// @dev uint64
    function supplyPerSecondInterestRateSlopeLow() external view returns (uint);
    /// @dev uint64
    function supplyPerSecondInterestRateSlopeHigh() external view returns (uint);
    /// @dev uint64
    function supplyPerSecondInterestRateBase() external view returns (uint);
    /// @dev uint64
    function borrowKink() external view returns (uint);
    /// @dev uint64
    function borrowPerSecondInterestRateSlopeLow() external view returns (uint);
    /// @dev uint64
    function borrowPerSecondInterestRateSlopeHigh() external view returns (uint);
    /// @dev uint64
    function borrowPerSecondInterestRateBase() external view returns (uint);
    /// @dev uint64
    function storeFrontPriceFactor() external view returns (uint);

    /// @dev uint64
    function baseScale() external view returns (uint);
    /// @dev uint64
    function trackingIndexScale() external view returns (uint);

    /// @dev uint64
    function baseTrackingSupplySpeed() external view returns (uint);
    /// @dev uint64
    function baseTrackingBorrowSpeed() external view returns (uint);
    /// @dev uint104
    function baseMinForRewards() external view returns (uint);
    /// @dev uint104
    function baseBorrowMin() external view returns (uint);
    /// @dev uint104
    function targetReserves() external view returns (uint);

    function numAssets() external view returns (uint8);
    function decimals() external view returns (uint8);

    function initializeStorage() external;

    function collateralBalanceOf(address account, address asset) external view returns (uint128);
    function allow(address manager, bool isAllowed_) external;
}

File 5 of 17 : IERC20NonStandard.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

/**
 * @title IERC20NonStandard
 * @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
 *  See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
 */
interface IERC20NonStandard {
    function approve(address spender, uint256 amount) external;
    function transfer(address to, uint256 value) external;
    function transferFrom(address from, address to, uint256 value) external;
    function balanceOf(address account) external view returns (uint256);
}

File 6 of 17 : IWETH9.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;

import "./IERC20NonStandard.sol";

/// @title Interface for WETH9
interface IWETH9 is IERC20NonStandard {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256) external;
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 8 of 17 : IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import './pool/IUniswapV3PoolImmutables.sol';
import './pool/IUniswapV3PoolState.sol';
import './pool/IUniswapV3PoolDerivedState.sol';
import './pool/IUniswapV3PoolActions.sol';
import './pool/IUniswapV3PoolOwnerActions.sol';
import './pool/IUniswapV3PoolEvents.sol';

/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
    IUniswapV3PoolImmutables,
    IUniswapV3PoolState,
    IUniswapV3PoolDerivedState,
    IUniswapV3PoolActions,
    IUniswapV3PoolOwnerActions,
    IUniswapV3PoolEvents
{

}

File 9 of 17 : IUniswapV3FlashCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#flash
/// @notice Any contract that calls IUniswapV3PoolActions#flash must implement this interface
interface IUniswapV3FlashCallback {
    /// @notice Called to `msg.sender` after transferring to the recipient from IUniswapV3Pool#flash.
    /// @dev In the implementation you must repay the pool the tokens sent by flash plus the computed fee amounts.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// @param fee0 The fee amount in token0 due to the pool by the end of the flash
    /// @param fee1 The fee amount in token1 due to the pool by the end of the flash
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#flash call
    function uniswapV3FlashCallback(
        uint256 fee0,
        uint256 fee1,
        bytes calldata data
    ) external;
}

File 10 of 17 : IUniswapV3SwapCallback.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
interface IUniswapV3SwapCallback {
    /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap.
    /// @dev In the implementation you must pay the pool tokens owed for the swap.
    /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory.
    /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped.
    /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token0 to the pool.
    /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by
    /// the end of the swap. If positive, the callback must send that amount of token1 to the pool.
    /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata data
    ) external;
}

File 11 of 17 : IUniswapV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
    /// @notice Sets the initial price for the pool
    /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
    /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
    function initialize(uint160 sqrtPriceX96) external;

    /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
    /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
    /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
    /// on tickLower, tickUpper, the amount of liquidity, and the current price.
    /// @param recipient The address for which the liquidity will be created
    /// @param tickLower The lower tick of the position in which to add liquidity
    /// @param tickUpper The upper tick of the position in which to add liquidity
    /// @param amount The amount of liquidity to mint
    /// @param data Any data that should be passed through to the callback
    /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
    /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
    function mint(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount,
        bytes calldata data
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Collects tokens owed to a position
    /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
    /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
    /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
    /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
    /// @param recipient The address which should receive the fees collected
    /// @param tickLower The lower tick of the position for which to collect fees
    /// @param tickUpper The upper tick of the position for which to collect fees
    /// @param amount0Requested How much token0 should be withdrawn from the fees owed
    /// @param amount1Requested How much token1 should be withdrawn from the fees owed
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);

    /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
    /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
    /// @dev Fees must be collected separately via a call to #collect
    /// @param tickLower The lower tick of the position for which to burn liquidity
    /// @param tickUpper The upper tick of the position for which to burn liquidity
    /// @param amount How much liquidity to burn
    /// @return amount0 The amount of token0 sent to the recipient
    /// @return amount1 The amount of token1 sent to the recipient
    function burn(
        int24 tickLower,
        int24 tickUpper,
        uint128 amount
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);

    /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
    /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(
        address recipient,
        uint256 amount0,
        uint256 amount1,
        bytes calldata data
    ) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}

File 12 of 17 : IUniswapV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
    /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
    /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
    /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
    /// you must call it with secondsAgos = [3600, 0].
    /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
    /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
    /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
    /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
    /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
    /// timestamp
    function observe(uint32[] calldata secondsAgos)
        external
        view
        returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);

    /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
    /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
    /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
    /// snapshot is taken and the second snapshot is taken.
    /// @param tickLower The lower tick of the range
    /// @param tickUpper The upper tick of the range
    /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
    /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
    /// @return secondsInside The snapshot of seconds per liquidity for the range
    function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
        external
        view
        returns (
            int56 tickCumulativeInside,
            uint160 secondsPerLiquidityInsideX128,
            uint32 secondsInside
        );
}

File 13 of 17 : IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
    /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
    /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
    /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
    /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
    event Initialize(uint160 sqrtPriceX96, int24 tick);

    /// @notice Emitted when liquidity is minted for a given position
    /// @param sender The address that minted the liquidity
    /// @param owner The owner of the position and recipient of any minted liquidity
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity minted to the position range
    /// @param amount0 How much token0 was required for the minted liquidity
    /// @param amount1 How much token1 was required for the minted liquidity
    event Mint(
        address sender,
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted when fees are collected by the owner of a position
    /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
    /// @param owner The owner of the position for which fees are collected
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount0 The amount of token0 fees collected
    /// @param amount1 The amount of token1 fees collected
    event Collect(
        address indexed owner,
        address recipient,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount0,
        uint128 amount1
    );

    /// @notice Emitted when a position's liquidity is removed
    /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
    /// @param owner The owner of the position for which liquidity is removed
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity to remove
    /// @param amount0 The amount of token0 withdrawn
    /// @param amount1 The amount of token1 withdrawn
    event Burn(
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted by the pool for any swaps between token0 and token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the output of the swap
    /// @param amount0 The delta of the token0 balance of the pool
    /// @param amount1 The delta of the token1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of price of the pool after the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );

    /// @notice Emitted by the pool for any flashes of token0/token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the tokens from flash
    /// @param amount0 The amount of token0 that was flashed
    /// @param amount1 The amount of token1 that was flashed
    /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
    /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
    event Flash(
        address indexed sender,
        address indexed recipient,
        uint256 amount0,
        uint256 amount1,
        uint256 paid0,
        uint256 paid1
    );

    /// @notice Emitted by the pool for increases to the number of observations that can be stored
    /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
    /// just before a mint/swap/burn.
    /// @param observationCardinalityNextOld The previous value of the next observation cardinality
    /// @param observationCardinalityNextNew The updated value of the next observation cardinality
    event IncreaseObservationCardinalityNext(
        uint16 observationCardinalityNextOld,
        uint16 observationCardinalityNextNew
    );

    /// @notice Emitted when the protocol fee is changed by the pool
    /// @param feeProtocol0Old The previous value of the token0 protocol fee
    /// @param feeProtocol1Old The previous value of the token1 protocol fee
    /// @param feeProtocol0New The updated value of the token0 protocol fee
    /// @param feeProtocol1New The updated value of the token1 protocol fee
    event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);

    /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
    /// @param sender The address that collects the protocol fees
    /// @param recipient The address that receives the collected protocol fees
    /// @param amount0 The amount of token0 protocol fees that is withdrawn
    /// @param amount0 The amount of token1 protocol fees that is withdrawn
    event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}

File 14 of 17 : IUniswapV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);

    /// @notice The maximum amount of position liquidity that can use any tick in the range
    /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
    /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
    /// @return The max amount of liquidity per tick
    function maxLiquidityPerTick() external view returns (uint128);
}

File 15 of 17 : IUniswapV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
    /// @notice Set the denominator of the protocol's % share of the fees
    /// @param feeProtocol0 new protocol fee for token0 of the pool
    /// @param feeProtocol1 new protocol fee for token1 of the pool
    function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;

    /// @notice Collect the protocol fee accrued to the pool
    /// @param recipient The address to which collected protocol fees should be sent
    /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
    /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
    /// @return amount0 The protocol fee collected in token0
    /// @return amount1 The protocol fee collected in token1
    function collectProtocol(
        address recipient,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);
}

File 16 of 17 : IUniswapV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );

    /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal0X128() external view returns (uint256);

    /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

    /// @notice The amounts of token0 and token1 that are owed to the protocol
    /// @dev Protocol fees will never exceed uint128 max in either token
    function protocolFees() external view returns (uint128 token0, uint128 token1);

    /// @notice The currently in range liquidity available to the pool
    /// @dev This value has no relationship to the total liquidity across all ticks
    function liquidity() external view returns (uint128);

    /// @notice Look up information about a specific tick in the pool
    /// @param tick The tick to look up
    /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
    /// tick upper,
    /// liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
    /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
    /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
    /// a specific position.
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside0X128,
            uint256 feeGrowthOutside1X128,
            int56 tickCumulativeOutside,
            uint160 secondsPerLiquidityOutsideX128,
            uint32 secondsOutside,
            bool initialized
        );

    /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
    function tickBitmap(int16 wordPosition) external view returns (uint256);

    /// @notice Returns the information about a position by the position's key
    /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
    /// @return _liquidity The amount of liquidity in the position,
    /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
    function positions(bytes32 key)
        external
        view
        returns (
            uint128 _liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    /// @notice Returns data about a specific observation index
    /// @param index The element of the observations array to fetch
    /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
    /// ago, rather than at a specific index in the array.
    /// @return blockTimestamp The timestamp of the observation,
    /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// Returns initialized whether the observation has been initialized and the values are safe to use
    function observations(uint256 index)
        external
        view
        returns (
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint160 secondsPerLiquidityCumulativeX128,
            bool initialized
        );
}

File 17 of 17 : ISwapRouter.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import '../../../v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';

/// @title Router token swapping functionality
/// @notice Functions for swapping tokens via Uniswap V3
interface ISwapRouter is IUniswapV3SwapCallback {
    struct ExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);

    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }

    /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
    /// @return amountOut The amount of the received token
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);

    struct ExactOutputSingleParams {
        address tokenIn;
        address tokenOut;
        uint24 fee;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
        uint160 sqrtPriceLimitX96;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another token
    /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn);

    struct ExactOutputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountOut;
        uint256 amountInMaximum;
    }

    /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
    /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
    /// @return amountIn The amount of the input token
    function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn);
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract Comet","name":"comet_","type":"address"},{"internalType":"contract IERC20NonStandard","name":"baseToken_","type":"address"},{"internalType":"contract CTokenLike","name":"cETH_","type":"address"},{"internalType":"contract IWETH9","name":"weth_","type":"address"},{"internalType":"contract ILendingPool","name":"aaveV2LendingPool_","type":"address"},{"internalType":"contract IUniswapV3Pool","name":"uniswapLiquidityPool_","type":"address"},{"internalType":"contract ISwapRouter","name":"swapRouter_","type":"address"},{"internalType":"address payable","name":"sweepee_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CTokenTransferFailure","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"},{"internalType":"uint256","name":"code","type":"uint256"}],"name":"CompoundV2Error","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"}],"name":"ERC20TransferFailure","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"}],"name":"InvalidCallback","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"}],"name":"InvalidConfiguration","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"}],"name":"InvalidInputs","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"}],"name":"Reentrancy","type":"error"},{"inputs":[{"internalType":"uint256","name":"loc","type":"uint256"}],"name":"SweepFailure","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"components":[{"components":[{"internalType":"contract CTokenLike","name":"cToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.CompoundV2Collateral[]","name":"collateral","type":"tuple[]"},{"components":[{"internalType":"contract CTokenLike","name":"cToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.CompoundV2Borrow[]","name":"borrows","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"}],"internalType":"struct CometMigratorV2.Swap[]","name":"swaps","type":"tuple[]"}],"indexed":false,"internalType":"struct CometMigratorV2.CompoundV2Position","name":"compoundV2Position","type":"tuple"},{"components":[{"components":[{"internalType":"contract ATokenLike","name":"aToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.AaveV2Collateral[]","name":"collateral","type":"tuple[]"},{"components":[{"internalType":"contract ADebtTokenLike","name":"aDebtToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.AaveV2Borrow[]","name":"borrows","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"}],"internalType":"struct CometMigratorV2.Swap[]","name":"swaps","type":"tuple[]"}],"indexed":false,"internalType":"struct CometMigratorV2.AaveV2Position","name":"aaveV2Position","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"flashAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"flashAmountWithFee","type":"uint256"}],"name":"Migrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sweeper","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Sweep","type":"event"},{"inputs":[],"name":"aaveV2LendingPool","outputs":[{"internalType":"contract ILendingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseToken","outputs":[{"internalType":"contract IERC20NonStandard","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cETH","outputs":[{"internalType":"contract CTokenLike","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comet","outputs":[{"internalType":"contract Comet","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"inMigration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isUniswapLiquidityPoolToken0","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"contract CTokenLike","name":"cToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.CompoundV2Collateral[]","name":"collateral","type":"tuple[]"},{"components":[{"internalType":"contract CTokenLike","name":"cToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.CompoundV2Borrow[]","name":"borrows","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"}],"internalType":"struct CometMigratorV2.Swap[]","name":"swaps","type":"tuple[]"}],"internalType":"struct CometMigratorV2.CompoundV2Position","name":"compoundV2Position","type":"tuple"},{"components":[{"components":[{"internalType":"contract ATokenLike","name":"aToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.AaveV2Collateral[]","name":"collateral","type":"tuple[]"},{"components":[{"internalType":"contract ADebtTokenLike","name":"aDebtToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct CometMigratorV2.AaveV2Borrow[]","name":"borrows","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"path","type":"bytes"},{"internalType":"uint256","name":"amountInMaximum","type":"uint256"}],"internalType":"struct CometMigratorV2.Swap[]","name":"swaps","type":"tuple[]"}],"internalType":"struct CometMigratorV2.AaveV2Position","name":"aaveV2Position","type":"tuple"},{"internalType":"uint256","name":"flashAmount","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapRouter","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20NonStandard","name":"token","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepee","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapLiquidityPool","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee0","type":"uint256"},{"internalType":"uint256","name":"fee1","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"uniswapV3FlashCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

6101a060408181523462000264578162002a8d803803809162000023828562000321565b833961010093849181010312620002645780516001600160a01b03929083811681036200026457602091828401519385851685036200026457818101519580871687036200026457606082015193818516850362000264576080830151958287168703620002645760a08401519783891692838a03620002645760c08601519385851696878603620002645760e001519a868c168c0362000264576004938e8694608052526101209c8d52610140998a526101609a8b5260a052875192838092630dfe168160e01b82525afa908115620002f457600091620002ff575b5083808c51169116148060c05215908162000281575b50620002695760e05261018095865287511690813b156200026457600091604483928551948593849263095ea7b360e01b84526004840152811960248401525af1801562000259576200022b575b50519361272695866200036787396080518681816106e80152818161136d01528181611aa60152612323015260a0518681816104d8015281816107b701526111c5015260c0518681816105030152818161063e0152611208015260e05186818161072d01528181611a13015261228a015251858181610772015261128901525184818161068401526115b801525183818161035c015281816116d30152611cb20152518281816107fc0152611f8601525181818161017d0152818161025601526103a10152f35b6001600160401b038111620002435781523862000164565b634e487b7160e01b600052604160045260246000fd5b82513d6000823e3d90fd5b600080fd5b83516332afc78f60e01b815260006004820152602490fd5b90506004818460a0511687519283809263d21220a760e01b82525afa918215620002f457600092620002c0575b505082808b5116911614153862000116565b620002e49250803d10620002ec575b620002db818362000321565b81019062000345565b3880620002ae565b503d620002cf565b86513d6000823e3d90fd5b6200031a9150823d8411620002ec57620002db818362000321565b3862000100565b601f909101601f19168101906001600160401b038211908210176200024357604052565b908160209103126200026457516001600160a01b038116810362000264579056fe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806301681a621461011f5780633fc8cef31461011657806362e1097d1461010d578063853058c3146101045780639df50c6f146100fb578063a1b4d011146100f2578063b9ea04c7146100e9578063ba3e9c12146100e0578063c31c9c07146100d7578063c55dae63146100ce578063df5089dc146100c5578063e822eb32146100bc5763e9cbafb00361000e576100b7610820565b61000e565b506100b76107db565b506100b7610796565b506100b7610751565b506100b761070c565b506100b76106c7565b506100b76106a8565b506100b7610663565b506100b7610625565b506100b76103d3565b506100b7610380565b506100b761033b565b506100b761013e565b6001600160a01b0381160361013957565b600080fd5b50346101395760203660031901126101395760043561015c81610128565b6000908154610317576001600160a01b0390808216908161021b57505047907f000000000000000000000000000000000000000000000000000000000000000016828383838115610211575b82809281926101b696f11590565b6101f457604051918252829133907ffe6f9ffae65cf2c41cdbb3faf5a94e71eab2c2c62215df2efd79e12e451d0b629080602081015b0390a4604051f35b604051636974857f60e11b815260006004820152602490fd5b0390fd5b6108fc93506101a8565b6040516370a0823160e01b81523060048201529192909190602082602481875afa91821561030a575b85926102d2575b5061027d82610281927f000000000000000000000000000000000000000000000000000000000000000016809561263c565b1590565b6102b95760405190815233907ffe6f9ffae65cf2c41cdbb3faf5a94e71eab2c2c62215df2efd79e12e451d0b629080602081016101ec565b604051636974857f60e11b815260016004820152602490fd5b6102819192506102fb61027d9160203d8111610303575b6102f381836109bc565b810190611166565b92915061024b565b503d6102e9565b6103126110b4565b610244565b60405163378db88b60e01b815260026004820152602490fd5b600091031261013957565b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b908160609103126101395790565b50346101395760603660031901126101395767ffffffffffffffff600480358281116101395761040690369083016103c5565b916024359081116101395761041e90369083016103c5565b906044356000938454806106075761043590610891565b855561044460208201826108c4565b6040959150610455838701846108fa565b919050036105ea5761046a60208201826108c4565b9050610478868301836108fa565b919050036105cd57916104d66104c894926104b588956104aa6104996109de565b338152938660208601523690610bfd565b898401523690610d11565b6060820152865195869160208301611036565b03601f1981018652856109bc565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316907f00000000000000000000000000000000000000000000000000000000000000009081156105c65780915b156105c0575083925b823b156105bc5784906105768851978896879586947f490e6cbc00000000000000000000000000000000000000000000000000000000865230908601611088565b03925af180156105af575b610596575b5061059182546110c1565b825551f35b806105a36105a992610947565b80610330565b38610586565b6105b76110b4565b610581565b8480fd5b92610535565b849161052c565b8451631615eca160e21b8152600181860190815281906020010390fd5b8451631615eca160e21b8152600081860190815281906020010390fd5b60405163378db88b60e01b8152600081860190815281906020010390fd5b50346101395760003660031901126101395760206040517f000000000000000000000000000000000000000000000000000000000000000015158152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b5034610139576000366003190112610139576020600054604051908152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346101395760603660031901126101395760443567ffffffffffffffff808211610139573660238301121561013957816004013590811161013957366024828401011161013957602461001992016024356004356111aa565b50634e487b7160e01b600052601160045260246000fd5b906001820180921161089f57565b6108a761087a565b565b600101908160011161089f57565b9190820180921161089f57565b903590601e1981360301821215610139570180359067ffffffffffffffff821161013957602001918160061b3603831361013957565b903590601e1981360301821215610139570180359067ffffffffffffffff821161013957602001918160051b3603831361013957565b50634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161095b57604052565b610963610930565b604052565b6040810190811067ffffffffffffffff82111761095b57604052565b6060810190811067ffffffffffffffff82111761095b57604052565b6080810190811067ffffffffffffffff82111761095b57604052565b90601f8019910116810190811067ffffffffffffffff82111761095b57604052565b604051906080820182811067ffffffffffffffff82111761095b57604052565b6040519060a0820182811067ffffffffffffffff82111761095b57604052565b60209067ffffffffffffffff8111610a38575b60051b0190565b610a40610930565b610a31565b929192610a5182610a1e565b604092610a60845192836109bc565b819581835260208093019160061b84019381851161013957915b848310610a8957505050505050565b858383031261013957838691825183810181811067ffffffffffffffff821117610ad0575b84528535610abb81610128565b81528286013583820152815201920191610a7a565b610ad8610930565b610aae565b9080601f8301121561013957816020610af893359101610a45565b90565b90601f81818401121561013957823592610b1484610a1e565b93604093610b24855196876109bc565b818652602094858088019360051b8501019482861161013957868501935b868510610b5457505050505050505090565b67ffffffffffffffff853581811161013957870191601f19928584828903011261013957855190610b8482610968565b8b8101358481116101395781019088603f83011215610139578c820135948511610bf0575b610bbb8d8951978988011601876109bc565b84865288888684010111610139578c956000878781988c80970183860137830101528352013583820152815201940193610b42565b610bf8610930565b610ba9565b91906060838203126101395760405190610c1682610984565b819380359167ffffffffffffffff9283811161013957820181601f820112156101395781816020610c4993359101610a45565b845260208201358381116101395781610c63918401610add565b6020850152604082013592831161013957604092610c819201610afb565b910152565b81601f8201121561013957803590610c9d82610a1e565b92604092610cad845195866109bc565b808552602091828087019260061b85010193818511610139578301915b848310610cda5750505050505090565b8583830312610139578386918251610cf181610968565b8535610cfc81610128565b81528286013583820152815201920191610cca565b919091606081840312610139576040805191610d2c83610984565b8294813567ffffffffffffffff9081811161013957830182601f8201121561013957803590610d5a82610a1e565b90610d67875192836109bc565b828252602092838084019160061b83010191868311610139578401905b828210610dc0575050508652808401358281116101395783610da7918601610c86565b908601528383013590811161013957610c819201610afb565b8882880312610139578489918251610dd781610968565b8435610de281610128565b81528285013583820152815201910190610d84565b919082519283825260005b848110610e23575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201610e02565b90815180825260208092019182818360051b85019501936000915b848310610e625750505050505090565b909192939495848082846001940386528951908280610e8984516040808652850190610df7565b9301519101529801930193019194939290610e52565b919060608101908351606082528051809352608082019260208092019060005b818110610f3a5750505080850151928281038284015281808551928381520194019160005b828110610f0657505050506040610af893940151906040818403910152610e37565b9091929482604082610f2e6001948a51602080916001600160a01b0381511684520151910152565b01960193929101610ee4565b9091929485604082610f626001948851602080916001600160a01b0381511684520151910152565b01969401929101610ebf565b90815180825260208080930193019160005b828110610f8e575050505090565b835180516001600160a01b031686528201518583015260409094019392810192600101610f80565b91909160608301928151606082528051809552608082019460208092019060005b81811061100e57505050610ffd610af89495826040938601519085830390860152610f6e565b920151906040818403910152610e37565b825180516001600160a01b031689528401518489015260409097019691830191600101610fd7565b90610af891602081526001600160a01b038251166020820152602082015160408201526060611073604084015160808385015260a0840190610e9f565b920151906080601f1982850301910152610fb6565b90926080926001600160a01b03610af89695168352602083015260408201528160608201520190610df7565b506040513d6000823e3d90fd5b60001981019190821161089f57565b9190820391821161089f57565b9060208282031261013957813567ffffffffffffffff928382116101395701906080828203126101395760405192611114846109a0565b823561111f81610128565b84526020830135602085015260408301358181116101395782611143918501610bfd565b604085015260608301359081116101395761115e9201610d11565b606082015290565b90816020910312610139575190565b906060926111926111a09297969597608085526080850190610e9f565b908382036020850152610fb6565b9460408201520152565b91909260009360018554036114b7576001600160a01b0392837f0000000000000000000000000000000000000000000000000000000000000000169283330361148557816111fd916112359301906110dd565b9160208301958651917f000000000000000000000000000000000000000000000000000000000000000060001461147d5750906108b7565b81516001600160a01b03169261125160408401948551906115ae565b8161126384516001600160a01b031690565b9761127460608601998a5190611f74565b6040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000009190888316602082602481845afa918215611470575b8392611450575b50848210611365575b505050906112df9261027d9261263c565b611333577fbb8de142bb152399837bcf93d4e2a07f28b940eeb90ba1349bb918fd675277749461131961132e93516001600160a01b031690565b93519651905190604051958695169785611175565b0390a2565b6040517f032e8ffd00000000000000000000000000000000000000000000000000000000815260006004820152602490fd5b9091929350887f000000000000000000000000000000000000000000000000000000000000000016906113a96113a289516001600160a01b031690565b93886110d0565b92823b156105bc576040517f264413180000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201523060248201529116604482015260648101929092526112df9461027d948794919390929091908290608490829084905af18015611443575b611430575b829550819394506112ce565b806105a361143d92610947565b38611424565b61144b6110b4565b61141f565b61146991925060203d8111610303576102f381836109bc565b90386112c5565b6114786110b4565b6112be565b9050906108b7565b6040517f25dc2e6700000000000000000000000000000000000000000000000000000000815260006004820152602490fd5b60405163378db88b60e01b815260016004820152602490fd5b60019060001981146114e0570190565b6114e861087a565b0190565b80518210156115005760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b6020815260a06080611533845183602086015260c0850190610df7565b936001600160a01b03602082015116604085015260408101516060850152606081015182850152015191015290565b908160209103126101395751610af881610128565b90816020910312610139575180151581036101395790565b80600019048211811515166115a2570290565b6115aa61087a565b0290565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169392909160005b602090818401518051821015611aa157816115fa916114ec565b51828101516000198103611a9b575061162961161d82516001600160a01b031690565b6001600160a01b031690565b6040517f17bfdfbc0000000000000000000000000000000000000000000000000000000081526001600160a01b0386166004820152908490829060249082906000905af1908115611a8e575b600091611a71575b50905b604093848701816116928683516114ec565b5151516119b3575b5050876116ae83516001600160a01b031690565b168a81036117f957505061161d61161d6116cf92516001600160a01b031690565b90867f00000000000000000000000000000000000000000000000000000000000000001691823b1561013957879085517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815260008160049681838161173c8a8c83019190602083019252565b03925af180156117ec575b6117d9575b501693843b1561013957517fe59746190000000000000000000000000000000000000000000000000000000081526001600160a01b0386169281019283526117b4949092600092849291839190829060200103925af180156117cc575b6117b9575b506114d0565b6115e0565b806105a36117c692610947565b386117ae565b6117d46110b4565b6117a9565b806105a36117e692610947565b3861174c565b6117f46110b4565b611747565b8592939194955193636f307dc360e01b855261183e61161d8b60049789818a8160008a5af19081156119a6575b600091611979575b501692516001600160a01b031690565b91813b156101395783611886600080966118e1958b97838c8c519687958694859363095ea7b360e01b85528401602090939291936001600160a01b0360408201951681520152565b03925af1801561196c575b611959575b5085519485809481937f2608f8180000000000000000000000000000000000000000000000000000000083528d8b8401602090939291936001600160a01b0360408201951681520152565b03925af193841561194c575b60009461192d575b505082611908575050506117b4906114d0565b61020d9051928392630eacb3ff60e31b84528301919060206040840193600081520152565b611944929450803d10610303576102f381836109bc565b9138806118f5565b6119546110b4565b6118ed565b806105a361196692610947565b38611896565b6119746110b4565b611891565b61199991508a3d8c1161199f575b61199181836109bc565b810190611562565b3861182e565b503d611987565b6119ae6110b4565b611826565b81816119d0886119c781611a0c97516114ec565b515193516114ec565b5101516119db6109fe565b918252308383015242898301528660608301526080820152875180938192631e51809360e31b835260048301611516565b038160008d7f0000000000000000000000000000000000000000000000000000000000000000165af18015611a64575b611a47575b8161169a565b611a5d90823d8411610303576102f381836109bc565b5038611a41565b611a6c6110b4565b611a3c565b611a889150843d8611610303576102f381836109bc565b3861167d565b611a966110b4565b611675565b90611680565b5092947f000000000000000000000000000000000000000000000000000000000000000085169350905060005b85518051821015611f6a5790611ae58185936114ec565b516020808201516000198103611f645750611b0a61161d83516001600160a01b031690565b6040516370a0823160e01b81526001600160a01b0386166004820152908290829060249082906000905af1908115611f57575b600091611f3a575b50905b611b5c61161d84516001600160a01b031690565b604080516323b872dd60e01b81526001600160a01b039790971660048089019190915230602489015260448801859052969093918390829060649082906000905af1908115611f2d575b600091611f00575b5015611ed857611c078282611bcd61161d88516001600160a01b031690565b89600088518096819582947fdb006a7500000000000000000000000000000000000000000000000000000000845283019190602083019252565b03925af1908115611ecb575b600091611eae575b5080611e7c575090611c90611c828b938884611c4161161d8a516001600160a01b031690565b8851928380927f182df0f50000000000000000000000000000000000000000000000000000000082525afa908115611e6f575b600091611e52575b5061158f565b670de0b6b3a7640000900490565b9382611ca5600092516001600160a01b031690565b168d8103611dfa575050507f000000000000000000000000000000000000000000000000000000000000000016803b1561013957889082517fd0e30db0000000000000000000000000000000000000000000000000000000008152600081888188865af18015611ded575b611dda575b505b1691823b1561013957815163095ea7b360e01b81526001600160a01b0389168682019081526020810183905260009082908190604001038183885af18015611dcd575b611dba575b50873b15610139579051634232cd6360e01b81526001600160a01b0380881695820195865290921660208501526040840152611db592600090829081906060010381838a5af180156117cc576117b957506114d0565b611ace565b806105a3611dc792610947565b38611d5f565b611dd56110b4565b611d5a565b806105a3611de792610947565b38611d15565b611df56110b4565b611d10565b82849383928a885180958193636f307dc360e01b83525af1928315611e45575b92611e28575b505016611d17565b611e3e9250803d1061199f5761199181836109bc565b3880611e20565b611e4d6110b4565b611e1a565b611e699150853d8711610303576102f381836109bc565b38611c7c565b611e776110b4565b611c74565b8661020d8592611e8b896108a9565b9351938493630eacb3ff60e31b8552840160209093929193604081019481520152565b611ec59150833d8511610303576102f381836109bc565b38611c1b565b611ed36110b4565b611c13565b8583517fec5b1ccd000000000000000000000000000000000000000000000000000000008152fd5b611f209150833d8511611f26575b611f1881836109bc565b810190611577565b38611bae565b503d611f0e565b611f356110b4565b611ba6565b611f519150823d8411610303576102f381836109bc565b38611b45565b611f5f6110b4565b611b3d565b90611b48565b5050945050505050565b90916000916001600160a01b039384807f000000000000000000000000000000000000000000000000000000000000000016945b60208084015180518310156123185782611fc1916114ec565b518181015160001981036123125750611fe461161d82516001600160a01b031690565b6040516370a0823160e01b81526001600160a01b0388166004820152908390829060249082905afa908115612305575b6000916122e8575b50905b604090818701846120318783516114ec565b515151612233575b505061204f61161d82516001600160a01b031690565b8461208e61161d8551996358b50cef60e11b8b528a84816004809e81995afa908115612226575b600091612209575b501694516001600160a01b031690565b8451988980927fb9a7b6220000000000000000000000000000000000000000000000000000000082525afa9687156121fc575b6000976121dd575b50813b1561013957825163095ea7b360e01b81526001600160a01b038c168282019081526020810186905261218b988795612171938d93600090829081906040010381838b5af180156121d0575b6121bd575b505196879586957f573ade8100000000000000000000000000000000000000000000000000000000875286019293606092959460808501966001600160a01b0380941686526020860152604085015216910152565b038160008c5af180156121b0575b612192575b50506114d0565b8590611fa8565b816121a892903d10610303576102f381836109bc565b503880612184565b6121b86110b4565b61217f565b806105a36121ca92610947565b3861211c565b6121d86110b4565b612117565b6121f5919750853d8711610303576102f381836109bc565b95386120c9565b6122046110b4565b6120c1565b6122209150853d871161199f5761199181836109bc565b3861207e565b61222e6110b4565b612076565b8181612247896119c78161228397516114ec565b5101516122526109fe565b918252308383015242868301528660608301526080820152845180938192631e51809360e31b835260048301611516565b038160008b7f0000000000000000000000000000000000000000000000000000000000000000165af180156122db575b6122be575b84612039565b6122d490853d8711610303576102f381836109bc565b50386122b8565b6122e36110b4565b6122b3565b6122ff9150833d8511610303576102f381836109bc565b3861201c565b61230d6110b4565b612014565b9061201f565b5050505092600092857f000000000000000000000000000000000000000000000000000000000000000016935b85518051821015611f6a578161235a916114ec565b519060208281809401516000198114600014612637575061238561161d82516001600160a01b031690565b6040516370a0823160e01b81526001600160a01b0389166004820152908390829060249082905afa90811561262a575b60009161260d575b505b8a888484516123d4906001600160a01b031690565b604080516323b872dd60e01b81526001600160a01b03948516600480830191909152306024830152604482018890529a91978b95919390929184916064918391165a90600091f161243e9261161d92918015612600575b6125e3575b50516001600160a01b031690565b8551928380926358b50cef60e11b82525afa9081156125d6575b6000916125b9575b50169282517f69328dec0000000000000000000000000000000000000000000000000000000081528181806124b830878a8d85019193929060409160608401956001600160a01b038093168552602085015216910152565b038160008d5af180156125ac575b61258e575b5050823b1561013957815163095ea7b360e01b81526001600160a01b038a168682019081526020810183905260009082908190604001038183885af18015612581575b61256e575b50883b15610139579051634232cd6360e01b81526001600160a01b038089169582019586529092166020850152604084015261256992600090829081906060010381838b5af180156117cc576117b957506114d0565b612345565b806105a361257b92610947565b38612513565b6125896110b4565b61250e565b816125a492903d10610303576102f381836109bc565b5038806124cb565b6125b46110b4565b6124c6565b6125d09150853d871161199f5761199181836109bc565b38612460565b6125de6110b4565b612458565b6125f990853d8711611f2657611f1881836109bc565b5038612430565b6126086110b4565b61242b565b6126249150833d8511610303576102f381836109bc565b386123bd565b6126326110b4565b6123b5565b6123bf565b91906001600160a01b036000931690813b156126ec576040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03919091166004820152602481019290925282908290604490829084905af180156126df575b6126d0575b50903d80156126c8576020146126be575080fd5b90602081803e5190565b506000199150565b6126d990610947565b386126aa565b6126e76110b4565b6126a5565b8380fdfea26469706673582212204efc5770ef87f33fafdbe274ac169704d2d1f9e4fccbaff08c6b23301e44115e64736f6c63430008100033000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed5000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a900000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000e592427a0aece92de3edee1f18e0157c058615640000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925

Deployed Bytecode

0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806301681a621461011f5780633fc8cef31461011657806362e1097d1461010d578063853058c3146101045780639df50c6f146100fb578063a1b4d011146100f2578063b9ea04c7146100e9578063ba3e9c12146100e0578063c31c9c07146100d7578063c55dae63146100ce578063df5089dc146100c5578063e822eb32146100bc5763e9cbafb00361000e576100b7610820565b61000e565b506100b76107db565b506100b7610796565b506100b7610751565b506100b761070c565b506100b76106c7565b506100b76106a8565b506100b7610663565b506100b7610625565b506100b76103d3565b506100b7610380565b506100b761033b565b506100b761013e565b6001600160a01b0381160361013957565b600080fd5b50346101395760203660031901126101395760043561015c81610128565b6000908154610317576001600160a01b0390808216908161021b57505047907f0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc3392516828383838115610211575b82809281926101b696f11590565b6101f457604051918252829133907ffe6f9ffae65cf2c41cdbb3faf5a94e71eab2c2c62215df2efd79e12e451d0b629080602081015b0390a4604051f35b604051636974857f60e11b815260006004820152602490fd5b0390fd5b6108fc93506101a8565b6040516370a0823160e01b81523060048201529192909190602082602481875afa91821561030a575b85926102d2575b5061027d82610281927f0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc3392516809561263c565b1590565b6102b95760405190815233907ffe6f9ffae65cf2c41cdbb3faf5a94e71eab2c2c62215df2efd79e12e451d0b629080602081016101ec565b604051636974857f60e11b815260016004820152602490fd5b6102819192506102fb61027d9160203d8111610303575b6102f381836109bc565b810190611166565b92915061024b565b503d6102e9565b6103126110b4565b610244565b60405163378db88b60e01b815260026004820152602490fd5b600091031261013957565b50346101395760003660031901126101395760206040516001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925168152f35b908160609103126101395790565b50346101395760603660031901126101395767ffffffffffffffff600480358281116101395761040690369083016103c5565b916024359081116101395761041e90369083016103c5565b906044356000938454806106075761043590610891565b855561044460208201826108c4565b6040959150610455838701846108fa565b919050036105ea5761046a60208201826108c4565b9050610478868301836108fa565b919050036105cd57916104d66104c894926104b588956104aa6104996109de565b338152938660208601523690610bfd565b898401523690610d11565b6060820152865195869160208301611036565b03601f1981018652856109bc565b7f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f56406001600160a01b0316907f00000000000000000000000000000000000000000000000000000000000000019081156105c65780915b156105c0575083925b823b156105bc5784906105768851978896879586947f490e6cbc00000000000000000000000000000000000000000000000000000000865230908601611088565b03925af180156105af575b610596575b5061059182546110c1565b825551f35b806105a36105a992610947565b80610330565b38610586565b6105b76110b4565b610581565b8480fd5b92610535565b849161052c565b8451631615eca160e21b8152600181860190815281906020010390fd5b8451631615eca160e21b8152600081860190815281906020010390fd5b60405163378db88b60e01b8152600081860190815281906020010390fd5b50346101395760003660031901126101395760206040517f000000000000000000000000000000000000000000000000000000000000000115158152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed5168152f35b5034610139576000366003190112610139576020600054604051908152f35b50346101395760003660031901126101395760206040516001600160a01b037f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3168152f35b50346101395760003660031901126101395760206040516001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564168152f35b50346101395760003660031901126101395760206040516001600160a01b037f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48168152f35b50346101395760003660031901126101395760206040516001600160a01b037f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640168152f35b50346101395760003660031901126101395760206040516001600160a01b037f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a9168152f35b50346101395760603660031901126101395760443567ffffffffffffffff808211610139573660238301121561013957816004013590811161013957366024828401011161013957602461001992016024356004356111aa565b50634e487b7160e01b600052601160045260246000fd5b906001820180921161089f57565b6108a761087a565b565b600101908160011161089f57565b9190820180921161089f57565b903590601e1981360301821215610139570180359067ffffffffffffffff821161013957602001918160061b3603831361013957565b903590601e1981360301821215610139570180359067ffffffffffffffff821161013957602001918160051b3603831361013957565b50634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161095b57604052565b610963610930565b604052565b6040810190811067ffffffffffffffff82111761095b57604052565b6060810190811067ffffffffffffffff82111761095b57604052565b6080810190811067ffffffffffffffff82111761095b57604052565b90601f8019910116810190811067ffffffffffffffff82111761095b57604052565b604051906080820182811067ffffffffffffffff82111761095b57604052565b6040519060a0820182811067ffffffffffffffff82111761095b57604052565b60209067ffffffffffffffff8111610a38575b60051b0190565b610a40610930565b610a31565b929192610a5182610a1e565b604092610a60845192836109bc565b819581835260208093019160061b84019381851161013957915b848310610a8957505050505050565b858383031261013957838691825183810181811067ffffffffffffffff821117610ad0575b84528535610abb81610128565b81528286013583820152815201920191610a7a565b610ad8610930565b610aae565b9080601f8301121561013957816020610af893359101610a45565b90565b90601f81818401121561013957823592610b1484610a1e565b93604093610b24855196876109bc565b818652602094858088019360051b8501019482861161013957868501935b868510610b5457505050505050505090565b67ffffffffffffffff853581811161013957870191601f19928584828903011261013957855190610b8482610968565b8b8101358481116101395781019088603f83011215610139578c820135948511610bf0575b610bbb8d8951978988011601876109bc565b84865288888684010111610139578c956000878781988c80970183860137830101528352013583820152815201940193610b42565b610bf8610930565b610ba9565b91906060838203126101395760405190610c1682610984565b819380359167ffffffffffffffff9283811161013957820181601f820112156101395781816020610c4993359101610a45565b845260208201358381116101395781610c63918401610add565b6020850152604082013592831161013957604092610c819201610afb565b910152565b81601f8201121561013957803590610c9d82610a1e565b92604092610cad845195866109bc565b808552602091828087019260061b85010193818511610139578301915b848310610cda5750505050505090565b8583830312610139578386918251610cf181610968565b8535610cfc81610128565b81528286013583820152815201920191610cca565b919091606081840312610139576040805191610d2c83610984565b8294813567ffffffffffffffff9081811161013957830182601f8201121561013957803590610d5a82610a1e565b90610d67875192836109bc565b828252602092838084019160061b83010191868311610139578401905b828210610dc0575050508652808401358281116101395783610da7918601610c86565b908601528383013590811161013957610c819201610afb565b8882880312610139578489918251610dd781610968565b8435610de281610128565b81528285013583820152815201910190610d84565b919082519283825260005b848110610e23575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201610e02565b90815180825260208092019182818360051b85019501936000915b848310610e625750505050505090565b909192939495848082846001940386528951908280610e8984516040808652850190610df7565b9301519101529801930193019194939290610e52565b919060608101908351606082528051809352608082019260208092019060005b818110610f3a5750505080850151928281038284015281808551928381520194019160005b828110610f0657505050506040610af893940151906040818403910152610e37565b9091929482604082610f2e6001948a51602080916001600160a01b0381511684520151910152565b01960193929101610ee4565b9091929485604082610f626001948851602080916001600160a01b0381511684520151910152565b01969401929101610ebf565b90815180825260208080930193019160005b828110610f8e575050505090565b835180516001600160a01b031686528201518583015260409094019392810192600101610f80565b91909160608301928151606082528051809552608082019460208092019060005b81811061100e57505050610ffd610af89495826040938601519085830390860152610f6e565b920151906040818403910152610e37565b825180516001600160a01b031689528401518489015260409097019691830191600101610fd7565b90610af891602081526001600160a01b038251166020820152602082015160408201526060611073604084015160808385015260a0840190610e9f565b920151906080601f1982850301910152610fb6565b90926080926001600160a01b03610af89695168352602083015260408201528160608201520190610df7565b506040513d6000823e3d90fd5b60001981019190821161089f57565b9190820391821161089f57565b9060208282031261013957813567ffffffffffffffff928382116101395701906080828203126101395760405192611114846109a0565b823561111f81610128565b84526020830135602085015260408301358181116101395782611143918501610bfd565b604085015260608301359081116101395761115e9201610d11565b606082015290565b90816020910312610139575190565b906060926111926111a09297969597608085526080850190610e9f565b908382036020850152610fb6565b9460408201520152565b91909260009360018554036114b7576001600160a01b0392837f00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640169283330361148557816111fd916112359301906110dd565b9160208301958651917f000000000000000000000000000000000000000000000000000000000000000160001461147d5750906108b7565b81516001600160a01b03169261125160408401948551906115ae565b8161126384516001600160a01b031690565b9761127460608601998a5190611f74565b6040516370a0823160e01b81523060048201527f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb489190888316602082602481845afa918215611470575b8392611450575b50848210611365575b505050906112df9261027d9261263c565b611333577fbb8de142bb152399837bcf93d4e2a07f28b940eeb90ba1349bb918fd675277749461131961132e93516001600160a01b031690565b93519651905190604051958695169785611175565b0390a2565b6040517f032e8ffd00000000000000000000000000000000000000000000000000000000815260006004820152602490fd5b9091929350887f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc316906113a96113a289516001600160a01b031690565b93886110d0565b92823b156105bc576040517f264413180000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201523060248201529116604482015260648101929092526112df9461027d948794919390929091908290608490829084905af18015611443575b611430575b829550819394506112ce565b806105a361143d92610947565b38611424565b61144b6110b4565b61141f565b61146991925060203d8111610303576102f381836109bc565b90386112c5565b6114786110b4565b6112be565b9050906108b7565b6040517f25dc2e6700000000000000000000000000000000000000000000000000000000815260006004820152602490fd5b60405163378db88b60e01b815260016004820152602490fd5b60019060001981146114e0570190565b6114e861087a565b0190565b80518210156115005760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b6020815260a06080611533845183602086015260c0850190610df7565b936001600160a01b03602082015116604085015260408101516060850152606081015182850152015191015290565b908160209103126101395751610af881610128565b90816020910312610139575180151581036101395790565b80600019048211811515166115a2570290565b6115aa61087a565b0290565b6001600160a01b037f0000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed581169392909160005b602090818401518051821015611aa157816115fa916114ec565b51828101516000198103611a9b575061162961161d82516001600160a01b031690565b6001600160a01b031690565b6040517f17bfdfbc0000000000000000000000000000000000000000000000000000000081526001600160a01b0386166004820152908490829060249082906000905af1908115611a8e575b600091611a71575b50905b604093848701816116928683516114ec565b5151516119b3575b5050876116ae83516001600160a01b031690565b168a81036117f957505061161d61161d6116cf92516001600160a01b031690565b90867f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21691823b1561013957879085517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815260008160049681838161173c8a8c83019190602083019252565b03925af180156117ec575b6117d9575b501693843b1561013957517fe59746190000000000000000000000000000000000000000000000000000000081526001600160a01b0386169281019283526117b4949092600092849291839190829060200103925af180156117cc575b6117b9575b506114d0565b6115e0565b806105a36117c692610947565b386117ae565b6117d46110b4565b6117a9565b806105a36117e692610947565b3861174c565b6117f46110b4565b611747565b8592939194955193636f307dc360e01b855261183e61161d8b60049789818a8160008a5af19081156119a6575b600091611979575b501692516001600160a01b031690565b91813b156101395783611886600080966118e1958b97838c8c519687958694859363095ea7b360e01b85528401602090939291936001600160a01b0360408201951681520152565b03925af1801561196c575b611959575b5085519485809481937f2608f8180000000000000000000000000000000000000000000000000000000083528d8b8401602090939291936001600160a01b0360408201951681520152565b03925af193841561194c575b60009461192d575b505082611908575050506117b4906114d0565b61020d9051928392630eacb3ff60e31b84528301919060206040840193600081520152565b611944929450803d10610303576102f381836109bc565b9138806118f5565b6119546110b4565b6118ed565b806105a361196692610947565b38611896565b6119746110b4565b611891565b61199991508a3d8c1161199f575b61199181836109bc565b810190611562565b3861182e565b503d611987565b6119ae6110b4565b611826565b81816119d0886119c781611a0c97516114ec565b515193516114ec565b5101516119db6109fe565b918252308383015242898301528660608301526080820152875180938192631e51809360e31b835260048301611516565b038160008d7f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564165af18015611a64575b611a47575b8161169a565b611a5d90823d8411610303576102f381836109bc565b5038611a41565b611a6c6110b4565b611a3c565b611a889150843d8611610303576102f381836109bc565b3861167d565b611a966110b4565b611675565b90611680565b5092947f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc385169350905060005b85518051821015611f6a5790611ae58185936114ec565b516020808201516000198103611f645750611b0a61161d83516001600160a01b031690565b6040516370a0823160e01b81526001600160a01b0386166004820152908290829060249082906000905af1908115611f57575b600091611f3a575b50905b611b5c61161d84516001600160a01b031690565b604080516323b872dd60e01b81526001600160a01b039790971660048089019190915230602489015260448801859052969093918390829060649082906000905af1908115611f2d575b600091611f00575b5015611ed857611c078282611bcd61161d88516001600160a01b031690565b89600088518096819582947fdb006a7500000000000000000000000000000000000000000000000000000000845283019190602083019252565b03925af1908115611ecb575b600091611eae575b5080611e7c575090611c90611c828b938884611c4161161d8a516001600160a01b031690565b8851928380927f182df0f50000000000000000000000000000000000000000000000000000000082525afa908115611e6f575b600091611e52575b5061158f565b670de0b6b3a7640000900490565b9382611ca5600092516001600160a01b031690565b168d8103611dfa575050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216803b1561013957889082517fd0e30db0000000000000000000000000000000000000000000000000000000008152600081888188865af18015611ded575b611dda575b505b1691823b1561013957815163095ea7b360e01b81526001600160a01b0389168682019081526020810183905260009082908190604001038183885af18015611dcd575b611dba575b50873b15610139579051634232cd6360e01b81526001600160a01b0380881695820195865290921660208501526040840152611db592600090829081906060010381838a5af180156117cc576117b957506114d0565b611ace565b806105a3611dc792610947565b38611d5f565b611dd56110b4565b611d5a565b806105a3611de792610947565b38611d15565b611df56110b4565b611d10565b82849383928a885180958193636f307dc360e01b83525af1928315611e45575b92611e28575b505016611d17565b611e3e9250803d1061199f5761199181836109bc565b3880611e20565b611e4d6110b4565b611e1a565b611e699150853d8711610303576102f381836109bc565b38611c7c565b611e776110b4565b611c74565b8661020d8592611e8b896108a9565b9351938493630eacb3ff60e31b8552840160209093929193604081019481520152565b611ec59150833d8511610303576102f381836109bc565b38611c1b565b611ed36110b4565b611c13565b8583517fec5b1ccd000000000000000000000000000000000000000000000000000000008152fd5b611f209150833d8511611f26575b611f1881836109bc565b810190611577565b38611bae565b503d611f0e565b611f356110b4565b611ba6565b611f519150823d8411610303576102f381836109bc565b38611b45565b611f5f6110b4565b611b3d565b90611b48565b5050945050505050565b90916000916001600160a01b039384807f0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a916945b60208084015180518310156123185782611fc1916114ec565b518181015160001981036123125750611fe461161d82516001600160a01b031690565b6040516370a0823160e01b81526001600160a01b0388166004820152908390829060249082905afa908115612305575b6000916122e8575b50905b604090818701846120318783516114ec565b515151612233575b505061204f61161d82516001600160a01b031690565b8461208e61161d8551996358b50cef60e11b8b528a84816004809e81995afa908115612226575b600091612209575b501694516001600160a01b031690565b8451988980927fb9a7b6220000000000000000000000000000000000000000000000000000000082525afa9687156121fc575b6000976121dd575b50813b1561013957825163095ea7b360e01b81526001600160a01b038c168282019081526020810186905261218b988795612171938d93600090829081906040010381838b5af180156121d0575b6121bd575b505196879586957f573ade8100000000000000000000000000000000000000000000000000000000875286019293606092959460808501966001600160a01b0380941686526020860152604085015216910152565b038160008c5af180156121b0575b612192575b50506114d0565b8590611fa8565b816121a892903d10610303576102f381836109bc565b503880612184565b6121b86110b4565b61217f565b806105a36121ca92610947565b3861211c565b6121d86110b4565b612117565b6121f5919750853d8711610303576102f381836109bc565b95386120c9565b6122046110b4565b6120c1565b6122209150853d871161199f5761199181836109bc565b3861207e565b61222e6110b4565b612076565b8181612247896119c78161228397516114ec565b5101516122526109fe565b918252308383015242868301528660608301526080820152845180938192631e51809360e31b835260048301611516565b038160008b7f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564165af180156122db575b6122be575b84612039565b6122d490853d8711610303576102f381836109bc565b50386122b8565b6122e36110b4565b6122b3565b6122ff9150833d8511610303576102f381836109bc565b3861201c565b61230d6110b4565b612014565b9061201f565b5050505092600092857f000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc316935b85518051821015611f6a578161235a916114ec565b519060208281809401516000198114600014612637575061238561161d82516001600160a01b031690565b6040516370a0823160e01b81526001600160a01b0389166004820152908390829060249082905afa90811561262a575b60009161260d575b505b8a888484516123d4906001600160a01b031690565b604080516323b872dd60e01b81526001600160a01b03948516600480830191909152306024830152604482018890529a91978b95919390929184916064918391165a90600091f161243e9261161d92918015612600575b6125e3575b50516001600160a01b031690565b8551928380926358b50cef60e11b82525afa9081156125d6575b6000916125b9575b50169282517f69328dec0000000000000000000000000000000000000000000000000000000081528181806124b830878a8d85019193929060409160608401956001600160a01b038093168552602085015216910152565b038160008d5af180156125ac575b61258e575b5050823b1561013957815163095ea7b360e01b81526001600160a01b038a168682019081526020810183905260009082908190604001038183885af18015612581575b61256e575b50883b15610139579051634232cd6360e01b81526001600160a01b038089169582019586529092166020850152604084015261256992600090829081906060010381838b5af180156117cc576117b957506114d0565b612345565b806105a361257b92610947565b38612513565b6125896110b4565b61250e565b816125a492903d10610303576102f381836109bc565b5038806124cb565b6125b46110b4565b6124c6565b6125d09150853d871161199f5761199181836109bc565b38612460565b6125de6110b4565b612458565b6125f990853d8711611f2657611f1881836109bc565b5038612430565b6126086110b4565b61242b565b6126249150833d8511610303576102f381836109bc565b386123bd565b6126326110b4565b6123b5565b6123bf565b91906001600160a01b036000931690813b156126ec576040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b03919091166004820152602481019290925282908290604490829084905af180156126df575b6126d0575b50903d80156126c8576020146126be575080fd5b90602081803e5190565b506000199150565b6126d990610947565b386126aa565b6126e76110b4565b6126a5565b8380fdfea26469706673582212204efc5770ef87f33fafdbe274ac169704d2d1f9e4fccbaff08c6b23301e44115e64736f6c63430008100033

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

000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed5000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a900000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000e592427a0aece92de3edee1f18e0157c058615640000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925

-----Decoded View---------------
Arg [0] : comet_ (address): 0xc3d688B66703497DAA19211EEdff47f25384cdc3
Arg [1] : baseToken_ (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : cETH_ (address): 0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5
Arg [3] : weth_ (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [4] : aaveV2LendingPool_ (address): 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9
Arg [5] : uniswapLiquidityPool_ (address): 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640
Arg [6] : swapRouter_ (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564
Arg [7] : sweepee_ (address): 0x6d903f6003cca6255D85CcA4D3B5E5146dC33925

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000c3d688b66703497daa19211eedff47f25384cdc3
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 0000000000000000000000004ddc2d193948926d02f9b1fe9e1daa0718270ed5
Arg [3] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [4] : 0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a9
Arg [5] : 00000000000000000000000088e6a0c2ddd26feeb64f039a2c41296fcb3f5640
Arg [6] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Arg [7] : 0000000000000000000000006d903f6003cca6255d85cca4d3b5e5146dc33925


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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