ETH Price: $2,340.75 (-0.70%)

Contract

0x968603e045d0a9DC1b3F055C2076B5e201A8541D
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Enter New Paradi...194504402024-03-16 22:32:35179 days ago1710628355IN
0x968603e0...201A8541D
0 ETH0.0062803632.60934208
Liquidate Tokens194504402024-03-16 22:32:35179 days ago1710628355IN
0x968603e0...201A8541D
0 ETH0.0354348334
Enter New Paradi...194503962024-03-16 22:23:35179 days ago1710627815IN
0x968603e0...201A8541D
0 ETH0.0077993737.95796805
Liquidate Tokens194503932024-03-16 22:22:59179 days ago1710627779IN
0x968603e0...201A8541D
0 ETH0.0445950642.01092941
Enter New Paradi...194503932024-03-16 22:22:59179 days ago1710627779IN
0x968603e0...201A8541D
0 ETH0.0073734242.01092941
Liquidate Tokens194503902024-03-16 22:22:23179 days ago1710627743IN
0x968603e0...201A8541D
0 ETH0.0439301641.38346743
Enter New Paradi...194503902024-03-16 22:22:23179 days ago1710627743IN
0x968603e0...201A8541D
0 ETH0.0072640441.38346743
Liquidate Tokens194503882024-03-16 22:21:59179 days ago1710627719IN
0x968603e0...201A8541D
0 ETH0.0425272640.06295584
Enter New Paradi...194503882024-03-16 22:21:59179 days ago1710627719IN
0x968603e0...201A8541D
0 ETH0.0070328140.06295584
Liquidate Tokens194503792024-03-16 22:20:11179 days ago1710627611IN
0x968603e0...201A8541D
0 ETH0.030565428.79424332
Enter New Paradi...194503792024-03-16 22:20:11179 days ago1710627611IN
0x968603e0...201A8541D
0 ETH0.0050529828.79424332
Liquidate Tokens194503432024-03-16 22:12:59179 days ago1710627179IN
0x968603e0...201A8541D
0 ETH0.0424185430.11132716
Enter New Paradi...194503092024-03-16 22:06:11179 days ago1710626771IN
0x968603e0...201A8541D
0 ETH0.0068178335.3996796
Enter New Paradi...188745132023-12-27 4:05:59260 days ago1703649959IN
0x968603e0...201A8541D
0 ETH0.0068162515.98075648
Liquidate Tokens188744862023-12-27 4:00:35260 days ago1703649635IN
0x968603e0...201A8541D
0 ETH0.0228861717.02028703
Enter New Paradi...188744852023-12-27 4:00:23260 days ago1703649623IN
0x968603e0...201A8541D
0 ETH0.0068128616.43005181
Enter New Paradi...187665422023-12-12 0:30:11275 days ago1702341011IN
0x968603e0...201A8541D
0 ETH0.024534840.47458176
Enter New Paradi...186778392023-11-29 14:22:23288 days ago1701267743IN
0x968603e0...201A8541D
0 ETH0.0274825945.33376507
Burn Chad185603992023-11-13 3:47:23304 days ago1699847243IN
0x968603e0...201A8541D
0 ETH0.0403628937.53347477
Enter New Paradi...185444752023-11-10 22:17:59306 days ago1699654679IN
0x968603e0...201A8541D
0 ETH0.0222044836.63066239
Burn Chad185096852023-11-06 1:31:11311 days ago1699234271IN
0x968603e0...201A8541D
0 ETH0.0237758822.10920342
Enter New Paradi...184870192023-11-02 21:18:11314 days ago1698959891IN
0x968603e0...201A8541D
0 ETH0.0141616723.36193788
Enter New Paradi...184595092023-10-30 0:49:23318 days ago1698626963IN
0x968603e0...201A8541D
0 ETH0.0103823915.39159227
Liquidate Tokens184595082023-10-30 0:49:11318 days ago1698626951IN
0x968603e0...201A8541D
0 ETH0.0163594215.07383402
Enter New Paradi...184516492023-10-28 22:23:35319 days ago1698531815IN
0x968603e0...201A8541D
0 ETH0.0033132311.615568
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
194504402024-03-16 22:32:35179 days ago1710628355
0x968603e0...201A8541D
0.02908644 ETH
194504402024-03-16 22:32:35179 days ago1710628355
0x968603e0...201A8541D
0.02908644 ETH
194504402024-03-16 22:32:35179 days ago1710628355
0x968603e0...201A8541D
 Contract Creation0 ETH
194503962024-03-16 22:23:35179 days ago1710627815
0x968603e0...201A8541D
0.05885636 ETH
194503962024-03-16 22:23:35179 days ago1710627815
0x968603e0...201A8541D
0.05885636 ETH
194503932024-03-16 22:22:59179 days ago1710627779
0x968603e0...201A8541D
 Contract Creation0 ETH
194503932024-03-16 22:22:59179 days ago1710627779
0x968603e0...201A8541D
0.05905567 ETH
194503932024-03-16 22:22:59179 days ago1710627779
0x968603e0...201A8541D
0.05905567 ETH
194503902024-03-16 22:22:23179 days ago1710627743
0x968603e0...201A8541D
 Contract Creation0 ETH
194503902024-03-16 22:22:23179 days ago1710627743
0x968603e0...201A8541D
0.0592574 ETH
194503902024-03-16 22:22:23179 days ago1710627743
0x968603e0...201A8541D
0.0592574 ETH
194503882024-03-16 22:21:59179 days ago1710627719
0x968603e0...201A8541D
 Contract Creation0 ETH
194503882024-03-16 22:21:59179 days ago1710627719
0x968603e0...201A8541D
0.05946016 ETH
194503882024-03-16 22:21:59179 days ago1710627719
0x968603e0...201A8541D
0.05946016 ETH
194503792024-03-16 22:20:11179 days ago1710627611
0x968603e0...201A8541D
 Contract Creation0 ETH
194503792024-03-16 22:20:11179 days ago1710627611
0x968603e0...201A8541D
0.07325264 ETH
194503792024-03-16 22:20:11179 days ago1710627611
0x968603e0...201A8541D
0.07325264 ETH
194503432024-03-16 22:12:59179 days ago1710627179
0x968603e0...201A8541D
 Contract Creation0 ETH
194503092024-03-16 22:06:11179 days ago1710626771
0x968603e0...201A8541D
0.00931367 ETH
194503092024-03-16 22:06:11179 days ago1710626771
0x968603e0...201A8541D
0.00931367 ETH
188745132023-12-27 4:05:59260 days ago1703649959
0x968603e0...201A8541D
0.03167164 ETH
188745132023-12-27 4:05:59260 days ago1703649959
0x968603e0...201A8541D
0.03167164 ETH
188744862023-12-27 4:00:35260 days ago1703649635
0x968603e0...201A8541D
 Contract Creation0 ETH
188744852023-12-27 4:00:23260 days ago1703649623
0x968603e0...201A8541D
0.00295188 ETH
188744852023-12-27 4:00:23260 days ago1703649623
0x968603e0...201A8541D
0.00295188 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Thundercock

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion
File 1 of 12 : Thundercock.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Owned} from "solmate/auth/Owned.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {WETH} from "solmate/tokens/WETH.sol";
import {Index} from "./Index.sol";
import {LightningBolt} from "./LightningBolt.sol";

import {IUniswapV2Router} from "./interfaces/IUniswapV2Router.sol";
import {ISwapRouter} from "@uniswap/v3-periphery/interfaces/ISwapRouter.sol";

//
//       .____.
//    xuu$``$$$uuu.
//  . $``$  $$$`$$$
// dP*$  $  $$$ $$$
// ?k $  $  $$$ $$$
//  $ $  $  $$$ $$$
//  ":$  $  $$$ $$$
//   N$  $  $$$ $$$
//   $$  $  $$$ $$$
//    $  $  $$$ $$$
//    $  $  $$$ $$$
//    $  $  $$$ $$$
//    $  $  $$$ $$$
//    $  $  $$$ $$$
//    $$#$  $$$ $$$
//    $$'$  $$$ $$$±
//    $$`R  $$$ $$$
//    $$$&  $$$ $$$
//    $#*$  $$$ $$$
//    $  $  $$$ @$$
//    $  $  $$$ $$$
//    $  $  $$$ $$$
//    $  $  $B$ $$&.
//    $  $  $D$ $$$$$muL.
//    $  $  $Q$ $$$$$  `"**mu..
//    $  $  $R$ $$$$$    k  `$$*t
//    $  @  $$$ $$$$$    k   $$!4
//    $ x$uu@B8u$NB@$uuuu6...$$X?
//    $ $(`RF`$`````R$ $$5`"""#"R
//    $ $" M$ $     $$ $$$      ?
//    $ $  ?$ $     T$ $$$      $
//    $ $F H$ $     M$ $$K      $  ..
//    $ $L $$ $     $$ $$R.     "d$$$$Ns.
//    $ $~ $$ $     N$ $$X      ."    "%2h
//    $ 4k f  $     *$ $$&      R       "iN
//    $ $$ %uz!     tuuR$$:     Buu      ?`:
//    $ $F          $??$8B      | '*Ned*$~L$
//    $ $k          $'@$$$      |$.suu+!' !$
//    $ ?N          $'$$@$      $*`      d:"
//    $ dL..........M.$&$$      5       d"P
//  ..$.^"*I$RR*$C""??77*?      "nu...n*L*
// '$C"R   ``""!$*@#""` .uor    bu8BUU+!`
// '*@m@.       *d"     *$Rouxxd"```$
//      R*@mu.           "#$R *$    !
//      *%x. "*L               $     %.
//         "N  `%.      ...u.d!` ..ue$$$o..
//          @    ".    $*"""" .u$$$$$$$$$$$$beu...
//         8  .mL %  :R`     x$$$$$$$$$$$$$$$$$$$$$$$$$$WmeemeeWc
//        |$e!" "s:k 4      d$N"`"#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//        $$      "N @      $?$    F$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//        $@       ^%Uu..   R#8buu$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                   ```""*u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                          #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                           "5$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                             `*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                               ^#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                                  "*$$$$$$$$$$$$$$$$$$$$$$$$$$>
//                                    `"*$$$$$$$$$$$$$$$$$$$$$$$>
//                                        ^!$$$$$$$$$$$$$$$$$$$$>
//                                            `"#+$$$$$$$$$$$$$$>
//                                                  ""**$$$$$$$$>
//                                                         ```""
//
// CHAD                   STAYS                     THUNDERCOCKED
//
contract Thundercock is Owned {
  using SafeTransferLib for ERC20;
  struct SellOrder {
    address token;
    uint256 amount;
    Index.UniswapVersion version;
    uint24 fee;
  }

  event IndexComponentUpdated(address indexed token, uint8 weight);
  event TokenPurchased(address indexed token, uint256 amount);
  event TokenRedeemed(address indexed token, uint256 amount);
  event TokenSold(address indexed token, uint256 amount);
  event TokenReturned(address indexed token, uint256 amount);

  IUniswapV2Router public immutable uniswapV2Router;
  ISwapRouter public immutable uniswapV3Router;
  address public immutable wethAddress;

  Index public immutable index;
  address public immutable timelock;
  address public immutable chad;

  constructor(address timelockAddress) Owned(msg.sender) {
    index = Index(payable(0xdCe46b2D2193b5fab04b3129eA9498c9B601A140));
    timelock = timelockAddress;
    chad = 0xB777eb033557490abb7Fb8F3948000826423Ea07;
    uniswapV2Router = IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
    uniswapV3Router = ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);
    wethAddress = uniswapV2Router.WETH();
  }

  receive() external payable {
    WETH(payable(wethAddress)).deposit{value: msg.value}();
  }

  function _requireIsOwner() internal view {
    require(msg.sender == owner, "!owner");
  }

  function reclaimIndexOwnership() external {
    _requireIsOwner();
    index.transferOwnership(owner);
  }

  function liquidateTokens(SellOrder[] calldata orders) external {
    _requireIsOwner();
    _redeemIndex();

    uint256 saleAmount;
    uint256 tokenBalance;
    address token;
    uint24 fee;
    Index.UniswapVersion version;

    for (uint256 i; i < orders.length; ) {
      token = orders[i].token;
      saleAmount = orders[i].amount;
      fee = orders[i].fee;
      version = orders[i].version;
      tokenBalance = ERC20(token).balanceOf(address(this));
      if (saleAmount > tokenBalance) {
        saleAmount = tokenBalance;
      }
      if (version == Index.UniswapVersion.V2) {
        _sellToV2(token, saleAmount);
      } else {
        _sellToV3(token, saleAmount, fee);
      }
      unchecked {
        i++;
      }
    }

    ERC20(wethAddress).safeTransfer(address(index), ERC20(wethAddress).balanceOf(address(this)));
    _returnAssets();
  }

  function enterNewParadigm() external {
    _requireIsOwner();
    uint256 priorWethBalance = ERC20(wethAddress).balanceOf(address(this));
    index.enterNewParadigm();
    ERC20(wethAddress).safeTransfer(msg.sender, ERC20(wethAddress).balanceOf(address(this)) - priorWethBalance);
  }

  function enterNewParadigmAndBurn() external {
    _requireIsOwner();
    _redeemIndex();

    uint256 etherBalance = address(this).balance;
    if (etherBalance > 0) {
      WETH(payable(wethAddress)).deposit{value: etherBalance}();
    }
    uint256 wethBalance = ERC20(wethAddress).balanceOf(address(this));

    if (wethBalance == 0) {
      return;
    }

    uint256 managementFee = (wethBalance * 2) / 100;
    uint256 purchaseAmount = (wethBalance * 98) / 100;

    WETH(payable(wethAddress)).withdraw(managementFee);
    (bool success, ) = address(owner).call{value: managementFee}("");
    require(success);

    address token;
    uint256 ethAmount;
    uint8 weight;
    uint24 fee;
    Index.UniswapVersion version;

    for (uint8 i = 0; i < index.currentTokenCount(); ) {
      token = index.tokens(i);
      (, weight, fee, version) = index.components(token);
      ethAmount = (weight * purchaseAmount) / 100;
      if (version == Index.UniswapVersion.V2) {
        _purchaseFromV2(token, ethAmount);
      } else {
        _purchaseFromV3(token, ethAmount, fee);
      }
      unchecked {
        i++;
      }
    }

    _returnAssets();
  }

  function burnChad() external {
    _requireIsOwner();
    require(ERC20(chad).balanceOf(address(index)) > 0, "!chad");
    _redeemIndex();
    _returnAssets();
  }

  function setChad() external {
    _requireIsOwner();
    index.setChad(chad);
  }

  function _redeemIndex() internal {
    ERC20 redemptionToken = new LightningBolt();
    index.setChad(address(redemptionToken));
    index.redeem(redemptionToken.balanceOf(address(this)));
    index.setChad(chad);
    uint256 chadBalance = ERC20(chad).balanceOf(address(this));
    if (chadBalance > 0) {
      index.redeem(chadBalance);
    }
  }

  function _returnAssets() internal {
    Index.TokenAmount[] memory tokenAmounts = index.redemptionAmounts();
    for (uint i; i < tokenAmounts.length; ) {
      address token = tokenAmounts[i].token;
      uint256 balance = ERC20(token).balanceOf(address(this));
      if (balance > 0) {
        ERC20(token).safeTransfer(address(index), balance);
        emit TokenReturned(token, balance);
      }
      unchecked {
        i++;
      }
    }
  }

  function _purchaseFromV2(address token, uint256 amount) internal {
    address[] memory path = new address[](2);
    path[0] = wethAddress;
    path[1] = token;
    uint256 balanceBefore = ERC20(token).balanceOf(address(this));
    uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
      amount,
      0,
      path,
      address(this),
      block.timestamp
    );
    uint256 balanceAfter = ERC20(token).balanceOf(address(this));
    emit TokenPurchased(token, balanceAfter - balanceBefore);
  }

  function _purchaseFromV3(address token, uint256 amount, uint24 fee) internal {
    uint256 balanceBefore = ERC20(token).balanceOf(address(this));
    uniswapV3Router.exactInput(
      ISwapRouter.ExactInputParams({
        path: abi.encodePacked(wethAddress, fee, token),
        recipient: address(this),
        deadline: block.timestamp,
        amountIn: amount,
        amountOutMinimum: 0
      })
    );
    uint256 balanceAfter = ERC20(token).balanceOf(address(this));
    emit TokenPurchased(token, balanceAfter - balanceBefore);
  }

  function _sellToV2(address token, uint256 amount) internal {
    ERC20(token).approve(address(uniswapV2Router), type(uint256).max);
    address[] memory path = new address[](2);
    path[0] = token;
    path[1] = wethAddress;
    uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
      amount,
      0,
      path,
      address(this),
      block.timestamp
    );
    emit TokenSold(token, amount);
  }

  function _sellToV3(address token, uint256 amount, uint24 fee) internal {
    ERC20(token).approve(address(uniswapV3Router), type(uint256).max);
    uniswapV3Router.exactInput(
      ISwapRouter.ExactInputParams({
        path: abi.encodePacked(token, fee, wethAddress),
        recipient: address(this),
        deadline: block.timestamp,
        amountIn: amount,
        amountOutMinimum: 0
      })
    );
    emit TokenSold(token, amount);
  }

  // Emergency Function

  function executeAssembly(address _target, bytes memory _data) public payable returns (bytes memory response) {
    require(msg.sender == timelock, "!timelock");
    require(_target != address(0), "!target");

    // call contract in current context
    assembly {
      let succeeded := delegatecall(sub(gas(), 5000), _target, add(_data, 0x20), mload(_data), 0, 0)
      let size := returndatasize()

      response := mload(0x40)
      mstore(0x40, add(response, and(add(add(size, 0x20), 0x1f), not(0x1f))))
      mstore(response, size)
      returndatacopy(add(response, 0x20), 0, size)

      switch iszero(succeeded)
      case 1 {
        // throw if delegatecall failed
        revert(add(response, 0x20), size)
      }
    }
  }

  function execute(address _target, bytes calldata _data) external {
    require(msg.sender == timelock, "!timelock");
    require(_target != address(0), "!target");

    (bool success, ) = _target.call(_data);
    require(success);
  }
}

File 2 of 12 : Owned.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Simple single owner authorization mixin.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)
abstract contract Owned {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

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

    /*//////////////////////////////////////////////////////////////
                            OWNERSHIP STORAGE
    //////////////////////////////////////////////////////////////*/

    address public owner;

    modifier onlyOwner() virtual {
        require(msg.sender == owner, "UNAUTHORIZED");

        _;
    }

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(address _owner) {
        owner = _owner;

        emit OwnershipTransferred(address(0), _owner);
    }

    /*//////////////////////////////////////////////////////////////
                             OWNERSHIP LOGIC
    //////////////////////////////////////////////////////////////*/

    function transferOwnership(address newOwner) public virtual onlyOwner {
        owner = newOwner;

        emit OwnershipTransferred(msg.sender, newOwner);
    }
}

File 3 of 12 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 4 of 12 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument.
            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 5 of 12 : WETH.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "./ERC20.sol";

import {SafeTransferLib} from "../utils/SafeTransferLib.sol";

/// @notice Minimalist and modern Wrapped Ether implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/WETH.sol)
/// @author Inspired by WETH9 (https://github.com/dapphub/ds-weth/blob/master/src/weth9.sol)
contract WETH is ERC20("Wrapped Ether", "WETH", 18) {
    using SafeTransferLib for address;

    event Deposit(address indexed from, uint256 amount);

    event Withdrawal(address indexed to, uint256 amount);

    function deposit() public payable virtual {
        _mint(msg.sender, msg.value);

        emit Deposit(msg.sender, msg.value);
    }

    function withdraw(uint256 amount) public virtual {
        _burn(msg.sender, amount);

        emit Withdrawal(msg.sender, amount);

        msg.sender.safeTransferETH(amount);
    }

    receive() external payable virtual {
        deposit();
    }
}

File 6 of 12 : Index.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Owned} from "solmate/auth/Owned.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {WETH as IWETH} from "solmate/tokens/WETH.sol";
import {IChad} from "./interfaces/IChad.sol";

import {IUniswapV2Router} from "./interfaces/IUniswapV2Router.sol";
import {ISwapRouter} from "@uniswap/v3-periphery/interfaces/ISwapRouter.sol";
import {IQuoter} from "@uniswap/v3-periphery/interfaces/IQuoter.sol";

contract Index is Owned {
  using SafeTransferLib for ERC20;

  enum UniswapVersion {
    V2,
    V3
  }

  struct IndexComponent {
    address token;
    uint8 weight;
    uint24 fee;
    UniswapVersion version;
  }
  struct TokenAmount {
    address token;
    uint256 amount;
  }

  event SetChad(address indexed chad);
  event IndexComponentUpdated(address indexed token, uint8 weight);
  event TokenPurchased(address indexed token, uint256 amount);
  event TokenRedeemed(address indexed token, uint256 amount);

  IUniswapV2Router public immutable uniswapV2Router;
  ISwapRouter public immutable uniswapV3Router;

  /// @dev enable perfect granularity
  uint256 public constant MAX_BPS = 1_000_000_000 * 1e18;
  uint24 public immutable LOW_FEE = 3_000;
  uint24 public immutable HIGH_FEE = 10_000;
  address public constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
  address public constant OX = 0x78a0A62Fba6Fb21A83FE8a3433d44C73a4017A6f;
  address public constant RLB = 0x046EeE2cc3188071C02BfC1745A6b17c656e3f3d;
  address public constant DMT = 0x0B7f0e51Cd1739D6C96982D55aD8fA634dd43A9C;
  address public constant BITCOIN = 0x72e4f9F808C49A2a61dE9C5896298920Dc4EEEa9;
  address public constant UNIBOT = 0xf819d9Cb1c2A819Fd991781A822dE3ca8607c3C9;

  bool public canUpdateWeights = true;
  address public chad;
  address public timelock;
  uint256 public lastPurchase;

  // Current implementation
  mapping(address => IndexComponent) public components;
  mapping(address => bool) public hasToken;
  address[] public tokens;
  address[] public allTokens;

  constructor(address routerAddressV2, address routerAddressV3, address timelockAddress) Owned(msg.sender) {
    uniswapV2Router = IUniswapV2Router(routerAddressV2);
    uniswapV3Router = ISwapRouter(routerAddressV3);
    timelock = timelockAddress;

    components[OX] = IndexComponent({token: OX, weight: 25, fee: HIGH_FEE, version: UniswapVersion.V3});
    components[RLB] = IndexComponent({token: RLB, weight: 25, fee: LOW_FEE, version: UniswapVersion.V3});
    components[DMT] = IndexComponent({token: DMT, weight: 10, fee: LOW_FEE, version: UniswapVersion.V3});
    components[BITCOIN] = IndexComponent({token: BITCOIN, weight: 20, fee: 0, version: UniswapVersion.V2});
    components[UNIBOT] = IndexComponent({token: UNIBOT, weight: 20, fee: 0, version: UniswapVersion.V2});

    tokens = [OX, RLB, DMT, BITCOIN, UNIBOT];
    allTokens = [OX, RLB, DMT, BITCOIN, UNIBOT];

    hasToken[OX] = true;
    hasToken[RLB] = true;
    hasToken[DMT] = true;
    hasToken[BITCOIN] = true;
    hasToken[UNIBOT] = true;

    ERC20(WETH).approve(routerAddressV2, type(uint256).max);
    ERC20(WETH).approve(routerAddressV3, type(uint256).max);

    lastPurchase = block.timestamp;
  }

  receive() external payable {}

  function _requireIsOwner() internal view {
    require(msg.sender == owner, "!owner");
  }

  function setChad(address newChad) external {
    _requireIsOwner();
    chad = newChad;
    ERC20(IChad(chad).uniswapV2Pair()).approve(address(uniswapV2Router), type(uint256).max);
    emit SetChad(newChad);
  }

  function enterNewParadigm() external {
    _requireIsOwner();
    uint256 wethBalance = ERC20(WETH).balanceOf(address(this));
    uint256 etherBalance = address(this).balance;

    uint256 totalBalance = wethBalance + etherBalance;

    if (totalBalance == 0) {
      return;
    }

    uint256 managementFee = (totalBalance * 2) / 100;
    uint256 purchaseAmount = (totalBalance * 98) / 100;
    uint256 etherToWithdraw = managementFee - etherBalance;

    if (etherToWithdraw > 0) {
      IWETH(payable(WETH)).withdraw(etherToWithdraw);
    }
    (bool success, ) = address(owner).call{value: managementFee}("");
    require(success);

    address token;
    uint256 ethAmount;
    IndexComponent memory component;
    for (uint8 i = 0; i < tokens.length; ) {
      token = tokens[i];
      component = components[token];
      ethAmount = (component.weight * purchaseAmount) / 100;
      if (component.version == UniswapVersion.V2) {
        _purchaseFromV2(token, ethAmount);
      } else {
        _purchaseFromV3(token, ethAmount, component.fee);
      }
      unchecked {
        i++;
      }
    }

    lastPurchase = block.timestamp;
  }

  /// @dev cannot update weights without using timelock as an anti rug measure
  function updateWeights(IndexComponent[] calldata newComponents) external {
    require(timelock != address(0) && msg.sender == timelock, "!timelock");
    uint8 totalWeight;
    for (uint8 i = 0; i < newComponents.length; ) {
      totalWeight += newComponents[i].weight;
      unchecked {
        i++;
      }
    }
    require(totalWeight == 100, "!valid");
    for (uint i = 0; i < allTokens.length; ) {
      address token = allTokens[i];
      delete components[token];
      emit IndexComponentUpdated(token, 0);
      unchecked {
        i++;
      }
    }
    delete tokens;
    IndexComponent memory currentComponent;
    for (uint i = 0; i < newComponents.length; ) {
      currentComponent = newComponents[i];
      components[currentComponent.token] = currentComponent;
      tokens.push(currentComponent.token);
      if (!hasToken[currentComponent.token]) {
        hasToken[currentComponent.token] = true;
        allTokens.push(currentComponent.token);
      }
      emit IndexComponentUpdated(currentComponent.token, currentComponent.weight);
      unchecked {
        i++;
      }
    }
  }

  function redeem(uint256 amount) external {
    require(chad != address(0));
    require(amount > 0, "!tokens");
    uint256 share = (amount * MAX_BPS) / ERC20(chad).totalSupply();

    IChad(chad).burn(msg.sender, amount);

    address token;
    uint256 allocation;
    uint256 contractBalance;
    for (uint8 i = 0; i < allTokens.length; ) {
      token = allTokens[i];
      contractBalance = ERC20(token).balanceOf(address(this));
      if (contractBalance > 0) {
        allocation = (contractBalance * share) / MAX_BPS;
        ERC20(token).safeTransfer(msg.sender, allocation);
        emit TokenRedeemed(token, allocation);
      }
      unchecked {
        i++;
      }
    }

    if (lastPurchase != 0 && lastPurchase + 15 days < block.timestamp) {
      // anti-rug vector, if deployed dies or project stagnates the initial LP can be redeemed + all added liquidity
      address liquidityAddress = IChad(chad).uniswapV2Pair();
      uint256 liquidityBalance = ERC20(liquidityAddress).balanceOf(address(this));
      uint256 liquidityAllocation = (liquidityBalance * share) / MAX_BPS;
      if (liquidityAllocation > 0) {
        uniswapV2Router.removeLiquidity(WETH, chad, liquidityAllocation, 0, 0, address(this), block.timestamp);
      }
      uint256 chadRemoved = ERC20(chad).balanceOf(address(this));
      IChad(chad).burn(address(this), chadRemoved);

      // anti-rug vector, if deployer dies or never updates the index - can redeem for weth
      uint256 wethBalance = ERC20(WETH).balanceOf(address(this));
      uint256 wethAllocation = (wethBalance * share) / MAX_BPS;
      if (wethAllocation > 0) {
        ERC20(WETH).safeTransfer(msg.sender, wethAllocation);
      }
    }
  }

  function redemptionAmounts() external view returns (TokenAmount[] memory) {
    TokenAmount[] memory tokenAmounts = new TokenAmount[](allTokens.length);
    for (uint8 i = 0; i < allTokens.length; ) {
      address token = allTokens[i];
      tokenAmounts[i].token = token;
      tokenAmounts[i].amount = ERC20(token).balanceOf(address(this));
      unchecked {
        i++;
      }
    }
    return tokenAmounts;
  }

  function currentTokenCount() external view returns (uint256) {
    return tokens.length;
  }

  function totalTokenCount() external view returns (uint256) {
    return allTokens.length;
  }

  function _purchaseFromV2(address token, uint256 amount) internal {
    address[] memory path = new address[](2);
    path[0] = WETH;
    path[1] = token;
    uint256 balanceBefore = ERC20(token).balanceOf(address(this));
    uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(
      amount,
      0,
      path,
      address(this),
      block.timestamp
    );
    uint256 balanceAfter = ERC20(token).balanceOf(address(this));
    emit TokenPurchased(token, balanceAfter - balanceBefore);
  }

  function _purchaseFromV3(address token, uint256 amount, uint24 fee) internal {
    uint256 balanceBefore = ERC20(token).balanceOf(address(this));
    uniswapV3Router.exactInput(
      ISwapRouter.ExactInputParams({
        path: abi.encodePacked(WETH, fee, token),
        recipient: address(this),
        deadline: block.timestamp,
        amountIn: amount,
        amountOutMinimum: 0
      })
    );
    uint256 balanceAfter = ERC20(token).balanceOf(address(this));
    emit TokenPurchased(token, balanceAfter - balanceBefore);
  }
}

File 7 of 12 : LightningBolt.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {ERC20} from "solmate/tokens/ERC20.sol";

/**

Create a token that implements the Chad burn.

 */
contract LightningBolt is ERC20 {
  address public uniswapV2Pair = 0x2DB071E62C052f9709F916A585cc9249D46Da778;

  constructor() ERC20("LightningBolt Token", "THUNDER", 18) {
    _mint(msg.sender, 1_000_000_000 * 1e18);
  }

  function burn(address from, uint256 amount) external {
    _burn(from, amount);
  }
}

File 8 of 12 : IUniswapV2Router.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IUniswapV2Router {
  function factory() external pure returns (address);

  function WETH() external pure returns (address);

  function addLiquidity(
    address tokenA,
    address tokenB,
    uint256 amountADesired,
    uint256 amountBDesired,
    uint256 amountAMin,
    uint256 amountBMin,
    address to,
    uint256 deadline
  ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);

  function removeLiquidity(
    address tokenA,
    address tokenB,
    uint liquidity,
    uint amountAMin,
    uint amountBMin,
    address to,
    uint deadline
  ) external returns (uint amountA, uint amountB);

  function addLiquidityETH(
    address token,
    uint256 amountTokenDesired,
    uint256 amountTokenMin,
    uint256 amountETHMin,
    address to,
    uint256 deadline
  ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);

  function swapExactTokensForTokensSupportingFeeOnTransferTokens(
    uint256 amountIn,
    uint256 amountOutMin,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external;

  function swapExactETHForTokensSupportingFeeOnTransferTokens(
    uint256 amountOutMin,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external payable;

  function swapExactTokensForETHSupportingFeeOnTransferTokens(
    uint256 amountIn,
    uint256 amountOutMin,
    address[] calldata path,
    address to,
    uint256 deadline
  ) external;
}

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

import '@uniswap/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);
}

File 10 of 12 : IChad.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IChad {
  function burn(address from, uint256 amount) external;

  function uniswapV2Pair() external returns (address);
}

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

/// @title Quoter Interface
/// @notice Supports quoting the calculated amounts from exact input or exact output swaps
/// @dev These functions are not marked view because they rely on calling non-view functions and reverting
/// to compute the result. They are also not gas efficient and should not be called on-chain.
interface IQuoter {
    /// @notice Returns the amount out received for a given exact input swap without executing the swap
    /// @param path The path of the swap, i.e. each token pair and the pool fee
    /// @param amountIn The amount of the first token to swap
    /// @return amountOut The amount of the last token that would be received
    function quoteExactInput(bytes memory path, uint256 amountIn) external returns (uint256 amountOut);

    /// @notice Returns the amount out received for a given exact input but for a swap of a single pool
    /// @param tokenIn The token being swapped in
    /// @param tokenOut The token being swapped out
    /// @param fee The fee of the token pool to consider for the pair
    /// @param amountIn The desired input amount
    /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
    /// @return amountOut The amount of `tokenOut` that would be received
    function quoteExactInputSingle(
        address tokenIn,
        address tokenOut,
        uint24 fee,
        uint256 amountIn,
        uint160 sqrtPriceLimitX96
    ) external returns (uint256 amountOut);

    /// @notice Returns the amount in required for a given exact output swap without executing the swap
    /// @param path The path of the swap, i.e. each token pair and the pool fee. Path must be provided in reverse order
    /// @param amountOut The amount of the last token to receive
    /// @return amountIn The amount of first token required to be paid
    function quoteExactOutput(bytes memory path, uint256 amountOut) external returns (uint256 amountIn);

    /// @notice Returns the amount in required to receive the given exact output amount but for a swap of a single pool
    /// @param tokenIn The token being swapped in
    /// @param tokenOut The token being swapped out
    /// @param fee The fee of the token pool to consider for the pair
    /// @param amountOut The desired output amount
    /// @param sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
    /// @return amountIn The amount required as the input for the swap in order to receive `amountOut`
    function quoteExactOutputSingle(
        address tokenIn,
        address tokenOut,
        uint24 fee,
        uint256 amountOut,
        uint160 sqrtPriceLimitX96
    ) external returns (uint256 amountIn);
}

File 12 of 12 : 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;
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/src/",
    "@uniswap/v3-core/=lib/v3-core/",
    "@uniswap/v3-periphery/=lib/v3-periphery/contracts/",
    "v3-core/=lib/v3-core/",
    "v3-periphery/=lib/v3-periphery/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "shanghai",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"timelockAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint8","name":"weight","type":"uint8"}],"name":"IndexComponentUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenReturned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenSold","type":"event"},{"inputs":[],"name":"burnChad","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"chad","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enterNewParadigm","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enterNewParadigmAndBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"executeAssembly","outputs":[{"internalType":"bytes","name":"response","type":"bytes"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"index","outputs":[{"internalType":"contract Index","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum Index.UniswapVersion","name":"version","type":"uint8"},{"internalType":"uint24","name":"fee","type":"uint24"}],"internalType":"struct Thundercock.SellOrder[]","name":"orders","type":"tuple[]"}],"name":"liquidateTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reclaimIndexOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setChad","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV2Router","outputs":[{"internalType":"contract IUniswapV2Router","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"uniswapV3Router","outputs":[{"internalType":"contract ISwapRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wethAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

61014060405234801562000011575f80fd5b506040516200377338038062003773833981016040819052620000349162000158565b5f80546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35073dce46b2d2193b5fab04b3129ea9498c9b601a14060e0526001600160a01b0381166101005273b777eb033557490abb7fb8f3948000826423ea0761012052737a250d5630b4cf539739df2c5dacb4c659f2488d608081905273e592427a0aece92de3edee1f18e0157c0586156460a052604080516315ab88c960e31b8152905163ad5c4648916004808201926020929091908290030181865afa1580156200011f573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000145919062000158565b6001600160a01b031660c0525062000187565b5f6020828403121562000169575f80fd5b81516001600160a01b038116811462000180575f80fd5b9392505050565b60805160a05160c05160e051610100516101205161349a620002d95f395f818161038b01528181610998015281816110ee015281816113a6015261143f01525f8181610330015281816105e40152610ecf01525f818161021f01528181610498015281816108a40152818161096e01528181610c9701528181610d3b01528181610dd101528181610fe10152818161111601528181611255015281816112cb015281816113ce015281816114d30152818161190e0152611a4801525f818161010e01528181610289015281816104200152818161052c015281816105ae015281816108ce01528181610a7101528181610af901528181610bce015281816116250152818161181101528181611ae00152611db201525f81816102540152818161174f015281816117e10152611d7801525f81816101a9015281816115500152818161167f0152611bde015261349a5ff3fe60806040526004361062000106575f3560e01c80639a32d8881162000092578063ef8d03da116200005e578063ef8d03da1462000378578063f1c5201314620003ad578063f2fde38b14620003c4578063f87345a514620003e8575f80fd5b80639a32d88814620002ef578063ac3467a71462000306578063d33219b4146200031d578063d76b0b481462000352575f80fd5b80632c76d7a611620000d25780632c76d7a614620002415780634f0e0ef314620002765780635e03383c14620002ab5780638da5cb5b14620002cf575f80fd5b80631281e8ff146200017f5780631694505e14620001965780631cff79cd14620001e85780632986c0e5146200020c575f80fd5b366200017b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b15801562000166575f80fd5b505af115801562000179573d5f803e3d5ffd5b005b5f80fd5b3480156200018b575f80fd5b5062000179620003ff565b348015620001a2575f80fd5b50620001cb7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620001f4575f80fd5b50620001796200020636600462001ece565b620005d9565b34801562000218575f80fd5b50620001cb7f000000000000000000000000000000000000000000000000000000000000000081565b3480156200024d575f80fd5b50620001cb7f000000000000000000000000000000000000000000000000000000000000000081565b34801562000282575f80fd5b50620001cb7f000000000000000000000000000000000000000000000000000000000000000081565b348015620002b7575f80fd5b5062000179620002c936600462001f53565b620006f6565b348015620002db575f80fd5b505f54620001cb906001600160a01b031681565b348015620002fb575f80fd5b50620001796200094d565b34801562000312575f80fd5b506200017962000a53565b34801562000329575f80fd5b50620001cb7f000000000000000000000000000000000000000000000000000000000000000081565b62000369620003633660046200203b565b62000ec2565b604051620001df91906200212d565b34801562000384575f80fd5b50620001cb7f000000000000000000000000000000000000000000000000000000000000000081565b348015620003b9575f80fd5b506200017962000fb6565b348015620003d0575f80fd5b5062000179620003e236600462002148565b62001039565b348015620003f4575f80fd5b5062000179620010cd565b6200040962001146565b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156200046e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000494919062002166565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631281e8ff6040518163ffffffff1660e01b81526004015f604051808303815f87803b158015620004ef575f80fd5b505af115801562000502573d5f803e3d5ffd5b50506040516370a0823160e01b8152306004820152620005d6925033915083906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801562000572573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000598919062002166565b620005a4919062002192565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691906200118a565b50565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614620006435760405162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b60448201526064015b60405180910390fd5b6001600160a01b038316620006855760405162461bcd60e51b8152602060048201526007602482015266085d185c99d95d60ca1b60448201526064016200063a565b5f836001600160a01b03168383604051620006a2929190620021ae565b5f604051808303815f865af19150503d805f8114620006dd576040519150601f19603f3d011682016040523d82523d5f602084013e620006e2565b606091505b5050905080620006f0575f80fd5b50505050565b6200070062001146565b6200070a62001209565b5f805f805f805b8681101562000889578787828181106200072f576200072f620021bd565b62000747926020608090920201908101915062002148565b93508787828181106200075e576200075e620021bd565b9050608002016020013595508787828181106200077f576200077f620021bd565b9050608002016060016020810190620007999190620021e2565b9250878782818110620007b057620007b0620021bd565b9050608002016040016020810190620007ca91906200220d565b6040516370a0823160e01b81523060048201529092506001600160a01b038516906370a0823190602401602060405180830381865afa15801562000810573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000836919062002166565b94508486111562000845578495505b5f8260018111156200085b576200085b6200222b565b0362000873576200086d848762001539565b62000880565b6200088084878562001738565b60010162000711565b506040516370a0823160e01b81523060048201526200093a907f0000000000000000000000000000000000000000000000000000000000000000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801562000914573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620005a4919062002166565b620009446200190b565b50505050505050565b6200095762001146565b6040516370a0823160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f917f0000000000000000000000000000000000000000000000000000000000000000909116906370a0823190602401602060405180830381865afa158015620009e0573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000a06919062002166565b1162000a3d5760405162461bcd60e51b81526020600482015260056024820152640858da185960da1b60448201526064016200063a565b62000a4762001209565b62000a516200190b565b565b62000a5d62001146565b62000a6762001209565b47801562000ae2577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b15801562000ac9575f80fd5b505af115801562000adc573d5f803e3d5ffd5b50505050505b6040516370a0823160e01b81523060048201525f907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801562000b47573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000b6d919062002166565b9050805f0362000b7b575050565b5f606462000b8b8360026200223f565b62000b97919062002259565b90505f606462000ba98460626200223f565b62000bb5919062002259565b604051632e1a7d4d60e01b8152600481018490529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d906024015f604051808303815f87803b15801562000c18575f80fd5b505af115801562000c2b573d5f803e3d5ffd5b50505f80546040519193506001600160a01b0316915084908381818185875af1925050503d805f811462000c7b576040519150601f19603f3d011682016040523d82523d5f602084013e62000c80565b606091505b505090508062000c8e575f80fd5b5f80808080805b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166311b639d96040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000cf2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000d18919062002166565b8160ff16101562000eab576040516327b2595f60e11b815260ff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690634f64b2be90602401602060405180830381865afa15801562000d89573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000daf919062002279565b604051633140acc960e01b81526001600160a01b0380831660048301529197507f000000000000000000000000000000000000000000000000000000000000000090911690633140acc990602401608060405180830381865afa15801562000e19573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000e3f919062002297565b919650945092506064905062000e598960ff87166200223f565b62000e65919062002259565b94505f82600181111562000e7d5762000e7d6200222b565b0362000e955762000e8f868662001abe565b62000ea2565b62000ea286868562001d09565b60010162000c95565b5062000eb66200190b565b50505050505050505050565b6060336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161462000f2a5760405162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b60448201526064016200063a565b6001600160a01b03831662000f6c5760405162461bcd60e51b8152602060048201526007602482015266085d185c99d95d60ca1b60448201526064016200063a565b5f80835160208501866113885a03f43d6040519250601f19601f6020830101168301604052808352805f602085013e81156001810362000fad578160208501fd5b50505092915050565b62000fc062001146565b5f5460405163f2fde38b60e01b81526001600160a01b0391821660048201527f00000000000000000000000000000000000000000000000000000000000000009091169063f2fde38b906024015b5f604051808303815f87803b15801562001026575f80fd5b505af1158015620006f0573d5f803e3d5ffd5b5f546001600160a01b03163314620010835760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064016200063a565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b620010d762001146565b60405163b6661b7160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b6661b71906024016200100e565b5f546001600160a01b0316331462000a515760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b60448201526064016200063a565b5f60405163a9059cbb60e01b81526001600160a01b038416600482015282602482015260205f6044835f895af13d15601f3d1160015f511416171691505080620006f05760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016200063a565b5f604051620012189062001eab565b604051809103905ff08015801562001232573d5f803e3d5ffd5b5060405163b6661b7160e01b81526001600160a01b0380831660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063b6661b71906024015f604051808303815f87803b15801562001299575f80fd5b505af1158015620012ac573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116935063db006a7592508416906370a0823190602401602060405180830381865afa1580156200131d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001343919062002166565b6040518263ffffffff1660e01b81526004016200136291815260200190565b5f604051808303815f87803b1580156200137a575f80fd5b505af11580156200138d573d5f803e3d5ffd5b505060405163b6661b7160e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000016925063b6661b7191506024015f604051808303815f87803b15801562001412575f80fd5b505af115801562001425573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201525f92507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691506370a0823190602401602060405180830381865afa1580156200148e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620014b4919062002166565b90508015620015355760405163db006a7560e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063db006a75906024015f604051808303815f87803b1580156200151d575f80fd5b505af115801562001530573d5f803e3d5ffd5b505050505b5050565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f19602483015283169063095ea7b3906044016020604051808303815f875af1158015620015a6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620015cc919062002300565b506040805160028082526060820183525f9260208301908036833701905050905082815f81518110620016035762001603620021bd565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000816001815181106200165a576200165a620021bd565b6001600160a01b039283166020918202929092010152604051635c11d79560e01b81527f000000000000000000000000000000000000000000000000000000000000000090911690635c11d79590620016c09085905f9086903090429060040162002321565b5f604051808303815f87803b158015620016d8575f80fd5b505af1158015620016eb573d5f803e3d5ffd5b50505050826001600160a01b03167ffe2ff4cf36ff7d2c2b06eb960897ee0d76d9c3e58da12feb7b93e86b226dd344836040516200172b91815260200190565b60405180910390a2505050565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301525f19602483015284169063095ea7b3906044016020604051808303815f875af1158015620017a5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620017cb919062002300565b506040805160a081019091526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c04b8d5990806200183a87867f000000000000000000000000000000000000000000000000000000000000000060c0850162002392565b6040516020818303038152906040528152602001306001600160a01b031681526020014281526020018581526020015f8152506040518263ffffffff1660e01b81526004016200188b9190620023cd565b6020604051808303815f875af1158015620018a8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620018ce919062002166565b50826001600160a01b03167ffe2ff4cf36ff7d2c2b06eb960897ee0d76d9c3e58da12feb7b93e86b226dd344836040516200172b91815260200190565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fd6c6a146040518163ffffffff1660e01b81526004015f60405180830381865afa15801562001968573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405262001991919081019062002426565b90505f5b815181101562001535575f828281518110620019b557620019b5620021bd565b6020908102919091010151516040516370a0823160e01b81523060048201529091505f906001600160a01b038316906370a0823190602401602060405180830381865afa15801562001a09573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001a2f919062002166565b9050801562001ab35762001a6e6001600160a01b0383167f0000000000000000000000000000000000000000000000000000000000000000836200118a565b816001600160a01b03167feaf449319c042c9ba3474fa0c5329eb58cd1f23be110cdbf9d697b8d303dac158260405162001aaa91815260200190565b60405180910390a25b505060010162001995565b6040805160028082526060820183525f926020830190803683370190505090507f0000000000000000000000000000000000000000000000000000000000000000815f8151811062001b145762001b14620021bd565b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811062001b4b5762001b4b620021bd565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b81523060048201525f918516906370a0823190602401602060405180830381865afa15801562001b9e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001bc4919062002166565b604051635c11d79560e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635c11d7959062001c1d9086905f9087903090429060040162002321565b5f604051808303815f87803b15801562001c35575f80fd5b505af115801562001c48573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201525f92506001600160a01b03871691506370a08231906024015b602060405180830381865afa15801562001c92573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001cb8919062002166565b90506001600160a01b0385167f55c18555197c6574627cf460c66073d10aa05d412468800b7b71feeaf82ea92d62001cf1848462002192565b60405190815260200160405180910390a25050505050565b6040516370a0823160e01b81523060048201525f906001600160a01b038516906370a0823190602401602060405180830381865afa15801562001d4e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001d74919062002166565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c04b8d596040518060a001604052807f0000000000000000000000000000000000000000000000000000000000000000868960405160200162001de79392919062002392565b6040516020818303038152906040528152602001306001600160a01b031681526020014281526020018681526020015f8152506040518263ffffffff1660e01b815260040162001e389190620023cd565b6020604051808303815f875af115801562001e55573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001e7b919062002166565b506040516370a0823160e01b81523060048201525f906001600160a01b038616906370a082319060240162001c76565b610f5e806200250783390190565b6001600160a01b0381168114620005d6575f80fd5b5f805f6040848603121562001ee1575f80fd5b833562001eee8162001eb9565b9250602084013567ffffffffffffffff8082111562001f0b575f80fd5b818601915086601f83011262001f1f575f80fd5b81358181111562001f2e575f80fd5b87602082850101111562001f40575f80fd5b6020830194508093505050509250925092565b5f806020838503121562001f65575f80fd5b823567ffffffffffffffff8082111562001f7d575f80fd5b818501915085601f83011262001f91575f80fd5b81358181111562001fa0575f80fd5b8660208260071b850101111562001fb5575f80fd5b60209290920196919550909350505050565b634e487b7160e01b5f52604160045260245ffd5b6040805190810167ffffffffffffffff8111828210171562002001576200200162001fc7565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171562002033576200203362001fc7565b604052919050565b5f80604083850312156200204d575f80fd5b82356200205a8162001eb9565b915060208381013567ffffffffffffffff8082111562002078575f80fd5b818601915086601f8301126200208c575f80fd5b813581811115620020a157620020a162001fc7565b620020b5601f8201601f1916850162002007565b91508082528784828501011115620020cb575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f81518084525f5b818110156200210e57602081850181015186830182015201620020f0565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f620021416020830184620020e8565b9392505050565b5f6020828403121562002159575f80fd5b8135620021418162001eb9565b5f6020828403121562002177575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115620021a857620021a86200217e565b92915050565b818382375f9101908152919050565b634e487b7160e01b5f52603260045260245ffd5b62ffffff81168114620005d6575f80fd5b5f60208284031215620021f3575f80fd5b81356200214181620021d1565b60028110620005d6575f80fd5b5f602082840312156200221e575f80fd5b8135620021418162002200565b634e487b7160e01b5f52602160045260245ffd5b8082028115828204841417620021a857620021a86200217e565b5f826200227457634e487b7160e01b5f52601260045260245ffd5b500490565b5f602082840312156200228a575f80fd5b8151620021418162001eb9565b5f805f8060808587031215620022ab575f80fd5b8451620022b88162001eb9565b602086015190945060ff81168114620022cf575f80fd5b6040860151909350620022e281620021d1565b6060860151909250620022f58162002200565b939692955090935050565b5f6020828403121562002311575f80fd5b8151801515811462002141575f80fd5b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b81811015620023715784516001600160a01b0316835293830193918301916001016200234a565b50506001600160a01b03969096166060850152505050608001529392505050565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b602081525f825160a06020840152620023ea60c0840182620020e8565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b5f602080838503121562002438575f80fd5b825167ffffffffffffffff8082111562002450575f80fd5b818501915085601f83011262002464575f80fd5b81518181111562002479576200247962001fc7565b62002489848260051b0162002007565b818152848101925060069190911b830184019087821115620024a9575f80fd5b928401925b81841015620024fb5760408489031215620024c8575f8081fd5b620024d262001fdb565b8451620024df8162001eb9565b81528486015186820152835260409093019291840191620024ae565b97965050505050505056fe60e0604052600680546001600160a01b031916732db071e62c052f9709f916a585cc9249d46da77817905534801562000036575f80fd5b506040518060400160405280601381526020017f4c696768746e696e67426f6c7420546f6b656e00000000000000000000000000815250604051806040016040528060078152602001662a242aa72222a960c91b8152506012825f90816200009f91906200028f565b506001620000ae83826200028f565b5060ff81166080524660a052620000c4620000ea565b60c05250620000e491503390506b033b2e3c9fd0803ce800000062000184565b620003f7565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f6040516200011c919062000357565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b8060025f828254620001979190620003d1565b90915550506001600160a01b0382165f818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200021857607f821691505b6020821081036200023757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200028a575f81815260208120601f850160051c81016020861015620002655750805b601f850160051c820191505b81811015620002865782815560010162000271565b5050505b505050565b81516001600160401b03811115620002ab57620002ab620001ef565b620002c381620002bc845462000203565b846200023d565b602080601f831160018114620002f9575f8415620002e15750858301515b5f19600386901b1c1916600185901b17855562000286565b5f85815260208120601f198616915b82811015620003295788860151825594840194600190910190840162000308565b50858210156200034757878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f808354620003668162000203565b600182811680156200038157600181146200039757620003c5565b60ff1984168752821515830287019450620003c5565b875f526020805f205f5b85811015620003bc5781548a820152908401908201620003a1565b50505082870194505b50929695505050505050565b80820180821115620003f157634e487b7160e01b5f52601160045260245ffd5b92915050565b60805160a05160c051610b3c620004225f395f61048701525f61045201525f6101590152610b3c5ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c806370a08231116100885780639dc29fac116100635780639dc29fac14610206578063a9059cbb1461021b578063d505accf1461022e578063dd62ed3e14610241575f80fd5b806370a08231146101c05780637ecebe00146101df57806395d89b41146101fe575f80fd5b806323b872dd116100c357806323b872dd14610141578063313ce567146101545780633644e5151461018d57806349bd5a5e14610195575f80fd5b806306fdde03146100e9578063095ea7b31461010757806318160ddd1461012a575b5f80fd5b6100f161026b565b6040516100fe919061088e565b60405180910390f35b61011a6101153660046108f4565b6102f6565b60405190151581526020016100fe565b61013360025481565b6040519081526020016100fe565b61011a61014f36600461091c565b610362565b61017b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100fe565b61013361044f565b6006546101a8906001600160a01b031681565b6040516001600160a01b0390911681526020016100fe565b6101336101ce366004610955565b60036020525f908152604090205481565b6101336101ed366004610955565b60056020525f908152604090205481565b6100f16104a9565b6102196102143660046108f4565b6104b6565b005b61011a6102293660046108f4565b6104c4565b61021961023c366004610975565b61053a565b61013361024f3660046109e2565b600460209081525f928352604080842090915290825290205481565b5f805461027790610a13565b80601f01602080910402602001604051908101604052809291908181526020018280546102a390610a13565b80156102ee5780601f106102c5576101008083540402835291602001916102ee565b820191905f5260205f20905b8154815290600101906020018083116102d157829003601f168201915b505050505081565b335f8181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103509086815260200190565b60405180910390a35060015b92915050565b6001600160a01b0383165f9081526004602090815260408083203384529091528120545f1981146103bb576103978382610a4b565b6001600160a01b0386165f9081526004602090815260408083203384529091529020555b6001600160a01b0385165f90815260036020526040812080548592906103e2908490610a4b565b90915550506001600160a01b038085165f81815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061043c9087815260200190565b60405180910390a3506001949350505050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146104845761047f61077d565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461027790610a13565b6104c08282610815565b5050565b335f908152600360205260408120805483919083906104e4908490610a4b565b90915550506001600160a01b0383165f81815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103509086815260200190565b4284101561058f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b5f600161059a61044f565b6001600160a01b038a81165f8181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f1981840301815282825280516020918201205f84529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156106a2573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116158015906106d85750876001600160a01b0316816001600160a01b0316145b6107155760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610586565b6001600160a01b039081165f9081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f6040516107ad9190610a6a565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6001600160a01b0382165f908152600360205260408120805483929061083c908490610a4b565b90915550506002805482900390556040518181525f906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b5f6020808352835180828501525f5b818110156108b95785810183015185820160400152820161089d565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146108ef575f80fd5b919050565b5f8060408385031215610905575f80fd5b61090e836108d9565b946020939093013593505050565b5f805f6060848603121561092e575f80fd5b610937846108d9565b9250610945602085016108d9565b9150604084013590509250925092565b5f60208284031215610965575f80fd5b61096e826108d9565b9392505050565b5f805f805f805f60e0888a03121561098b575f80fd5b610994886108d9565b96506109a2602089016108d9565b95506040880135945060608801359350608088013560ff811681146109c5575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f80604083850312156109f3575f80fd5b6109fc836108d9565b9150610a0a602084016108d9565b90509250929050565b600181811c90821680610a2757607f821691505b602082108103610a4557634e487b7160e01b5f52602260045260245ffd5b50919050565b8181038181111561035c57634e487b7160e01b5f52601160045260245ffd5b5f80835481600182811c915080831680610a8557607f831692505b60208084108203610aa457634e487b7160e01b86526022600452602486fd5b818015610ab85760018114610acd57610af8565b60ff1986168952841515850289019650610af8565b5f8a8152602090205f5b86811015610af05781548b820152908501908301610ad7565b505084890196505b50949897505050505050505056fea2646970667358221220e767c144a83cbde82d4c00fa858ee2d641ccf91155f6facff48d0fa2fcfe424064736f6c63430008150033a26469706673582212201f24456fd84fb1492980a92398a76d6ded7e6a5c938a5656f23cb1c56d27f43164736f6c634300081500330000000000000000000000003ab3ae08d104e76e4085a5d077f73a90a4096418

Deployed Bytecode

0x60806040526004361062000106575f3560e01c80639a32d8881162000092578063ef8d03da116200005e578063ef8d03da1462000378578063f1c5201314620003ad578063f2fde38b14620003c4578063f87345a514620003e8575f80fd5b80639a32d88814620002ef578063ac3467a71462000306578063d33219b4146200031d578063d76b0b481462000352575f80fd5b80632c76d7a611620000d25780632c76d7a614620002415780634f0e0ef314620002765780635e03383c14620002ab5780638da5cb5b14620002cf575f80fd5b80631281e8ff146200017f5780631694505e14620001965780631cff79cd14620001e85780632986c0e5146200020c575f80fd5b366200017b577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b15801562000166575f80fd5b505af115801562000179573d5f803e3d5ffd5b005b5f80fd5b3480156200018b575f80fd5b5062000179620003ff565b348015620001a2575f80fd5b50620001cb7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620001f4575f80fd5b50620001796200020636600462001ece565b620005d9565b34801562000218575f80fd5b50620001cb7f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a14081565b3480156200024d575f80fd5b50620001cb7f000000000000000000000000e592427a0aece92de3edee1f18e0157c0586156481565b34801562000282575f80fd5b50620001cb7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b348015620002b7575f80fd5b5062000179620002c936600462001f53565b620006f6565b348015620002db575f80fd5b505f54620001cb906001600160a01b031681565b348015620002fb575f80fd5b50620001796200094d565b34801562000312575f80fd5b506200017962000a53565b34801562000329575f80fd5b50620001cb7f0000000000000000000000003ab3ae08d104e76e4085a5d077f73a90a409641881565b62000369620003633660046200203b565b62000ec2565b604051620001df91906200212d565b34801562000384575f80fd5b50620001cb7f000000000000000000000000b777eb033557490abb7fb8f3948000826423ea0781565b348015620003b9575f80fd5b506200017962000fb6565b348015620003d0575f80fd5b5062000179620003e236600462002148565b62001039565b348015620003f4575f80fd5b5062000179620010cd565b6200040962001146565b6040516370a0823160e01b81523060048201525f907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a0823190602401602060405180830381865afa1580156200046e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000494919062002166565b90507f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1406001600160a01b0316631281e8ff6040518163ffffffff1660e01b81526004015f604051808303815f87803b158015620004ef575f80fd5b505af115801562000502573d5f803e3d5ffd5b50506040516370a0823160e01b8152306004820152620005d6925033915083906001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216906370a0823190602401602060405180830381865afa15801562000572573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000598919062002166565b620005a4919062002192565b6001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21691906200118a565b50565b336001600160a01b037f0000000000000000000000003ab3ae08d104e76e4085a5d077f73a90a40964181614620006435760405162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b60448201526064015b60405180910390fd5b6001600160a01b038316620006855760405162461bcd60e51b8152602060048201526007602482015266085d185c99d95d60ca1b60448201526064016200063a565b5f836001600160a01b03168383604051620006a2929190620021ae565b5f604051808303815f865af19150503d805f8114620006dd576040519150601f19603f3d011682016040523d82523d5f602084013e620006e2565b606091505b5050905080620006f0575f80fd5b50505050565b6200070062001146565b6200070a62001209565b5f805f805f805b8681101562000889578787828181106200072f576200072f620021bd565b62000747926020608090920201908101915062002148565b93508787828181106200075e576200075e620021bd565b9050608002016020013595508787828181106200077f576200077f620021bd565b9050608002016060016020810190620007999190620021e2565b9250878782818110620007b057620007b0620021bd565b9050608002016040016020810190620007ca91906200220d565b6040516370a0823160e01b81523060048201529092506001600160a01b038516906370a0823190602401602060405180830381865afa15801562000810573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000836919062002166565b94508486111562000845578495505b5f8260018111156200085b576200085b6200222b565b0362000873576200086d848762001539565b62000880565b6200088084878562001738565b60010162000711565b506040516370a0823160e01b81523060048201526200093a907f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a140906001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216906370a0823190602401602060405180830381865afa15801562000914573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620005a4919062002166565b620009446200190b565b50505050505050565b6200095762001146565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a140811660048301525f917f000000000000000000000000b777eb033557490abb7fb8f3948000826423ea07909116906370a0823190602401602060405180830381865afa158015620009e0573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000a06919062002166565b1162000a3d5760405162461bcd60e51b81526020600482015260056024820152640858da185960da1b60448201526064016200063a565b62000a4762001209565b62000a516200190b565b565b62000a5d62001146565b62000a6762001209565b47801562000ae2577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b15801562000ac9575f80fd5b505af115801562000adc573d5f803e3d5ffd5b50505050505b6040516370a0823160e01b81523060048201525f907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316906370a0823190602401602060405180830381865afa15801562000b47573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000b6d919062002166565b9050805f0362000b7b575050565b5f606462000b8b8360026200223f565b62000b97919062002259565b90505f606462000ba98460626200223f565b62000bb5919062002259565b604051632e1a7d4d60e01b8152600481018490529091507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031690632e1a7d4d906024015f604051808303815f87803b15801562000c18575f80fd5b505af115801562000c2b573d5f803e3d5ffd5b50505f80546040519193506001600160a01b0316915084908381818185875af1925050503d805f811462000c7b576040519150601f19603f3d011682016040523d82523d5f602084013e62000c80565b606091505b505090508062000c8e575f80fd5b5f80808080805b7f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1406001600160a01b03166311b639d96040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000cf2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000d18919062002166565b8160ff16101562000eab576040516327b2595f60e11b815260ff821660048201527f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1406001600160a01b031690634f64b2be90602401602060405180830381865afa15801562000d89573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000daf919062002279565b604051633140acc960e01b81526001600160a01b0380831660048301529197507f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a14090911690633140acc990602401608060405180830381865afa15801562000e19573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062000e3f919062002297565b919650945092506064905062000e598960ff87166200223f565b62000e65919062002259565b94505f82600181111562000e7d5762000e7d6200222b565b0362000e955762000e8f868662001abe565b62000ea2565b62000ea286868562001d09565b60010162000c95565b5062000eb66200190b565b50505050505050505050565b6060336001600160a01b037f0000000000000000000000003ab3ae08d104e76e4085a5d077f73a90a4096418161462000f2a5760405162461bcd60e51b81526020600482015260096024820152682174696d656c6f636b60b81b60448201526064016200063a565b6001600160a01b03831662000f6c5760405162461bcd60e51b8152602060048201526007602482015266085d185c99d95d60ca1b60448201526064016200063a565b5f80835160208501866113885a03f43d6040519250601f19601f6020830101168301604052808352805f602085013e81156001810362000fad578160208501fd5b50505092915050565b62000fc062001146565b5f5460405163f2fde38b60e01b81526001600160a01b0391821660048201527f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1409091169063f2fde38b906024015b5f604051808303815f87803b15801562001026575f80fd5b505af1158015620006f0573d5f803e3d5ffd5b5f546001600160a01b03163314620010835760405162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b60448201526064016200063a565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b620010d762001146565b60405163b6661b7160e01b81526001600160a01b037f000000000000000000000000b777eb033557490abb7fb8f3948000826423ea07811660048301527f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a140169063b6661b71906024016200100e565b5f546001600160a01b0316331462000a515760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b60448201526064016200063a565b5f60405163a9059cbb60e01b81526001600160a01b038416600482015282602482015260205f6044835f895af13d15601f3d1160015f511416171691505080620006f05760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016200063a565b5f604051620012189062001eab565b604051809103905ff08015801562001232573d5f803e3d5ffd5b5060405163b6661b7160e01b81526001600160a01b0380831660048301529192507f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1409091169063b6661b71906024015f604051808303815f87803b15801562001299575f80fd5b505af1158015620012ac573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201526001600160a01b037f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1408116935063db006a7592508416906370a0823190602401602060405180830381865afa1580156200131d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001343919062002166565b6040518263ffffffff1660e01b81526004016200136291815260200190565b5f604051808303815f87803b1580156200137a575f80fd5b505af11580156200138d573d5f803e3d5ffd5b505060405163b6661b7160e01b81526001600160a01b037f000000000000000000000000b777eb033557490abb7fb8f3948000826423ea07811660048301527f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a14016925063b6661b7191506024015f604051808303815f87803b15801562001412575f80fd5b505af115801562001425573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201525f92507f000000000000000000000000b777eb033557490abb7fb8f3948000826423ea076001600160a01b031691506370a0823190602401602060405180830381865afa1580156200148e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620014b4919062002166565b90508015620015355760405163db006a7560e01b8152600481018290527f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1406001600160a01b03169063db006a75906024015f604051808303815f87803b1580156200151d575f80fd5b505af115801562001530573d5f803e3d5ffd5b505050505b5050565b60405163095ea7b360e01b81526001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d811660048301525f19602483015283169063095ea7b3906044016020604051808303815f875af1158015620015a6573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620015cc919062002300565b506040805160028082526060820183525f9260208301908036833701905050905082815f81518110620016035762001603620021bd565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2816001815181106200165a576200165a620021bd565b6001600160a01b039283166020918202929092010152604051635c11d79560e01b81527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d90911690635c11d79590620016c09085905f9086903090429060040162002321565b5f604051808303815f87803b158015620016d8575f80fd5b505af1158015620016eb573d5f803e3d5ffd5b50505050826001600160a01b03167ffe2ff4cf36ff7d2c2b06eb960897ee0d76d9c3e58da12feb7b93e86b226dd344836040516200172b91815260200190565b60405180910390a2505050565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564811660048301525f19602483015284169063095ea7b3906044016020604051808303815f875af1158015620017a5573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620017cb919062002300565b506040805160a081019091526001600160a01b037f000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564169063c04b8d5990806200183a87867f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc260c0850162002392565b6040516020818303038152906040528152602001306001600160a01b031681526020014281526020018581526020015f8152506040518263ffffffff1660e01b81526004016200188b9190620023cd565b6020604051808303815f875af1158015620018a8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190620018ce919062002166565b50826001600160a01b03167ffe2ff4cf36ff7d2c2b06eb960897ee0d76d9c3e58da12feb7b93e86b226dd344836040516200172b91815260200190565b5f7f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a1406001600160a01b031663fd6c6a146040518163ffffffff1660e01b81526004015f60405180830381865afa15801562001968573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405262001991919081019062002426565b90505f5b815181101562001535575f828281518110620019b557620019b5620021bd565b6020908102919091010151516040516370a0823160e01b81523060048201529091505f906001600160a01b038316906370a0823190602401602060405180830381865afa15801562001a09573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001a2f919062002166565b9050801562001ab35762001a6e6001600160a01b0383167f000000000000000000000000dce46b2d2193b5fab04b3129ea9498c9b601a140836200118a565b816001600160a01b03167feaf449319c042c9ba3474fa0c5329eb58cd1f23be110cdbf9d697b8d303dac158260405162001aaa91815260200190565b60405180910390a25b505060010162001995565b6040805160028082526060820183525f926020830190803683370190505090507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2815f8151811062001b145762001b14620021bd565b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811062001b4b5762001b4b620021bd565b6001600160a01b0392831660209182029290920101526040516370a0823160e01b81523060048201525f918516906370a0823190602401602060405180830381865afa15801562001b9e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001bc4919062002166565b604051635c11d79560e01b81529091506001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1690635c11d7959062001c1d9086905f9087903090429060040162002321565b5f604051808303815f87803b15801562001c35575f80fd5b505af115801562001c48573d5f803e3d5ffd5b50506040516370a0823160e01b81523060048201525f92506001600160a01b03871691506370a08231906024015b602060405180830381865afa15801562001c92573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001cb8919062002166565b90506001600160a01b0385167f55c18555197c6574627cf460c66073d10aa05d412468800b7b71feeaf82ea92d62001cf1848462002192565b60405190815260200160405180910390a25050505050565b6040516370a0823160e01b81523060048201525f906001600160a01b038516906370a0823190602401602060405180830381865afa15801562001d4e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001d74919062002166565b90507f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615646001600160a01b031663c04b8d596040518060a001604052807f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2868960405160200162001de79392919062002392565b6040516020818303038152906040528152602001306001600160a01b031681526020014281526020018681526020015f8152506040518263ffffffff1660e01b815260040162001e389190620023cd565b6020604051808303815f875af115801562001e55573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019062001e7b919062002166565b506040516370a0823160e01b81523060048201525f906001600160a01b038616906370a082319060240162001c76565b610f5e806200250783390190565b6001600160a01b0381168114620005d6575f80fd5b5f805f6040848603121562001ee1575f80fd5b833562001eee8162001eb9565b9250602084013567ffffffffffffffff8082111562001f0b575f80fd5b818601915086601f83011262001f1f575f80fd5b81358181111562001f2e575f80fd5b87602082850101111562001f40575f80fd5b6020830194508093505050509250925092565b5f806020838503121562001f65575f80fd5b823567ffffffffffffffff8082111562001f7d575f80fd5b818501915085601f83011262001f91575f80fd5b81358181111562001fa0575f80fd5b8660208260071b850101111562001fb5575f80fd5b60209290920196919550909350505050565b634e487b7160e01b5f52604160045260245ffd5b6040805190810167ffffffffffffffff8111828210171562002001576200200162001fc7565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171562002033576200203362001fc7565b604052919050565b5f80604083850312156200204d575f80fd5b82356200205a8162001eb9565b915060208381013567ffffffffffffffff8082111562002078575f80fd5b818601915086601f8301126200208c575f80fd5b813581811115620020a157620020a162001fc7565b620020b5601f8201601f1916850162002007565b91508082528784828501011115620020cb575f80fd5b80848401858401375f848284010152508093505050509250929050565b5f81518084525f5b818110156200210e57602081850181015186830182015201620020f0565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f620021416020830184620020e8565b9392505050565b5f6020828403121562002159575f80fd5b8135620021418162001eb9565b5f6020828403121562002177575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b81810381811115620021a857620021a86200217e565b92915050565b818382375f9101908152919050565b634e487b7160e01b5f52603260045260245ffd5b62ffffff81168114620005d6575f80fd5b5f60208284031215620021f3575f80fd5b81356200214181620021d1565b60028110620005d6575f80fd5b5f602082840312156200221e575f80fd5b8135620021418162002200565b634e487b7160e01b5f52602160045260245ffd5b8082028115828204841417620021a857620021a86200217e565b5f826200227457634e487b7160e01b5f52601260045260245ffd5b500490565b5f602082840312156200228a575f80fd5b8151620021418162001eb9565b5f805f8060808587031215620022ab575f80fd5b8451620022b88162001eb9565b602086015190945060ff81168114620022cf575f80fd5b6040860151909350620022e281620021d1565b6060860151909250620022f58162002200565b939692955090935050565b5f6020828403121562002311575f80fd5b8151801515811462002141575f80fd5b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b81811015620023715784516001600160a01b0316835293830193918301916001016200234a565b50506001600160a01b03969096166060850152505050608001529392505050565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b602081525f825160a06020840152620023ea60c0840182620020e8565b905060018060a01b0360208501511660408401526040840151606084015260608401516080840152608084015160a08401528091505092915050565b5f602080838503121562002438575f80fd5b825167ffffffffffffffff8082111562002450575f80fd5b818501915085601f83011262002464575f80fd5b81518181111562002479576200247962001fc7565b62002489848260051b0162002007565b818152848101925060069190911b830184019087821115620024a9575f80fd5b928401925b81841015620024fb5760408489031215620024c8575f8081fd5b620024d262001fdb565b8451620024df8162001eb9565b81528486015186820152835260409093019291840191620024ae565b97965050505050505056fe60e0604052600680546001600160a01b031916732db071e62c052f9709f916a585cc9249d46da77817905534801562000036575f80fd5b506040518060400160405280601381526020017f4c696768746e696e67426f6c7420546f6b656e00000000000000000000000000815250604051806040016040528060078152602001662a242aa72222a960c91b8152506012825f90816200009f91906200028f565b506001620000ae83826200028f565b5060ff81166080524660a052620000c4620000ea565b60c05250620000e491503390506b033b2e3c9fd0803ce800000062000184565b620003f7565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f6040516200011c919062000357565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b8060025f828254620001979190620003d1565b90915550506001600160a01b0382165f818152600360209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200021857607f821691505b6020821081036200023757634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200028a575f81815260208120601f850160051c81016020861015620002655750805b601f850160051c820191505b81811015620002865782815560010162000271565b5050505b505050565b81516001600160401b03811115620002ab57620002ab620001ef565b620002c381620002bc845462000203565b846200023d565b602080601f831160018114620002f9575f8415620002e15750858301515b5f19600386901b1c1916600185901b17855562000286565b5f85815260208120601f198616915b82811015620003295788860151825594840194600190910190840162000308565b50858210156200034757878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f808354620003668162000203565b600182811680156200038157600181146200039757620003c5565b60ff1984168752821515830287019450620003c5565b875f526020805f205f5b85811015620003bc5781548a820152908401908201620003a1565b50505082870194505b50929695505050505050565b80820180821115620003f157634e487b7160e01b5f52601160045260245ffd5b92915050565b60805160a05160c051610b3c620004225f395f61048701525f61045201525f6101590152610b3c5ff3fe608060405234801561000f575f80fd5b50600436106100e5575f3560e01c806370a08231116100885780639dc29fac116100635780639dc29fac14610206578063a9059cbb1461021b578063d505accf1461022e578063dd62ed3e14610241575f80fd5b806370a08231146101c05780637ecebe00146101df57806395d89b41146101fe575f80fd5b806323b872dd116100c357806323b872dd14610141578063313ce567146101545780633644e5151461018d57806349bd5a5e14610195575f80fd5b806306fdde03146100e9578063095ea7b31461010757806318160ddd1461012a575b5f80fd5b6100f161026b565b6040516100fe919061088e565b60405180910390f35b61011a6101153660046108f4565b6102f6565b60405190151581526020016100fe565b61013360025481565b6040519081526020016100fe565b61011a61014f36600461091c565b610362565b61017b7f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff90911681526020016100fe565b61013361044f565b6006546101a8906001600160a01b031681565b6040516001600160a01b0390911681526020016100fe565b6101336101ce366004610955565b60036020525f908152604090205481565b6101336101ed366004610955565b60056020525f908152604090205481565b6100f16104a9565b6102196102143660046108f4565b6104b6565b005b61011a6102293660046108f4565b6104c4565b61021961023c366004610975565b61053a565b61013361024f3660046109e2565b600460209081525f928352604080842090915290825290205481565b5f805461027790610a13565b80601f01602080910402602001604051908101604052809291908181526020018280546102a390610a13565b80156102ee5780601f106102c5576101008083540402835291602001916102ee565b820191905f5260205f20905b8154815290600101906020018083116102d157829003601f168201915b505050505081565b335f8181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103509086815260200190565b60405180910390a35060015b92915050565b6001600160a01b0383165f9081526004602090815260408083203384529091528120545f1981146103bb576103978382610a4b565b6001600160a01b0386165f9081526004602090815260408083203384529091529020555b6001600160a01b0385165f90815260036020526040812080548592906103e2908490610a4b565b90915550506001600160a01b038085165f81815260036020526040908190208054870190555190918716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061043c9087815260200190565b60405180910390a3506001949350505050565b5f7f000000000000000000000000000000000000000000000000000000000000000046146104845761047f61077d565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b6001805461027790610a13565b6104c08282610815565b5050565b335f908152600360205260408120805483919083906104e4908490610a4b565b90915550506001600160a01b0383165f81815260036020526040908190208054850190555133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103509086815260200190565b4284101561058f5760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f4558504952454400000000000000000060448201526064015b60405180910390fd5b5f600161059a61044f565b6001600160a01b038a81165f8181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f1981840301815282825280516020918201205f84529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156106a2573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116158015906106d85750876001600160a01b0316816001600160a01b0316145b6107155760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610586565b6001600160a01b039081165f9081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f5f6040516107ad9190610a6a565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6001600160a01b0382165f908152600360205260408120805483929061083c908490610a4b565b90915550506002805482900390556040518181525f906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b5f6020808352835180828501525f5b818110156108b95785810183015185820160400152820161089d565b505f604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146108ef575f80fd5b919050565b5f8060408385031215610905575f80fd5b61090e836108d9565b946020939093013593505050565b5f805f6060848603121561092e575f80fd5b610937846108d9565b9250610945602085016108d9565b9150604084013590509250925092565b5f60208284031215610965575f80fd5b61096e826108d9565b9392505050565b5f805f805f805f60e0888a03121561098b575f80fd5b610994886108d9565b96506109a2602089016108d9565b95506040880135945060608801359350608088013560ff811681146109c5575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f80604083850312156109f3575f80fd5b6109fc836108d9565b9150610a0a602084016108d9565b90509250929050565b600181811c90821680610a2757607f821691505b602082108103610a4557634e487b7160e01b5f52602260045260245ffd5b50919050565b8181038181111561035c57634e487b7160e01b5f52601160045260245ffd5b5f80835481600182811c915080831680610a8557607f831692505b60208084108203610aa457634e487b7160e01b86526022600452602486fd5b818015610ab85760018114610acd57610af8565b60ff1986168952841515850289019650610af8565b5f8a8152602090205f5b86811015610af05781548b820152908501908301610ad7565b505084890196505b50949897505050505050505056fea2646970667358221220e767c144a83cbde82d4c00fa858ee2d641ccf91155f6facff48d0fa2fcfe424064736f6c63430008150033a26469706673582212201f24456fd84fb1492980a92398a76d6ded7e6a5c938a5656f23cb1c56d27f43164736f6c63430008150033

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

0000000000000000000000003ab3ae08d104e76e4085a5d077f73a90a4096418

-----Decoded View---------------
Arg [0] : timelockAddress (address): 0x3AB3Ae08d104e76e4085a5d077F73a90a4096418

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000003ab3ae08d104e76e4085a5d077f73a90a4096418


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.