ETH Price: $3,388.58 (-2.65%)
Gas: 1 Gwei

Contract

0x384b6066CD1e0aeA770790b3162a754B26ac5f15
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Mint From Pool143937322022-03-15 22:01:12836 days ago1647381672IN
0x384b6066...B26ac5f15
0.0888 ETH0.0092578765.2197291
Mint From Pool143937322022-03-15 22:01:12836 days ago1647381672IN
0x384b6066...B26ac5f15
0.0888 ETH0.0092578765.2197291
Mint From Pool143937322022-03-15 22:01:12836 days ago1647381672IN
0x384b6066...B26ac5f15
0.0888 ETH0.0092578765.2197291
Mint From Pool143937322022-03-15 22:01:12836 days ago1647381672IN
0x384b6066...B26ac5f15
0.0888 ETH0.0092578765.2197291
Mint From Pool142124502022-02-15 18:51:51864 days ago1644951111IN
0x384b6066...B26ac5f15
0.2664 ETH0.012098184.37552843
Mint From Pool142124502022-02-15 18:51:51864 days ago1644951111IN
0x384b6066...B26ac5f15
0.2664 ETH0.012098184.37552843
Mint From Pool142124502022-02-15 18:51:51864 days ago1644951111IN
0x384b6066...B26ac5f15
0.2664 ETH0.012098184.37552843
Mint From Pool141260812022-02-02 10:27:04877 days ago1643797624IN
0x384b6066...B26ac5f15
0.0888 ETH0.0109862777.39591603
Mint From Pool141260812022-02-02 10:27:04877 days ago1643797624IN
0x384b6066...B26ac5f15
0.0888 ETH0.0109862777.39591603
Mint From Pool141260812022-02-02 10:27:04877 days ago1643797624IN
0x384b6066...B26ac5f15
0.0888 ETH0.0109862777.39591603
Mint From Pool141256492022-02-02 8:46:32877 days ago1643791592IN
0x384b6066...B26ac5f15
0.0888 ETH0.0102732472.37278489
Mint From Pool141102822022-01-30 23:56:00880 days ago1643586960IN
0x384b6066...B26ac5f15
0.1776 ETH0.0117374182.2713757
Mint From Pool141045282022-01-30 2:46:41880 days ago1643510801IN
0x384b6066...B26ac5f15
0.1776 ETH0.0135017891.6624576
Mint From Pool141044172022-01-30 2:23:49880 days ago1643509429IN
0x384b6066...B26ac5f15
0.0888 ETH0.0137116596.5956467
Mint From Pool141044152022-01-30 2:23:20880 days ago1643509400IN
0x384b6066...B26ac5f15
0.444 ETH0.0126204787.14597167
Mint From Pool141043102022-01-30 2:01:49880 days ago1643508109IN
0x384b6066...B26ac5f15
0.0888 ETH0.0114208864.83648419
Mint From Pool141042492022-01-30 1:50:13880 days ago1643507413IN
0x384b6066...B26ac5f15
0.0888 ETH0.01835943104.22671894
Mint From Pool141042462022-01-30 1:49:55880 days ago1643507395IN
0x384b6066...B26ac5f15
0.0888 ETH0.02360396134
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.444 ETH0.02844823158.91091261
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.0888 ETH0.02799199158.91091261
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.2664 ETH0.02822003158.91091261
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.1776 ETH0.02810609158.91091261
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.444 ETH0.02844823158.91091261
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.444 ETH0.02301347158.91091261
Mint From Pool141042412022-01-30 1:48:17880 days ago1643507297IN
0x384b6066...B26ac5f15
0.2664 ETH0.02278528158.91091261
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
143937322022-03-15 22:01:12836 days ago1647381672
0x384b6066...B26ac5f15
0.0888 ETH
143937322022-03-15 22:01:12836 days ago1647381672
0x384b6066...B26ac5f15
0.0888 ETH
143937322022-03-15 22:01:12836 days ago1647381672
0x384b6066...B26ac5f15
0.0888 ETH
143937322022-03-15 22:01:12836 days ago1647381672
0x384b6066...B26ac5f15
0.0888 ETH
142124502022-02-15 18:51:51864 days ago1644951111
0x384b6066...B26ac5f15
0.2664 ETH
142124502022-02-15 18:51:51864 days ago1644951111
0x384b6066...B26ac5f15
0.2664 ETH
142124502022-02-15 18:51:51864 days ago1644951111
0x384b6066...B26ac5f15
0.2664 ETH
141260812022-02-02 10:27:04877 days ago1643797624
0x384b6066...B26ac5f15
0.0888 ETH
141260812022-02-02 10:27:04877 days ago1643797624
0x384b6066...B26ac5f15
0.0888 ETH
141260812022-02-02 10:27:04877 days ago1643797624
0x384b6066...B26ac5f15
0.0888 ETH
141256492022-02-02 8:46:32877 days ago1643791592
0x384b6066...B26ac5f15
0.0888 ETH
141102822022-01-30 23:56:00880 days ago1643586960
0x384b6066...B26ac5f15
0.1776 ETH
141045282022-01-30 2:46:41880 days ago1643510801
0x384b6066...B26ac5f15
0.1776 ETH
141044172022-01-30 2:23:49880 days ago1643509429
0x384b6066...B26ac5f15
0.0888 ETH
141044152022-01-30 2:23:20880 days ago1643509400
0x384b6066...B26ac5f15
0.444 ETH
141043102022-01-30 2:01:49880 days ago1643508109
0x384b6066...B26ac5f15
0.0888 ETH
141042492022-01-30 1:50:13880 days ago1643507413
0x384b6066...B26ac5f15
0.0888 ETH
141042462022-01-30 1:49:55880 days ago1643507395
0x384b6066...B26ac5f15
0.0888 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.444 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.0888 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.2664 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.1776 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.444 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.444 ETH
141042412022-01-30 1:48:17880 days ago1643507297
0x384b6066...B26ac5f15
0.2664 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MintShop1155

Compiler Version
v0.8.8+commit.dddeac2f

Optimization Enabled:
Yes with 0 runs

Other Settings:
default evmVersion
File 1 of 17 : SuperMintShop1155.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.8;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "./base/Sweepable.sol";
import "./assets/erc1155/interfaces/ISuper1155.sol";
import "./assets/erc721/interfaces/ISuper721.sol";
import "./interfaces/IStaker.sol";
import "./interfaces/IMintShop.sol";
import "./libraries/merkle/SuperMerkleAccess.sol";
import "./libraries/DFStorage.sol";

/**
  @title A Shop contract for selling NFTs via direct minting through particular
    pools with specific participation requirements.
  @author Tim Clancy
  @author Qazawat Zirak
  @author Rostislav Khlebnikov
  @author Nikita Elunin


  This launchpad contract sells new items by minting them into existence. It
  cannot be used to sell items that already exist.
*/
contract MintShop1155 is Sweepable, ReentrancyGuard, IMintShop, SuperMerkleAccess {
  using SafeERC20 for IERC20;


  /// The public identifier for the right to set the payment receiver.
  bytes32 public constant SET_PAYMENT_RECEIVER
    = keccak256("SET_PAYMENT_RECEIVER");

  /// The public identifier for the right to lock the payment receiver.
  bytes32 public constant LOCK_PAYMENT_RECEIVER
    = keccak256("LOCK_PAYMENT_RECEIVER");

  /// The public identifier for the right to update the global purchase limit.
  bytes32 public constant UPDATE_GLOBAL_LIMIT
    = keccak256("UPDATE_GLOBAL_LIMIT");

  /// The public identifier for the right to lock the global purchase limit.
  bytes32 public constant LOCK_GLOBAL_LIMIT = keccak256("LOCK_GLOBAL_LIMIT");

  /// The public identifier for the right to manage whitelists.
  bytes32 public constant WHITELIST = keccak256("WHITELIST");

  /// The public identifier for the right to manage item pools.
  bytes32 public constant POOL = keccak256("POOL");

  /// The public identifier for the right to set new items.
  bytes32 public constant SET_ITEMS = keccak256("SET_ITEMS");

  /// @dev A mask for isolating an item's group ID.
  uint256 constant GROUP_MASK = uint256(type(uint128).max) << 128;


  /// The maximum amount that can be minted through all collections.
  uint256 public immutable maxAllocation;

  /// The item collection contract that minted items are sold from.
  ISuper1155[] public items;

  /**
    The address where the payment from each item buyer is sent. Care must be
    taken that this address can actually take receipt of the Ether or ERC-20
    earnings.
  */
  address public paymentReceiver;

  /**
    A flag determining whether or not the `paymentReceiver` may be updated using
    the `updatePaymentReceiver` function.
  */
  bool public paymentReceiverLocked;

  /**
    A limit on the number of items that a particular address may purchase across
    any number of pools in this shop.
  */
  uint256 public globalPurchaseLimit;

  /**
    A flag determining whether or not the `globalPurchaseLimit` may be updated
    using the `updateGlobalPurchaseLimit` function.
  */
  bool public globalPurchaseLimitLocked;

  /// A mapping of addresses to the number of items each has purchased globally.
  mapping (address => uint256) public globalPurchaseCounts;

  /// The next available ID to be assumed by the next pool added.
  uint256 public nextPoolId;

  /// A mapping of pool IDs to pools.
  mapping (uint256 => Pool) public pools;

  /**
    This mapping relates each item group ID to the next item ID within that
    group which should be issued, minus one.
  */
  mapping (bytes32 => uint256) public nextItemIssues;

  /**
    This struct tracks information about a single item pool in the Shop.
    @param currentPoolVersion A version number hashed with item group IDs before
           being used as keys to other mappings. This supports efficient
           invalidation of stale mappings.
    @param config configuration  struct PoolInput.
    @param purchaseCounts A mapping of addresses to the number of items each has
      purchased from this pool.
    @param itemCaps A mapping of item group IDs to the maximum number this pool
      is allowed to mint.
    @param itemMinted A mapping of item group IDs to the number this pool has
      currently minted.
    @param itemPrices A mapping of item group IDs to a mapping of available
      Price assets available to purchase with.
    @param itemGroups An array of all item groups currently present in this
      pool.
  */
  struct Pool {
    uint256 currentPoolVersion;
    DFStorage.PoolInput config;
    mapping (address => uint256) purchaseCounts;
    mapping (bytes32 => uint256) itemCaps;
    mapping (bytes32 => uint256) itemMinted;
    mapping (bytes32 => uint256) itemPricesLength;
    mapping (bytes32 => mapping (uint256 => DFStorage.Price)) itemPrices;
    uint256[] itemGroups;
    Whitelist[] whiteLists;
  }

  /**
    This struct tracks information about a single whitelist known to this shop.
    Whitelists may be shared across multiple different item pools.
    @param id Id of the whiteList.
    @param minted Mapping, which is needed to keep track of whether a user bought an nft or not.
  */
  struct Whitelist {
    uint256 id;
    mapping (address => uint256) minted;
  }



  /**
    This struct tracks information about a single item being sold in a pool.
    @param groupId The group ID of the specific NFT in the collection being sold
      by a pool.
    @param cap The maximum number of items that this shop may mint for the
      specified `groupId`.
    @param minted The number of items that a pool has currently minted of the
      specified `groupId`.
    @param prices The `Price` options that may be used to purchase this item
      from its pool. A buyer may fulfill the purchase with any price option.
  */
  struct PoolItem {
    uint256 groupId;
    uint256 cap;
    uint256 minted;
    DFStorage.Price[] prices;
  }

  /**
    This struct contains the information gleaned from the `getPool` and
    `getPools` functions; it represents a single pool's data.
    @param config configuration struct PoolInput
    @param itemMetadataUri The metadata URI of the item collection being sold
      by this launchpad.
    @param items An array of PoolItems representing each item for sale in the
      pool.
  */
  struct PoolOutput {
    DFStorage.PoolInput config;
    string itemMetadataUri;
    PoolItem[] items;
  }

//   /**
//     This struct contains the information gleaned from the `getPool` and
//     `getPools` functions; it represents a single pool's data. It also includes
//     additional information relevant to a user's address lookup.
//     @param purchaseCount The amount of items purchased from this pool by the
//       specified address.
//     @param config configuration struct PoolInput.
//     @param whitelistStatus Whether or not the specified address is whitelisted
//       for this pool.
//     @param itemMetadataUri The metadata URI of the item collection being sold by
//       this launchpad.
//     @param items An array of PoolItems representing each item for sale in the
//       pool.
//   */
//   struct PoolAddressOutput {
//     uint256 purchaseCount;
//     DFStorage.PoolInput config;
//     bool whitelistStatus;
//     string itemMetadataUri;
//     PoolItem[] items;
//   }

  /**
    An event to track an update to this shop's `paymentReceiver`.

    @param updater The calling address which updated the payment receiver.
    @param oldPaymentReceiver The address of the old payment receiver.
    @param newPaymentReceiver The address of the new payment receiver.
  */
  event PaymentReceiverUpdated(address indexed updater,
    address indexed oldPaymentReceiver, address indexed newPaymentReceiver);

  /**
    An event to track future changes to `paymentReceiver` being locked.

    @param locker The calling address which locked down the payment receiver.
  */
  event PaymentReceiverLocked(address indexed locker);

  /**
    An event to track an update to this shop's `globalPurchaseLimit`.

    @param updater The calling address which updated the purchase limit.
    @param oldPurchaseLimit The value of the old purchase limit.
    @param newPurchaseLimit The value of the new purchase limit.
  */
  event GlobalPurchaseLimitUpdated(address indexed updater,
    uint256 indexed oldPurchaseLimit, uint256 indexed newPurchaseLimit);

  /**
    An event to track future changes to `globalPurchaseLimit` being locked.

    @param locker The calling address which locked down the purchase limit.
  */
  event GlobalPurchaseLimitLocked(address indexed locker);

  /**
    An event to track a specific whitelist being updated. When emitted this
    event indicates that a specific whitelist has had its settings completely
    replaced.

    @param updater The calling address which updated this whitelist.
    @param whitelistId The ID of the whitelist being updated.
    @param timestamp Timestamp of whiteList update.
  */
  event WhitelistUpdated(address indexed updater, uint256 whitelistId,
    uint256 timestamp);

  /**
    An event to track an item pool's data being updated. When emitted this event
    indicates that a specific item pool's settings have been completely
    replaced.

    @param updater The calling address which updated this pool.
    @param poolId The ID of the pool being updated.
    @param pool The input data used to update the pool.
    @param groupIds The groupIds that are now on sale in the item pool.
    @param caps The caps, keyed to `groupIds`, of the maximum that each groupId
      may mint up to.
    @param prices The prices, keyed to `groupIds`, of the arrays for `Price`
      objects that each item group may be able be bought with.
  */
  event PoolUpdated(address indexed updater, uint256 poolId,
    DFStorage.PoolInput indexed pool, uint256[] groupIds, uint256[] caps,
    DFStorage.Price[][] indexed prices);

  /**
    An event to track the purchase of items from an item pool.

    @param buyer The address that bought the item from an item pool.
    @param poolId The ID of the item pool that the buyer bought from.
    @param itemIds The array of item IDs that were purchased by the user.
    @param amounts The keyed array of each amount of item purchased by `buyer`.
  */
  event ItemPurchased(address indexed buyer, uint256 poolId,
    uint256[] indexed itemIds, uint256[] amounts);

  /**
    Construct a new shop which can mint items upon purchase from various pools.

    @param _paymentReceiver The address where shop earnings are sent.
    @param _globalPurchaseLimit A global limit on the number of items that a
      single address may purchase across all item pools in the shop.
  */
  constructor(address _owner, address _paymentReceiver,
    uint256 _globalPurchaseLimit, uint256 _maxAllocation) {

    if (_owner != owner()) {
      transferOwnership(_owner);
    }
    // Initialization.
    paymentReceiver = _paymentReceiver;
    globalPurchaseLimit = _globalPurchaseLimit;
    maxAllocation = _maxAllocation;
  }

  /**
    Allow the shop owner or an approved manager to update the payment receiver
    address if it has not been locked.

    @param _newPaymentReceiver The address of the new payment receiver.
  */
  function updatePaymentReceiver(address _newPaymentReceiver) external
    hasValidPermit(UNIVERSAL, SET_PAYMENT_RECEIVER) {
    require(!paymentReceiverLocked, "XXX"
      );
    emit PaymentReceiverUpdated(_msgSender(), paymentReceiver,
      _newPaymentReceiver);
    // address oldPaymentReceiver = paymentReceiver;
    paymentReceiver = _newPaymentReceiver;

  }


   /**
    Allow the shop owner or an approved manager to set the array of items known to this shop.
    @param _items The array of Super1155 addresses.
  */
  function setItems(ISuper1155[] calldata _items) external hasValidPermit(UNIVERSAL, SET_ITEMS) {
    items = _items;
  }

  /**
    Allow the shop owner or an approved manager to lock the payment receiver
    address against any future changes.
  */
  function lockPaymentReceiver() external
    hasValidPermit(UNIVERSAL, LOCK_PAYMENT_RECEIVER) {
    paymentReceiverLocked = true;
    emit PaymentReceiverLocked(_msgSender());
  }

  /**
    Allow the shop owner or an approved manager to update the global purchase
    limit if it has not been locked.

    @param _newGlobalPurchaseLimit The value of the new global purchase limit.
  */
  function updateGlobalPurchaseLimit(uint256 _newGlobalPurchaseLimit) external
    hasValidPermit(UNIVERSAL, UPDATE_GLOBAL_LIMIT) {
    require(!globalPurchaseLimitLocked,
      "0x0A");
    emit GlobalPurchaseLimitUpdated(_msgSender(), globalPurchaseLimit,
      _newGlobalPurchaseLimit);
    globalPurchaseLimit = _newGlobalPurchaseLimit;

  }

  /**
    Allow the shop owner or an approved manager to lock the global purchase
    limit against any future changes.
  */
  function lockGlobalPurchaseLimit() external
    hasValidPermit(UNIVERSAL, LOCK_GLOBAL_LIMIT) {
    globalPurchaseLimitLocked = true;
    emit GlobalPurchaseLimitLocked(_msgSender());
  }

  /**
    Adds new whiteList restriction for the pool by `_poolId`.
    @param _poolId id of the pool, where new white list is added.
    @param whitelist struct for creating a new whitelist.
   */
  function addWhiteList(uint256 _poolId, DFStorage.WhiteListCreate[] calldata whitelist) external hasValidPermit(UNIVERSAL, WHITELIST) {
    for (uint256 i = 0; i < whitelist.length; i++) {
      super.setAccessRound(whitelist[i]._accesslistId, whitelist[i]._merkleRoot, whitelist[i]._startTime, whitelist[i]._endTime, whitelist[i]._price, whitelist[i]._token);
      pools[_poolId].whiteLists.push();
      uint256 newIndex = pools[_poolId].whiteLists.length - 1;
      pools[_poolId].whiteLists[newIndex].id = whitelist[i]._accesslistId;
      emit WhitelistUpdated(_msgSender(), whitelist[i]._accesslistId, block.timestamp);
    }
  }


  /**
    A function which allows the caller to retrieve information about specific
    pools, the items for sale within, and the collection this shop uses.

    @param _ids An array of pool IDs to retrieve information about.
  */
  function getPools(uint256[] calldata _ids, uint256 _itemIndex) external view
    returns (PoolOutput[] memory) {
    PoolOutput[] memory poolOutputs = new PoolOutput[](_ids.length);
    for (uint256 i = 0; i < _ids.length; i++) {
      uint256 id = _ids[i];

      // Process output for each pool.
      PoolItem[] memory poolItems = new PoolItem[](pools[id].itemGroups.length);
      for (uint256 j = 0; j < pools[id].itemGroups.length; j++) {
        uint256 itemGroupId = pools[id].itemGroups[j];
        bytes32 itemKey = keccak256(abi.encodePacked(pools[id].config.collection,
          pools[id].currentPoolVersion, itemGroupId));

        // Parse each price the item is sold at.
        DFStorage.Price[] memory itemPrices =
          new DFStorage.Price[](pools[id].itemPricesLength[itemKey]);
        for (uint256 k = 0; k < pools[id].itemPricesLength[itemKey]; k++) {
          itemPrices[k] = pools[id].itemPrices[itemKey][k];
        }

        // Track the item.
        poolItems[j] = PoolItem({
          groupId: itemGroupId,
          cap: pools[id].itemCaps[itemKey],
          minted: pools[id].itemMinted[itemKey],
          prices: itemPrices
        });
      }

      // Track the pool.
      poolOutputs[i] = PoolOutput({
        config: pools[id].config,
        itemMetadataUri: items[_itemIndex].metadataUri(),
        items: poolItems
      });
    }

    // Return the pools.
    return poolOutputs;
  }

  /**
    A function which allows the caller to retrieve the number of items specific
    addresses have purchased from specific pools.

    @param _ids The IDs of the pools to check for addresses in `purchasers`.
    @param _purchasers The addresses to check the purchase counts for.
  */
  function getPurchaseCounts(address[] calldata _purchasers,
  uint256[] calldata _ids) external view returns (uint256[][] memory) {
    uint256[][] memory purchaseCounts = new uint256[][](_purchasers.length);
    for (uint256 i = 0; i < _purchasers.length; i++) {
      purchaseCounts[i] = new uint256[](_ids.length);
      for (uint256 j = 0; j < _ids.length; j++) {
        uint256 id = _ids[j];
        address purchaser = _purchasers[i];
        purchaseCounts[i][j] = pools[id].purchaseCounts[purchaser];
      }
    }
    return purchaseCounts;
  }

//   /**
//     A function which allows the caller to retrieve information about specific
//     pools, the items for sale within, and the collection this launchpad uses.
//     A provided address differentiates this function from `getPools`; the added
//     address enables this function to retrieve pool data as well as whitelisting
//     and purchase count details for the provided address.

//     @param _ids An array of pool IDs to retrieve information about.
//   */
//   function getPoolsWithAddress(uint256[] calldata _ids)
//     external view returns (PoolAddressOutput[] memory) {
//     PoolAddressOutput[] memory poolOutputs =
//       new PoolAddressOutput[](_ids.length);
//     for (uint256 i = 0; i < _ids.length; i++) {
//       uint256 id = _ids[i];

//       // Process output for each pool.
//       PoolItem[] memory poolItems = new PoolItem[](pools[id].itemGroups.length);
//       for (uint256 j = 0; j < pools[id].itemGroups.length; j++) {
//         uint256 itemGroupId = pools[id].itemGroups[j];
//         bytes32 itemKey = keccak256(abi.encodePacked(pools[id].config.collection,
//           pools[id].currentPoolVersion, itemGroupId));

//         // Parse each price the item is sold at.
//         DFStorage.Price[] memory itemPrices =
//           new DFStorage.Price[](pools[id].itemPricesLength[itemKey]);
//         for (uint256 k = 0; k < pools[id].itemPricesLength[itemKey]; k++) {
//           itemPrices[k] = pools[id].itemPrices[itemKey][k];
//         }

//         // Track the item.
//         poolItems[j] = PoolItem({
//           groupId: itemGroupId,
//           cap: pools[id].itemCaps[itemKey],
//           minted: pools[id].itemMinted[itemKey],
//           prices: itemPrices
//         });
//       }

//       // Track the pool.
//       // uint256 whitelistId = pools[id].config.requirement.whitelistId;
//       // bytes32 addressKey = keccak256(
//       //   abi.encode(whitelists[whitelistId].currentWhitelistVersion, _address));
//       // poolOutputs[i] = PoolAddressOutput({
//       //   config: pools[id].config,
//       //   itemMetadataUri: items[_itemIndex].metadataUri(),
//       //   items: poolItems,
//       //   purchaseCount: pools[id].purchaseCounts[_address],
//       //   whitelistStatus: whitelists[whitelistId].addresses[addressKey]
//       // });
//     }

//     // Return the pools.
//     return poolOutputs;
//   }

  /**
    Allow the owner of the shop or an approved manager to add a new pool of
    items that users may purchase.

    @param _pool The PoolInput full of data defining the pool's operation.
    @param _groupIds The specific item group IDs to sell in this pool,
      keyed to the `_amounts` array.
    @param _issueNumberOffsets The offset for the next issue number minted for a
      particular item group in `_groupIds`. This is *important* to handle
      pre-minted or partially-minted item groups.
    @param _caps The maximum amount of each particular groupId that can be sold
      by this pool.
    @param _prices The asset address to price pairings to use for selling each
      item.
  */
  function addPool(DFStorage.PoolInput calldata _pool, uint256[] calldata _groupIds,
    uint256[] calldata _issueNumberOffsets, uint256[] calldata _caps,
    DFStorage.Price[][] calldata _prices) external hasValidPermit(UNIVERSAL, POOL) {
    updatePool(nextPoolId, _pool, _groupIds, _issueNumberOffsets, _caps,
      _prices);

    // Increment the ID which will be used by the next pool added.
    nextPoolId += 1;
  }

     /**
    Allow the owner of the shop or an approved manager to update an existing
    pool of items.

    @param _id The ID of the pool to update.
    @param _config The PoolInput full of data defining the pool's operation.
    @param _groupIds The specific item group IDs to sell in this pool,
      keyed to the `_amounts` array.
    @param _issueNumberOffsets The offset for the next issue number minted for a
      particular item group in `_groupIds`. This is *important* to handle
      pre-minted or partially-minted item groups.
    @param _caps The maximum amount of each particular groupId that can be sold
      by this pool.
    @param _prices The asset address to price pairings to use for selling each
      item.
  */
  function updatePool(uint256 _id, DFStorage.PoolInput calldata _config,
    uint256[] calldata _groupIds, uint256[] calldata _issueNumberOffsets,
    uint256[] calldata _caps, DFStorage.Price[][] memory _prices) public
    hasValidPermit(UNIVERSAL, POOL) {
    require(_id <= nextPoolId && _config.endTime >= _config.startTime && _groupIds.length > 0,
      "0x1A");
    require(_groupIds.length == _caps.length && _caps.length == _prices.length && _issueNumberOffsets.length == _prices.length,
      "0x4A");

    // Immediately store some given information about this pool.
    Pool storage pool = pools[_id];
    pool.config = _config;
    pool.itemGroups = _groupIds;
    pool.currentPoolVersion = pools[_id].currentPoolVersion + 1;

    // Delegate work to a helper function to avoid stack-too-deep errors.
    _updatePoolHelper(_id, _groupIds, _issueNumberOffsets, _caps, _prices);

    // Emit an event indicating that a pool has been updated.
    emit PoolUpdated(_msgSender(), _id, _config, _groupIds, _caps, _prices);
  }

  /**
    A private helper function for `updatePool` to prevent it from running too
    deep into the stack. This function will store the amount of each item group
    that this pool may mint.

    @param _id The ID of the pool to update.
    @param _groupIds The specific item group IDs to sell in this pool,
      keyed to the `_amounts` array.
    @param _issueNumberOffsets The offset for the next issue number minted for a
      particular item group in `_groupIds`. This is *important* to handle
      pre-minted or partially-minted item groups.
    @param _caps The maximum amount of each particular groupId that can be sold
      by this pool.
    @param _prices The asset address to price pairings to use for selling each
      item.
  */
  function _updatePoolHelper(uint256 _id,
    uint256[] calldata _groupIds, uint256[] calldata _issueNumberOffsets,
    uint256[] calldata _caps, DFStorage.Price[][] memory _prices) private {
    for (uint256 i = 0; i < _groupIds.length; i++) {
      require(_caps[i] > 0,
        "0x5A");
      bytes32 itemKey = keccak256(abi.encodePacked(pools[_id].config.collection, pools[_id].currentPoolVersion, _groupIds[i]));
      pools[_id].itemCaps[itemKey] = _caps[i];

      // Pre-seed the next item issue IDs given the pool offsets.
      // We generate a key from collection address and groupId.
      bytes32 key = keccak256(abi.encodePacked(pools[_id].config.collection, pools[_id].currentPoolVersion, _groupIds[i]));
      nextItemIssues[key] = _issueNumberOffsets[i];

      // Store future purchase information for the item group.
      for (uint256 j = 0; j < _prices[i].length; j++) {
        pools[_id].itemPrices[itemKey][j] = _prices[i][j];
      }
      pools[_id].itemPricesLength[itemKey] = _prices[i].length;
    }
  }

  function updatePoolConfig(uint256 _id, DFStorage.PoolInput calldata _config) external hasValidPermit(UNIVERSAL, POOL){
    require(_id <= nextPoolId && _config.endTime >= _config.startTime,
      "0x1A");
    pools[_id].config = _config;
  }

  /**
    Allow a buyer to purchase an item from a pool.

    @param _id The ID of the particular item pool that the user would like to
      purchase from.
    @param _groupId The item group ID that the user would like to purchase.
    @param _assetIndex The selection of supported payment asset `Price` that the
      buyer would like to make a purchase with.
    @param _amount The amount of item that the user would like to purchase.
  */
  function mintFromPool(uint256 _id, uint256 _groupId, uint256 _assetIndex,
    uint256 _amount, uint256 _itemIndex, DFStorage.WhiteListInput calldata _whiteList) external nonReentrant payable {
    require(_amount > 0,
      "0x0B");
    require(_id < nextPoolId && pools[_id].config.singlePurchaseLimit >= _amount,
      "0x1B");

    bool whiteListed;
    if (pools[_id].whiteLists.length != 0)
    {
        bytes32 root = keccak256(abi.encodePacked(_whiteList.index, _msgSender(), _whiteList.allowance));
        whiteListed = super.verify(_whiteList.whiteListId, _whiteList.index, root, _whiteList.merkleProof) &&
                                root == _whiteList.node &&
                                pools[_id].whiteLists[_whiteList.whiteListId].minted[_msgSender()] + _amount <= _whiteList.allowance;
    }

    require(block.timestamp >= pools[_id].config.startTime && block.timestamp <= pools[_id].config.endTime || whiteListed, "0x4B");

    bytes32 itemKey = keccak256(abi.encodePacked(pools[_id].config.collection,
       pools[_id].currentPoolVersion, _groupId));
    require(_assetIndex < pools[_id].itemPricesLength[itemKey],
      "0x3B");

    // Verify that the pool is running its sale.


    // Verify that the pool is respecting per-address global purchase limits.
    uint256 userGlobalPurchaseAmount =
        _amount + globalPurchaseCounts[_msgSender()];


    if (globalPurchaseLimit != 0) {
      require(userGlobalPurchaseAmount <= globalPurchaseLimit,
        "0x5B");

      // Verify that the pool is respecting per-address pool purchase limits.
    }
    uint256 userPoolPurchaseAmount =
        _amount + pools[_id].purchaseCounts[_msgSender()];

    // Verify that the pool is not depleted by the user's purchase.
    uint256 newCirculatingTotal = pools[_id].itemMinted[itemKey] + _amount;
    require(newCirculatingTotal <= pools[_id].itemCaps[itemKey],
      "0x7B");

    {
        uint256 result;
        for (uint256 i = 0; i < nextPoolId; i++) {
            for (uint256 j = 0; j < pools[i].itemGroups.length; j++) {
                result += pools[i].itemMinted[itemKey];
            }
        }
        require(maxAllocation >= result + _amount, "0x0D");
    }

    require(checkRequirments(_id), "0x8B");

    sellingHelper(_id, itemKey, _assetIndex, _amount, whiteListed, _whiteList.whiteListId);


    mintingHelper(_itemIndex, _groupId, _id, itemKey, _amount, newCirculatingTotal, userPoolPurchaseAmount, userGlobalPurchaseAmount);

    // Emit an event indicating a successful purchase.
  }

  function remainder(DFStorage.WhiteListInput calldata _whiteList, uint256 _id, address _user) public view returns (uint256) {
      return (pools[_id].whiteLists[_whiteList.whiteListId].minted[_user] < _whiteList.allowance) ? _whiteList.allowance - pools[_id].whiteLists[_whiteList.whiteListId].minted[_user] : 0;
  }

  function isEligible(DFStorage.WhiteListInput calldata _whiteList, uint256 _id) public view returns (bool) {
    return  (super.verify(_whiteList.whiteListId, _whiteList.index, keccak256(abi.encodePacked(_whiteList.index, _msgSender(), _whiteList.allowance)), _whiteList.merkleProof)) &&
                    pools[_id].whiteLists[_whiteList.whiteListId].minted[_msgSender()] < _whiteList.allowance ||
                    (block.timestamp >= pools[_id].config.startTime && block.timestamp <= pools[_id].config.endTime);
  }

  function sellingHelper(uint256 _id, bytes32 itemKey, uint256 _assetIndex, uint256 _amount, bool _whiteListPrice, uint256 _accesListId) private {
        // Process payment for the user, checking to sell for Staker points.
    if (_whiteListPrice) {
      SuperMerkleAccess.AccessList storage accessList = SuperMerkleAccess.accessRoots[_accesListId];
      uint256 price = accessList.price * _amount;
      if (accessList.token == address(0)) {
        require(msg.value >= price,
          "0x9B");
        (bool success, ) = payable(paymentReceiver).call{ value: msg.value }("");
        require(success,
          "0x0C");
        pools[_id].whiteLists[_accesListId].minted[_msgSender()] += _amount;
      } else {
        require(IERC20(accessList.token).balanceOf(_msgSender()) >= price,
          "0x1C");
        IERC20(accessList.token).safeTransferFrom(_msgSender(), paymentReceiver, price);
        pools[_id].whiteLists[_accesListId].minted[_msgSender()] += _amount;
      }
    } else {
      DFStorage.Price storage sellingPair = pools[_id].itemPrices[itemKey][_assetIndex];
      if (sellingPair.assetType == DFStorage.AssetType.Point) {
        IStaker(sellingPair.asset).spendPoints(_msgSender(),
          sellingPair.price * _amount);

      // Process payment for the user with a check to sell for Ether.
      } else if (sellingPair.assetType == DFStorage.AssetType.Ether) {
        uint256 etherPrice = sellingPair.price * _amount;
        require(msg.value >= etherPrice,
          "0x9B");
        (bool success, ) = payable(paymentReceiver).call{ value: msg.value }("");
        require(success,
          "0x0C");

      // Process payment for the user with a check to sell for an ERC-20 token.
      } else if (sellingPair.assetType == DFStorage.AssetType.Token) {
        uint256 tokenPrice = sellingPair.price * _amount;
        require(IERC20(sellingPair.asset).balanceOf(_msgSender()) >= tokenPrice,
          "0x1C");
        IERC20(sellingPair.asset).safeTransferFrom(_msgSender(), paymentReceiver, tokenPrice);

      // Otherwise, error out because the payment type is unrecognized.
      } else {
        revert("0x0");
      }
    }
  }

  /**
  * Private function to avoid a stack-too-deep error.
  */
  function checkRequirments(uint256 _id) private view returns (bool) {
    // Verify that the user meets any requirements gating participation in this
    // pool. Verify that any possible ERC-20 requirements are met.
    uint256 amount;

    DFStorage.PoolRequirement memory poolRequirement = pools[_id].config.requirement;
    if (poolRequirement.requiredType == DFStorage.AccessType.TokenRequired) {
      // bytes data
      for (uint256 i = 0; i < poolRequirement.requiredAsset.length; i++) {
        amount += IERC20(poolRequirement.requiredAsset[i]).balanceOf(_msgSender());
      }
      return amount >= poolRequirement.requiredAmount;
      // Verify that any possible Staker point threshold requirements are met.
    } else if (poolRequirement.requiredType == DFStorage.AccessType.PointRequired) {
        // IStaker requiredStaker = IStaker(poolRequirement.requiredAsset[0]);
       return IStaker(poolRequirement.requiredAsset[0]).getAvailablePoints(_msgSender())
          >= poolRequirement.requiredAmount;
    }

    // Verify that any possible ERC-1155 ownership requirements are met.
    if (poolRequirement.requiredId.length == 0) {
      if (poolRequirement.requiredType == DFStorage.AccessType.ItemRequired) {
        for (uint256 i = 0; i < poolRequirement.requiredAsset.length; i++) {
            amount += ISuper1155(poolRequirement.requiredAsset[i]).totalBalances(_msgSender());
        }
        return amount >= poolRequirement.requiredAmount;
      }
      else if (poolRequirement.requiredType == DFStorage.AccessType.ItemRequired721) {
        for (uint256 i = 0; i < poolRequirement.requiredAsset.length; i++) {
            amount += ISuper721(poolRequirement.requiredAsset[i]).balanceOf(_msgSender());
        }
        // IERC721 requiredItem = IERC721(poolRequirement.requiredAsset[0]);
        return amount >= poolRequirement.requiredAmount;
      }
    } else {
      if (poolRequirement.requiredType == DFStorage.AccessType.ItemRequired) {
        // ISuper1155 requiredItem = ISuper1155(poolRequirement.requiredAsset[0]);
        for (uint256 i = 0; i < poolRequirement.requiredAsset.length; i++) {
          for (uint256 j = 0; j < poolRequirement.requiredAsset.length; j++) {
            amount += ISuper1155(poolRequirement.requiredAsset[i]).balanceOf(_msgSender(), poolRequirement.requiredId[j]);
          }
        }
        return amount >= poolRequirement.requiredAmount;
      }
      else if (poolRequirement.requiredType == DFStorage.AccessType.ItemRequired721) {
        for (uint256 i = 0; i < poolRequirement.requiredAsset.length; i++) {
            for (uint256 j = 0; j < poolRequirement.requiredAsset.length; j++) {
              amount += ISuper721(poolRequirement.requiredAsset[i]).balanceOfGroup(_msgSender(), poolRequirement.requiredId[j]);
            }
        }
        return amount >= poolRequirement.requiredAmount;
    }
  }
  return true;
}


  /**
  * Private function to avoid a stack-too-deep error.
  */
  function mintingHelper(uint256 _itemIndex, uint256 _groupId, uint256 _id, bytes32 _itemKey, uint256 _amount, uint256 _newCirculatingTotal, uint256 _userPoolPurchaseAmount, uint256 _userGlobalPurchaseAmount) private {
     // If payment is successful, mint each of the user's purchased items.
    uint256[] memory itemIds = new uint256[](_amount);
    uint256[] memory amounts = new uint256[](_amount);
    bytes32 key = keccak256(abi.encodePacked(pools[_id].config.collection,
       pools[_id].currentPoolVersion, _groupId));
    uint256 nextIssueNumber = nextItemIssues[key];
    {
      uint256 shiftedGroupId = _groupId << 128;

      for (uint256 i = 1; i <= _amount; i++) {
        uint256 itemId = (shiftedGroupId + nextIssueNumber) + i;
        itemIds[i - 1] = itemId;
        amounts[i - 1] = 1;
      }
    }
     // Update the tracker for available item issue numbers.
    nextItemIssues[key] = nextIssueNumber + _amount;

    // Update the count of circulating items from this pool.
    pools[_id].itemMinted[_itemKey] = _newCirculatingTotal;

    // Update the pool's count of items that a user has purchased.
    pools[_id].purchaseCounts[_msgSender()] = _userPoolPurchaseAmount;

    // Update the global count of items that a user has purchased.
    globalPurchaseCounts[_msgSender()] = _userGlobalPurchaseAmount;



    // Mint the items.
    items[_itemIndex].mintBatch(_msgSender(), itemIds, amounts, "");

    emit ItemPurchased(_msgSender(), _id, itemIds, amounts);
  }

}

File 2 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 3 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 17 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 17 : Sweepable.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;


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

import "../access/PermitControl.sol";

/**
  @title A base contract which supports an administrative sweep function wherein
    authorized callers may transfer ERC-20 tokens out of this contract.
  @author Tim Clancy
  @author Qazawat Zirak

  This is a base contract designed with the intent to support rescuing ERC-20
  tokens which users might have wrongly sent to a contract.
*/
contract Sweepable is PermitControl {
  using SafeERC20 for IERC20;

  /// The public identifier for the right to sweep tokens.
  bytes32 public constant SWEEP = keccak256("SWEEP");

  /// The public identifier for the right to lock token sweeps.
  bytes32 public constant LOCK_SWEEP = keccak256("LOCK_SWEEP");

  /// A flag determining whether or not the `sweep` function may be used.
  bool public sweepLocked;

  /**
    An event to track a token sweep event.

    @param sweeper The calling address which triggered the sweeep.
    @param token The specific ERC-20 token being swept.
    @param amount The amount of the ERC-20 token being swept.
    @param recipient The recipient of the swept tokens.
  */
  event TokenSweep(address indexed sweeper, IERC20 indexed token,
    uint256 amount, address indexed recipient);

  /**
    An event to track future use of the `sweep` function being locked.

    @param locker The calling address which locked down sweeping.
  */
  event SweepLocked(address indexed locker);

  /**
    Return a version number for this contract's interface.
  */
  function version() external virtual override pure returns (uint256) {
    return 1;
  }

  /**
    Allow the owner or an approved manager to sweep all of a particular ERC-20
    token from the contract and send it to another address. This function exists
    to allow the shop owner to recover tokens that are otherwise sent directly
    to this contract and get stuck. Provided that sweeping is not locked, this
    is a useful tool to help buyers recover otherwise-lost funds.

    @param _token The token to sweep the balance from.
    @param _amount The amount of token to sweep.
    @param _address The address to send the swept tokens to.
  */
  function sweep(IERC20 _token, uint256 _amount, address _address) external
    hasValidPermit(UNIVERSAL, SWEEP) {
    require(!sweepLocked,
      "Sweep: the sweep function is locked");
    _token.safeTransfer(_address, _amount);
    emit TokenSweep(_msgSender(), _token, _amount, _address);
  }

  /**
    Allow the shop owner or an approved manager to lock the contract against any
    future token sweeps.
  */
  function lockSweep() external hasValidPermit(UNIVERSAL, LOCK_SWEEP) {
    sweepLocked = true;
    emit SweepLocked(_msgSender());
  }
}

File 6 of 17 : ISuper1155.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.8;

import "../../../libraries/DFStorage.sol";

/**
  @title An interface for the `Super1155` ERC-1155 item collection contract.
  @author 0xthrpw
  @author Tim Clancy

  August 12th, 2021.
*/
interface ISuper1155 {

  /// The public identifier for the right to set this contract's metadata URI.
  function SET_URI () external view returns (bytes32);

  /// The public identifier for the right to set this contract's proxy registry.
  function SET_PROXY_REGISTRY () external view returns (bytes32);

  /// The public identifier for the right to configure item groups.
  function CONFIGURE_GROUP () external view returns (bytes32);

  /// The public identifier for the right to mint items.
  function MINT () external view returns (bytes32);

  /// The public identifier for the right to burn items.
  function BURN () external view returns (bytes32);

  /// The public identifier for the right to set item metadata.
  function SET_METADATA () external view returns (bytes32);

  /// The public identifier for the right to lock the metadata URI.
  function LOCK_URI () external view returns (bytes32);

  /// The public identifier for the right to lock an item's metadata.
  function LOCK_ITEM_URI () external view returns (bytes32);

  /// The public identifier for the right to disable item creation.
  function LOCK_CREATION () external view returns (bytes32);

  /// The public name of this contract.
  function name () external view returns (string memory);

  /**
    The ERC-1155 URI for tracking item metadata, supporting {id} substitution.
    For example: https://token-cdn-domain/{id}.json. See the ERC-1155 spec for
    more details: https://eips.ethereum.org/EIPS/eip-1155#metadata.
  */
  function metadataUri () external view returns (string memory);

  /// A proxy registry address for supporting automatic delegated approval.
  function proxyRegistryAddress () external view returns (address);

  /// A mapping from each group ID to per-address balances.
  function groupBalances (uint256, address) external view returns (uint256);

  /// A mapping from each address to a collection-wide balance.
  function totalBalances (address) external view returns (uint256);

  /// A mapping of data for each item group.
  // function itemGroups (uint256) external view returns (ItemGroup memory);
  /* function itemGroups (uint256) external view returns (bool initialized, string memory _name, uint8 supplyType, uint256 supplyData, uint8 itemType, uint256 itemData, uint8 burnType, uint256 burnData, uint256 _circulatingSupply, uint256 _mintCount, uint256 _burnCount); */

  /// A mapping of circulating supplies for each individual token.
  function circulatingSupply (uint256) external view returns (uint256);

  /// A mapping of the number of times each individual token has been minted.
  function mintCount (uint256) external view returns (uint256);

  /// A mapping of the number of times each individual token has been burnt.
  function burnCount (uint256) external view returns (uint256);

  /**
    A mapping of token ID to a boolean representing whether the item's metadata
    has been explicitly frozen via a call to `lockURI(string calldata _uri,
    uint256 _id)`. Do note that it is possible for an item's mapping here to be
    false while still having frozen metadata if the item collection as a whole
    has had its `uriLocked` value set to true.
  */
  function metadataFrozen (uint256) external view returns (bool);

  /**
    A public mapping of optional on-chain metadata for each token ID. A token's
    on-chain metadata is unable to be changed if the item's metadata URI has
    been permanently fixed or if the collection's metadata URI as a whole has
    been frozen.
  */
  function metadata (uint256) external view returns (string memory);

  /// Whether or not the metadata URI has been locked to future changes.
  function uriLocked () external view returns (bool);

  /// Whether or not the item collection has been locked to all further minting.
  function locked () external view returns (bool);

  /**
    Return a version number for this contract's interface.
  */
  function version () external view returns (uint256);

  /**
    Return the item collection's metadata URI. This implementation returns the
    same URI for all tokens within the collection and relies on client-side
    ID substitution per https://eips.ethereum.org/EIPS/eip-1155#metadata. Per
    said specification, clients calling this function must replace the {id}
    substring with the actual token ID in hex, not prefixed by 0x, and padded
    to 64 characters in length.

    @return The metadata URI string of the item with ID `_itemId`.
  */
  function uri (uint256) external view returns (string memory);

  /**
    Allow the item collection owner or an approved manager to update the
    metadata URI of this collection. This implementation relies on a single URI
    for all items within the collection, and as such does not emit the standard
    URI event. Instead, we emit our own event to reflect changes in the URI.

    @param _uri The new URI to update to.
  */
  function setURI (string memory _uri) external;

  /**
    Allow the item collection owner or an approved manager to update the proxy
    registry address handling delegated approval.

    @param _proxyRegistryAddress The address of the new proxy registry to
      update to.
  */
  function setProxyRegistry (address _proxyRegistryAddress) external;

  /**
    Retrieve the balance of a particular token `_id` for a particular address
    `_owner`.

    @param _owner The owner to check for this token balance.
    @param _id The ID of the token to check for a balance.
    @return The amount of token `_id` owned by `_owner`.
  */
  function balanceOf (address _owner, uint256 _id) external view returns (uint256);

  /**
    Retrieve in a single call the balances of some mulitple particular token
    `_ids` held by corresponding `_owners`.

    @param _owners The owners to check for token balances.
    @param _ids The IDs of tokens to check for balances.
    @return the amount of each token owned by each owner.
  */
  function balanceOfBatch (address[] memory _owners, uint256[] memory _ids) external view returns (uint256[] memory);

  /**
    This function returns true if `_operator` is approved to transfer items
    owned by `_owner`. This approval check features an override to explicitly
    whitelist any addresses delegated in the proxy registry.

    @param _owner The owner of items to check for transfer ability.
    @param _operator The potential transferrer of `_owner`'s items.
    @return Whether `_operator` may transfer items owned by `_owner`.
  */
  function isApprovedForAll (address _owner, address _operator) external view returns (bool);

  /**
    Enable or disable approval for a third party `_operator` address to manage
    (transfer or burn) all of the caller's tokens.

    @param _operator The address to grant management rights over all of the
      caller's tokens.
    @param _approved The status of the `_operator`'s approval for the caller.
  */
  function setApprovalForAll (address _operator, bool _approved) external;

  /**
    Transfer on behalf of a caller or one of their authorized token managers
    items from one address to another.

    @param _from The address to transfer tokens from.
    @param _to The address to transfer tokens to.
    @param _id The specific token ID to transfer.
    @param _amount The amount of the specific `_id` to transfer.
    @param _data Additional call data to send with this transfer.
  */
  function safeTransferFrom (address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data) external;

  /**
    Transfer on behalf of a caller or one of their authorized token managers
    items from one address to another.

    @param _from The address to transfer tokens from.
    @param _to The address to transfer tokens to.
    @param _ids The specific token IDs to transfer.
    @param _amounts The amounts of the specific `_ids` to transfer.
    @param _data Additional call data to send with this transfer.
  */
  function safeBatchTransferFrom (address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) external;

  /**
    Create a new NFT item group or configure an existing one. NFTs within a
    group share a group ID in the upper 128-bits of their full item ID.
    Within a group NFTs can be distinguished for the purposes of serializing
    issue numbers.

    @param _groupId The ID of the item group to create or configure.
    @param _data The `ItemGroup` data input.
  */
  function configureGroup (uint256 _groupId, DFStorage.ItemGroupInput calldata _data) external;

  /**
    Mint a batch of tokens into existence and send them to the `_recipient`
    address. In order to mint an item, its item group must first have been
    created. Minting an item must obey both the fungibility and size cap of its
    group.

    @param _recipient The address to receive all NFTs within the newly-minted
      group.
    @param _ids The item IDs for the new items to create.
    @param _amounts The amount of each corresponding item ID to create.
    @param _data Any associated data to use on items minted in this transaction.
  */
  function mintBatch (address _recipient, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) external;

  /**
    This function allows an address to destroy some of its items.

    @param _burner The address whose item is burning.
    @param _id The item ID to burn.
    @param _amount The amount of the corresponding item ID to burn.
  */
  function burn (address _burner, uint256 _id, uint256 _amount) external;

  /**
    This function allows an address to destroy multiple different items in a
    single call.

    @param _burner The address whose items are burning.
    @param _ids The item IDs to burn.
    @param _amounts The amounts of the corresponding item IDs to burn.
  */
  function burnBatch (address _burner, uint256[] memory _ids, uint256[] memory _amounts) external;

  /**
    Set the on-chain metadata attached to a specific token ID so long as the
    collection as a whole or the token specifically has not had metadata
    editing frozen.

    @param _id The ID of the token to set the `_metadata` for.
    @param _metadata The metadata string to store on-chain.
  */
  function setMetadata (uint256 _id, string memory _metadata) external;

  /**
    Allow the item collection owner or an associated manager to forever lock the
    metadata URI on the entire collection to future changes.

    @param _uri The value of the URI to lock for `_id`.
  */
  function lockURI(string calldata _uri) external;

  /**
    Allow the item collection owner or an associated manager to forever lock the
    metadata URI on an item to future changes.

    @param _uri The value of the URI to lock for `_id`.
    @param _id The token ID to lock a metadata URI value into.
  */
  function lockURI(string calldata _uri, uint256 _id) external;


  /**
    Allow the item collection owner or an associated manager to forever lock the
    metadata URI on a group of items to future changes.

    @param _uri The value of the URI to lock for `groupId`.
    @param groupId The group ID to lock a metadata URI value into.
  */
  function lockGroupURI(string calldata _uri, uint256 groupId) external;

  /**
    Allow the item collection owner or an associated manager to forever lock
    this contract to further item minting.
  */
  function lock() external;
}

File 7 of 17 : ISuper721.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.8;

/**
    @title Super721 interface 
    Interface for interacting with Super721 contract
 */
interface ISuper721 {

    /**
        Returns amount of NFTs, which are owned by `_owner` in some group `_id`.
        @param _owner address of NFTs owner.
        @param _id group id of collection.
     */
    function balanceOfGroup(address _owner, uint256 _id) external view returns (uint256);

    /**
        Returns overall amount of NFTs, which are owned by `_owner`.
        @param _owner address of NFTs owner.
     */
    function balanceOf(address _owner) external view returns (uint256);

    function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids)
        external
        view
        returns (uint256[] memory);
}

File 8 of 17 : IStaker.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.8;

/// @title interface for interacting with Staker contract.
interface IStaker {

    /**
        Allows an approved spender of points to spend points on behalf of a user.
        @param _user The user whose points are being spent.
        @param _amount The amount of the user's points being spent.
    */
    function spendPoints(address _user, uint256 _amount) external;

    /**
        Return the number of points that the user has available to spend.
        @return the number of points that the user has available to spend.
    */
    function getAvailablePoints(address _user) external view returns (uint256);
}

File 9 of 17 : IMintShop.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.8;

import "../assets/erc1155/interfaces/ISuper1155.sol";

/**
    @title Interface for interaction with MintShop contract.
 */
interface IMintShop {

    /**
    Allow the owner of the shop or an approved manager to add a new pool of
    items that users may purchase.

    @param _pool The PoolInput full of data defining the pool's operation.
    @param _groupIds The specific item group IDs to sell in this pool,
      keyed to the `_amounts` array.
    @param _issueNumberOffsets The offset for the next issue number minted for a
      particular item group in `_groupIds`. This is *important* to handle
      pre-minted or partially-minted item groups.
    @param _caps The maximum amount of each particular groupId that can be sold
      by this pool.
    @param _prices The asset address to price pairings to use for selling each
      item.
  */
    function addPool(
        DFStorage.PoolInput calldata _pool,
        uint256[] calldata _groupIds,
        uint256[] calldata _issueNumberOffsets,
        uint256[] calldata _caps,
        DFStorage.Price[][] memory _prices
    ) external;

    /**
        Adds new whiteList restriction for the pool by `_poolId`.
        @param _poolId id of the pool, where new white list is added.
        @param whitelist struct for creating a new whitelist.
   */
    function addWhiteList(uint256 _poolId, DFStorage.WhiteListCreate[] calldata whitelist) external;

    /**
        Allow the shop owner or an approved manager to set the array of items known to this shop.
        @param _items The array of Super1155 addresses.
    */
    function setItems(ISuper1155[] memory _items) external;

    /// The public identifier for the right to set new items.
    function SET_ITEMS() external view returns (bytes32); 

    /// The public identifier for the right to manage item pools.
    function POOL() external view returns (bytes32); 

     /// The public identifier for the right to manage whitelists.
    function WHITELIST() external view returns (bytes32); 

}

File 10 of 17 : SuperMerkleAccess.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;

import "./MerkleCore.sol";
import "../../interfaces/IMerkle.sol";

/**
  @title A merkle tree based access control.
  @author Qazawat Zirak

  This contract replaces the traditional whitelists for access control
  by using a merkle tree, storing the root on-chain instead of all the
  addressses. The merkle tree alongside the whitelist is kept off-chain
  for lookups and creating proofs to validate an access.
  This code is inspired by and modified from incredible work of RicMoo.
  https://github.com/ricmoo/ethers-airdrop/blob/master/AirDropToken.sol

  October 12th, 2021.
*/
abstract contract SuperMerkleAccess is MerkleCore {

  /// The public identifier for the right to set a root for a round.
  bytes32 public constant SET_ACCESS_ROUND = keccak256("SET_ACCESS_ROUND");

  /**
    A struct containing information about the AccessList.
    @param merkleRoot the proof stored on chain to verify against.
    @param startTime the start time of validity for the accesslist.
    @param endTime the end time of validity for the accesslist.
    @param round the number times the accesslist has been set.
    @param price the amount of ether/token required for the access.
    @param token the address of the token, paid as a price. A price
      with zero token address is ether.
  */
  struct AccessList {
    bytes32 merkleRoot;
    uint256 startTime;
    uint256 endTime;
    uint256 round;
    uint256 price;
    address token;
  }

  /// MerkleRootId to 'Accesslist', each containing a merkleRoot.
  mapping (uint256 => AccessList) public accessRoots;

  /**
    Set a new round for the accesslist.
    @param _accesslistId the accesslist id containg the merkleRoot.
    @param _merkleRoot the new merkleRoot for the round.
    @param _startTime the start time of the new round.
    @param _endTime the end time of the new round.
    @param _price the access price.
    @param _token the token address for access price.
  */
  function setAccessRound(uint256 _accesslistId, bytes32 _merkleRoot,
  uint256 _startTime, uint256 _endTime, uint256 _price, address _token) public virtual
  hasValidPermit(UNIVERSAL, SET_ACCESS_ROUND) {

    AccessList memory accesslist = AccessList({
      merkleRoot: _merkleRoot,
      startTime: _startTime,
      endTime: _endTime,
      round: accessRoots[_accesslistId].round + 1,
      price: _price,
      token: _token
    });
    accessRoots[_accesslistId] = accesslist;
  }

  /**
    Verify an access against a targetted markleRoot on-chain.
    @param _accesslistId the id of the accesslist containing the merkleRoot.
    @param _index index of the hashed node from off-chain list.
    @param _node the actual hashed node which needs to be verified.
    @param _merkleProof required merkle hashes from off-chain merkle tree.
   */
  function verify(uint256 _accesslistId, uint256 _index, bytes32 _node,
  bytes32[] calldata _merkleProof) public virtual view returns(bool) {
    
    if (accessRoots[_accesslistId].merkleRoot == 0) {
      return false;
    } else if (block.timestamp < accessRoots[_accesslistId].startTime) {
      return false;
    } else if (block.timestamp > accessRoots[_accesslistId].endTime) {
      return false;
    } else if (getRootHash(_index, _node, _merkleProof) != accessRoots[_accesslistId].merkleRoot) {
      return false;
    }
    return true;
  }
}

File 11 of 17 : DFStorage.sol
pragma solidity 0.8.8;

library DFStorage {
    /**
    @notice This struct is a source of mapping-free input to the `addPool` function.

    @param name A name for the pool.
    @param startTime The timestamp when this pool begins allowing purchases.
    @param endTime The timestamp after which this pool disallows purchases.
    @param purchaseLimit The maximum number of items a single address may
      purchase from this pool.
    @param singlePurchaseLimit The maximum number of items a single address may
      purchase from this pool in a single transaction.
    @param requirement A PoolRequirement requisite for users who want to
      participate in this pool.
  */
    struct PoolInput {
        string name;
        uint256 startTime;
        uint256 endTime;
        uint256 purchaseLimit;
        uint256 singlePurchaseLimit;
        PoolRequirement requirement;
        address collection;
    }

    /**
    @notice This enumeration type specifies the different access rules that may be
    applied to pools in this shop. Access to a pool may be restricted based on
    the buyer's holdings of either tokens or items.

    @param Public This specifies a pool which requires no special asset holdings
      to buy from.
    @param TokenRequired This specifies a pool which requires the buyer to hold
      some amount of ERC-20 tokens to buy from.
    @param ItemRequired This specifies a pool which requires the buyer to hold
      some amount of an ERC-1155 item to buy from.
    @param PointRequired This specifies a pool which requires the buyer to hold
      some amount of points in a Staker to buy from.
  */
    enum AccessType {
        Public,
        TokenRequired,
        ItemRequired,
        PointRequired,
        ItemRequired721
    }

    /**
    @notice This struct tracks information about a prerequisite for a user to
    participate in a pool.

    @param requiredType The `AccessType` being applied to gate buyers from
      participating in this pool. See `requiredAsset` for how additional data
      can apply to the access type.
    @param requiredAsset Some more specific information about the asset to
      require. If the `requiredType` is `TokenRequired`, we use this address to
      find the ERC-20 token that we should be specifically requiring holdings
      of. If the `requiredType` is `ItemRequired`, we use this address to find
      the item contract that we should be specifically requiring holdings of. If
      the `requiredType` is `PointRequired`, we treat this address as the
      address of a Staker contract. Do note that in order for this to work, the
      Staker must have approved this shop as a point spender.
    @param requiredAmount The amount of the specified `requiredAsset` required
      for the buyer to purchase from this pool.
    @param requiredId The ID of an address whitelist to restrict participants
      in this pool. To participate, a purchaser must have their address present
      in the corresponding whitelist. Other requirements from `requiredType`
      also apply. An ID of 0 is a sentinel value for no whitelist required.
  */
    struct PoolRequirement {
        AccessType requiredType;
        address[] requiredAsset;
        uint256 requiredAmount;
        uint256[] requiredId;
    }

    /**
    @notice This enumeration type specifies the different assets that may be used to
    complete purchases from this mint shop.

    @param Point This specifies that the asset being used to complete
      this purchase is non-transferrable points from a `Staker` contract.
    @param Ether This specifies that the asset being used to complete
      this purchase is native Ether currency.
    @param Token This specifies that the asset being used to complete
      this purchase is an ERC-20 token.
  */
    enum AssetType {
        Point,
        Ether,
        Token
    }

    /**
    @notice This struct tracks information about a single asset with the associated
    price that an item is being sold in the shop for. It also includes an
    `asset` field which is used to convey optional additional data about the
    asset being used to purchase with.

    @param assetType The `AssetType` type of the asset being used to buy.
    @param asset Some more specific information about the asset to charge in.
     If the `assetType` is Point, we use this address to find the specific
     Staker whose points are used as the currency.
     If the `assetType` is Ether, we ignore this field.
     If the `assetType` is Token, we use this address to find the
     ERC-20 token that we should be specifically charging with.
    @param price The amount of the specified `assetType` and `asset` to charge.
  */
    struct Price {
        AssetType assetType;
        address asset;
        uint256 price;
    }
  /**
    This enumeration lists the various supply types that each item group may
    use. In general, the administrator of this collection or those permissioned
    to do so may move from a more-permissive supply type to a less-permissive.
    For example: an uncapped or flexible supply type may be converted to a
    capped supply type. A capped supply type may not be uncapped later, however.

    @param Capped There exists a fixed cap on the size of the item group. The
      cap is set by `supplyData`.
    @param Uncapped There is no cap on the size of the item group. The value of
      `supplyData` cannot be set below the current circulating supply but is
      otherwise ignored.
    @param Flexible There is a cap which can be raised or lowered (down to
      circulating supply) freely. The value of `supplyData` cannot be set below
      the current circulating supply and determines the cap.
  */
  enum SupplyType {
    Capped,
    Uncapped,
    Flexible
  }

  /**
    This enumeration lists the various item types that each item group may use.
    In general, these are static once chosen.

    @param Nonfungible The item group is truly nonfungible where each ID may be
      used only once. The value of `itemData` is ignored.
    @param Fungible The item group is truly fungible and collapses into a single
      ID. The value of `itemData` is ignored.
    @param Semifungible The item group may be broken up across multiple
      repeating token IDs. The value of `itemData` is the cap of any single
      token ID in the item group.
  */
  enum ItemType {
    Nonfungible,
    Fungible,
    Semifungible
  }

  /**
    This enumeration lists the various burn types that each item group may use.
    These are static once chosen.

    @param None The items in this group may not be burnt. The value of
      `burnData` is ignored.
    @param Burnable The items in this group may be burnt. The value of
      `burnData` is the maximum that may be burnt.
    @param Replenishable The items in this group, once burnt, may be reminted by
      the owner. The value of `burnData` is ignored.
  */
  enum BurnType {
    None,
    Burnable,
    Replenishable
  }

  /**
    This struct is a source of mapping-free input to the `configureGroup`
    function. It defines the settings for a particular item group.
   
    @param supplyData An optional integer used by some `supplyType` values.
    @param itemData An optional integer used by some `itemType` values.
    @param burnData An optional integer used by some `burnType` values.
    @param name A name for the item group.
    @param supplyType The supply type for this group of items.
    @param itemType The type of item represented by this item group.
    @param burnType The type of burning permitted by this item group.
    
  */
  struct ItemGroupInput {
    uint256 supplyData;
    uint256 itemData;
    uint256 burnData;
    SupplyType supplyType;
    ItemType itemType;
    BurnType burnType;
    string name;
  }


  /**
    This structure is used at the moment of NFT purchase.
    @param whiteListId Id of a whiteList.
    @param index Element index in the original array
    @param allowance The quantity is available to the user for purchase.
    @param node Base hash of the element.
    @param merkleProof Proof that the user is on the whitelist.
  */
  struct WhiteListInput {
    uint256 whiteListId;
    uint256 index; 
    uint256 allowance;
    bytes32 node; 
    bytes32[] merkleProof;
  }


  /**
    This structure is used at the moment of NFT purchase.
    @param _accesslistId Id of a whiteList.
    @param _merkleRoot Hash root of merkle tree.
    @param _startTime The start date of the whitelist
    @param _endTime The end date of the whitelist
    @param _price The price that applies to the whitelist
    @param _token Token with which the purchase will be made
  */
  struct WhiteListCreate {
    uint256 _accesslistId;
    bytes32 _merkleRoot;
    uint256 _startTime; 
    uint256 _endTime; 
    uint256 _price; 
    address _token;
  }
}

File 12 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 13 of 17 : PermitControl.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Address.sol";

/**
  @title An advanced permission-management contract.
  @author Tim Clancy

  This contract allows for a contract owner to delegate specific rights to
  external addresses. Additionally, these rights can be gated behind certain
  sets of circumstances and granted expiration times. This is useful for some
  more finely-grained access control in contracts.

  The owner of this contract is always a fully-permissioned super-administrator.

  August 23rd, 2021.
*/
abstract contract PermitControl is Ownable {
  using Address for address;

  /// A special reserved constant for representing no rights.
  bytes32 public constant ZERO_RIGHT = hex"00000000000000000000000000000000";

  /// A special constant specifying the unique, universal-rights circumstance.
  bytes32 public constant UNIVERSAL = hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";

  /*
    A special constant specifying the unique manager right. This right allows an
    address to freely-manipulate the `managedRight` mapping.
  **/
  bytes32 public constant MANAGER = hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";

  /**
    A mapping of per-address permissions to the circumstances, represented as
    an additional layer of generic bytes32 data, under which the addresses have
    various permits. A permit in this sense is represented by a per-circumstance
    mapping which couples some right, represented as a generic bytes32, to an
    expiration time wherein the right may no longer be exercised. An expiration
    time of 0 indicates that there is in fact no permit for the specified
    address to exercise the specified right under the specified circumstance.

    @dev Universal rights MUST be stored under the 0xFFFFFFFFFFFFFFFFFFFFFFFF...
    max-integer circumstance. Perpetual rights may be given an expiry time of
    max-integer.
  */
  mapping( address => mapping( bytes32 => mapping( bytes32 => uint256 )))
    public permissions;

  /**
    An additional mapping of managed rights to manager rights. This mapping
    represents the administrator relationship that various rights have with one
    another. An address with a manager right may freely set permits for that
    manager right's managed rights. Each right may be managed by only one other
    right.
  */
  mapping( bytes32 => bytes32 ) public managerRight;

  /**
    An event emitted when an address has a permit updated. This event captures,
    through its various parameter combinations, the cases of granting a permit,
    updating the expiration time of a permit, or revoking a permit.

    @param updator The address which has updated the permit.
    @param updatee The address whose permit was updated.
    @param circumstance The circumstance wherein the permit was updated.
    @param role The role which was updated.
    @param expirationTime The time when the permit expires.
  */
  event PermitUpdated(
    address indexed updator,
    address indexed updatee,
    bytes32 circumstance,
    bytes32 indexed role,
    uint256 expirationTime
  );

//   /**
//     A version of PermitUpdated for work with setPermits() function.
    
//     @param updator The address which has updated the permit.
//     @param updatees The addresses whose permit were updated.
//     @param circumstances The circumstances wherein the permits were updated.
//     @param roles The roles which were updated.
//     @param expirationTimes The times when the permits expire.
//   */
//   event PermitsUpdated(
//     address indexed updator,
//     address[] indexed updatees,
//     bytes32[] circumstances,
//     bytes32[] indexed roles,
//     uint256[] expirationTimes
//   );

  /**
    An event emitted when a management relationship in `managerRight` is
    updated. This event captures adding and revoking management permissions via
    observing the update history of the `managerRight` value.

    @param manager The address of the manager performing this update.
    @param managedRight The right which had its manager updated.
    @param managerRight The new manager right which was updated to.
  */
  event ManagementUpdated(
    address indexed manager,
    bytes32 indexed managedRight,
    bytes32 indexed managerRight
  );

  /**
    A modifier which allows only the super-administrative owner or addresses
    with a specified valid right to perform a call.

    @param _circumstance The circumstance under which to check for the validity
      of the specified `right`.
    @param _right The right to validate for the calling address. It must be
      non-expired and exist within the specified `_circumstance`.
  */
  modifier hasValidPermit(
    bytes32 _circumstance,
    bytes32 _right
  ) {
    require(_msgSender() == owner()
      || hasRight(_msgSender(), _circumstance, _right),
      "P1");
    _;
  }

  /**
    Return a version number for this contract's interface.
  */
  function version() external virtual pure returns (uint256) {
    return 1;
  }

  /**
    Determine whether or not an address has some rights under the given
    circumstance, and if they do have the right, until when.

    @param _address The address to check for the specified `_right`.
    @param _circumstance The circumstance to check the specified `_right` for.
    @param _right The right to check for validity.
    @return The timestamp in seconds when the `_right` expires. If the timestamp
      is zero, we can assume that the user never had the right.
  */
  function hasRightUntil(
    address _address,
    bytes32 _circumstance,
    bytes32 _right
  ) public view returns (uint256) {
    return permissions[_address][_circumstance][_right];
  }

   /**
    Determine whether or not an address has some rights under the given
    circumstance,

    @param _address The address to check for the specified `_right`.
    @param _circumstance The circumstance to check the specified `_right` for.
    @param _right The right to check for validity.
    @return true or false, whether user has rights and time is valid.
  */
  function hasRight(
    address _address,
    bytes32 _circumstance,
    bytes32 _right
  ) public view returns (bool) {
    return permissions[_address][_circumstance][_right] > block.timestamp;
  }

  /**
    Set the permit to a specific address under some circumstances. A permit may
    only be set by the super-administrative contract owner or an address holding
    some delegated management permit.

    @param _address The address to assign the specified `_right` to.
    @param _circumstance The circumstance in which the `_right` is valid.
    @param _right The specific right to assign.
    @param _expirationTime The time when the `_right` expires for the provided
      `_circumstance`.
  */
  function setPermit(
    address _address,
    bytes32 _circumstance,
    bytes32 _right,
    uint256 _expirationTime
  ) public virtual hasValidPermit(UNIVERSAL, managerRight[_right]) {
    require(_right != ZERO_RIGHT,
      "P2");
    permissions[_address][_circumstance][_right] = _expirationTime;
    emit PermitUpdated(_msgSender(), _address, _circumstance, _right,
      _expirationTime);
  }

//   /**
//     Version of setPermit() that works with multiple addresses in one transaction.

//     @param _addresses The array of addresses to assign the specified `_right` to.
//     @param _circumstances The array of circumstances in which the `_right` is 
//                           valid.
//     @param _rights The array of specific rights to assign.
//     @param _expirationTimes The array of times when the `_rights` expires for 
//                             the provided _circumstance`.
//   */
//   function setPermits(
//     address[] memory _addresses,
//     bytes32[] memory _circumstances, 
//     bytes32[] memory _rights, 
//     uint256[] memory _expirationTimes
//   ) public virtual {
//     require((_addresses.length == _circumstances.length)
//              && (_circumstances.length == _rights.length)
//              && (_rights.length == _expirationTimes.length),
//              "leghts of input arrays are not equal"
//     );
//     bytes32 lastRight;
//     for(uint i = 0; i < _rights.length; i++) {
//       if (lastRight != _rights[i] || (i == 0)) { 
//         require(_msgSender() == owner() || hasRight(_msgSender(), _circumstances[i], _rights[i]), "P1");
//         require(_rights[i] != ZERO_RIGHT, "P2");
//         lastRight = _rights[i];
//       }
//       permissions[_addresses[i]][_circumstances[i]][_rights[i]] = _expirationTimes[i];
//     }
//     emit PermitsUpdated(
//       _msgSender(), 
//       _addresses,
//       _circumstances,
//       _rights,
//       _expirationTimes
//     );
//   }

  /**
    Set the `_managerRight` whose `UNIVERSAL` holders may freely manage the
    specified `_managedRight`.

    @param _managedRight The right which is to have its manager set to
      `_managerRight`.
    @param _managerRight The right whose `UNIVERSAL` holders may manage
      `_managedRight`.
  */
  function setManagerRight(
    bytes32 _managedRight,
    bytes32 _managerRight
  ) external virtual hasValidPermit(UNIVERSAL, MANAGER) {
    require(_managedRight != ZERO_RIGHT,
      "P3");
    managerRight[_managedRight] = _managerRight;
    emit ManagementUpdated(_msgSender(), _managedRight, _managerRight);
  }
}

File 14 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 15 of 17 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 16 of 17 : MerkleCore.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.7;

import "../../base/Sweepable.sol";

/**
  @title A merkle tree root finder.
  @author Qazawat Zirak

  This contract is meant for calculating a root hash from any given
  valid index, valid node at that index, and valid merkle proofs.

  October 12th, 2021.
*/
abstract contract MerkleCore is Sweepable {

  /**
    Calculate a root hash from given parameters.
    @param _index index of the hashed node from the list.
    @param _node the hashed node at that index.
    @param _merkleProof array of one required merkle hash per level.
    @return a root hash from given parameters.
   */
  function getRootHash(uint256 _index, bytes32 _node,
  bytes32[] calldata _merkleProof) internal pure returns(bytes32) {

    uint256 path = _index;
    for (uint256 i = 0; i < _merkleProof.length; i++) {
      if ((path & 0x01) == 1) {
          _node = keccak256(abi.encodePacked(_merkleProof[i], _node));
      } else {
          _node = keccak256(abi.encodePacked(_node, _merkleProof[i]));
      }
      path /= 2;
    }
    return _node;
  }
}

File 17 of 17 : IMerkle.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.8;

/**
    Interface for interacting with contract inheriting from SuperMerkleAccess contract
 */
interface IMerkle {

    /**
    Set a new round for the accesslist.
    @param _accesslistId the accesslist id containg the merkleRoot.
    @param _merkleRoot the new merkleRoot for the round.
    @param _startTime the start time of the new round.
    @param _endTime the end time of the new round.
    @param _price the access price.
    @param _token the token address for access price.
  */
   function setAccessRound(uint256 _accesslistId, bytes32 _merkleRoot,
  uint256 _startTime, uint256 _endTime, uint256 _price, address _token) external;

}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_paymentReceiver","type":"address"},{"internalType":"uint256","name":"_globalPurchaseLimit","type":"uint256"},{"internalType":"uint256","name":"_maxAllocation","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"locker","type":"address"}],"name":"GlobalPurchaseLimitLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updater","type":"address"},{"indexed":true,"internalType":"uint256","name":"oldPurchaseLimit","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"newPurchaseLimit","type":"uint256"}],"name":"GlobalPurchaseLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"uint256[]","name":"itemIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ItemPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"manager","type":"address"},{"indexed":true,"internalType":"bytes32","name":"managedRight","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"managerRight","type":"bytes32"}],"name":"ManagementUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"locker","type":"address"}],"name":"PaymentReceiverLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updater","type":"address"},{"indexed":true,"internalType":"address","name":"oldPaymentReceiver","type":"address"},{"indexed":true,"internalType":"address","name":"newPaymentReceiver","type":"address"}],"name":"PaymentReceiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updator","type":"address"},{"indexed":true,"internalType":"address","name":"updatee","type":"address"},{"indexed":false,"internalType":"bytes32","name":"circumstance","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"expirationTime","type":"uint256"}],"name":"PermitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updater","type":"address"},{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"},{"internalType":"uint256","name":"singlePurchaseLimit","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AccessType","name":"requiredType","type":"uint8"},{"internalType":"address[]","name":"requiredAsset","type":"address[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256[]","name":"requiredId","type":"uint256[]"}],"internalType":"struct DFStorage.PoolRequirement","name":"requirement","type":"tuple"},{"internalType":"address","name":"collection","type":"address"}],"indexed":true,"internalType":"struct DFStorage.PoolInput","name":"pool","type":"tuple"},{"indexed":false,"internalType":"uint256[]","name":"groupIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"caps","type":"uint256[]"},{"components":[{"internalType":"enum DFStorage.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"indexed":true,"internalType":"struct DFStorage.Price[][]","name":"prices","type":"tuple[][]"}],"name":"PoolUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"locker","type":"address"}],"name":"SweepLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sweeper","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"}],"name":"TokenSweep","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"updater","type":"address"},{"indexed":false,"internalType":"uint256","name":"whitelistId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"WhitelistUpdated","type":"event"},{"inputs":[],"name":"LOCK_GLOBAL_LIMIT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_PAYMENT_RECEIVER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LOCK_SWEEP","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SET_ACCESS_ROUND","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SET_ITEMS","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SET_PAYMENT_RECEIVER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWEEP","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNIVERSAL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UPDATE_GLOBAL_LIMIT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZERO_RIGHT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"accessRoots","outputs":[{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"round","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"},{"internalType":"uint256","name":"singlePurchaseLimit","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AccessType","name":"requiredType","type":"uint8"},{"internalType":"address[]","name":"requiredAsset","type":"address[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256[]","name":"requiredId","type":"uint256[]"}],"internalType":"struct DFStorage.PoolRequirement","name":"requirement","type":"tuple"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct DFStorage.PoolInput","name":"_pool","type":"tuple"},{"internalType":"uint256[]","name":"_groupIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_issueNumberOffsets","type":"uint256[]"},{"internalType":"uint256[]","name":"_caps","type":"uint256[]"},{"components":[{"internalType":"enum DFStorage.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct DFStorage.Price[][]","name":"_prices","type":"tuple[][]"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"components":[{"internalType":"uint256","name":"_accesslistId","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"internalType":"struct DFStorage.WhiteListCreate[]","name":"whitelist","type":"tuple[]"}],"name":"addWhiteList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256","name":"_itemIndex","type":"uint256"}],"name":"getPools","outputs":[{"components":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"},{"internalType":"uint256","name":"singlePurchaseLimit","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AccessType","name":"requiredType","type":"uint8"},{"internalType":"address[]","name":"requiredAsset","type":"address[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256[]","name":"requiredId","type":"uint256[]"}],"internalType":"struct DFStorage.PoolRequirement","name":"requirement","type":"tuple"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct DFStorage.PoolInput","name":"config","type":"tuple"},{"internalType":"string","name":"itemMetadataUri","type":"string"},{"components":[{"internalType":"uint256","name":"groupId","type":"uint256"},{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct DFStorage.Price[]","name":"prices","type":"tuple[]"}],"internalType":"struct MintShop1155.PoolItem[]","name":"items","type":"tuple[]"}],"internalType":"struct MintShop1155.PoolOutput[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_purchasers","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"getPurchaseCounts","outputs":[{"internalType":"uint256[][]","name":"","type":"uint256[][]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"globalPurchaseCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalPurchaseLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalPurchaseLimitLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_circumstance","type":"bytes32"},{"internalType":"bytes32","name":"_right","type":"bytes32"}],"name":"hasRight","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_circumstance","type":"bytes32"},{"internalType":"bytes32","name":"_right","type":"bytes32"}],"name":"hasRightUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"whiteListId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct DFStorage.WhiteListInput","name":"_whiteList","type":"tuple"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"isEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"items","outputs":[{"internalType":"contract ISuper1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockGlobalPurchaseLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockPaymentReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockSweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"managerRight","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_groupId","type":"uint256"},{"internalType":"uint256","name":"_assetIndex","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_itemIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"whiteListId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct DFStorage.WhiteListInput","name":"_whiteList","type":"tuple"}],"name":"mintFromPool","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"nextItemIssues","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentReceiverLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"permissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"uint256","name":"currentPoolVersion","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"},{"internalType":"uint256","name":"singlePurchaseLimit","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AccessType","name":"requiredType","type":"uint8"},{"internalType":"address[]","name":"requiredAsset","type":"address[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256[]","name":"requiredId","type":"uint256[]"}],"internalType":"struct DFStorage.PoolRequirement","name":"requirement","type":"tuple"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct DFStorage.PoolInput","name":"config","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"whiteListId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct DFStorage.WhiteListInput","name":"_whiteList","type":"tuple"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"remainder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_accesslistId","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_endTime","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"address","name":"_token","type":"address"}],"name":"setAccessRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ISuper1155[]","name":"_items","type":"address[]"}],"name":"setItems","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_managedRight","type":"bytes32"},{"internalType":"bytes32","name":"_managerRight","type":"bytes32"}],"name":"setManagerRight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_circumstance","type":"bytes32"},{"internalType":"bytes32","name":"_right","type":"bytes32"},{"internalType":"uint256","name":"_expirationTime","type":"uint256"}],"name":"setPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"sweep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newGlobalPurchaseLimit","type":"uint256"}],"name":"updateGlobalPurchaseLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newPaymentReceiver","type":"address"}],"name":"updatePaymentReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"},{"internalType":"uint256","name":"singlePurchaseLimit","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AccessType","name":"requiredType","type":"uint8"},{"internalType":"address[]","name":"requiredAsset","type":"address[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256[]","name":"requiredId","type":"uint256[]"}],"internalType":"struct DFStorage.PoolRequirement","name":"requirement","type":"tuple"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct DFStorage.PoolInput","name":"_config","type":"tuple"},{"internalType":"uint256[]","name":"_groupIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_issueNumberOffsets","type":"uint256[]"},{"internalType":"uint256[]","name":"_caps","type":"uint256[]"},{"components":[{"internalType":"enum DFStorage.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct DFStorage.Price[][]","name":"_prices","type":"tuple[][]"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"},{"internalType":"uint256","name":"singlePurchaseLimit","type":"uint256"},{"components":[{"internalType":"enum DFStorage.AccessType","name":"requiredType","type":"uint8"},{"internalType":"address[]","name":"requiredAsset","type":"address[]"},{"internalType":"uint256","name":"requiredAmount","type":"uint256"},{"internalType":"uint256[]","name":"requiredId","type":"uint256[]"}],"internalType":"struct DFStorage.PoolRequirement","name":"requirement","type":"tuple"},{"internalType":"address","name":"collection","type":"address"}],"internalType":"struct DFStorage.PoolInput","name":"_config","type":"tuple"}],"name":"updatePoolConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_accesslistId","type":"uint256"},{"internalType":"uint256","name":"_index","type":"uint256"},{"internalType":"bytes32","name":"_node","type":"bytes32"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]

60a06040523480156200001157600080fd5b5060405162005b7938038062005b798339810160408190526200003491620001f8565b6200003f33620000a0565b60016004556200004e620000f0565b6001600160a01b0316846001600160a01b03161462000072576200007284620000ff565b600780546001600160a01b0319166001600160a01b0394909416939093179092556008556080525062000240565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031690565b336200010a620000f0565b6001600160a01b031614620001665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b038116620001cd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200015d565b620001d881620000a0565b50565b80516001600160a01b0381168114620001f357600080fd5b919050565b600080600080608085870312156200020f57600080fd5b6200021a85620001db565b93506200022a60208601620001db565b6040860151606090960151949790965092505050565b60805161591662000263600039600081816106dd0152611e5301526159166000f3fe60806040526004361061025a5760003560e01c80630272a7c81461025f5780630b3f6580146102945780630bdfe46c146102b457806317f5ebb4146102d657806318e56131146102f257806319b0deb1146103085780631a717d1a1461031d5780631b2df850146102d65780631bb7cc99146103ac57806320a01824146103ce578063221b6199146103f0578063227292e0146104205780632ed83f781461044057806331ff40831461045a57806340e611f614610474578063455006e414610496578063483ba44e146104b6578063503e97d4146104f457806354fd4d501461050a578063650c35d21461051e57806366a0e54d1461053e578063715018a61461058c5780637535d246146105a157806375cc557a146105c357806376ba264a146105d8578063792f6110146105f8578063808506aa146106255780638681d49c146106455780638b6a3cfc146106655780638da5cb5b146106875780638db56e3f146106a95780639b3ba79f146106cb5780639d57137f146106ff578063a625776e14610721578063a9d9aa5014610736578063ac4afa3814610749578063b794a00b14610777578063bfb231d2146107a4578063c2e62359146107c4578063c5b16c59146107e5578063cb37f3b214610812578063cc2af30814610832578063cf64d4c214610852578063d3b7d5e714610872578063d417656e14610894578063dc2c256f146108a9578063e1dc45f6146108c9578063e5e6e846146108e9578063ed4f7cc614610909578063f2fde38b14610936578063f37523f214610956578063f8d4deeb14610976578063fd7e967914610998575b600080fd5b34801561026b57600080fd5b506102816000805160206157e183398151915281565b6040519081526020015b60405180910390f35b3480156102a057600080fd5b506102816102af36600461415a565b6109c5565b3480156102c057600080fd5b506102d46102cf3660046141b4565b610a89565b005b3480156102e257600080fd5b506102816001600160801b031981565b3480156102fe57600080fd5b50610281600b5481565b34801561031457600080fd5b506102d4610b94565b34801561032957600080fd5b506103766103383660046141d1565b60056020819052600091825260409091208054600182015460028301546003840154600485015494909501549294919390926001600160a01b031686565b60408051968752602087019590955293850192909252606084015260808301526001600160a01b031660a082015260c00161028b565b3480156103b857600080fd5b506102816000805160206158a183398151915281565b3480156103da57600080fd5b5061028160008051602061588183398151915281565b3480156103fc57600080fd5b5061041061040b3660046141ea565b610c46565b604051901515815260200161028b565b34801561042c57600080fd5b506102d461043b36600461428b565b610d3c565b34801561044c57600080fd5b506003546104109060ff1681565b34801561046657600080fd5b506009546104109060ff1681565b34801561048057600080fd5b506102816000805160206158c183398151915281565b3480156104a257600080fd5b506102d46104b1366004614375565b610dd8565b3480156104c257600080fd5b506102816104d13660046143f3565b600160209081526000938452604080852082529284528284209052825290205481565b34801561050057600080fd5b5061028160085481565b34801561051657600080fd5b506001610281565b34801561052a57600080fd5b506102d4610539366004614428565b610fef565b34801561054a57600080fd5b506102816105593660046143f3565b6001600160a01b038316600090815260016020908152604080832085845282528083208484529091529020549392505050565b34801561059857600080fd5b506102d46110a1565b3480156105ad57600080fd5b506102816000805160206157c183398151915281565b3480156105cf57600080fd5b506102d46110dc565b3480156105e457600080fd5b506102d46105f336600461446e565b611188565b34801561060457600080fd5b506106186106133660046144c3565b6112a3565b60405161028b91906146c8565b34801561063157600080fd5b50610410610640366004614833565b611901565b34801561065157600080fd5b506104106106603660046143f3565b611993565b34801561067157600080fd5b5061028160008051602061580183398151915281565b34801561069357600080fd5b5061069c6119c8565b60405161028b9190614893565b3480156106b557600080fd5b5061028160008051602061582183398151915281565b3480156106d757600080fd5b506102817f000000000000000000000000000000000000000000000000000000000000000081565b34801561070b57600080fd5b5061028160008051602061586183398151915281565b34801561072d57600080fd5b50610281600081565b6102d46107443660046148a7565b6119d7565b34801561075557600080fd5b506107696107643660046141d1565b611f19565b60405161028b929190614912565b34801561078357600080fd5b506102816107923660046141d1565b600d6020526000908152604090205481565b3480156107b057600080fd5b5061069c6107bf3660046141d1565b61211f565b3480156107d057600080fd5b5060075461041090600160a01b900460ff1681565b3480156107f157600080fd5b506102816108003660046141d1565b60026020526000908152604090205481565b34801561081e57600080fd5b5060075461069c906001600160a01b031681565b34801561083e57600080fd5b506102d461084d36600461492b565b612149565b34801561085e57600080fd5b506102d461086d36600461494d565b61220e565b34801561087e57600080fd5b506102816000805160206157a183398151915281565b3480156108a057600080fd5b506102d4612312565b3480156108b557600080fd5b506102d46108c4366004614988565b6123be565b3480156108d557600080fd5b506102d46108e4366004614b80565b6124f4565b3480156108f557600080fd5b506102d4610904366004614c6a565b6126c8565b34801561091557600080fd5b506102816109243660046141b4565b600a6020526000908152604090205481565b34801561094257600080fd5b506102d46109513660046141b4565b61273a565b34801561096257600080fd5b506102d46109713660046141d1565b6127da565b34801561098257600080fd5b5061028160008051602061584183398151915281565b3480156109a457600080fd5b506109b86109b3366004614cab565b6128bc565b60405161028b9190614d16565b6000828152600c60205260408082206011018054918601359186359081106109ef576109ef614d78565b600091825260208083206001600160a01b03871684526001600290930201919091019052604090205410610a24576000610a7f565b6000838152600c6020526040902060110180548535908110610a4857610a48614d78565b600091825260208083206001600160a01b0386168452600160029093020191909101905260409081902054610a7f91860135614da4565b90505b9392505050565b6001600160801b03196000805160206157e1833981519152610aa96119c8565b6001600160a01b0316336001600160a01b03161480610acf5750610acf335b8383611993565b610af45760405162461bcd60e51b8152600401610aeb90614dbb565b60405180910390fd5b600754600160a01b900460ff1615610b345760405162461bcd60e51b81526020600482015260036024820152620b0b0b60eb1b6044820152606401610aeb565b6007546040516001600160a01b0385811692169033907faa9eda00deceb121f44db5f12b8c55aeaa0fb2ee701ee72d104601b7f555a91190600090a45050600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160801b0319600080516020615821833981519152610bb46119c8565b6001600160a01b0316336001600160a01b03161480610bd75750610bd733610ac8565b610bf35760405162461bcd60e51b8152600401610aeb90614dbb565b6007805460ff60a01b1916600160a01b179055610c0d3390565b6001600160a01b03167f8d0325105fd3b3a305731ddae0cf51348d6d17464ddf0bc7e315b9cb359e7b1a60405160405180910390a25050565b6000610c908335602085013580338760400135604051602001610c6b93929190614dd7565b60408051601f1981840301815291905280516020909101206106406080880188614dfa565b8015610cff57506000828152600c602052604090819020601101805491850135918535908110610cc257610cc2614d78565b90600052602060002090600202016001016000610cdc3390565b6001600160a01b03166001600160a01b0316815260200190815260200160002054105b80610a8257506000828152600c60205260409020600201544210801590610a825750506000908152600c6020526040902060030154421115919050565b6001600160801b03196000805160206157c1833981519152610d5c6119c8565b6001600160a01b0316336001600160a01b03161480610d7f5750610d7f33610ac8565b610d9b5760405162461bcd60e51b8152600401610aeb90614dbb565b600b54610db3908c8c8c8c8c8c8c6108e48c8e614e43565b6001600b6000828254610dc69190614e50565b90915550505050505050505050505050565b6001600160801b03196000805160206158a1833981519152610df86119c8565b6001600160a01b0316336001600160a01b03161480610e1b5750610e1b33610ac8565b610e375760405162461bcd60e51b8152600401610aeb90614dbb565b60005b83811015610fe757610efb858583818110610e5757610e57614d78565b905060c0020160000135868684818110610e7357610e73614d78565b905060c0020160200135878785818110610e8f57610e8f614d78565b905060c0020160400135888886818110610eab57610eab614d78565b905060c0020160600135898987818110610ec757610ec7614d78565b905060c00201608001358a8a88818110610ee357610ee3614d78565b905060c0020160a00160208101906105f391906141b4565b6000868152600c602052604081206011018054600190810191829055610f2091614da4565b9050858583818110610f3457610f34614d78565b905060c0020160000135600c60008981526020019081526020016000206011018281548110610f6557610f65614d78565b6000918252602090912060029091020155337f1f9a093b2e93f445118693693f1e05c8435a7c6081c00b7086c5aaf5ddbf9597878785818110610faa57610faa614d78565b905060c002016000013542604051610fcc929190918252602082015260400190565b60405180910390a25080610fdf81614e68565b915050610e3a565b505050505050565b6001600160801b03196000805160206157c183398151915261100f6119c8565b6001600160a01b0316336001600160a01b03161480611032575061103233610ac8565b61104e5760405162461bcd60e51b8152600401610aeb90614dbb565b600b54841115801561106857508260200135836040013510155b6110845760405162461bcd60e51b8152600401610aeb90614e83565b6000848152600c602052604090208390600101610fe78282615189565b336110aa6119c8565b6001600160a01b0316146110d05760405162461bcd60e51b8152600401610aeb9061524b565b6110da6000612a5e565b565b6001600160801b03196000805160206158018339815191526110fc6119c8565b6001600160a01b0316336001600160a01b0316148061111f575061111f33610ac8565b61113b5760405162461bcd60e51b8152600401610aeb90614dbb565b6003805460ff1916600117905561114f3390565b6001600160a01b03167f566bf2f7f55514125b614cf69d186b37b3f88823adabb810d2b8164544fb3cfb60405160405180910390a25050565b6001600160801b03196000805160206157a18339815191526111a86119c8565b6001600160a01b0316336001600160a01b031614806111cb57506111cb33610ac8565b6111e75760405162461bcd60e51b8152600401610aeb90614dbb565b60006040518060c00160405280898152602001888152602001878152602001600560008c81526020019081526020016000206003015460016112299190614e50565b81526020808201979097526001600160a01b0395861660409182015260009a8b5260058088529a819020825181559682015160018801558101516002870155606081015160038701556080810151600487015560a001519490980180546001600160a01b0319169490931693909317909155505050505050565b60606000836001600160401b038111156112bf576112bf6149bf565b6040519080825280602002602001820160405280156112f857816020015b6112e5613fdc565b8152602001906001900390816112dd5790505b50905060005b848110156118f857600086868381811061131a5761131a614d78565b602090810292909201356000818152600c909352604083206010015490935090506001600160401b03811115611352576113526149bf565b6040519080825280602002602001820160405280156113ae57816020015b61139b6040518060800160405280600081526020016000815260200160008152602001606081525090565b8152602001906001900390816113705790505b50905060005b6000838152600c6020526040902060100154811015611619576000838152600c602052604081206010018054839081106113f0576113f0614d78565b6000918252602080832090910154868352600c82526040808420600a8101549054915192955061142e936001600160a01b0390911692869101615280565b60408051601f1981840301815291815281516020928301206000888152600c8452828120828252600e01909352908220549092506001600160401b03811115611479576114796149bf565b6040519080825280602002602001820160405280156114c457816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816114975790505b50905060005b6000878152600c60209081526040808320868452600e0190915290205481101561159b576000878152600c60209081526040808320868452600f018252808320848452909152908190208151606081019092528054829060ff16600281111561153557611535614566565b600281111561154657611546614566565b8152815461010090046001600160a01b03166020820152600190910154604090910152825183908390811061157d5761157d614d78565b6020026020010181905250808061159390614e68565b9150506114ca565b50604080516080810182528481526000888152600c602081815284832087845291820181528483205481850152868352600d909101905282902054918101919091526060810182905285518690869081106115f8576115f8614d78565b6020026020010181905250505050808061161190614e68565b9150506113b4565b50604080516000848152600c602052829020610140820190925260019091018054829160608301918290829061164e90614ea1565b80601f016020809104026020016040519081016040528092919081815260200182805461167a90614ea1565b80156116c75780601f1061169c576101008083540402835291602001916116c7565b820191906000526020600020905b8154815290600101906020018083116116aa57829003601f168201915b5050505050815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582016040518060800160405290816000820160009054906101000a900460ff16600481111561172c5761172c614566565b600481111561173d5761173d614566565b81526020016001820180548060200260200160405190810160405280929190818152602001828054801561179a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161177c575b5050505050815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156117fc57602002820191906000526020600020905b8154815260200190600101908083116117e8575b505050919092525050508152600991909101546001600160a01b03166020918201529082526006805492909101918990811061183a5761183a614d78565b6000918252602082200154604080516377a4d55960e01b815290516001600160a01b03909216926377a4d55992600480840193829003018186803b15801561188157600080fd5b505afa158015611895573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118bd91908101906152a5565b8152602001828152508484815181106118d8576118d8614d78565b6020026020010181905250505080806118f090614e68565b9150506112fe565b50949350505050565b60008581526005602052604081205461191c5750600061198a565b60008681526005602052604090206001015442101561193d5750600061198a565b60008681526005602052604090206002015442111561195e5750600061198a565b60008681526005602052604090205461197986868686612aae565b146119865750600061198a565b5060015b95945050505050565b6001600160a01b0383166000908152600160209081526040808320858452825280832084845290915290205442109392505050565b6000546001600160a01b031690565b60026004541415611a2a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610aeb565b600260045582611a655760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c182160e11b604082015260600190565b600b5486108015611a8757506000868152600c60205260409020600501548311155b611abc5760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c18a160e11b604082015260600190565b6000868152600c602052604081206011015415611bb75760006020830135338460400135604051602001611af293929190614dd7565b60408051601f1981840301815291905280516020918201209150611b2490843590850135836106406080880188614dfa565b8015611b335750826060013581145b8015611bb35750826040013585600c60008b8152602001908152602001600020601101856000013581548110611b6b57611b6b614d78565b90600052602060002090600202016001016000611b853390565b6001600160a01b03166001600160a01b0316815260200190815260200160002054611bb09190614e50565b11155b9150505b6000878152600c60205260409020600201544210801590611be957506000878152600c60205260409020600301544211155b80611bf15750805b611c265760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1a2160e11b604082015260600190565b6000878152600c60209081526040808320600a81015490549151611c59936001600160a01b0390921692918b9101615280565b60408051601f19818403018152918152815160209283012060008b8152600c8452828120828252600e019093529120549091508610611cc35760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c19a160e11b604082015260600190565b336000908152600a6020526040812054611cdd9087614e50565b9050600854600014611d2457600854811115611d245760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1aa160e11b604082015260600190565b6000898152600c60209081526040808320338452600b01909152812054611d4b9088614e50565b60008b8152600c60209081526040808320878452600d0190915281205491925090611d77908990614e50565b60008c8152600c602081815260408084208985529092019052902054909150811115611dce5760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1ba160e11b604082015260600190565b6000805b600b54811015611e465760005b6000828152600c6020526040902060100154811015611e33576000828152600c602090815260408083208a8452600d01909152902054611e1f9084614e50565b925080611e2b81614e68565b915050611ddf565b5080611e3e81614e68565b915050611dd2565b50611e518982614e50565b7f00000000000000000000000000000000000000000000000000000000000000001015611ea95760405162461bcd60e51b8152600401610aeb906020808252600490820152630c1e0c1160e21b604082015260600190565b50611eb38b612b8f565b611ee85760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1c2160e11b604082015260600190565b611ef78b858b8b898b356132af565b611f07878b8d878c86888a6137f0565b50506001600455505050505050505050565b600c60205260009081526040908190208054825160e0810190935260018201805491939182908290611f4a90614ea1565b80601f0160208091040260200160405190810160405280929190818152602001828054611f7690614ea1565b8015611fc35780601f10611f9857610100808354040283529160200191611fc3565b820191906000526020600020905b815481529060010190602001808311611fa657829003601f168201915b5050505050815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582016040518060800160405290816000820160009054906101000a900460ff16600481111561202857612028614566565b600481111561203957612039614566565b81526020016001820180548060200260200160405190810160405280929190818152602001828054801561209657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612078575b5050505050815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156120f857602002820191906000526020600020905b8154815260200190600101908083116120e4575b505050919092525050508152600991909101546001600160a01b0316602090910152905082565b6006818154811061212f57600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160801b03198061215b6119c8565b6001600160a01b0316336001600160a01b0316148061217e575061217e33610ac8565b61219a5760405162461bcd60e51b8152600401610aeb90614dbb565b836121cc5760405162461bcd60e51b8152602060048201526002602482015261503360f01b6044820152606401610aeb565b600084815260026020526040808220859055518491869133917fad26b90be8a18bd2262e914f6fd4919c42f9dd6a0d07a15fa728ec603a836a8891a450505050565b6000828152600260205260409020546001600160801b03199061222f6119c8565b6001600160a01b0316336001600160a01b03161480612252575061225233610ac8565b61226e5760405162461bcd60e51b8152600401610aeb90614dbb565b836122a05760405162461bcd60e51b8152602060048201526002602482015261281960f11b6044820152606401610aeb565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b6001600160801b03196000805160206158418339815191526123326119c8565b6001600160a01b0316336001600160a01b03161480612355575061235533610ac8565b6123715760405162461bcd60e51b8152600401610aeb90614dbb565b6009805460ff191660011790556123853390565b6001600160a01b03167fa1ff8cb11b17d2fe38338d2b440199d17a429ff01672ffdff66f020cdd0e5f6960405160405180910390a25050565b6001600160801b03196000805160206158618339815191526123de6119c8565b6001600160a01b0316336001600160a01b03161480612401575061240133610ac8565b61241d5760405162461bcd60e51b8152600401610aeb90614dbb565b60035460ff161561247c5760405162461bcd60e51b815260206004820152602360248201527f53776565703a207468652073776565702066756e6374696f6e206973206c6f636044820152621ad95960ea1b6064820152608401610aeb565b6124906001600160a01b0386168486613aa2565b826001600160a01b0316856001600160a01b03166124ab3390565b6001600160a01b03167f9ccf4a542a203e3a302cfbe38c13fdcc934a9882f80039c23c65dd5f1ee74cf2876040516124e591815260200190565b60405180910390a45050505050565b6001600160801b03196000805160206157c18339815191526125146119c8565b6001600160a01b0316336001600160a01b03161480612537575061253733610ac8565b6125535760405162461bcd60e51b8152600401610aeb90614dbb565b600b548b1115801561256d575089602001358a6040013510155b801561257857508715155b6125945760405162461bcd60e51b8152600401610aeb90614e83565b87841480156125a35750825184145b80156125af5750825186145b6125e45760405162461bcd60e51b8152600401610aeb906020808252600490820152633078344160e01b604082015260600190565b60008b8152600c602052604090208a600182016126018282615189565b506126129050601082018b8b614003565b5060008c8152600c602052604090205461262d906001614e50565b815561263f8c8b8b8b8b8b8b8b613afd565b8360405161264d919061532f565b60405180910390208b60405161266391906154db565b60405180910390206126723390565b6001600160a01b03167fbc53fee877af9054280fb70b43f9631cf0662d6b3842adb894c0279697ac29758f8e8e8c8c6040516126b29594939291906155d1565b60405180910390a4505050505050505050505050565b6001600160801b03196000805160206158c18339815191526126e86119c8565b6001600160a01b0316336001600160a01b0316148061270b575061270b33610ac8565b6127275760405162461bcd60e51b8152600401610aeb90614dbb565b6127336006858561404e565b5050505050565b336127436119c8565b6001600160a01b0316146127695760405162461bcd60e51b8152600401610aeb9061524b565b6001600160a01b0381166127ce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610aeb565b6127d781612a5e565b50565b6001600160801b03196000805160206158818339815191526127fa6119c8565b6001600160a01b0316336001600160a01b0316148061281d575061281d33610ac8565b6128395760405162461bcd60e51b8152600401610aeb90614dbb565b60095460ff16156128755760405162461bcd60e51b8152600401610aeb906020808252600490820152633078304160e01b604082015260600190565b826008546128803390565b6001600160a01b03167f935ec6c776e019beac24f91af4297a8257ddf3ed3fb912173b9f944f7f5deda960405160405180910390a45050600855565b60606000846001600160401b038111156128d8576128d86149bf565b60405190808252806020026020018201604052801561290b57816020015b60608152602001906001900390816128f65790505b50905060005b85811015612a5457836001600160401b03811115612931576129316149bf565b60405190808252806020026020018201604052801561295a578160200160208202803683370190505b5082828151811061296d5761296d614d78565b602002602001018190525060005b84811015612a4157600086868381811061299757612997614d78565b90506020020135905060008989858181106129b4576129b4614d78565b90506020020160208101906129c991906141b4565b6000838152600c602090815260408083206001600160a01b0385168452600b01909152902054865191925090869086908110612a0757612a07614d78565b60200260200101518481518110612a2057612a20614d78565b60200260200101818152505050508080612a3990614e68565b91505061297b565b5080612a4c81614e68565b915050612911565b5095945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600084815b83811015612b84578160011660011415612b1857848482818110612ad957612ad9614d78565b9050602002013586604051602001612afb929190918252602082015260400190565b604051602081830303815290604052805190602001209550612b65565b85858583818110612b2b57612b2b614d78565b90506020020135604051602001612b4c929190918252602082015260400190565b6040516020818303038152906040528051906020012095505b612b7060028361560a565b915080612b7c81614e68565b915050612ab3565b509395945050505050565b6000818152600c60205260408082208151608081019092526006018054839283929091829060ff166004811115612bc857612bc8614566565b6004811115612bd957612bd9614566565b815260200160018201805480602002602001604051908101604052809291908181526020018280548015612c3657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c18575b505050505081526020016002820154815260200160038201805480602002602001604051908101604052809291908181526020018280548015612c9857602002820191906000526020600020905b815481526020019060010190808311612c84575b505050505081525050905060016004811115612cb657612cb6614566565b81516004811115612cc957612cc9614566565b1415612da95760005b816020015151811015612d9c5781602001518181518110612cf557612cf5614d78565b60200260200101516001600160a01b03166370a08231612d123390565b6040518263ffffffff1660e01b8152600401612d2e9190614893565b60206040518083038186803b158015612d4657600080fd5b505afa158015612d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7e919061562c565b612d889084614e50565b925080612d9481614e68565b915050612cd2565b5060400151111592915050565b600381516004811115612dbe57612dbe614566565b1415612e735780604001518160200151600081518110612de057612de0614d78565b60200260200101516001600160a01b031663ca1fb21b612dfd3390565b6040518263ffffffff1660e01b8152600401612e199190614893565b60206040518083038186803b158015612e3157600080fd5b505afa158015612e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e69919061562c565b1015949350505050565b60608101515161305257600281516004811115612e9257612e92614566565b1415612f655760005b816020015151811015612d9c5781602001518181518110612ebe57612ebe614d78565b60200260200101516001600160a01b031663aee9c872612edb3390565b6040518263ffffffff1660e01b8152600401612ef79190614893565b60206040518083038186803b158015612f0f57600080fd5b505afa158015612f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f47919061562c565b612f519084614e50565b925080612f5d81614e68565b915050612e9b565b600481516004811115612f7a57612f7a614566565b141561304d5760005b816020015151811015612d9c5781602001518181518110612fa657612fa6614d78565b60200260200101516001600160a01b03166370a08231612fc33390565b6040518263ffffffff1660e01b8152600401612fdf9190614893565b60206040518083038186803b158015612ff757600080fd5b505afa15801561300b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302f919061562c565b6130399084614e50565b92508061304581614e68565b915050612f83565b6132a5565b60028151600481111561306757613067614566565b141561317b5760005b816020015151811015612d9c5760005b82602001515181101561316857826020015182815181106130a3576130a3614d78565b60200260200101516001600160a01b031662fdd58e6130bf3390565b856060015184815181106130d5576130d5614d78565b60200260200101516040518363ffffffff1660e01b81526004016130fa929190615645565b60206040518083038186803b15801561311257600080fd5b505afa158015613126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314a919061562c565b6131549085614e50565b93508061316081614e68565b915050613080565b508061317381614e68565b915050613070565b60048151600481111561319057613190614566565b14156132a55760005b816020015151811015612d9c5760005b82602001515181101561329257826020015182815181106131cc576131cc614d78565b60200260200101516001600160a01b03166324fdefc46131e93390565b856060015184815181106131ff576131ff614d78565b60200260200101516040518363ffffffff1660e01b8152600401613224929190615645565b60206040518083038186803b15801561323c57600080fd5b505afa158015613250573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613274919061562c565b61327e9085614e50565b93508061328a81614e68565b9150506131a9565b508061329d81614e68565b915050613199565b5060019392505050565b811561353557600081815260056020526040812060048101549091906132d6908690615014565b60058301549091506001600160a01b03166133f9578034101561330b5760405162461bcd60e51b8152600401610aeb9061565e565b6007546040516000916001600160a01b03169034908381818185875af1925050503d8060008114613358576040519150601f19603f3d011682016040523d82523d6000602084013e61335d565b606091505b505090508061337e5760405162461bcd60e51b8152600401610aeb9061567c565b6000898152600c602052604090206011018054879190869081106133a4576133a4614d78565b906000526020600020906002020160010160006133be3390565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546133ed9190614e50565b9091555061352e915050565b60058201546040516370a0823160e01b815282916001600160a01b0316906370a082319061342b903390600401614893565b60206040518083038186803b15801561344357600080fd5b505afa158015613457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347b919061562c565b10156134995760405162461bcd60e51b8152600401610aeb9061569a565b6134b93360075460058501546001600160a01b0390811692911684613dc1565b6000888152600c602052604090206011018054869190859081106134df576134df614d78565b906000526020600020906002020160010160006134f93390565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135289190614e50565b90915550505b5050610fe7565b6000868152600c60209081526040808320888452600f018252808320878452909152812090815460ff16600281111561357057613570614566565b14156135f057805461010090046001600160a01b031663918d24283386846001015461359c9190615014565b6040518363ffffffff1660e01b81526004016135b9929190615645565b600060405180830381600087803b1580156135d357600080fd5b505af11580156135e7573d6000803e3d6000fd5b505050506137e7565b6001815460ff16600281111561360857613608614566565b14156136bc5760008482600101546136209190615014565b9050803410156136425760405162461bcd60e51b8152600401610aeb9061565e565b6007546040516000916001600160a01b03169034908381818185875af1925050503d806000811461368f576040519150601f19603f3d011682016040523d82523d6000602084013e613694565b606091505b50509050806136b55760405162461bcd60e51b8152600401610aeb9061567c565b50506137e7565b6002815460ff1660028111156136d4576136d4614566565b14156137b95760008482600101546136ec9190615014565b8254909150819061010090046001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016137239190614893565b60206040518083038186803b15801561373b57600080fd5b505afa15801561374f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613773919061562c565b10156137915760405162461bcd60e51b8152600401610aeb9061569a565b6137b333600754845461010090046001600160a01b0390811692911684613dc1565b506137e7565b60405162461bcd60e51b815260206004820152600360248201526203078360ec1b6044820152606401610aeb565b50505050505050565b6000846001600160401b0381111561380a5761380a6149bf565b604051908082528060200260200182016040528015613833578160200160208202803683370190505b5090506000856001600160401b03811115613850576138506149bf565b604051908082528060200260200182016040528015613879578160200160208202803683370190505b506000898152600c60209081526040808320600a8101549054915194955092936138af936001600160a01b0316928e9101615280565b60408051601f1981840301815291815281516020928301206000818152600d90935291205490915060808b901b60015b898111613962576000816138f38585614e50565b6138fd9190614e50565b9050808761390c600185614da4565b8151811061391c5761391c614d78565b60209081029190910101526001866139348285614da4565b8151811061394457613944614d78565b6020908102919091010152508061395a81614e68565b9150506138df565b5061396f90508882614e50565b6000838152600d60208181526040808420949094558d8352600c81528383208d845291820181528383208b9055338352600b9091018152828220899055600a905220859055600680548d9081106139c8576139c8614d78565b6000918252602090912001546001600160a01b0316631f7fdffa3386866040518463ffffffff1660e01b8152600401613a03939291906156b8565b600060405180830381600087803b158015613a1d57600080fd5b505af1158015613a31573d6000803e3d6000fd5b5050505083604051613a43919061570a565b6040518091039020613a523390565b6001600160a01b03167fb9597a073e873c1209bf07b0c0237cdf35718d0fffb7385b222bc2c80798a9538c86604051613a8c929190615740565b60405180910390a3505050505050505050505050565b613af88363a9059cbb60e01b8484604051602401613ac1929190615645565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613dff565b505050565b60005b86811015613db6576000848483818110613b1c57613b1c614d78565b9050602002013511613b595760405162461bcd60e51b8152600401610aeb906020808252600490820152633078354160e01b604082015260600190565b6000898152600c60205260408120600a81015490546001600160a01b03909116908a8a85818110613b8c57613b8c614d78565b90506020020135604051602001613ba593929190615280565b604051602081830303815290604052805190602001209050848483818110613bcf57613bcf614d78565b60008d8152600c60208181526040808420888552808401835290842094820296909601359093558e8252909152600a830154925490926001600160a01b031691508b8b86818110613c2257613c22614d78565b90506020020135604051602001613c3b93929190615280565b604051602081830303815290604052805190602001209050878784818110613c6557613c65614d78565b6000848152600d602090815260408220920293909301359055505b848481518110613c9257613c92614d78565b602002602001015151811015613d6357848481518110613cb457613cb4614d78565b60200260200101518181518110613ccd57613ccd614d78565b60209081029190910181015160008e8152600c83526040808220878352600f0184528082208583529093529190912081518154829060ff19166001836002811115613d1a57613d1a614566565b0217905550602082015181546001600160a01b0390911661010002610100600160a81b031990911617815560409091015160019091015580613d5b81614e68565b915050613c80565b50838381518110613d7657613d76614d78565b6020908102919091018101515160008d8152600c83526040808220958252600e909501909252929020919091555080613dae81614e68565b915050613b00565b505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052613df99085906323b872dd60e01b90608401613ac1565b50505050565b6000613e54826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613ed19092919063ffffffff16565b805190915015613af85780806020019051810190613e729190615759565b613af85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610aeb565b6060610a7f848460008585843b613f2a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aeb565b600080866001600160a01b03168587604051613f46919061577b565b60006040518083038185875af1925050503d8060008114613f83576040519150601f19603f3d011682016040523d82523d6000602084013e613f88565b606091505b5091509150613f98828286613fa3565b979650505050505050565b60608315613fb2575081610a82565b825115613fc25782518084602001fd5b8160405162461bcd60e51b8152600401610aeb919061578d565b6040518060600160405280613fef6140a1565b815260200160608152602001606081525090565b82805482825590600052602060002090810192821561403e579160200282015b8281111561403e578235825591602001919060010190614023565b5061404a929150614108565b5090565b82805482825590600052602060002090810192821561403e579160200282015b8281111561403e5781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061406e565b6040518060e0016040528060608152602001600081526020016000815260200160008152602001600081526020016140fb604080516080810190915280600081526020016060815260200160008152602001606081525090565b8152600060209091015290565b5b8082111561404a5760008155600101614109565b600060a0828403121561412f57600080fd5b50919050565b6001600160a01b03811681146127d757600080fd5b803561415581614135565b919050565b60008060006060848603121561416f57600080fd5b83356001600160401b0381111561418557600080fd5b6141918682870161411d565b9350506020840135915060408401356141a981614135565b809150509250925092565b6000602082840312156141c657600080fd5b8135610a8281614135565b6000602082840312156141e357600080fd5b5035919050565b600080604083850312156141fd57600080fd5b82356001600160401b0381111561421357600080fd5b61421f8582860161411d565b95602094909401359450505050565b600060e0828403121561412f57600080fd5b60008083601f84011261425257600080fd5b5081356001600160401b0381111561426957600080fd5b6020830191508360208260051b850101111561428457600080fd5b9250929050565b600080600080600080600080600060a08a8c0312156142a957600080fd5b89356001600160401b03808211156142c057600080fd5b6142cc8d838e0161422e565b9a5060208c01359150808211156142e257600080fd5b6142ee8d838e01614240565b909a50985060408c013591508082111561430757600080fd5b6143138d838e01614240565b909850965060608c013591508082111561432c57600080fd5b6143388d838e01614240565b909650945060808c013591508082111561435157600080fd5b5061435e8c828d01614240565b915080935050809150509295985092959850929598565b60008060006040848603121561438a57600080fd5b8335925060208401356001600160401b03808211156143a857600080fd5b818601915086601f8301126143bc57600080fd5b8135818111156143cb57600080fd5b87602060c0830285010111156143e057600080fd5b6020830194508093505050509250925092565b60008060006060848603121561440857600080fd5b833561441381614135565b95602085013595506040909401359392505050565b6000806040838503121561443b57600080fd5b8235915060208301356001600160401b0381111561445857600080fd5b6144648582860161422e565b9150509250929050565b60008060008060008060c0878903121561448757600080fd5b863595506020870135945060408701359350606087013592506080870135915060a08701356144b581614135565b809150509295509295509295565b6000806000604084860312156144d857600080fd5b83356001600160401b038111156144ee57600080fd5b6144fa86828701614240565b909790965060209590950135949350505050565b60005b83811015614529578181015183820152602001614511565b83811115613df95750506000910152565b6000815180845261455281602086016020860161450e565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b6005811061458c5761458c614566565b9052565b600081518084526020808501945080840160005b838110156145c0578151875295820195908201906001016145a4565b509495945050505050565b6000815160e084526145e060e085018261453a565b90506020808401518186015260408401516040860152606084015160608601526080840151608086015260a084015185830360a08701526080830161462684835161457c565b8183015160808585015280519182905283019060009060a08601905b8083101561466b5783516001600160a01b03168252928501926001929092019190850190614642565b506040840151604087015260608401519450858103606087015261468f8186614590565b9550505050505060c08301516146b060c08601826001600160a01b03169052565b509392505050565b6003811061458c5761458c614566565b60208152600060208201835180825260408401915060408160051b8501016020860160005b8381101561482757603f19878403018552815180516060855261471360608601826145cb565b90506020820151858203602087015261472c828261453a565b91505060408201519150848103604086015280825180835260208301915060208160051b84010160208501945060005b8281101561480757848203601f19018452855180518352602080820151818501526040808301519085015260609182015160809285018390528051928501839052019060a084019060005b818110156147ef5783516147bc8482516146b8565b6020818101516001600160a01b0316858201526040918201519185019190915293909301926060909201916001016147a7565b5050602097880197959095019492505060010161475c565b5080975050505050506020820191506020850194506001810190506146ed565b50909695505050505050565b60008060008060006080868803121561484b57600080fd5b85359450602086013593506040860135925060608601356001600160401b0381111561487657600080fd5b61488288828901614240565b969995985093965092949392505050565b6001600160a01b0391909116815260200190565b60008060008060008060c087890312156148c057600080fd5b863595506020870135945060408701359350606087013592506080870135915060a08701356001600160401b038111156148f957600080fd5b61490589828a0161411d565b9150509295509295509295565b828152604060208201526000610a7f60408301846145cb565b6000806040838503121561493e57600080fd5b50508035926020909101359150565b6000806000806080858703121561496357600080fd5b843561496e81614135565b966020860135965060408601359560600135945092505050565b60008060006060848603121561499d57600080fd5b83356149a881614135565b92506020840135915060408401356141a981614135565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156149f7576149f76149bf565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614a2557614a256149bf565b604052919050565b60006001600160401b03821115614a4657614a466149bf565b5060051b60200190565b6000614a63614a5e84614a2d565b6149fd565b8381529050602080820190600585901b840186811115614a8257600080fd5b845b81811015614b555780356001600160401b03811115614aa35760008081fd5b8601601f81018913614ab55760008081fd5b8035614ac3614a5e82614a2d565b8181526060918202830186019186820191908c841115614ae35760008081fd5b938701935b83851015614b445780858e031215614b005760008081fd5b614b086149d5565b853560038110614b185760008081fd5b815285890135614b2781614135565b818a01526040868101359082015283529384019391870191614ae8565b508752505050928201928201614a84565b505050509392505050565b600082601f830112614b7157600080fd5b610a8283833560208501614a50565b600080600080600080600080600060c08a8c031215614b9e57600080fd5b8935985060208a01356001600160401b0380821115614bbc57600080fd5b614bc88d838e0161422e565b995060408c0135915080821115614bde57600080fd5b614bea8d838e01614240565b909950975060608c0135915080821115614c0357600080fd5b614c0f8d838e01614240565b909750955060808c0135915080821115614c2857600080fd5b614c348d838e01614240565b909550935060a08c0135915080821115614c4d57600080fd5b50614c5a8c828d01614b60565b9150509295985092959850929598565b60008060208385031215614c7d57600080fd5b82356001600160401b03811115614c9357600080fd5b614c9f85828601614240565b90969095509350505050565b60008060008060408587031215614cc157600080fd5b84356001600160401b0380821115614cd857600080fd5b614ce488838901614240565b90965094506020870135915080821115614cfd57600080fd5b50614d0a87828801614240565b95989497509550505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614d6b57603f19888603018452614d59858351614590565b94509285019290850190600101614d3d565b5092979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015614db657614db6614d8e565b500390565b602080825260029082015261503160f01b604082015260600190565b92835260609190911b6001600160601b0319166020830152603482015260540190565b6000808335601e19843603018112614e1157600080fd5b8301803591506001600160401b03821115614e2b57600080fd5b6020019150600581901b360382131561428457600080fd5b6000610a82368484614a50565b60008219821115614e6357614e63614d8e565b500190565b6000600019821415614e7c57614e7c614d8e565b5060010190565b6020808252600490820152633078314160e01b604082015260600190565b600181811c90821680614eb557607f821691505b6020821081141561412f57634e487b7160e01b600052602260045260246000fd5b5b81811015614eeb5760008155600101614ed7565b5050565b601f821115613af857806000526020600020601f840160051c81016020851015614f165750805b612733601f850160051c830182614ed6565b6001600160401b03831115614f3f57614f3f6149bf565b614f5383614f4d8354614ea1565b83614eef565b6000601f841160018114614f875760008515614f6f5750838201355b600019600387901b1c1916600186901b178355612733565b600083815260209020601f19861690835b82811015614fb85786850135825560209485019460019092019101614f98565b5086821015614fd55760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008235607e19833603018112614ffd57600080fd5b9190910192915050565b600581106127d757600080fd5b600081600019048311821515161561502e5761502e614d8e565b500290565b81831015613af857806000526020600020613df9838201858301614ed6565b6000813561505f81614135565b92915050565b600160401b831115615079576150796149bf565b8054838255615089848284615033565b50818160005260208060002060005b868110156137e757833582559282019260019182019101615098565b81356150bf81615007565b600581106150cf576150cf614566565b60ff1982541660ff8216811783555050600180820160206150f281860186614dfa565b600160401b811115615106576151066149bf565b8354818555615116828287615033565b506000938452828420935b8181101561515e57823561513481614135565b85546001600160a01b0319166001600160a01b039190911617855593850193918301918501615121565b5050505050506040820135600282015561517b6060830183614dfa565b613df9818360038601615065565b8135601e1983360301811261519d57600080fd5b820180356001600160401b038111156151b557600080fd5b6020820191508036038213156151ca57600080fd5b6151d5818385614f28565b50506020820135600182015560408201356002820155606082013560038201556080820135600482015561521861520f60a0840184614fe7565b600583016150b4565b614eeb61522760c08401615052565b6009830180546001600160a01b0319166001600160a01b0392909216919091179055565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60609390931b6001600160601b03191683526014830191909152603482015260540190565b6000602082840312156152b757600080fd5b81516001600160401b03808211156152ce57600080fd5b818401915084601f8301126152e257600080fd5b8151818111156152f4576152f46149bf565b615307601f8201601f19166020016149fd565b915080825285602082850101111561531e57600080fd5b6118f881602084016020860161450e565b81516000908290602080860184805b848110156153a65782518051908501908790845b818110156153945783516153678482516146b8565b808901516001600160a01b0316848a01526040908101519084015292870192606090920191600101615352565b5090975050509183019160010161533e565b5093979650505050505050565b8181843750600082820152601f01601f19160190565b60008235607e198336030181126153df57600080fd5b90910192915050565b6000808335601e198436030181126153ff57600080fd5b83016020810192503590506001600160401b0381111561541e57600080fd5b8060051b360383131561428457600080fd5b6000813561543d81615007565b615447848261457c565b506020808401615459828501856153e8565b9091600091905b8183101561549057833561547381614135565b6001600160a01b0316815292840192600192909201918401615460565b604087013581526154a460608801886153e8565b945092506001600160fb1b038411156154bc57600080fd5b8360051b93508383868301376000930190930191825250949350505050565b60008235601e198436030181126154f157600080fd5b830180356001600160401b0381111561550957600080fd5b80360385131561551857600080fd5b61198a61557e61556c61555f6155526155456155388a8860208b016153b3565b60208c0135815260200190565b60408b0135815260200190565b60608a0135815260200190565b6080890135815260200190565b61557960a08901896153c9565b615430565b61558a60c0880161414a565b6001600160a01b0316815260200190565b81835260006001600160fb1b038311156155b457600080fd5b8260051b8083602087013760009401602001938452509192915050565b8581526060602082015260006155eb60608301868861559b565b82810360408401526155fe81858761559b565b98975050505050505050565b60008261562757634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561563e57600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b602080825260049082015263183c1ca160e11b604082015260600190565b6020808252600490820152633078304360e01b604082015260600190565b6020808252600490820152633078314360e01b604082015260600190565b6001600160a01b03841681526080602082018190526000906156dc90830185614590565b82810360408401526156ee8185614590565b8381036060909401939093525050600081526020019392505050565b815160009082906020808601845b8381101561573457815185529382019390820190600101615718565b50929695505050505050565b828152604060208201526000610a7f6040830184614590565b60006020828403121561576b57600080fd5b81518015158114610a8257600080fd5b60008251614ffd81846020870161450e565b602081526000610a82602083018461453a56fedbcef4c79a032f94ada7192586b76f7380ea76142bf44f7dffcbf07318d22d145d5c2d2522b7f6ec8d1c86f44956b9ecd4376b1842cd263d54a5368aa149486d9db6e9c424dcde0d5f3a75b470e5bc54cc3dc02c6879e33feab14f958b87680eefa425e0e493cbbeeed2833ecbc426ad9e567110edb11951c74d293f99a4201627a197db167d9ef273594120ada4e4c5e3a13bc9f76d745c1bc0a36315dea30a36aca941e75bffb6d7615d125171f4f3d34f99718ee03908ed244cdc4cc8e759305f9d04da14abed356cd8eddf1c22de3798f6aa89fa84e82f3bcb1ba154e2d8d6eb7457563d8954a1befba5aaf8bc2f82bd1b2cc37d8475791cad943bdcf0c60af0c3ebe77999ca20698e1ff25f812bf82409a59d21ca15a41f39e0ce9f2500c903eceeaa295aa6e6e9842295a59defe28f342a27ae7c55c8b481933b1ae86da26469706673582212203d2af68d59ab2b7bc13ee29001409aeeb1ba6c6e25c8c6847ce23421bd49982564736f6c634300080800330000000000000000000000004cd8a767d3ffa90b802caa61d206cea812ce51490000000000000000000000004b228ada7a940928f747ee6a5778da2773b377a4ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000002710

Deployed Bytecode

0x60806040526004361061025a5760003560e01c80630272a7c81461025f5780630b3f6580146102945780630bdfe46c146102b457806317f5ebb4146102d657806318e56131146102f257806319b0deb1146103085780631a717d1a1461031d5780631b2df850146102d65780631bb7cc99146103ac57806320a01824146103ce578063221b6199146103f0578063227292e0146104205780632ed83f781461044057806331ff40831461045a57806340e611f614610474578063455006e414610496578063483ba44e146104b6578063503e97d4146104f457806354fd4d501461050a578063650c35d21461051e57806366a0e54d1461053e578063715018a61461058c5780637535d246146105a157806375cc557a146105c357806376ba264a146105d8578063792f6110146105f8578063808506aa146106255780638681d49c146106455780638b6a3cfc146106655780638da5cb5b146106875780638db56e3f146106a95780639b3ba79f146106cb5780639d57137f146106ff578063a625776e14610721578063a9d9aa5014610736578063ac4afa3814610749578063b794a00b14610777578063bfb231d2146107a4578063c2e62359146107c4578063c5b16c59146107e5578063cb37f3b214610812578063cc2af30814610832578063cf64d4c214610852578063d3b7d5e714610872578063d417656e14610894578063dc2c256f146108a9578063e1dc45f6146108c9578063e5e6e846146108e9578063ed4f7cc614610909578063f2fde38b14610936578063f37523f214610956578063f8d4deeb14610976578063fd7e967914610998575b600080fd5b34801561026b57600080fd5b506102816000805160206157e183398151915281565b6040519081526020015b60405180910390f35b3480156102a057600080fd5b506102816102af36600461415a565b6109c5565b3480156102c057600080fd5b506102d46102cf3660046141b4565b610a89565b005b3480156102e257600080fd5b506102816001600160801b031981565b3480156102fe57600080fd5b50610281600b5481565b34801561031457600080fd5b506102d4610b94565b34801561032957600080fd5b506103766103383660046141d1565b60056020819052600091825260409091208054600182015460028301546003840154600485015494909501549294919390926001600160a01b031686565b60408051968752602087019590955293850192909252606084015260808301526001600160a01b031660a082015260c00161028b565b3480156103b857600080fd5b506102816000805160206158a183398151915281565b3480156103da57600080fd5b5061028160008051602061588183398151915281565b3480156103fc57600080fd5b5061041061040b3660046141ea565b610c46565b604051901515815260200161028b565b34801561042c57600080fd5b506102d461043b36600461428b565b610d3c565b34801561044c57600080fd5b506003546104109060ff1681565b34801561046657600080fd5b506009546104109060ff1681565b34801561048057600080fd5b506102816000805160206158c183398151915281565b3480156104a257600080fd5b506102d46104b1366004614375565b610dd8565b3480156104c257600080fd5b506102816104d13660046143f3565b600160209081526000938452604080852082529284528284209052825290205481565b34801561050057600080fd5b5061028160085481565b34801561051657600080fd5b506001610281565b34801561052a57600080fd5b506102d4610539366004614428565b610fef565b34801561054a57600080fd5b506102816105593660046143f3565b6001600160a01b038316600090815260016020908152604080832085845282528083208484529091529020549392505050565b34801561059857600080fd5b506102d46110a1565b3480156105ad57600080fd5b506102816000805160206157c183398151915281565b3480156105cf57600080fd5b506102d46110dc565b3480156105e457600080fd5b506102d46105f336600461446e565b611188565b34801561060457600080fd5b506106186106133660046144c3565b6112a3565b60405161028b91906146c8565b34801561063157600080fd5b50610410610640366004614833565b611901565b34801561065157600080fd5b506104106106603660046143f3565b611993565b34801561067157600080fd5b5061028160008051602061580183398151915281565b34801561069357600080fd5b5061069c6119c8565b60405161028b9190614893565b3480156106b557600080fd5b5061028160008051602061582183398151915281565b3480156106d757600080fd5b506102817f000000000000000000000000000000000000000000000000000000000000271081565b34801561070b57600080fd5b5061028160008051602061586183398151915281565b34801561072d57600080fd5b50610281600081565b6102d46107443660046148a7565b6119d7565b34801561075557600080fd5b506107696107643660046141d1565b611f19565b60405161028b929190614912565b34801561078357600080fd5b506102816107923660046141d1565b600d6020526000908152604090205481565b3480156107b057600080fd5b5061069c6107bf3660046141d1565b61211f565b3480156107d057600080fd5b5060075461041090600160a01b900460ff1681565b3480156107f157600080fd5b506102816108003660046141d1565b60026020526000908152604090205481565b34801561081e57600080fd5b5060075461069c906001600160a01b031681565b34801561083e57600080fd5b506102d461084d36600461492b565b612149565b34801561085e57600080fd5b506102d461086d36600461494d565b61220e565b34801561087e57600080fd5b506102816000805160206157a183398151915281565b3480156108a057600080fd5b506102d4612312565b3480156108b557600080fd5b506102d46108c4366004614988565b6123be565b3480156108d557600080fd5b506102d46108e4366004614b80565b6124f4565b3480156108f557600080fd5b506102d4610904366004614c6a565b6126c8565b34801561091557600080fd5b506102816109243660046141b4565b600a6020526000908152604090205481565b34801561094257600080fd5b506102d46109513660046141b4565b61273a565b34801561096257600080fd5b506102d46109713660046141d1565b6127da565b34801561098257600080fd5b5061028160008051602061584183398151915281565b3480156109a457600080fd5b506109b86109b3366004614cab565b6128bc565b60405161028b9190614d16565b6000828152600c60205260408082206011018054918601359186359081106109ef576109ef614d78565b600091825260208083206001600160a01b03871684526001600290930201919091019052604090205410610a24576000610a7f565b6000838152600c6020526040902060110180548535908110610a4857610a48614d78565b600091825260208083206001600160a01b0386168452600160029093020191909101905260409081902054610a7f91860135614da4565b90505b9392505050565b6001600160801b03196000805160206157e1833981519152610aa96119c8565b6001600160a01b0316336001600160a01b03161480610acf5750610acf335b8383611993565b610af45760405162461bcd60e51b8152600401610aeb90614dbb565b60405180910390fd5b600754600160a01b900460ff1615610b345760405162461bcd60e51b81526020600482015260036024820152620b0b0b60eb1b6044820152606401610aeb565b6007546040516001600160a01b0385811692169033907faa9eda00deceb121f44db5f12b8c55aeaa0fb2ee701ee72d104601b7f555a91190600090a45050600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160801b0319600080516020615821833981519152610bb46119c8565b6001600160a01b0316336001600160a01b03161480610bd75750610bd733610ac8565b610bf35760405162461bcd60e51b8152600401610aeb90614dbb565b6007805460ff60a01b1916600160a01b179055610c0d3390565b6001600160a01b03167f8d0325105fd3b3a305731ddae0cf51348d6d17464ddf0bc7e315b9cb359e7b1a60405160405180910390a25050565b6000610c908335602085013580338760400135604051602001610c6b93929190614dd7565b60408051601f1981840301815291905280516020909101206106406080880188614dfa565b8015610cff57506000828152600c602052604090819020601101805491850135918535908110610cc257610cc2614d78565b90600052602060002090600202016001016000610cdc3390565b6001600160a01b03166001600160a01b0316815260200190815260200160002054105b80610a8257506000828152600c60205260409020600201544210801590610a825750506000908152600c6020526040902060030154421115919050565b6001600160801b03196000805160206157c1833981519152610d5c6119c8565b6001600160a01b0316336001600160a01b03161480610d7f5750610d7f33610ac8565b610d9b5760405162461bcd60e51b8152600401610aeb90614dbb565b600b54610db3908c8c8c8c8c8c8c6108e48c8e614e43565b6001600b6000828254610dc69190614e50565b90915550505050505050505050505050565b6001600160801b03196000805160206158a1833981519152610df86119c8565b6001600160a01b0316336001600160a01b03161480610e1b5750610e1b33610ac8565b610e375760405162461bcd60e51b8152600401610aeb90614dbb565b60005b83811015610fe757610efb858583818110610e5757610e57614d78565b905060c0020160000135868684818110610e7357610e73614d78565b905060c0020160200135878785818110610e8f57610e8f614d78565b905060c0020160400135888886818110610eab57610eab614d78565b905060c0020160600135898987818110610ec757610ec7614d78565b905060c00201608001358a8a88818110610ee357610ee3614d78565b905060c0020160a00160208101906105f391906141b4565b6000868152600c602052604081206011018054600190810191829055610f2091614da4565b9050858583818110610f3457610f34614d78565b905060c0020160000135600c60008981526020019081526020016000206011018281548110610f6557610f65614d78565b6000918252602090912060029091020155337f1f9a093b2e93f445118693693f1e05c8435a7c6081c00b7086c5aaf5ddbf9597878785818110610faa57610faa614d78565b905060c002016000013542604051610fcc929190918252602082015260400190565b60405180910390a25080610fdf81614e68565b915050610e3a565b505050505050565b6001600160801b03196000805160206157c183398151915261100f6119c8565b6001600160a01b0316336001600160a01b03161480611032575061103233610ac8565b61104e5760405162461bcd60e51b8152600401610aeb90614dbb565b600b54841115801561106857508260200135836040013510155b6110845760405162461bcd60e51b8152600401610aeb90614e83565b6000848152600c602052604090208390600101610fe78282615189565b336110aa6119c8565b6001600160a01b0316146110d05760405162461bcd60e51b8152600401610aeb9061524b565b6110da6000612a5e565b565b6001600160801b03196000805160206158018339815191526110fc6119c8565b6001600160a01b0316336001600160a01b0316148061111f575061111f33610ac8565b61113b5760405162461bcd60e51b8152600401610aeb90614dbb565b6003805460ff1916600117905561114f3390565b6001600160a01b03167f566bf2f7f55514125b614cf69d186b37b3f88823adabb810d2b8164544fb3cfb60405160405180910390a25050565b6001600160801b03196000805160206157a18339815191526111a86119c8565b6001600160a01b0316336001600160a01b031614806111cb57506111cb33610ac8565b6111e75760405162461bcd60e51b8152600401610aeb90614dbb565b60006040518060c00160405280898152602001888152602001878152602001600560008c81526020019081526020016000206003015460016112299190614e50565b81526020808201979097526001600160a01b0395861660409182015260009a8b5260058088529a819020825181559682015160018801558101516002870155606081015160038701556080810151600487015560a001519490980180546001600160a01b0319169490931693909317909155505050505050565b60606000836001600160401b038111156112bf576112bf6149bf565b6040519080825280602002602001820160405280156112f857816020015b6112e5613fdc565b8152602001906001900390816112dd5790505b50905060005b848110156118f857600086868381811061131a5761131a614d78565b602090810292909201356000818152600c909352604083206010015490935090506001600160401b03811115611352576113526149bf565b6040519080825280602002602001820160405280156113ae57816020015b61139b6040518060800160405280600081526020016000815260200160008152602001606081525090565b8152602001906001900390816113705790505b50905060005b6000838152600c6020526040902060100154811015611619576000838152600c602052604081206010018054839081106113f0576113f0614d78565b6000918252602080832090910154868352600c82526040808420600a8101549054915192955061142e936001600160a01b0390911692869101615280565b60408051601f1981840301815291815281516020928301206000888152600c8452828120828252600e01909352908220549092506001600160401b03811115611479576114796149bf565b6040519080825280602002602001820160405280156114c457816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816114975790505b50905060005b6000878152600c60209081526040808320868452600e0190915290205481101561159b576000878152600c60209081526040808320868452600f018252808320848452909152908190208151606081019092528054829060ff16600281111561153557611535614566565b600281111561154657611546614566565b8152815461010090046001600160a01b03166020820152600190910154604090910152825183908390811061157d5761157d614d78565b6020026020010181905250808061159390614e68565b9150506114ca565b50604080516080810182528481526000888152600c602081815284832087845291820181528483205481850152868352600d909101905282902054918101919091526060810182905285518690869081106115f8576115f8614d78565b6020026020010181905250505050808061161190614e68565b9150506113b4565b50604080516000848152600c602052829020610140820190925260019091018054829160608301918290829061164e90614ea1565b80601f016020809104026020016040519081016040528092919081815260200182805461167a90614ea1565b80156116c75780601f1061169c576101008083540402835291602001916116c7565b820191906000526020600020905b8154815290600101906020018083116116aa57829003601f168201915b5050505050815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582016040518060800160405290816000820160009054906101000a900460ff16600481111561172c5761172c614566565b600481111561173d5761173d614566565b81526020016001820180548060200260200160405190810160405280929190818152602001828054801561179a57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161177c575b5050505050815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156117fc57602002820191906000526020600020905b8154815260200190600101908083116117e8575b505050919092525050508152600991909101546001600160a01b03166020918201529082526006805492909101918990811061183a5761183a614d78565b6000918252602082200154604080516377a4d55960e01b815290516001600160a01b03909216926377a4d55992600480840193829003018186803b15801561188157600080fd5b505afa158015611895573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118bd91908101906152a5565b8152602001828152508484815181106118d8576118d8614d78565b6020026020010181905250505080806118f090614e68565b9150506112fe565b50949350505050565b60008581526005602052604081205461191c5750600061198a565b60008681526005602052604090206001015442101561193d5750600061198a565b60008681526005602052604090206002015442111561195e5750600061198a565b60008681526005602052604090205461197986868686612aae565b146119865750600061198a565b5060015b95945050505050565b6001600160a01b0383166000908152600160209081526040808320858452825280832084845290915290205442109392505050565b6000546001600160a01b031690565b60026004541415611a2a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610aeb565b600260045582611a655760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c182160e11b604082015260600190565b600b5486108015611a8757506000868152600c60205260409020600501548311155b611abc5760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c18a160e11b604082015260600190565b6000868152600c602052604081206011015415611bb75760006020830135338460400135604051602001611af293929190614dd7565b60408051601f1981840301815291905280516020918201209150611b2490843590850135836106406080880188614dfa565b8015611b335750826060013581145b8015611bb35750826040013585600c60008b8152602001908152602001600020601101856000013581548110611b6b57611b6b614d78565b90600052602060002090600202016001016000611b853390565b6001600160a01b03166001600160a01b0316815260200190815260200160002054611bb09190614e50565b11155b9150505b6000878152600c60205260409020600201544210801590611be957506000878152600c60205260409020600301544211155b80611bf15750805b611c265760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1a2160e11b604082015260600190565b6000878152600c60209081526040808320600a81015490549151611c59936001600160a01b0390921692918b9101615280565b60408051601f19818403018152918152815160209283012060008b8152600c8452828120828252600e019093529120549091508610611cc35760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c19a160e11b604082015260600190565b336000908152600a6020526040812054611cdd9087614e50565b9050600854600014611d2457600854811115611d245760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1aa160e11b604082015260600190565b6000898152600c60209081526040808320338452600b01909152812054611d4b9088614e50565b60008b8152600c60209081526040808320878452600d0190915281205491925090611d77908990614e50565b60008c8152600c602081815260408084208985529092019052902054909150811115611dce5760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1ba160e11b604082015260600190565b6000805b600b54811015611e465760005b6000828152600c6020526040902060100154811015611e33576000828152600c602090815260408083208a8452600d01909152902054611e1f9084614e50565b925080611e2b81614e68565b915050611ddf565b5080611e3e81614e68565b915050611dd2565b50611e518982614e50565b7f00000000000000000000000000000000000000000000000000000000000027101015611ea95760405162461bcd60e51b8152600401610aeb906020808252600490820152630c1e0c1160e21b604082015260600190565b50611eb38b612b8f565b611ee85760405162461bcd60e51b8152600401610aeb90602080825260049082015263183c1c2160e11b604082015260600190565b611ef78b858b8b898b356132af565b611f07878b8d878c86888a6137f0565b50506001600455505050505050505050565b600c60205260009081526040908190208054825160e0810190935260018201805491939182908290611f4a90614ea1565b80601f0160208091040260200160405190810160405280929190818152602001828054611f7690614ea1565b8015611fc35780601f10611f9857610100808354040283529160200191611fc3565b820191906000526020600020905b815481529060010190602001808311611fa657829003601f168201915b5050505050815260200160018201548152602001600282015481526020016003820154815260200160048201548152602001600582016040518060800160405290816000820160009054906101000a900460ff16600481111561202857612028614566565b600481111561203957612039614566565b81526020016001820180548060200260200160405190810160405280929190818152602001828054801561209657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612078575b5050505050815260200160028201548152602001600382018054806020026020016040519081016040528092919081815260200182805480156120f857602002820191906000526020600020905b8154815260200190600101908083116120e4575b505050919092525050508152600991909101546001600160a01b0316602090910152905082565b6006818154811061212f57600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160801b03198061215b6119c8565b6001600160a01b0316336001600160a01b0316148061217e575061217e33610ac8565b61219a5760405162461bcd60e51b8152600401610aeb90614dbb565b836121cc5760405162461bcd60e51b8152602060048201526002602482015261503360f01b6044820152606401610aeb565b600084815260026020526040808220859055518491869133917fad26b90be8a18bd2262e914f6fd4919c42f9dd6a0d07a15fa728ec603a836a8891a450505050565b6000828152600260205260409020546001600160801b03199061222f6119c8565b6001600160a01b0316336001600160a01b03161480612252575061225233610ac8565b61226e5760405162461bcd60e51b8152600401610aeb90614dbb565b836122a05760405162461bcd60e51b8152602060048201526002602482015261281960f11b6044820152606401610aeb565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b6001600160801b03196000805160206158418339815191526123326119c8565b6001600160a01b0316336001600160a01b03161480612355575061235533610ac8565b6123715760405162461bcd60e51b8152600401610aeb90614dbb565b6009805460ff191660011790556123853390565b6001600160a01b03167fa1ff8cb11b17d2fe38338d2b440199d17a429ff01672ffdff66f020cdd0e5f6960405160405180910390a25050565b6001600160801b03196000805160206158618339815191526123de6119c8565b6001600160a01b0316336001600160a01b03161480612401575061240133610ac8565b61241d5760405162461bcd60e51b8152600401610aeb90614dbb565b60035460ff161561247c5760405162461bcd60e51b815260206004820152602360248201527f53776565703a207468652073776565702066756e6374696f6e206973206c6f636044820152621ad95960ea1b6064820152608401610aeb565b6124906001600160a01b0386168486613aa2565b826001600160a01b0316856001600160a01b03166124ab3390565b6001600160a01b03167f9ccf4a542a203e3a302cfbe38c13fdcc934a9882f80039c23c65dd5f1ee74cf2876040516124e591815260200190565b60405180910390a45050505050565b6001600160801b03196000805160206157c18339815191526125146119c8565b6001600160a01b0316336001600160a01b03161480612537575061253733610ac8565b6125535760405162461bcd60e51b8152600401610aeb90614dbb565b600b548b1115801561256d575089602001358a6040013510155b801561257857508715155b6125945760405162461bcd60e51b8152600401610aeb90614e83565b87841480156125a35750825184145b80156125af5750825186145b6125e45760405162461bcd60e51b8152600401610aeb906020808252600490820152633078344160e01b604082015260600190565b60008b8152600c602052604090208a600182016126018282615189565b506126129050601082018b8b614003565b5060008c8152600c602052604090205461262d906001614e50565b815561263f8c8b8b8b8b8b8b8b613afd565b8360405161264d919061532f565b60405180910390208b60405161266391906154db565b60405180910390206126723390565b6001600160a01b03167fbc53fee877af9054280fb70b43f9631cf0662d6b3842adb894c0279697ac29758f8e8e8c8c6040516126b29594939291906155d1565b60405180910390a4505050505050505050505050565b6001600160801b03196000805160206158c18339815191526126e86119c8565b6001600160a01b0316336001600160a01b0316148061270b575061270b33610ac8565b6127275760405162461bcd60e51b8152600401610aeb90614dbb565b6127336006858561404e565b5050505050565b336127436119c8565b6001600160a01b0316146127695760405162461bcd60e51b8152600401610aeb9061524b565b6001600160a01b0381166127ce5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610aeb565b6127d781612a5e565b50565b6001600160801b03196000805160206158818339815191526127fa6119c8565b6001600160a01b0316336001600160a01b0316148061281d575061281d33610ac8565b6128395760405162461bcd60e51b8152600401610aeb90614dbb565b60095460ff16156128755760405162461bcd60e51b8152600401610aeb906020808252600490820152633078304160e01b604082015260600190565b826008546128803390565b6001600160a01b03167f935ec6c776e019beac24f91af4297a8257ddf3ed3fb912173b9f944f7f5deda960405160405180910390a45050600855565b60606000846001600160401b038111156128d8576128d86149bf565b60405190808252806020026020018201604052801561290b57816020015b60608152602001906001900390816128f65790505b50905060005b85811015612a5457836001600160401b03811115612931576129316149bf565b60405190808252806020026020018201604052801561295a578160200160208202803683370190505b5082828151811061296d5761296d614d78565b602002602001018190525060005b84811015612a4157600086868381811061299757612997614d78565b90506020020135905060008989858181106129b4576129b4614d78565b90506020020160208101906129c991906141b4565b6000838152600c602090815260408083206001600160a01b0385168452600b01909152902054865191925090869086908110612a0757612a07614d78565b60200260200101518481518110612a2057612a20614d78565b60200260200101818152505050508080612a3990614e68565b91505061297b565b5080612a4c81614e68565b915050612911565b5095945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600084815b83811015612b84578160011660011415612b1857848482818110612ad957612ad9614d78565b9050602002013586604051602001612afb929190918252602082015260400190565b604051602081830303815290604052805190602001209550612b65565b85858583818110612b2b57612b2b614d78565b90506020020135604051602001612b4c929190918252602082015260400190565b6040516020818303038152906040528051906020012095505b612b7060028361560a565b915080612b7c81614e68565b915050612ab3565b509395945050505050565b6000818152600c60205260408082208151608081019092526006018054839283929091829060ff166004811115612bc857612bc8614566565b6004811115612bd957612bd9614566565b815260200160018201805480602002602001604051908101604052809291908181526020018280548015612c3657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612c18575b505050505081526020016002820154815260200160038201805480602002602001604051908101604052809291908181526020018280548015612c9857602002820191906000526020600020905b815481526020019060010190808311612c84575b505050505081525050905060016004811115612cb657612cb6614566565b81516004811115612cc957612cc9614566565b1415612da95760005b816020015151811015612d9c5781602001518181518110612cf557612cf5614d78565b60200260200101516001600160a01b03166370a08231612d123390565b6040518263ffffffff1660e01b8152600401612d2e9190614893565b60206040518083038186803b158015612d4657600080fd5b505afa158015612d5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7e919061562c565b612d889084614e50565b925080612d9481614e68565b915050612cd2565b5060400151111592915050565b600381516004811115612dbe57612dbe614566565b1415612e735780604001518160200151600081518110612de057612de0614d78565b60200260200101516001600160a01b031663ca1fb21b612dfd3390565b6040518263ffffffff1660e01b8152600401612e199190614893565b60206040518083038186803b158015612e3157600080fd5b505afa158015612e45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e69919061562c565b1015949350505050565b60608101515161305257600281516004811115612e9257612e92614566565b1415612f655760005b816020015151811015612d9c5781602001518181518110612ebe57612ebe614d78565b60200260200101516001600160a01b031663aee9c872612edb3390565b6040518263ffffffff1660e01b8152600401612ef79190614893565b60206040518083038186803b158015612f0f57600080fd5b505afa158015612f23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f47919061562c565b612f519084614e50565b925080612f5d81614e68565b915050612e9b565b600481516004811115612f7a57612f7a614566565b141561304d5760005b816020015151811015612d9c5781602001518181518110612fa657612fa6614d78565b60200260200101516001600160a01b03166370a08231612fc33390565b6040518263ffffffff1660e01b8152600401612fdf9190614893565b60206040518083038186803b158015612ff757600080fd5b505afa15801561300b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302f919061562c565b6130399084614e50565b92508061304581614e68565b915050612f83565b6132a5565b60028151600481111561306757613067614566565b141561317b5760005b816020015151811015612d9c5760005b82602001515181101561316857826020015182815181106130a3576130a3614d78565b60200260200101516001600160a01b031662fdd58e6130bf3390565b856060015184815181106130d5576130d5614d78565b60200260200101516040518363ffffffff1660e01b81526004016130fa929190615645565b60206040518083038186803b15801561311257600080fd5b505afa158015613126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061314a919061562c565b6131549085614e50565b93508061316081614e68565b915050613080565b508061317381614e68565b915050613070565b60048151600481111561319057613190614566565b14156132a55760005b816020015151811015612d9c5760005b82602001515181101561329257826020015182815181106131cc576131cc614d78565b60200260200101516001600160a01b03166324fdefc46131e93390565b856060015184815181106131ff576131ff614d78565b60200260200101516040518363ffffffff1660e01b8152600401613224929190615645565b60206040518083038186803b15801561323c57600080fd5b505afa158015613250573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613274919061562c565b61327e9085614e50565b93508061328a81614e68565b9150506131a9565b508061329d81614e68565b915050613199565b5060019392505050565b811561353557600081815260056020526040812060048101549091906132d6908690615014565b60058301549091506001600160a01b03166133f9578034101561330b5760405162461bcd60e51b8152600401610aeb9061565e565b6007546040516000916001600160a01b03169034908381818185875af1925050503d8060008114613358576040519150601f19603f3d011682016040523d82523d6000602084013e61335d565b606091505b505090508061337e5760405162461bcd60e51b8152600401610aeb9061567c565b6000898152600c602052604090206011018054879190869081106133a4576133a4614d78565b906000526020600020906002020160010160006133be3390565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546133ed9190614e50565b9091555061352e915050565b60058201546040516370a0823160e01b815282916001600160a01b0316906370a082319061342b903390600401614893565b60206040518083038186803b15801561344357600080fd5b505afa158015613457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061347b919061562c565b10156134995760405162461bcd60e51b8152600401610aeb9061569a565b6134b93360075460058501546001600160a01b0390811692911684613dc1565b6000888152600c602052604090206011018054869190859081106134df576134df614d78565b906000526020600020906002020160010160006134f93390565b6001600160a01b03166001600160a01b0316815260200190815260200160002060008282546135289190614e50565b90915550505b5050610fe7565b6000868152600c60209081526040808320888452600f018252808320878452909152812090815460ff16600281111561357057613570614566565b14156135f057805461010090046001600160a01b031663918d24283386846001015461359c9190615014565b6040518363ffffffff1660e01b81526004016135b9929190615645565b600060405180830381600087803b1580156135d357600080fd5b505af11580156135e7573d6000803e3d6000fd5b505050506137e7565b6001815460ff16600281111561360857613608614566565b14156136bc5760008482600101546136209190615014565b9050803410156136425760405162461bcd60e51b8152600401610aeb9061565e565b6007546040516000916001600160a01b03169034908381818185875af1925050503d806000811461368f576040519150601f19603f3d011682016040523d82523d6000602084013e613694565b606091505b50509050806136b55760405162461bcd60e51b8152600401610aeb9061567c565b50506137e7565b6002815460ff1660028111156136d4576136d4614566565b14156137b95760008482600101546136ec9190615014565b8254909150819061010090046001600160a01b03166370a08231336040518263ffffffff1660e01b81526004016137239190614893565b60206040518083038186803b15801561373b57600080fd5b505afa15801561374f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613773919061562c565b10156137915760405162461bcd60e51b8152600401610aeb9061569a565b6137b333600754845461010090046001600160a01b0390811692911684613dc1565b506137e7565b60405162461bcd60e51b815260206004820152600360248201526203078360ec1b6044820152606401610aeb565b50505050505050565b6000846001600160401b0381111561380a5761380a6149bf565b604051908082528060200260200182016040528015613833578160200160208202803683370190505b5090506000856001600160401b03811115613850576138506149bf565b604051908082528060200260200182016040528015613879578160200160208202803683370190505b506000898152600c60209081526040808320600a8101549054915194955092936138af936001600160a01b0316928e9101615280565b60408051601f1981840301815291815281516020928301206000818152600d90935291205490915060808b901b60015b898111613962576000816138f38585614e50565b6138fd9190614e50565b9050808761390c600185614da4565b8151811061391c5761391c614d78565b60209081029190910101526001866139348285614da4565b8151811061394457613944614d78565b6020908102919091010152508061395a81614e68565b9150506138df565b5061396f90508882614e50565b6000838152600d60208181526040808420949094558d8352600c81528383208d845291820181528383208b9055338352600b9091018152828220899055600a905220859055600680548d9081106139c8576139c8614d78565b6000918252602090912001546001600160a01b0316631f7fdffa3386866040518463ffffffff1660e01b8152600401613a03939291906156b8565b600060405180830381600087803b158015613a1d57600080fd5b505af1158015613a31573d6000803e3d6000fd5b5050505083604051613a43919061570a565b6040518091039020613a523390565b6001600160a01b03167fb9597a073e873c1209bf07b0c0237cdf35718d0fffb7385b222bc2c80798a9538c86604051613a8c929190615740565b60405180910390a3505050505050505050505050565b613af88363a9059cbb60e01b8484604051602401613ac1929190615645565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613dff565b505050565b60005b86811015613db6576000848483818110613b1c57613b1c614d78565b9050602002013511613b595760405162461bcd60e51b8152600401610aeb906020808252600490820152633078354160e01b604082015260600190565b6000898152600c60205260408120600a81015490546001600160a01b03909116908a8a85818110613b8c57613b8c614d78565b90506020020135604051602001613ba593929190615280565b604051602081830303815290604052805190602001209050848483818110613bcf57613bcf614d78565b60008d8152600c60208181526040808420888552808401835290842094820296909601359093558e8252909152600a830154925490926001600160a01b031691508b8b86818110613c2257613c22614d78565b90506020020135604051602001613c3b93929190615280565b604051602081830303815290604052805190602001209050878784818110613c6557613c65614d78565b6000848152600d602090815260408220920293909301359055505b848481518110613c9257613c92614d78565b602002602001015151811015613d6357848481518110613cb457613cb4614d78565b60200260200101518181518110613ccd57613ccd614d78565b60209081029190910181015160008e8152600c83526040808220878352600f0184528082208583529093529190912081518154829060ff19166001836002811115613d1a57613d1a614566565b0217905550602082015181546001600160a01b0390911661010002610100600160a81b031990911617815560409091015160019091015580613d5b81614e68565b915050613c80565b50838381518110613d7657613d76614d78565b6020908102919091018101515160008d8152600c83526040808220958252600e909501909252929020919091555080613dae81614e68565b915050613b00565b505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052613df99085906323b872dd60e01b90608401613ac1565b50505050565b6000613e54826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316613ed19092919063ffffffff16565b805190915015613af85780806020019051810190613e729190615759565b613af85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610aeb565b6060610a7f848460008585843b613f2a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610aeb565b600080866001600160a01b03168587604051613f46919061577b565b60006040518083038185875af1925050503d8060008114613f83576040519150601f19603f3d011682016040523d82523d6000602084013e613f88565b606091505b5091509150613f98828286613fa3565b979650505050505050565b60608315613fb2575081610a82565b825115613fc25782518084602001fd5b8160405162461bcd60e51b8152600401610aeb919061578d565b6040518060600160405280613fef6140a1565b815260200160608152602001606081525090565b82805482825590600052602060002090810192821561403e579160200282015b8281111561403e578235825591602001919060010190614023565b5061404a929150614108565b5090565b82805482825590600052602060002090810192821561403e579160200282015b8281111561403e5781546001600160a01b0319166001600160a01b0384351617825560209092019160019091019061406e565b6040518060e0016040528060608152602001600081526020016000815260200160008152602001600081526020016140fb604080516080810190915280600081526020016060815260200160008152602001606081525090565b8152600060209091015290565b5b8082111561404a5760008155600101614109565b600060a0828403121561412f57600080fd5b50919050565b6001600160a01b03811681146127d757600080fd5b803561415581614135565b919050565b60008060006060848603121561416f57600080fd5b83356001600160401b0381111561418557600080fd5b6141918682870161411d565b9350506020840135915060408401356141a981614135565b809150509250925092565b6000602082840312156141c657600080fd5b8135610a8281614135565b6000602082840312156141e357600080fd5b5035919050565b600080604083850312156141fd57600080fd5b82356001600160401b0381111561421357600080fd5b61421f8582860161411d565b95602094909401359450505050565b600060e0828403121561412f57600080fd5b60008083601f84011261425257600080fd5b5081356001600160401b0381111561426957600080fd5b6020830191508360208260051b850101111561428457600080fd5b9250929050565b600080600080600080600080600060a08a8c0312156142a957600080fd5b89356001600160401b03808211156142c057600080fd5b6142cc8d838e0161422e565b9a5060208c01359150808211156142e257600080fd5b6142ee8d838e01614240565b909a50985060408c013591508082111561430757600080fd5b6143138d838e01614240565b909850965060608c013591508082111561432c57600080fd5b6143388d838e01614240565b909650945060808c013591508082111561435157600080fd5b5061435e8c828d01614240565b915080935050809150509295985092959850929598565b60008060006040848603121561438a57600080fd5b8335925060208401356001600160401b03808211156143a857600080fd5b818601915086601f8301126143bc57600080fd5b8135818111156143cb57600080fd5b87602060c0830285010111156143e057600080fd5b6020830194508093505050509250925092565b60008060006060848603121561440857600080fd5b833561441381614135565b95602085013595506040909401359392505050565b6000806040838503121561443b57600080fd5b8235915060208301356001600160401b0381111561445857600080fd5b6144648582860161422e565b9150509250929050565b60008060008060008060c0878903121561448757600080fd5b863595506020870135945060408701359350606087013592506080870135915060a08701356144b581614135565b809150509295509295509295565b6000806000604084860312156144d857600080fd5b83356001600160401b038111156144ee57600080fd5b6144fa86828701614240565b909790965060209590950135949350505050565b60005b83811015614529578181015183820152602001614511565b83811115613df95750506000910152565b6000815180845261455281602086016020860161450e565b601f01601f19169290920160200192915050565b634e487b7160e01b600052602160045260246000fd5b6005811061458c5761458c614566565b9052565b600081518084526020808501945080840160005b838110156145c0578151875295820195908201906001016145a4565b509495945050505050565b6000815160e084526145e060e085018261453a565b90506020808401518186015260408401516040860152606084015160608601526080840151608086015260a084015185830360a08701526080830161462684835161457c565b8183015160808585015280519182905283019060009060a08601905b8083101561466b5783516001600160a01b03168252928501926001929092019190850190614642565b506040840151604087015260608401519450858103606087015261468f8186614590565b9550505050505060c08301516146b060c08601826001600160a01b03169052565b509392505050565b6003811061458c5761458c614566565b60208152600060208201835180825260408401915060408160051b8501016020860160005b8381101561482757603f19878403018552815180516060855261471360608601826145cb565b90506020820151858203602087015261472c828261453a565b91505060408201519150848103604086015280825180835260208301915060208160051b84010160208501945060005b8281101561480757848203601f19018452855180518352602080820151818501526040808301519085015260609182015160809285018390528051928501839052019060a084019060005b818110156147ef5783516147bc8482516146b8565b6020818101516001600160a01b0316858201526040918201519185019190915293909301926060909201916001016147a7565b5050602097880197959095019492505060010161475c565b5080975050505050506020820191506020850194506001810190506146ed565b50909695505050505050565b60008060008060006080868803121561484b57600080fd5b85359450602086013593506040860135925060608601356001600160401b0381111561487657600080fd5b61488288828901614240565b969995985093965092949392505050565b6001600160a01b0391909116815260200190565b60008060008060008060c087890312156148c057600080fd5b863595506020870135945060408701359350606087013592506080870135915060a08701356001600160401b038111156148f957600080fd5b61490589828a0161411d565b9150509295509295509295565b828152604060208201526000610a7f60408301846145cb565b6000806040838503121561493e57600080fd5b50508035926020909101359150565b6000806000806080858703121561496357600080fd5b843561496e81614135565b966020860135965060408601359560600135945092505050565b60008060006060848603121561499d57600080fd5b83356149a881614135565b92506020840135915060408401356141a981614135565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156149f7576149f76149bf565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614a2557614a256149bf565b604052919050565b60006001600160401b03821115614a4657614a466149bf565b5060051b60200190565b6000614a63614a5e84614a2d565b6149fd565b8381529050602080820190600585901b840186811115614a8257600080fd5b845b81811015614b555780356001600160401b03811115614aa35760008081fd5b8601601f81018913614ab55760008081fd5b8035614ac3614a5e82614a2d565b8181526060918202830186019186820191908c841115614ae35760008081fd5b938701935b83851015614b445780858e031215614b005760008081fd5b614b086149d5565b853560038110614b185760008081fd5b815285890135614b2781614135565b818a01526040868101359082015283529384019391870191614ae8565b508752505050928201928201614a84565b505050509392505050565b600082601f830112614b7157600080fd5b610a8283833560208501614a50565b600080600080600080600080600060c08a8c031215614b9e57600080fd5b8935985060208a01356001600160401b0380821115614bbc57600080fd5b614bc88d838e0161422e565b995060408c0135915080821115614bde57600080fd5b614bea8d838e01614240565b909950975060608c0135915080821115614c0357600080fd5b614c0f8d838e01614240565b909750955060808c0135915080821115614c2857600080fd5b614c348d838e01614240565b909550935060a08c0135915080821115614c4d57600080fd5b50614c5a8c828d01614b60565b9150509295985092959850929598565b60008060208385031215614c7d57600080fd5b82356001600160401b03811115614c9357600080fd5b614c9f85828601614240565b90969095509350505050565b60008060008060408587031215614cc157600080fd5b84356001600160401b0380821115614cd857600080fd5b614ce488838901614240565b90965094506020870135915080821115614cfd57600080fd5b50614d0a87828801614240565b95989497509550505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614d6b57603f19888603018452614d59858351614590565b94509285019290850190600101614d3d565b5092979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015614db657614db6614d8e565b500390565b602080825260029082015261503160f01b604082015260600190565b92835260609190911b6001600160601b0319166020830152603482015260540190565b6000808335601e19843603018112614e1157600080fd5b8301803591506001600160401b03821115614e2b57600080fd5b6020019150600581901b360382131561428457600080fd5b6000610a82368484614a50565b60008219821115614e6357614e63614d8e565b500190565b6000600019821415614e7c57614e7c614d8e565b5060010190565b6020808252600490820152633078314160e01b604082015260600190565b600181811c90821680614eb557607f821691505b6020821081141561412f57634e487b7160e01b600052602260045260246000fd5b5b81811015614eeb5760008155600101614ed7565b5050565b601f821115613af857806000526020600020601f840160051c81016020851015614f165750805b612733601f850160051c830182614ed6565b6001600160401b03831115614f3f57614f3f6149bf565b614f5383614f4d8354614ea1565b83614eef565b6000601f841160018114614f875760008515614f6f5750838201355b600019600387901b1c1916600186901b178355612733565b600083815260209020601f19861690835b82811015614fb85786850135825560209485019460019092019101614f98565b5086821015614fd55760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60008235607e19833603018112614ffd57600080fd5b9190910192915050565b600581106127d757600080fd5b600081600019048311821515161561502e5761502e614d8e565b500290565b81831015613af857806000526020600020613df9838201858301614ed6565b6000813561505f81614135565b92915050565b600160401b831115615079576150796149bf565b8054838255615089848284615033565b50818160005260208060002060005b868110156137e757833582559282019260019182019101615098565b81356150bf81615007565b600581106150cf576150cf614566565b60ff1982541660ff8216811783555050600180820160206150f281860186614dfa565b600160401b811115615106576151066149bf565b8354818555615116828287615033565b506000938452828420935b8181101561515e57823561513481614135565b85546001600160a01b0319166001600160a01b039190911617855593850193918301918501615121565b5050505050506040820135600282015561517b6060830183614dfa565b613df9818360038601615065565b8135601e1983360301811261519d57600080fd5b820180356001600160401b038111156151b557600080fd5b6020820191508036038213156151ca57600080fd5b6151d5818385614f28565b50506020820135600182015560408201356002820155606082013560038201556080820135600482015561521861520f60a0840184614fe7565b600583016150b4565b614eeb61522760c08401615052565b6009830180546001600160a01b0319166001600160a01b0392909216919091179055565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60609390931b6001600160601b03191683526014830191909152603482015260540190565b6000602082840312156152b757600080fd5b81516001600160401b03808211156152ce57600080fd5b818401915084601f8301126152e257600080fd5b8151818111156152f4576152f46149bf565b615307601f8201601f19166020016149fd565b915080825285602082850101111561531e57600080fd5b6118f881602084016020860161450e565b81516000908290602080860184805b848110156153a65782518051908501908790845b818110156153945783516153678482516146b8565b808901516001600160a01b0316848a01526040908101519084015292870192606090920191600101615352565b5090975050509183019160010161533e565b5093979650505050505050565b8181843750600082820152601f01601f19160190565b60008235607e198336030181126153df57600080fd5b90910192915050565b6000808335601e198436030181126153ff57600080fd5b83016020810192503590506001600160401b0381111561541e57600080fd5b8060051b360383131561428457600080fd5b6000813561543d81615007565b615447848261457c565b506020808401615459828501856153e8565b9091600091905b8183101561549057833561547381614135565b6001600160a01b0316815292840192600192909201918401615460565b604087013581526154a460608801886153e8565b945092506001600160fb1b038411156154bc57600080fd5b8360051b93508383868301376000930190930191825250949350505050565b60008235601e198436030181126154f157600080fd5b830180356001600160401b0381111561550957600080fd5b80360385131561551857600080fd5b61198a61557e61556c61555f6155526155456155388a8860208b016153b3565b60208c0135815260200190565b60408b0135815260200190565b60608a0135815260200190565b6080890135815260200190565b61557960a08901896153c9565b615430565b61558a60c0880161414a565b6001600160a01b0316815260200190565b81835260006001600160fb1b038311156155b457600080fd5b8260051b8083602087013760009401602001938452509192915050565b8581526060602082015260006155eb60608301868861559b565b82810360408401526155fe81858761559b565b98975050505050505050565b60008261562757634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561563e57600080fd5b5051919050565b6001600160a01b03929092168252602082015260400190565b602080825260049082015263183c1ca160e11b604082015260600190565b6020808252600490820152633078304360e01b604082015260600190565b6020808252600490820152633078314360e01b604082015260600190565b6001600160a01b03841681526080602082018190526000906156dc90830185614590565b82810360408401526156ee8185614590565b8381036060909401939093525050600081526020019392505050565b815160009082906020808601845b8381101561573457815185529382019390820190600101615718565b50929695505050505050565b828152604060208201526000610a7f6040830184614590565b60006020828403121561576b57600080fd5b81518015158114610a8257600080fd5b60008251614ffd81846020870161450e565b602081526000610a82602083018461453a56fedbcef4c79a032f94ada7192586b76f7380ea76142bf44f7dffcbf07318d22d145d5c2d2522b7f6ec8d1c86f44956b9ecd4376b1842cd263d54a5368aa149486d9db6e9c424dcde0d5f3a75b470e5bc54cc3dc02c6879e33feab14f958b87680eefa425e0e493cbbeeed2833ecbc426ad9e567110edb11951c74d293f99a4201627a197db167d9ef273594120ada4e4c5e3a13bc9f76d745c1bc0a36315dea30a36aca941e75bffb6d7615d125171f4f3d34f99718ee03908ed244cdc4cc8e759305f9d04da14abed356cd8eddf1c22de3798f6aa89fa84e82f3bcb1ba154e2d8d6eb7457563d8954a1befba5aaf8bc2f82bd1b2cc37d8475791cad943bdcf0c60af0c3ebe77999ca20698e1ff25f812bf82409a59d21ca15a41f39e0ce9f2500c903eceeaa295aa6e6e9842295a59defe28f342a27ae7c55c8b481933b1ae86da26469706673582212203d2af68d59ab2b7bc13ee29001409aeeb1ba6c6e25c8c6847ce23421bd49982564736f6c63430008080033

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

0000000000000000000000004cd8a767d3ffa90b802caa61d206cea812ce51490000000000000000000000004b228ada7a940928f747ee6a5778da2773b377a4ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000002710

-----Decoded View---------------
Arg [0] : _owner (address): 0x4Cd8A767D3fFA90B802CAa61d206cea812ce5149
Arg [1] : _paymentReceiver (address): 0x4b228ADa7a940928F747Ee6A5778da2773b377a4
Arg [2] : _globalPurchaseLimit (uint256): 115792089237316195423570985008687907853269984665640564039457584007913129639935
Arg [3] : _maxAllocation (uint256): 10000

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000004cd8a767d3ffa90b802caa61d206cea812ce5149
Arg [1] : 0000000000000000000000004b228ada7a940928f747ee6a5778da2773b377a4
Arg [2] : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Arg [3] : 0000000000000000000000000000000000000000000000000000000000002710


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.