ETH Price: $3,113.05 (-6.09%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim217146412025-01-27 8:23:116 hrs ago1737966191IN
0x8D1eE415...284f5503C
0 ETH0.004567267.54980036
Claim217129522025-01-27 2:44:3512 hrs ago1737945875IN
0x8D1eE415...284f5503C
0 ETH0.003609057.11582816
Claim217129492025-01-27 2:43:5912 hrs ago1737945839IN
0x8D1eE415...284f5503C
0 ETH0.003209176.43659806
Claim217104462025-01-26 18:21:2321 hrs ago1737915683IN
0x8D1eE415...284f5503C
0 ETH0.001930176.1
Claim217078882025-01-26 9:46:2329 hrs ago1737884783IN
0x8D1eE415...284f5503C
0 ETH0.001511082.89853686
Claim217065592025-01-26 5:19:2334 hrs ago1737868763IN
0x8D1eE415...284f5503C
0 ETH0.001270212.50443259
Claim217049102025-01-25 23:48:4739 hrs ago1737848927IN
0x8D1eE415...284f5503C
0 ETH0.002538373.81218555
Claim216999192025-01-25 7:06:112 days ago1737788771IN
0x8D1eE415...284f5503C
0 ETH0.003406886.71419497
Rename216998812025-01-25 6:58:352 days ago1737788315IN
0x8D1eE415...284f5503C
0 ETH0.004131175.0375972
Wrap216998762025-01-25 6:57:352 days ago1737788255IN
0x8D1eE415...284f5503C
0.1 ETH0.001374895.17145228
Claim216997892025-01-25 6:40:112 days ago1737787211IN
0x8D1eE415...284f5503C
0 ETH0.004342676.12936505
Rename216888292025-01-23 17:57:113 days ago1737655031IN
0x8D1eE415...284f5503C
0 ETH0.0109146910.56697599
Claim216857652025-01-23 7:41:594 days ago1737618119IN
0x8D1eE415...284f5503C
0 ETH0.0021123.82491434
Claim216834582025-01-22 23:57:234 days ago1737590243IN
0x8D1eE415...284f5503C
0 ETH0.002652485.22979897
Wrap216814362025-01-22 17:10:474 days ago1737565847IN
0x8D1eE415...284f5503C
0.1 ETH0.0027538210.35809341
Claim216696952025-01-21 1:51:116 days ago1737424271IN
0x8D1eE415...284f5503C
0 ETH0.0051815210.21343784
Rename216571422025-01-19 7:48:238 days ago1737272903IN
0x8D1eE415...284f5503C
0 ETH0.0146234515.74556449
Wrap216559392025-01-19 3:46:238 days ago1737258383IN
0x8D1eE415...284f5503C
0.1 ETH0.00221538.33254438
Wrap216559352025-01-19 3:45:358 days ago1737258335IN
0x8D1eE415...284f5503C
0.1 ETH0.002254438.32933792
Claim216384962025-01-16 17:19:4710 days ago1737047987IN
0x8D1eE415...284f5503C
0 ETH0.005116589.82321674
Claim216355522025-01-16 7:27:3511 days ago1737012455IN
0x8D1eE415...284f5503C
0 ETH0.001426093.19957265
Claim216338532025-01-16 1:46:3511 days ago1736991995IN
0x8D1eE415...284f5503C
0 ETH0.001320992.60360209
Claim216338512025-01-16 1:46:1111 days ago1736991971IN
0x8D1eE415...284f5503C
0 ETH0.001442292.60358009
Claim216337052025-01-16 1:16:4711 days ago1736990207IN
0x8D1eE415...284f5503C
0 ETH0.001657063.18136067
Claim216275932025-01-15 4:46:4712 days ago1736916407IN
0x8D1eE415...284f5503C
0 ETH0.001658152.91072738
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
216998762025-01-25 6:57:352 days ago1737788255
0x8D1eE415...284f5503C
0.1 ETH
216814362025-01-22 17:10:474 days ago1737565847
0x8D1eE415...284f5503C
0.1 ETH
216559392025-01-19 3:46:238 days ago1737258383
0x8D1eE415...284f5503C
0.1 ETH
216559352025-01-19 3:45:358 days ago1737258335
0x8D1eE415...284f5503C
0.1 ETH
216185962025-01-13 22:37:5913 days ago1736807879
0x8D1eE415...284f5503C
0.1 ETH
216136022025-01-13 5:52:4714 days ago1736747567
0x8D1eE415...284f5503C
0.1 ETH
215752652025-01-07 21:25:1119 days ago1736285111
0x8D1eE415...284f5503C
0.1 ETH
215575092025-01-05 9:54:2322 days ago1736070863
0x8D1eE415...284f5503C
0.1 ETH
215574442025-01-05 9:40:5922 days ago1736070059
0x8D1eE415...284f5503C
0.1 ETH
215096902024-12-29 17:42:1128 days ago1735494131
0x8D1eE415...284f5503C
0.1 ETH
214656182024-12-23 13:55:4735 days ago1734962147
0x8D1eE415...284f5503C
0.1 ETH
214095342024-12-15 17:53:4742 days ago1734285227
0x8D1eE415...284f5503C
0.1 ETH
214038292024-12-14 22:46:3543 days ago1734216395
0x8D1eE415...284f5503C
0.1 ETH
214001602024-12-14 10:28:4744 days ago1734172127
0x8D1eE415...284f5503C
0.1 ETH
213974622024-12-14 1:26:4744 days ago1734139607
0x8D1eE415...284f5503C
0.1 ETH
213962832024-12-13 21:29:3544 days ago1734125375
0x8D1eE415...284f5503C
0.1 ETH
213897172024-12-12 23:29:3545 days ago1734046175
0x8D1eE415...284f5503C
0.1 ETH
213787862024-12-11 10:51:4747 days ago1733914307
0x8D1eE415...284f5503C
0.1 ETH
213778202024-12-11 7:36:4747 days ago1733902607
0x8D1eE415...284f5503C
0.1 ETH
213776842024-12-11 7:09:2347 days ago1733900963
0x8D1eE415...284f5503C
0.1 ETH
213504432024-12-07 11:53:4751 days ago1733572427
0x8D1eE415...284f5503C
0.1 ETH
213427142024-12-06 9:59:2352 days ago1733479163
0x8D1eE415...284f5503C
0.1 ETH
213408082024-12-06 3:35:5952 days ago1733456159
0x8D1eE415...284f5503C
0.1 ETH
213047382024-12-01 2:41:2357 days ago1733020883
0x8D1eE415...284f5503C
0.1 ETH
212983852024-11-30 5:24:2358 days ago1732944263
0x8D1eE415...284f5503C
0.1 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
WrappedNFTHero

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 21 : WrappedNFTHero.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import { IWrappedNFTHero } from "src/interfaces/IWrappedNFTHero.sol";
import { ObeliskNFT } from "./ObeliskNFT.sol";
import { IHCT } from "src/interfaces/IHCT.sol";
import { IObeliskRegistry } from "src/interfaces/IObeliskRegistry.sol";
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import { IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
import { strings } from "src/lib/strings.sol";
import { IERC721 } from "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/**
 * @title WrappedNFTHero
 * @notice It allows users to wrap their NFT to get a WrappedNFTHero NFT.
 * @custom:export abi
 * @dev The NFT ID of this contract is reflecting the NFT ID from the input collection.
 */
contract WrappedNFTHero is IWrappedNFTHero, ERC721, IERC721Receiver, ObeliskNFT {
  using strings for string;
  using strings for strings.slice;

  uint256 private constant MAX_BPS = 10_000;
  uint256 private constant SECONDS_PER_YEAR = 31_557_600;

  uint256 public constant SLOT_PRICE = 0.1e18;
  uint256 public constant FREE_SLOT_BPS = 2500; // 25 %

  uint256 public constant RATE_PER_YEAR = 0.43e18;
  uint256 public constant MAX_RATE = 3e18;

  IHCT public immutable HCT;
  ERC721 public immutable INPUT_COLLECTION;

  uint32 public immutable COLLECTION_STARTED_UNIX_TIME;
  bool public immutable FREE_SLOT_FOR_ODD;
  bool public immutable PREMIUM;
  bool public emergencyWithdrawEnabled;

  uint256 public freeSlots;

  mapping(uint256 => NFTData) internal nftData;

  uint256 public immutable ID;

  constructor(
    address _HCT,
    address _nftPass,
    address _inputCollection,
    address _obeliskRegistry,
    uint256 _currentSupply,
    uint32 _collectionStartedUnixTime,
    bool _premium,
    uint256 _id
  ) ERC721("WrappedNFTHero", "WNH") ObeliskNFT(_obeliskRegistry, _nftPass) {
    HCT = IHCT(_HCT);
    INPUT_COLLECTION = ERC721(_inputCollection);

    freeSlots = _currentSupply * FREE_SLOT_BPS / MAX_BPS;
    FREE_SLOT_FOR_ODD = uint256(keccak256(abi.encode(_inputCollection))) % 2 == 1;
    COLLECTION_STARTED_UNIX_TIME = _collectionStartedUnixTime;
    PREMIUM = _premium;
    ID = _id;
  }

  /// @inheritdoc IWrappedNFTHero
  function wrap(uint256 _inputCollectionNFTId) external payable override {
    if (emergencyWithdrawEnabled) revert EmergencyModeIsActive();
    if (IERC721(address(NFT_PASS)).balanceOf(msg.sender) == 0) revert NotNFTPassHolder();

    bool isIdOdd = _inputCollectionNFTId % 2 == 1;
    bool canHaveFreeSlot = freeSlots != 0 && FREE_SLOT_FOR_ODD == isIdOdd;

    NFTData storage nftdata = nftData[_inputCollectionNFTId];
    bool didWrapBefore = nftdata.wrappedOnce;

    if (nftdata.isMinted) revert AlreadyMinted();

    if ((canHaveFreeSlot || didWrapBefore) && msg.value != 0) revert FreeSlotAvailable();
    if ((!canHaveFreeSlot && !didWrapBefore) && msg.value != SLOT_PRICE) {
      revert NoFreeSlots();
    }

    nftdata.isMinted = true;
    INPUT_COLLECTION.transferFrom(msg.sender, address(this), _inputCollectionNFTId);

    _safeMint(msg.sender, _inputCollectionNFTId);
    emit Wrapped(_inputCollectionNFTId);

    if (didWrapBefore) return;
    nftdata.wrappedOnce = true;

    if (!canHaveFreeSlot) {
      obeliskRegistry.onSlotBought{ value: msg.value }();
      emit SlotBought(msg.sender, _inputCollectionNFTId);
    } else {
      freeSlots--;
      emit FreeSlotUsed(freeSlots);
    }
  }

  /// @inheritdoc IWrappedNFTHero
  function rename(uint256 _tokenId, string memory _newName) external override {
    uint256 nameBytesLength = bytes(_newName).length;
    if (nameBytesLength == 0 || nameBytesLength > MAX_NAME_BYTES_LENGTH) {
      revert InvalidNameLength();
    }

    _renameRequirements(_tokenId);
    _updateMultiplier(_tokenId);

    bytes32 identity;
    address receiver;

    if (bytes(names[_tokenId]).length != 0) {
      (identity, receiver) = _getIdentityInformation(_tokenId);
      _removeOldTickers(identity, receiver, _tokenId, false);
    }

    (identity, receiver) = _updateIdentity(_tokenId, _newName);
    _addNewTickers(identity, receiver, _tokenId, _newName);

    emit NameUpdated(_tokenId, _newName);
    names[_tokenId] = _newName;
  }

  function _renameRequirements(uint256 _tokenId) internal {
    NFTData storage nftdata = nftData[_tokenId];

    if (!nftdata.isMinted) revert NotMinted();
    if (_ownerOf(_tokenId) != msg.sender) revert NotNFTHolder();

    if (PREMIUM && !nftdata.hasBeenRenamed) {
      nftdata.hasBeenRenamed = true;
      return;
    }

    HCT.usesForRenaming(msg.sender);
  }

  function _updateIdentity(uint256 _tokenId, string memory _name)
    internal
    virtual
    returns (bytes32 _identity, address receiver_)
  {
    strings.slice memory nameSlice = _name.toSlice();
    strings.slice memory needle = TICKER_START_IDENTITY.toSlice();
    string memory substring =
      nameSlice.find(needle).beyond(needle).split(string(" ").toSlice()).toString();

    receiver_ = NFT_PASS.getMetadata(0, substring).walletReceiver;

    if (receiver_ == address(0)) revert InvalidWalletReceiver();

    nftPassAttached[_tokenId] = substring;

    return (keccak256(abi.encode(substring)), receiver_);
  }

  /// @inheritdoc IWrappedNFTHero
  function unwrap(uint256 _tokenId) external override {
    NFTData storage nftdata = nftData[_tokenId];

    if (!nftdata.isMinted) revert NotMinted();
    if (_ownerOf(_tokenId) != msg.sender) revert NotNFTHolder();

    if (!emergencyWithdrawEnabled) {
      (bytes32 identity, address receiver) = _getIdentityInformation(_tokenId);
      _removeOldTickers(identity, receiver, _tokenId, false);
    }

    _burn(_tokenId);
    delete names[_tokenId];
    delete nftPassAttached[_tokenId];

    nftdata.assignedMultiplier = 0;
    nftdata.isMinted = false;

    INPUT_COLLECTION.safeTransferFrom(address(this), msg.sender, _tokenId);

    emit Unwrapped(_tokenId);
  }

  function _claimRequirements(uint256 _tokenId) internal view override returns (bool) {
    if (_ownerOf(_tokenId) != msg.sender) revert NotNFTHolder();
    return true;
  }

  function _update(address to, uint256 tokenId, address auth)
    internal
    override
    returns (address)
  {
    NFTData storage nftdata = nftData[tokenId];

    address from = _ownerOf(tokenId);
    uint128 multiplier = nftdata.assignedMultiplier;

    if (to == address(0)) {
      HCT.removePower(from, multiplier);
      multiplier = 0;
    } else if (from == address(0)) {
      multiplier = getWrapperMultiplier();
      HCT.addPower(to, multiplier, true);
    } else {
      revert CannotTransferUnwrapFirst();
    }

    nftdata.assignedMultiplier = multiplier;
    emit MultiplierUpdated(tokenId, multiplier);

    return super._update(to, tokenId, auth);
  }

  function _getIdentityInformation(uint256 _tokenId)
    internal
    view
    override
    returns (bytes32, address)
  {
    string memory nftPass = nftPassAttached[_tokenId];

    return
      (keccak256(abi.encode(nftPass)), NFT_PASS.getMetadata(0, nftPass).walletReceiver);
  }

  /// @inheritdoc IWrappedNFTHero
  function updateMultiplier(uint256 _tokenId) external override {
    if (!_updateMultiplier(_tokenId)) revert SameMultiplier();
  }

  function _updateMultiplier(uint256 _tokenId) internal returns (bool) {
    NFTData storage nftdata = nftData[_tokenId];
    if (_ownerOf(_tokenId) != msg.sender) revert NotNFTHolder();

    uint128 newMultiplier = getWrapperMultiplier();
    uint128 multiplier = nftdata.assignedMultiplier;

    if (newMultiplier == multiplier) return false;

    HCT.addPower(msg.sender, newMultiplier - multiplier, false);
    nftData[_tokenId].assignedMultiplier = newMultiplier;
    emit MultiplierUpdated(_tokenId, newMultiplier);

    return true;
  }

  /// @inheritdoc IWrappedNFTHero
  function enableEmergencyWithdraw() external override {
    if (msg.sender != address(obeliskRegistry)) revert NotObeliskRegistry();
    emergencyWithdrawEnabled = true;

    emit EmergencyWithdrawEnabled();
  }

  /// @inheritdoc IWrappedNFTHero
  function getWrapperMultiplier() public view override returns (uint128) {
    if (PREMIUM) return uint128(MAX_RATE);

    uint256 currentYear =
      (block.timestamp - COLLECTION_STARTED_UNIX_TIME) / SECONDS_PER_YEAR;
    return uint128(Math.min(currentYear * RATE_PER_YEAR, MAX_RATE));
  }

  /// @inheritdoc IWrappedNFTHero
  function getNFTData(uint256 _tokenId) external view override returns (NFTData memory) {
    return nftData[_tokenId];
  }

  function onERC721Received(address, address, uint256, bytes calldata)
    external
    pure
    override
    returns (bytes4)
  {
    return this.onERC721Received.selector;
  }

  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    _requireOwned(tokenId);

    string memory name = names[tokenId];

    if (bytes(name).length == 0) name = "Unnamed";

    string memory data = string(
      abi.encodePacked(
        '{"name":"',
        name,
        '","description":"Wrapped Version of an external collection","image":"',
        IObeliskRegistry(obeliskRegistry).getCollectionImageIPFS(ID),
        '"}'
      )
    );

    return string(abi.encodePacked("data:application/json;utf8,", data));
  }
}

File 2 of 21 : IWrappedNFTHero.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface IWrappedNFTHero {
  error AlreadyMinted();
  error NotMinted();
  error NotNFTHolder();
  error NoFreeSlots();
  error FreeSlotAvailable();
  error CannotTransferUnwrapFirst();
  error SameMultiplier();
  error InvalidNameLength();
  error InvalidWalletReceiver();
  error EmergencyWithdrawDisabled();
  error EmergencyModeIsActive();
  error NotObeliskRegistry();
  error NotNFTPassHolder();

  event Wrapped(uint256 indexed tokenId);
  event Unwrapped(uint256 indexed tokenId);
  event SlotBought(address indexed user, uint256 indexed inputCollectionNFTId);
  event FreeSlotUsed(uint256 freeSlotLeft);
  event EmergencyWithdrawEnabled();
  event MultiplierUpdated(uint256 indexed tokenId, uint128 newMultiplier);

  struct NFTData {
    bool isMinted;
    bool hasBeenRenamed;
    bool wrappedOnce;
    uint128 assignedMultiplier;
  }

  /**
   * @notice Wraps an NFT from the input collection into a Wrapped NFT Hero.
   * @param _inputCollectionNFTId The ID of the NFT to wrap.
   */
  function wrap(uint256 _inputCollectionNFTId) external payable;

  /**
   * @notice Renames a Wrapped NFT Hero.
   * @param _tokenId The ID of the Wrapped NFT Hero to rename.
   * @param _newName The new name for the Wrapped NFT Hero.
   */
  function rename(uint256 _tokenId, string memory _newName) external;

  /**
   * @notice Unwraps a Wrapped NFT Hero back into the original NFT from the input
   * collection.
   * @param _tokenId The ID of the Wrapped NFT Hero to unwrap.
   */
  function unwrap(uint256 _tokenId) external;

  /**
   * @notice Updates the multiplier of a Wrapped NFT Hero.
   * @param _tokenId The ID of the Wrapped NFT Hero to update the multiplier.
   * @dev Since the multiplier increases over-time, the user needs to update the
   * multiplier on their side. Not ideal, but good enough for the time we have.
   */
  function updateMultiplier(uint256 _tokenId) external;

  /**
   * @notice Returns the multiplier of the Wrapped NFT Hero.
   */
  function getWrapperMultiplier() external view returns (uint128);

  /**
   * @notice Returns the data of a Wrapped NFT Hero.
   * @param _tokenId The ID of the Wrapped NFT Hero to get the data.
   */
  function getNFTData(uint256 _tokenId) external view returns (NFTData memory);

  /**
   * @notice Enables emergency withdraw for the Wrapped NFT Hero.
   */
  function enableEmergencyWithdraw() external;
}

File 3 of 21 : ObeliskNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

import { IObeliskNFT } from "src/interfaces/IObeliskNFT.sol";
import { ILiteTicker } from "src/interfaces/ILiteTicker.sol";
import { IObeliskRegistry } from "src/interfaces/IObeliskRegistry.sol";
import { INFTPass } from "src/interfaces/INFTPass.sol";

import { strings } from "src/lib/strings.sol";
import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

/**
 * @title ObeliskNFT
 * @notice Base contract for Obelisk NFTs. It contains the staking logic via name.
 */
abstract contract ObeliskNFT is IObeliskNFT, ReentrancyGuard {
  using strings for string;
  using strings for strings.slice;

  string public constant TICKER_START_INDICE = "#";
  string public constant TICKER_SPLIT_STRING = ",";
  string public constant TICKER_START_IDENTITY = "@";
  uint32 public constant MAX_NAME_BYTES_LENGTH = 29;
  IObeliskRegistry public immutable obeliskRegistry;
  INFTPass public immutable NFT_PASS;

  mapping(uint256 => string) public nftPassAttached;
  mapping(uint256 => address[]) internal linkedTickers;
  mapping(uint256 => string) public names;

  constructor(address _obeliskRegistry, address _nftPass) {
    obeliskRegistry = IObeliskRegistry(_obeliskRegistry);
    NFT_PASS = INFTPass(_nftPass);
  }

  function _removeOldTickers(
    bytes32 _identity,
    address _receiver,
    uint256 _tokenId,
    bool _ignoreRewards
  ) internal nonReentrant {
    address[] memory activePools = linkedTickers[_tokenId];
    delete linkedTickers[_tokenId];

    address currentPool;

    for (uint256 i = 0; i < activePools.length; ++i) {
      currentPool = activePools[i];

      ILiteTicker(currentPool).virtualWithdraw(
        _identity, _tokenId, _receiver, _ignoreRewards
      );

      emit TickerDeactivated(_tokenId, currentPool);
    }
  }

  function _addNewTickers(
    bytes32 _identity,
    address _receiver,
    uint256 _tokenId,
    string memory _name
  ) internal virtual nonReentrant {
    strings.slice memory nameSlice = _name.toSlice();
    strings.slice memory needle = TICKER_START_INDICE.toSlice();
    strings.slice memory substring =
      nameSlice.find(needle).beyond(needle).split(string(" ").toSlice());
    strings.slice memory delim = TICKER_SPLIT_STRING.toSlice();

    address[] memory poolTargets = new address[](substring.count(delim) + 1);

    address poolTarget;
    string memory tickerName;
    for (uint256 i = 0; i < poolTargets.length; ++i) {
      tickerName = substring.split(delim).toString();
      if (bytes(tickerName).length == 0) continue;

      poolTarget = obeliskRegistry.getTickerLogic(tickerName);
      if (poolTarget == address(0)) continue;

      poolTargets[i] = poolTarget;

      ILiteTicker(poolTarget).virtualDeposit(_identity, _tokenId, _receiver);
      emit TickerActivated(_tokenId, poolTarget);
    }

    linkedTickers[_tokenId] = poolTargets;
  }

  /// @inheritdoc IObeliskNFT
  function claim(uint256 _tokenId) external nonReentrant {
    address[] memory activePools = linkedTickers[_tokenId];
    assert(_claimRequirements(_tokenId));

    (bytes32 identity, address identityReceiver) = _getIdentityInformation(_tokenId);

    for (uint256 i = 0; i < activePools.length; i++) {
      ILiteTicker(activePools[i]).claim(identity, _tokenId, identityReceiver, false);
      emit TickerClaimed(_tokenId, activePools[i]);
    }
  }

  function _claimRequirements(uint256 _tokenId) internal view virtual returns (bool);

  function getIdentityInformation(uint256 _tokenId)
    external
    view
    override
    returns (bytes32 identityInTicker_, address rewardReceiver_)
  {
    return _getIdentityInformation(_tokenId);
  }

  function _getIdentityInformation(uint256 _tokenId)
    internal
    view
    virtual
    returns (bytes32, address);

  function getLinkedTickers(uint256 _tokenId) external view returns (address[] memory) {
    return linkedTickers[_tokenId];
  }

  function getPendingRewards(uint256 _tokenId)
    external
    view
    returns (uint256[] memory pendingRewards_, address[] memory pendingRewardsTokens_)
  {
    address[] memory activePools = linkedTickers[_tokenId];
    (bytes32 identity,) = _getIdentityInformation(_tokenId);

    pendingRewards_ = new uint256[](activePools.length);
    pendingRewardsTokens_ = new address[](activePools.length);

    uint256 pendingRewards;
    address pendingRewardsToken;

    for (uint256 i = 0; i < activePools.length; ++i) {
      (pendingRewards, pendingRewardsToken) =
        ILiteTicker(activePools[i]).getClaimableRewards(identity, 0);

      pendingRewards_[i] = pendingRewards;
      pendingRewardsTokens_[i] = pendingRewardsToken;
    }

    return (pendingRewards_, pendingRewardsTokens_);
  }
}

File 4 of 21 : IHCT.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface IHCT {
  error NotWrappedNFT();
  error NothingToClaim();

  event TotalNFTWrapped(uint256 totalWrappedNFT);
  event PowerAdded(address indexed wrappedNFT, address indexed user, uint128 multiplier);
  event PowerRemoved(
    address indexed wrappedNFT, address indexed user, uint128 multiplier
  );
  event Transferred(
    address indexed wrappedNFT,
    address indexed from,
    address indexed to,
    uint128 multiplier
  );
  event Claimed(address indexed user, uint256 amount);
  event BurnedForRenaming(
    address indexed wrappedNFT, address indexed user, uint256 amount
  );
  event InflationRateSet(uint256 inflationRate);
  event BaseRateSet(uint256 baseRate);
  event InflationThresholdSet(uint256 inflationThreshold);

  struct UserInfo {
    uint256 multiplier;
    uint256 userRates;
  }

  function addPower(address _user, uint128 _addMultiplier, bool _newNFT) external;
  function removePower(address _user, uint128 _removeMultiplier) external;
  function burn(address _user, uint256 _amount) external;
  function usesForRenaming(address _user) external;
  function getUserPendingRewards(address _user) external view returns (uint256);
  function getSystemPendingRewards() external view returns (uint256);
  function getTotalRewardsGenerated() external view returns (uint256);
  function getUserInfo(address _user) external view returns (UserInfo memory);
}

File 5 of 21 : IObeliskRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface IObeliskRegistry {
  error TooManyEth();
  error GoalReached();
  error AmountExceedsDeposit();
  error TransferFailed();
  error FailedDeployment();
  error TickerAlreadyExists();
  error NotSupporterDepositor();
  error AlreadyRemoved();
  error SupportNotFinished();
  error NothingToClaim();
  error NotWrappedNFT();
  error CollectionNotAllowed();
  error NotAuthorized();
  error OnlyOneValue();
  error AmountTooLow();
  error ContributionBalanceTooLow();
  error ZeroAddress();
  error CollectionAlreadyAllowed();
  error NoAccess();

  event WrappedNFTCreated(address indexed collection, address indexed wrappedNFT);
  event WrappedNFTEnabled(address indexed collection, address indexed wrappedNFT);
  event WrappedNFTDisabled(address indexed collection, address indexed wrappedNFT);
  event MegapoolFactorySet(address indexed megapoolFactory);
  event TickerCreationAccessSet(address indexed to, bool status);
  event TickerLogicSet(string indexed ticker, address indexed pool, string readableName);
  event NewGenesisTickerCreated(string indexed ticker, address pool);
  event Supported(uint32 indexed supportId, address indexed supporter, uint256 amount);
  event SupportRetrieved(
    uint32 indexed supportId, address indexed supporter, uint256 amount
  );
  event CollectionContributed(
    address indexed collection, address indexed contributor, uint256 amount
  );
  event CollectionContributionWithdrawn(
    address indexed collection, address indexed contributor, uint256 amount
  );
  event Claimed(address indexed collection, address indexed contributor, uint256 amount);
  event SlotBought(address indexed wrappedNFT, uint256 toCollection, uint256 toTreasury);
  event CollectionAllowed(
    address indexed collection,
    uint256 totalSupply,
    uint32 collectionStartedUnixTime,
    bool premium
  );
  event TreasurySet(address indexed treasury);
  event MaxRewardPerCollectionSet(uint256 maxRewardPerCollection);
  event CollectionImageIPFSUpdated(uint256 indexed id, string ipfsImage);

  struct Collection {
    uint256 totalSupply;
    uint256 contributionBalance;
    address wrappedVersion;
    uint32 collectionStartedUnixTime;
    bool allowed;
    bool premium;
  }

  struct Supporter {
    address depositor;
    address token;
    uint128 amount;
    uint32 lockUntil;
    bool removed;
  }

  struct CollectionRewards {
    uint128 totalRewards;
    uint128 claimedRewards;
  }

  struct ContributionInfo {
    uint128 deposit;
    uint128 claimed;
  }

  function isWrappedNFT(address _collection) external view returns (bool);

  /**
   * @notice Contribute to collection
   * @param _collection NFT Collection address
   * @dev Warning: once the collection goal is reached, it cannot be removed
   */
  function addToCollection(address _collection) external payable;

  /**
   * @notice Remove from collection
   * @param _collection Collection address
   * @dev Warning: once the collection goal is reached, it cannot be removed
   */
  function removeFromCollection(address _collection, uint256 _amount) external;

  /**
   * @notice Support the yield pool
   * @param _amount The amount to support with
   * @dev The amount is locked for 30 days
   * @dev if msg.value is 0, the amount is expected to be sent in DAI
   */
  function supportYieldPool(uint256 _amount) external payable;

  /**
   * @notice Retrieve support to yield pool
   * @param _id Support ID
   */
  function retrieveSupportToYieldPool(uint32 _id) external;

  /**
   * @notice Set ticker logic
   * @param _ticker Ticker
   * @param _pool Pool address
   * @param _override Override existing ticker logic. Only owner can override.
   */
  function setTickerLogic(string memory _ticker, address _pool, bool _override) external;

  /**
   * @notice When a slot is bought from the wrapped NFT
   */
  function onSlotBought() external payable;

  /**
   * @notice Get ticker logic
   * @param _ticker Ticker
   */
  function getTickerLogic(string memory _ticker) external view returns (address);

  /**
   * @notice Get supporter
   * @param _id Support ID
   */
  function getSupporter(uint32 _id) external view returns (Supporter memory);

  /**
   * @notice Get user contribution
   * @param _user User address
   * @param _collection Collection address
   */
  function getUserContribution(address _user, address _collection)
    external
    view
    returns (ContributionInfo memory);

  /**
   * @notice Get collection rewards
   * @param _collection Collection address
   */
  function getCollectionRewards(address _collection)
    external
    view
    returns (CollectionRewards memory);

  /**
   * @notice Get collection
   * @param _collection Collection address
   */
  function getCollection(address _collection) external view returns (Collection memory);

  function getCollectionImageIPFS(uint256 _id) external view returns (string memory);
}

File 6 of 21 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.20;

import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    mapping(uint256 tokenId => address) private _owners;

    mapping(address owner => uint256) private _balances;

    mapping(uint256 tokenId => address) private _tokenApprovals;

    mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual returns (uint256) {
        if (owner == address(0)) {
            revert ERC721InvalidOwner(address(0));
        }
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual returns (address) {
        return _requireOwned(tokenId);
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
        _requireOwned(tokenId);

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual {
        _approve(to, tokenId, _msgSender());
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual returns (address) {
        _requireOwned(tokenId);

        return _getApproved(tokenId);
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public virtual {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
        // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
        address previousOwner = _update(to, tokenId, _msgSender());
        if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
        transferFrom(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     *
     * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
     * core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances
     * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
     * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

    /**
     * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
     */
    function _getApproved(uint256 tokenId) internal view virtual returns (address) {
        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
     * particular (ignoring whether it is owned by `owner`).
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
        return
            spender != address(0) &&
            (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
    }

    /**
     * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
     * Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
     * the `spender` for the specific `tokenId`.
     *
     * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
     * assumption.
     */
    function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
        if (!_isAuthorized(owner, spender, tokenId)) {
            if (owner == address(0)) {
                revert ERC721NonexistentToken(tokenId);
            } else {
                revert ERC721InsufficientApproval(spender, tokenId);
            }
        }
    }

    /**
     * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
     *
     * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
     * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
     *
     * WARNING: Increasing an account's balance using this function tends to be paired with an override of the
     * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
     * remain consistent with one another.
     */
    function _increaseBalance(address account, uint128 value) internal virtual {
        unchecked {
            _balances[account] += value;
        }
    }

    /**
     * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
     * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that
     * `auth` is either the owner of the token, or approved to operate on the token (by the owner).
     *
     * Emits a {Transfer} event.
     *
     * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
     */
    function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
        address from = _ownerOf(tokenId);

        // Perform (optional) operator check
        if (auth != address(0)) {
            _checkAuthorized(from, auth, tokenId);
        }

        // Execute the update
        if (from != address(0)) {
            // Clear approval. No need to re-authorize or emit the Approval event
            _approve(address(0), tokenId, address(0), false);

            unchecked {
                _balances[from] -= 1;
            }
        }

        if (to != address(0)) {
            unchecked {
                _balances[to] += 1;
            }
        }

        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        return from;
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner != address(0)) {
            revert ERC721InvalidSender(address(0));
        }
    }

    /**
     * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {
        _mint(to, tokenId);
        _checkOnERC721Received(address(0), to, tokenId, data);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal {
        address previousOwner = _update(address(0), tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(address from, address to, uint256 tokenId) internal {
        if (to == address(0)) {
            revert ERC721InvalidReceiver(address(0));
        }
        address previousOwner = _update(to, tokenId, address(0));
        if (previousOwner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        } else if (previousOwner != from) {
            revert ERC721IncorrectOwner(from, tokenId, previousOwner);
        }
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
     * are aware of the ERC721 standard to prevent tokens from being forever locked.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is like {safeTransferFrom} in the sense that it invokes
     * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `tokenId` token must exist and be owned by `from`.
     * - `to` cannot be the zero address.
     * - `from` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(address from, address to, uint256 tokenId) internal {
        _safeTransfer(from, to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
        _transfer(from, to, tokenId);
        _checkOnERC721Received(from, to, tokenId, data);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
     * either the owner of the token, or approved to operate on all tokens held by this owner.
     *
     * Emits an {Approval} event.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address to, uint256 tokenId, address auth) internal {
        _approve(to, tokenId, auth, true);
    }

    /**
     * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
     * emitted in the context of transfers.
     */
    function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
        // Avoid reading the owner unless necessary
        if (emitEvent || auth != address(0)) {
            address owner = _requireOwned(tokenId);

            // We do not use _isAuthorized because single-token approvals should not be able to call approve
            if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
                revert ERC721InvalidApprover(auth);
            }

            if (emitEvent) {
                emit Approval(owner, to, tokenId);
            }
        }

        _tokenApprovals[tokenId] = to;
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Requirements:
     * - operator can't be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC721InvalidOperator(operator);
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
     * Returns the owner.
     *
     * Overrides to ownership logic should be done to {_ownerOf}.
     */
    function _requireOwned(uint256 tokenId) internal view returns (address) {
        address owner = _ownerOf(tokenId);
        if (owner == address(0)) {
            revert ERC721NonexistentToken(tokenId);
        }
        return owner;
    }

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
     * recipient doesn't accept the token transfer. The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
        if (to.code.length > 0) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                if (retval != IERC721Receiver.onERC721Received.selector) {
                    revert ERC721InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert ERC721InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }
}

File 7 of 21 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.20;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be
     * reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 8 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 9 of 21 : strings.sol
/*
 * @title String & slice utility library for Solidity contracts.
 * @author Nick Johnson <[email protected]>
 *
 * @dev Functionality in this library is largely implemented using an
 *      abstraction called a 'slice'. A slice represents a part of a string -
 *      anything from the entire string to a single character, or even no
 *      characters at all (a 0-length slice). Since a slice only has to specify
 *      an offset and a length, copying and manipulating slices is a lot less
 *      expensive than copying and manipulating the strings they reference.
 *
 *      To further reduce gas costs, most functions on slice that need to return
 *      a slice modify the original one instead of allocating a new one; for
 *      instance, `s.split(".")` will return the text up to the first '.',
 *      modifying s to only contain the remainder of the string after the '.'.
 *      In situations where you do not want to modify the original slice, you
 *      can make a copy first with `.copy()`, for example:
 *      `s.copy().split(".")`. Try and avoid using this idiom in loops; since
 *      Solidity has no memory management, it will result in allocating many
 *      short-lived slices that are later discarded.
 *
 *      Functions that return two slices come in two versions: a non-allocating
 *      version that takes the second slice as an argument, modifying it in
 *      place, and an allocating version that allocates and returns the second
 *      slice; see `nextRune` for example.
 *
 *      Functions that have to copy string data will return strings rather than
 *      slices; these can be cast back to slices for further processing if
 *      required.
 *
 *      For convenience, some functions are provided with non-modifying
 *      variants that create a new slice and return both; for instance,
 *      `s.splitNew('.')` leaves s unmodified, and returns two values
 *      corresponding to the left and right parts of the string.
 */

pragma solidity ^0.8.0;

library strings {
  struct slice {
    uint256 _len;
    uint256 _ptr;
  }

  function memcpy(uint256 dest, uint256 src, uint256 _len) private pure {
    // Copy word-length chunks while possible
    for (; _len >= 32; _len -= 32) {
      assembly {
        mstore(dest, mload(src))
      }
      dest += 32;
      src += 32;
    }

    // Copy remaining bytes
    uint256 mask = type(uint256).max;
    if (_len > 0) {
      mask = 256 ** (32 - _len) - 1;
    }
    assembly {
      let srcpart := and(mload(src), not(mask))
      let destpart := and(mload(dest), mask)
      mstore(dest, or(destpart, srcpart))
    }
  }

  /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
  function toSlice(string memory self) internal pure returns (slice memory) {
    uint256 ptr;
    assembly {
      ptr := add(self, 0x20)
    }
    return slice(bytes(self).length, ptr);
  }

  /*
     * @dev Returns the length of a null-terminated bytes32 string.
     * @param self The value to find the length of.
     * @return The length of the string, from 0 to 32.
     */
  function len(bytes32 self) internal pure returns (uint256) {
    uint256 ret;
    if (self == 0) {
      return 0;
    }
    if (uint256(self) & type(uint128).max == 0) {
      ret += 16;
      self = bytes32(uint256(self) / 0x100000000000000000000000000000000);
    }
    if (uint256(self) & type(uint64).max == 0) {
      ret += 8;
      self = bytes32(uint256(self) / 0x10000000000000000);
    }
    if (uint256(self) & type(uint32).max == 0) {
      ret += 4;
      self = bytes32(uint256(self) / 0x100000000);
    }
    if (uint256(self) & type(uint16).max == 0) {
      ret += 2;
      self = bytes32(uint256(self) / 0x10000);
    }
    if (uint256(self) & type(uint8).max == 0) {
      ret += 1;
    }
    return 32 - ret;
  }

  /*
     * @dev Returns a slice containing the entire bytes32, interpreted as a
     *      null-terminated utf-8 string.
     * @param self The bytes32 value to convert to a slice.
     * @return A new slice containing the value of the input argument up to the
     *         first null.
     */
  function toSliceB32(bytes32 self) internal pure returns (slice memory ret) {
    // Allocate space for `self` in memory, copy it there, and point ret at it
    assembly {
      let ptr := mload(0x40)
      mstore(0x40, add(ptr, 0x20))
      mstore(ptr, self)
      mstore(add(ret, 0x20), ptr)
    }
    ret._len = len(self);
  }

  /*
     * @dev Returns a new slice containing the same data as the current slice.
     * @param self The slice to copy.
     * @return A new slice containing the same data as `self`.
     */
  function copy(slice memory self) internal pure returns (slice memory) {
    return slice(self._len, self._ptr);
  }

  /*
     * @dev Copies a slice to a new string.
     * @param self The slice to copy.
     * @return A newly allocated string containing the slice's text.
     */
  function toString(slice memory self) internal pure returns (string memory) {
    string memory ret = new string(self._len);
    uint256 retptr;
    assembly {
      retptr := add(ret, 32)
    }

    memcpy(retptr, self._ptr, self._len);
    return ret;
  }

  /*
     * @dev Returns the length in runes of the slice. Note that this operation
     *      takes time proportional to the length of the slice; avoid using it
     *      in loops, and call `slice.empty()` if you only need to know whether
     *      the slice is empty or not.
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
  function len(slice memory self) internal pure returns (uint256 l) {
    // Starting at ptr-31 means the LSB will be the byte we care about
    uint256 ptr = self._ptr - 31;
    uint256 end = ptr + self._len;
    for (l = 0; ptr < end; l++) {
      uint8 b;
      assembly {
        b := and(mload(ptr), 0xFF)
      }
      if (b < 0x80) {
        ptr += 1;
      } else if (b < 0xE0) {
        ptr += 2;
      } else if (b < 0xF0) {
        ptr += 3;
      } else if (b < 0xF8) {
        ptr += 4;
      } else if (b < 0xFC) {
        ptr += 5;
      } else {
        ptr += 6;
      }
    }
  }

  /*
     * @dev Returns true if the slice is empty (has a length of 0).
     * @param self The slice to operate on.
     * @return True if the slice is empty, False otherwise.
     */
  function empty(slice memory self) internal pure returns (bool) {
    return self._len == 0;
  }

  /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two slices are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first slice to compare.
     * @param other The second slice to compare.
     * @return The result of the comparison.
     */
  function compare(slice memory self, slice memory other) internal pure returns (int256) {
    uint256 shortest = self._len;
    if (other._len < self._len) {
      shortest = other._len;
    }

    uint256 selfptr = self._ptr;
    uint256 otherptr = other._ptr;
    for (uint256 idx = 0; idx < shortest; idx += 32) {
      uint256 a;
      uint256 b;
      assembly {
        a := mload(selfptr)
        b := mload(otherptr)
      }
      if (a != b) {
        // Mask out irrelevant bytes and check again
        uint256 mask = type(uint256).max; // 0xffff...
        if (shortest < 32) {
          mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
        }
        unchecked {
          uint256 diff = (a & mask) - (b & mask);
          if (diff != 0) {
            return int256(diff);
          }
        }
      }
      selfptr += 32;
      otherptr += 32;
    }
    return int256(self._len) - int256(other._len);
  }

  /*
     * @dev Returns true if the two slices contain the same text.
     * @param self The first slice to compare.
     * @param self The second slice to compare.
     * @return True if the slices are equal, false otherwise.
     */
  function equals(slice memory self, slice memory other) internal pure returns (bool) {
    return compare(self, other) == 0;
  }

  /*
     * @dev Extracts the first rune in the slice into `rune`, advancing the
     *      slice to point to the next rune and returning `self`.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
  function nextRune(slice memory self, slice memory rune)
    internal
    pure
    returns (slice memory)
  {
    rune._ptr = self._ptr;

    if (self._len == 0) {
      rune._len = 0;
      return rune;
    }

    uint256 l;
    uint256 b;
    // Load the first byte of the rune into the LSBs of b
    assembly {
      b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF)
    }
    if (b < 0x80) {
      l = 1;
    } else if (b < 0xE0) {
      l = 2;
    } else if (b < 0xF0) {
      l = 3;
    } else {
      l = 4;
    }

    // Check for truncated codepoints
    if (l > self._len) {
      rune._len = self._len;
      self._ptr += self._len;
      self._len = 0;
      return rune;
    }

    self._ptr += l;
    self._len -= l;
    rune._len = l;
    return rune;
  }

  /*
     * @dev Returns the first rune in the slice, advancing the slice to point
     *      to the next rune.
     * @param self The slice to operate on.
     * @return A slice containing only the first rune from `self`.
     */
  function nextRune(slice memory self) internal pure returns (slice memory ret) {
    nextRune(self, ret);
  }

  /*
     * @dev Returns the number of the first codepoint in the slice.
     * @param self The slice to operate on.
     * @return The number of the first codepoint in the slice.
     */
  function ord(slice memory self) internal pure returns (uint256 ret) {
    if (self._len == 0) {
      return 0;
    }

    uint256 word;
    uint256 length;
    uint256 divisor = 2 ** 248;

    // Load the rune into the MSBs of b
    assembly {
      word := mload(mload(add(self, 32)))
    }
    uint256 b = word / divisor;
    if (b < 0x80) {
      ret = b;
      length = 1;
    } else if (b < 0xE0) {
      ret = b & 0x1F;
      length = 2;
    } else if (b < 0xF0) {
      ret = b & 0x0F;
      length = 3;
    } else {
      ret = b & 0x07;
      length = 4;
    }

    // Check for truncated codepoints
    if (length > self._len) {
      return 0;
    }

    for (uint256 i = 1; i < length; i++) {
      divisor = divisor / 256;
      b = (word / divisor) & 0xFF;
      if (b & 0xC0 != 0x80) {
        // Invalid UTF-8 sequence
        return 0;
      }
      ret = (ret * 64) | (b & 0x3F);
    }

    return ret;
  }

  /*
     * @dev Returns the keccak-256 hash of the slice.
     * @param self The slice to hash.
     * @return The hash of the slice.
     */
  function keccak(slice memory self) internal pure returns (bytes32 ret) {
    assembly {
      ret := keccak256(mload(add(self, 32)), mload(self))
    }
  }

  /*
     * @dev Returns true if `self` starts with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
  function startsWith(slice memory self, slice memory needle)
    internal
    pure
    returns (bool)
  {
    if (self._len < needle._len) {
      return false;
    }

    if (self._ptr == needle._ptr) {
      return true;
    }

    bool equal;
    assembly {
      let length := mload(needle)
      let selfptr := mload(add(self, 0x20))
      let needleptr := mload(add(needle, 0x20))
      equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
    }
    return equal;
  }

  /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
  function beyond(slice memory self, slice memory needle)
    internal
    pure
    returns (slice memory)
  {
    if (self._len < needle._len) {
      return self;
    }

    bool equal = true;
    if (self._ptr != needle._ptr) {
      assembly {
        let length := mload(needle)
        let selfptr := mload(add(self, 0x20))
        let needleptr := mload(add(needle, 0x20))
        equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
      }
    }

    if (equal) {
      self._len -= needle._len;
      self._ptr += needle._len;
    }

    return self;
  }

  /*
     * @dev Returns true if the slice ends with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
  function endsWith(slice memory self, slice memory needle) internal pure returns (bool) {
    if (self._len < needle._len) {
      return false;
    }

    uint256 selfptr = self._ptr + self._len - needle._len;

    if (selfptr == needle._ptr) {
      return true;
    }

    bool equal;
    assembly {
      let length := mload(needle)
      let needleptr := mload(add(needle, 0x20))
      equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
    }

    return equal;
  }

  /*
     * @dev If `self` ends with `needle`, `needle` is removed from the
     *      end of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
  function until(slice memory self, slice memory needle)
    internal
    pure
    returns (slice memory)
  {
    if (self._len < needle._len) {
      return self;
    }

    uint256 selfptr = self._ptr + self._len - needle._len;
    bool equal = true;
    if (selfptr != needle._ptr) {
      assembly {
        let length := mload(needle)
        let needleptr := mload(add(needle, 0x20))
        equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
      }
    }

    if (equal) {
      self._len -= needle._len;
    }

    return self;
  }

  // Returns the memory address of the first byte of the first occurrence of
  // `needle` in `self`, or the first byte after `self` if not found.
  function findPtr(uint256 selflen, uint256 selfptr, uint256 needlelen, uint256 needleptr)
    private
    pure
    returns (uint256)
  {
    uint256 ptr = selfptr;
    uint256 idx;

    if (needlelen <= selflen) {
      if (needlelen <= 32) {
        bytes32 mask;
        if (needlelen > 0) {
          mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
        }

        bytes32 needledata;
        assembly {
          needledata := and(mload(needleptr), mask)
        }

        uint256 end = selfptr + selflen - needlelen;
        bytes32 ptrdata;
        assembly {
          ptrdata := and(mload(ptr), mask)
        }

        while (ptrdata != needledata) {
          if (ptr >= end) {
            return selfptr + selflen;
          }
          ptr++;
          assembly {
            ptrdata := and(mload(ptr), mask)
          }
        }
        return ptr;
      } else {
        // For long needles, use hashing
        bytes32 hash;
        assembly {
          hash := keccak256(needleptr, needlelen)
        }

        for (idx = 0; idx <= selflen - needlelen; idx++) {
          bytes32 testHash;
          assembly {
            testHash := keccak256(ptr, needlelen)
          }
          if (hash == testHash) {
            return ptr;
          }
          ptr += 1;
        }
      }
    }
    return selfptr + selflen;
  }

  // Returns the memory address of the first byte after the last occurrence of
  // `needle` in `self`, or the address of `self` if not found.
  function rfindPtr(
    uint256 selflen,
    uint256 selfptr,
    uint256 needlelen,
    uint256 needleptr
  ) private pure returns (uint256) {
    uint256 ptr;

    if (needlelen <= selflen) {
      if (needlelen <= 32) {
        bytes32 mask;
        if (needlelen > 0) {
          mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
        }

        bytes32 needledata;
        assembly {
          needledata := and(mload(needleptr), mask)
        }

        ptr = selfptr + selflen - needlelen;
        bytes32 ptrdata;
        assembly {
          ptrdata := and(mload(ptr), mask)
        }

        while (ptrdata != needledata) {
          if (ptr <= selfptr) {
            return selfptr;
          }
          ptr--;
          assembly {
            ptrdata := and(mload(ptr), mask)
          }
        }
        return ptr + needlelen;
      } else {
        // For long needles, use hashing
        bytes32 hash;
        assembly {
          hash := keccak256(needleptr, needlelen)
        }
        ptr = selfptr + (selflen - needlelen);
        while (ptr >= selfptr) {
          bytes32 testHash;
          assembly {
            testHash := keccak256(ptr, needlelen)
          }
          if (hash == testHash) {
            return ptr + needlelen;
          }
          ptr -= 1;
        }
      }
    }
    return selfptr;
  }

  /*
     * @dev Modifies `self` to contain everything from the first occurrence of
     *      `needle` to the end of the slice. `self` is set to the empty slice
     *      if `needle` is not found.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
  function find(slice memory self, slice memory needle)
    internal
    pure
    returns (slice memory)
  {
    uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
    self._len -= ptr - self._ptr;
    self._ptr = ptr;
    return self;
  }

  /*
     * @dev Modifies `self` to contain the part of the string from the start of
     *      `self` to the end of the first occurrence of `needle`. If `needle`
     *      is not found, `self` is set to the empty slice.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
  function rfind(slice memory self, slice memory needle)
    internal
    pure
    returns (slice memory)
  {
    uint256 ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
    self._len = ptr - self._ptr;
    return self;
  }

  /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and `token` to everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
  function split(slice memory self, slice memory needle, slice memory token)
    internal
    pure
    returns (slice memory)
  {
    uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
    token._ptr = self._ptr;
    token._len = ptr - self._ptr;
    if (ptr == self._ptr + self._len) {
      // Not found
      self._len = 0;
    } else {
      self._len -= token._len + needle._len;
      self._ptr = ptr + needle._len;
    }
    return token;
  }

  /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and returning everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` up to the first occurrence of `delim`.
     */
  function split(slice memory self, slice memory needle)
    internal
    pure
    returns (slice memory token)
  {
    split(self, needle, token);
  }

  /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and `token` to everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
  function rsplit(slice memory self, slice memory needle, slice memory token)
    internal
    pure
    returns (slice memory)
  {
    uint256 ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
    token._ptr = ptr;
    token._len = self._len - (ptr - self._ptr);
    if (ptr == self._ptr) {
      // Not found
      self._len = 0;
    } else {
      self._len -= token._len + needle._len;
    }
    return token;
  }

  /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and returning everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` after the last occurrence of `delim`.
     */
  function rsplit(slice memory self, slice memory needle)
    internal
    pure
    returns (slice memory token)
  {
    rsplit(self, needle, token);
  }

  /*
     * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return The number of occurrences of `needle` found in `self`.
     */
  function count(slice memory self, slice memory needle)
    internal
    pure
    returns (uint256 cnt)
  {
    uint256 ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
    while (ptr <= self._ptr + self._len) {
      cnt++;
      ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr)
        + needle._len;
    }
  }

  /*
     * @dev Returns True if `self` contains `needle`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return True if `needle` is found in `self`, false otherwise.
     */
  function contains(slice memory self, slice memory needle) internal pure returns (bool) {
    return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
  }

  /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
  function concat(slice memory self, slice memory other)
    internal
    pure
    returns (string memory)
  {
    string memory ret = new string(self._len + other._len);
    uint256 retptr;
    assembly {
      retptr := add(ret, 32)
    }
    memcpy(retptr, self._ptr, self._len);
    memcpy(retptr + self._len, other._ptr, other._len);
    return ret;
  }

  /*
     * @dev Joins an array of slices, using `self` as a delimiter, returning a
     *      newly allocated string.
     * @param self The delimiter to use.
     * @param parts A list of slices to join.
     * @return A newly allocated string containing all the slices in `parts`,
     *         joined with `self`.
     */
  function join(slice memory self, slice[] memory parts)
    internal
    pure
    returns (string memory)
  {
    if (parts.length == 0) {
      return "";
    }

    uint256 length = self._len * (parts.length - 1);
    for (uint256 i = 0; i < parts.length; i++) {
      length += parts[i]._len;
    }

    string memory ret = new string(length);
    uint256 retptr;
    assembly {
      retptr := add(ret, 32)
    }

    for (uint256 i = 0; i < parts.length; i++) {
      memcpy(retptr, parts[i]._ptr, parts[i]._len);
      retptr += parts[i]._len;
      if (i < parts.length - 1) {
        memcpy(retptr, self._ptr, self._len);
        retptr += self._len;
      }
    }

    return ret;
  }
}

File 10 of 21 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
     *   {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
     *   a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the address zero.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 11 of 21 : IObeliskNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface IObeliskNFT {
  event TickerDeactivated(uint256 indexed tokenId, address indexed stakedPool);
  event TickerActivated(uint256 indexed tokenId, address indexed stakedPool);
  event TickerClaimed(uint256 indexed tokenId, address indexed stakedPool);
  event NameUpdated(uint256 indexed tokenId, string name);

  /**
   * @notice Claims the rewards for a given token ID.
   * @param _tokenId The ID of the token to claim rewards for.
   */
  function claim(uint256 _tokenId) external;

  /**
   * @notice Returns the identity information for a given token ID.
   * @param _tokenId The ID of the token to get identity information for.
   * @return identityInTicker_ The identity id in the ticker pools.
   * @return rewardReceiver_ The address that will receive the rewards.
   */
  function getIdentityInformation(uint256 _tokenId)
    external
    view
    returns (bytes32 identityInTicker_, address rewardReceiver_);
}

File 12 of 21 : ILiteTicker.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface ILiteTicker {
  error NotWrappedNFT();
  error NotDeposited();
  error AlreadyDeposited();

  event Deposited(address indexed wrappedNFT, uint256 indexed nftId);
  event Withdrawn(address indexed wrappedNFT, uint256 indexed nftId);

  /**
   * @dev Virtual deposit and withdraw functions for the wrapped NFTs.
   * @param _tokenId The ID of the NFT to deposit or withdraw.
   */
  function virtualDeposit(bytes32 _identity, uint256 _tokenId, address _receiver)
    external;

  /**
   * @dev Virtual withdraw function for the wrapped NFTs.
   * @param _tokenId The ID of the NFT to withdraw.
   * @param _ignoreRewards Whether to ignore the rewards and withdraw the NFT.
   * @dev The `_ignoreRewards` parameter is primarily used for Hashmasks. When
   * transferring or renaming their NFTs, any
   * claims made will result in the rewards being canceled and returned to the pool. This
   * mechanism is in place to
   * prevent exploitative farming.
   */
  function virtualWithdraw(
    bytes32 _identity,
    uint256 _tokenId,
    address _receiver,
    bool _ignoreRewards
  ) external;

  /**
   * @dev Claim function for the wrapped NFTs.
   * @param _tokenId The ID of the NFT to claim.
   */
  function claim(
    bytes32 _identity,
    uint256 _tokenId,
    address _receiver,
    bool _ignoreRewards
  ) external;

  /**
   * @dev Get the claimable rewards for a given identity.
   * @param _identity The identity of the NFT.
   * @param _extraRewards The extra rewards to add to the total for simulation purposes.
   * @return rewards_ The amount of rewards.
   * @return rewardsToken_ The address of the rewards token.
   */
  function getClaimableRewards(bytes32 _identity, uint256 _extraRewards)
    external
    view
    returns (uint256 rewards_, address rewardsToken_);
}

File 13 of 21 : INFTPass.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

interface INFTPass {
  error NoNeedToPay();
  error InvalidBPS();
  error MsgValueTooLow();
  error AlreadyClaimed();
  error InvalidProof();
  error NameTooLong();
  error ClaimingEnded();

  event NFTPassCreated(
    uint256 indexed nftId, string indexed name, address indexed receiver, uint256 cost
  );
  event NFTPassUpdated(
    uint256 indexed nftId, string indexed name, address indexed receiver
  );
  event MaxIdentityPerDayAtInitialPriceUpdated(uint32 newMaxIdentityPerDayAtInitialPrice);
  event PriceIncreaseThresholdUpdated(uint32 newPriceIncreaseThreshold);
  event PriceDecayBPSUpdated(uint32 newPriceDecayBPS);

  struct Metadata {
    string name;
    address walletReceiver;
    uint8 imageIndex;
  }

  /**
   * @param _name The name of the NFT Pass
   * @param _receiverWallet The wallet address that will receive the NFT Pass
   * @param merkleProof The Merkle proof for the NFT Pass
   */
  function claimPass(
    string calldata _name,
    address _receiverWallet,
    bytes32[] calldata merkleProof
  ) external;

  /**
   * @param _name The name of the NFT Pass
   * @param _receiverWallet The wallet address that will receive the NFT Pass
   */
  function create(string calldata _name, address _receiverWallet) external payable;

  /**
   * @param _nftId The ID of the NFT Pass
   * @param _name The name of the NFT Pass
   * @param _receiver The wallet address that will receive the NFT Pass
   * @dev It's nftId or Name, if nftId is 0, it will use the name to find the nftId
   */
  function updateReceiverAddress(uint256 _nftId, string calldata _name, address _receiver)
    external;

  /**
   * @return The cost of the NFT Pass
   */
  function getCost() external view returns (uint256);

  /**
   * @param _nftId The ID of the NFT Pass
   * @param _name The name of the NFT Pass
   */
  function getMetadata(uint256 _nftId, string calldata _name)
    external
    view
    returns (Metadata memory);
}

File 14 of 21 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 15 of 21 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.20;

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

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 16 of 21 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 17 of 21 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant HEX_DIGITS = "0123456789abcdef";
    uint8 private constant ADDRESS_LENGTH = 20;

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        uint256 localValue = value;
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = HEX_DIGITS[localValue & 0xf];
            localValue >>= 4;
        }
        if (localValue != 0) {
            revert StringsInsufficientHexLength(value, length);
        }
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 18 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 19 of 21 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

File 20 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 21 of 21 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

Settings
{
  "remappings": [
    "hero-tokens/test/=test/",
    "ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/",
    "forge-std/=node_modules/@layerzerolabs/toolbox-foundry/lib/forge-std/src/",
    "@layerzerolabs/=node_modules/@layerzerolabs/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "heroglyph-library/=node_modules/@layerzerolabs/toolbox-foundry/lib/heroglyph-library/src/",
    "@axelar-network/=node_modules/@axelar-network/",
    "@chainlink/=node_modules/@chainlink/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "hardhat-deploy/=node_modules/hardhat-deploy/",
    "hardhat/=node_modules/hardhat/",
    "solidity-bytes-utils/=node_modules/solidity-bytes-utils/",
    "@prb-math/=node_modules/@layerzerolabs/toolbox-foundry/lib/prb-math/",
    "@prb/math/=node_modules/@layerzerolabs/toolbox-foundry/lib/prb-math/",
    "@sablier/v2-core/=node_modules/@sablier/v2-core/",
    "@uniswap/v3-periphery/=node_modules/@layerzerolabs/toolbox-foundry/lib/v3-periphery/",
    "@uniswap/v3-core/=node_modules/@layerzerolabs/toolbox-foundry/lib/v3-core/",
    "atoumic/=node_modules/@layerzerolabs/toolbox-foundry/lib/atoumic/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_HCT","type":"address"},{"internalType":"address","name":"_nftPass","type":"address"},{"internalType":"address","name":"_inputCollection","type":"address"},{"internalType":"address","name":"_obeliskRegistry","type":"address"},{"internalType":"uint256","name":"_currentSupply","type":"uint256"},{"internalType":"uint32","name":"_collectionStartedUnixTime","type":"uint32"},{"internalType":"bool","name":"_premium","type":"bool"},{"internalType":"uint256","name":"_id","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyMinted","type":"error"},{"inputs":[],"name":"CannotTransferUnwrapFirst","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[],"name":"EmergencyModeIsActive","type":"error"},{"inputs":[],"name":"EmergencyWithdrawDisabled","type":"error"},{"inputs":[],"name":"FreeSlotAvailable","type":"error"},{"inputs":[],"name":"InvalidNameLength","type":"error"},{"inputs":[],"name":"InvalidWalletReceiver","type":"error"},{"inputs":[],"name":"NoFreeSlots","type":"error"},{"inputs":[],"name":"NotMinted","type":"error"},{"inputs":[],"name":"NotNFTHolder","type":"error"},{"inputs":[],"name":"NotNFTPassHolder","type":"error"},{"inputs":[],"name":"NotObeliskRegistry","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"SameMultiplier","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"EmergencyWithdrawEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"freeSlotLeft","type":"uint256"}],"name":"FreeSlotUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"newMultiplier","type":"uint128"}],"name":"MultiplierUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"NameUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"inputCollectionNFTId","type":"uint256"}],"name":"SlotBought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"stakedPool","type":"address"}],"name":"TickerActivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"stakedPool","type":"address"}],"name":"TickerClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"stakedPool","type":"address"}],"name":"TickerDeactivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Unwrapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Wrapped","type":"event"},{"inputs":[],"name":"COLLECTION_STARTED_UNIX_TIME","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FREE_SLOT_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FREE_SLOT_FOR_ODD","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HCT","outputs":[{"internalType":"contract IHCT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"INPUT_COLLECTION","outputs":[{"internalType":"contract ERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_NAME_BYTES_LENGTH","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NFT_PASS","outputs":[{"internalType":"contract INFTPass","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PREMIUM","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATE_PER_YEAR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SLOT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TICKER_SPLIT_STRING","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TICKER_START_IDENTITY","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TICKER_START_INDICE","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freeSlots","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getIdentityInformation","outputs":[{"internalType":"bytes32","name":"identityInTicker_","type":"bytes32"},{"internalType":"address","name":"rewardReceiver_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getLinkedTickers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getNFTData","outputs":[{"components":[{"internalType":"bool","name":"isMinted","type":"bool"},{"internalType":"bool","name":"hasBeenRenamed","type":"bool"},{"internalType":"bool","name":"wrappedOnce","type":"bool"},{"internalType":"uint128","name":"assignedMultiplier","type":"uint128"}],"internalType":"struct IWrappedNFTHero.NFTData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getPendingRewards","outputs":[{"internalType":"uint256[]","name":"pendingRewards_","type":"uint256[]"},{"internalType":"address[]","name":"pendingRewardsTokens_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWrapperMultiplier","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"names","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftPassAttached","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"obeliskRegistry","outputs":[{"internalType":"contract IObeliskRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_newName","type":"string"}],"name":"rename","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"updateMultiplier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_inputCollectionNFTId","type":"uint256"}],"name":"wrap","outputs":[],"stateMutability":"payable","type":"function"}]

6101803461050557601f613e3d38819003918201601f19168301916001600160401b038311848410176104075780849260409485528339610100938491810103126105055761004d81610525565b9061005a60208201610525565b92610066818301610525565b61007260608401610525565b9460808401519160a08501519663ffffffff881688036105055760c08601519586151587036105055760e001519685516100ab8161050a565b600e81526d577261707065644e46544865726f60901b60208201528651906100d28261050a565b60038252620ae9c960eb1b60208301528051906001600160401b0382116104075760005490600182811c921680156104fb575b60208310146103e75781601f84931161049e575b50602090601f83116001146104285760009261041d575b50508160011b916000199060031b1c1916176000555b8051906001600160401b0382116104075760015490600182811c921680156103fd575b60208310146103e75781601f849311610389575b50602090601f83116001146103155760009261030a575b50508160011b916000199060031b1c1916176001555b60016006556001600160a01b0391821660805292811660a05291821660c0521660e0819052906109c480820291801590830490911417156102f457600191612710839204600b55835160208101918252602081526102078161050a565b519020161493610120948552855261014091825261016092835251926138c3948561053a863960805185818161085f0152818161103b0152818161145d0152818161210e0152612a1f015260a051858181610f1c01528181611fc3015281816124b40152612935015260c05185818161134d01528181611a47015281816125a0015281816126af01528181612ed80152613016015260e0518581816104d5015281816116de015261205c0152518481816108040152611de7015251838181611143015261226301525182818161183201528181611dbd015261257201525181818161125001526114280152f35b634e487b7160e01b600052601160045260246000fd5b015190503880610194565b60016000908152600080516020613e1d8339815191529350601f198516905b8181106103715750908460019594939210610358575b505050811b016001556101aa565b015160001960f88460031b161c1916905538808061034a565b92936020600181928786015181550195019301610334565b6001600052909150600080516020613e1d833981519152601f840160051c810191602085106103dd575b90601f859493920160051c01905b8181106103ce575061017d565b600081558493506001016103c1565b90915081906103b3565b634e487b7160e01b600052602260045260246000fd5b91607f1691610169565b634e487b7160e01b600052604160045260246000fd5b015190503880610130565b60008080529350600080516020613dfd83398151915291905b601f1984168510610483576001945083601f1981161061046a575b505050811b01600055610146565b015160001960f88460031b161c1916905538808061045c565b81810151835560209485019460019093019290910190610441565b60008052909150600080516020613dfd833981519152601f840160051c810191602085106104f1575b90601f859493920160051c01905b8181106104e25750610119565b600081558493506001016104d5565b90915081906104c7565b91607f1691610105565b600080fd5b604081019081106001600160401b0382111761040757604052565b51906001600160a01b03821682036105055756fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a7146102e757806306fdde03146102e257806307eefa09146102dd578063081812fc146102d8578063095ea7b3146102d35780630ad4c4f4146102ce578063150b7a02146102c957806321ac8eb4146102c457806323b872dd146102bf5780632da2d6e1146102ba57806330866abe146102b557806336301533146102b0578063379607f5146102ab5780633ec2d836146102a657806342842e0e146102a15780634622ab031461029c5780635747e69f146102975780635cec72a4146102925780635f7c95311461028d5780635ffe6146146102885780636352211e1461028357806370a082311461027e57806370ec6e1b1461027957806388124bd914610274578063947d56101461026f57806395d89b411461026a5780639915e23d14610265578063a22cb46514610260578063a50053901461025b578063b153673014610256578063b3cea21714610251578063b449810f1461024c578063b88d4fde14610247578063b90aac9c14610242578063bb5f943f1461023d578063c15319bf14610238578063c24dbebd14610233578063c87b56dd1461022e578063d2d4d77d14610229578063de0e9a3e14610224578063e985e9c51461021f578063ea3696ca1461021a578063ea598cb014610215578063f3239a18146102105763f9f87c181461020b57600080fd5b6118da565b61186e565b611857565b61181a565b6117b2565b6115f7565b6115db565b6113d8565b6113b5565b611399565b611337565b61131b565b611291565b611273565b611238565b6111b6565b61112b565b61106a565b611025565b610f7e565b610f4b565b610f06565b610eda565b610e7d565b610e4d565b610e18565b610dec565b610dc9565b610da6565b610d66565b610c54565b610b38565b6108d3565b61084b565b610828565b6107e7565b6107d0565b610787565b61071a565b610656565b610553565b610504565b6104bf565b6103d8565b610303565b6001600160e01b03198116036102fe57565b600080fd5b346102fe5760203660031901126102fe576020600435610322816102ec565b63ffffffff60e01b166380ac58cd60e01b8114908115610360575b811561034f575b506040519015158152f35b6301ffc9a760e01b14905038610344565b635b5e139f60e01b8114915061033d565b60009103126102fe57565b60005b83811061038f5750506000910152565b818101518382015260200161037f565b906020916103b88151809281855285808601910161037c565b601f01601f1916010190565b9060206103d592818152019061039f565b90565b346102fe576000806003193601126104bc5760405190808054906103fb82610c87565b8085529160209160019182811690811561048f5750600114610438575b6104348661042881880382610ac5565b604051918291826103c4565b0390f35b80809550527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b83851061047c575050505081016020016104288261043438610418565b805486860184015293820193810161045f565b90508695506104349693506020925061042894915060ff191682840152151560051b820101929338610418565b80fd5b346102fe5760003660031901126102fe576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346102fe5760203660031901126102fe576004356105218161233e565b506000526004602052602060018060a01b0360406000205416604051908152f35b6001600160a01b038116036102fe57565b346102fe5760403660031901126102fe5760043561057081610542565b6024359061057d8261233e565b33151580610643575b80610615575b6105fd576105fb926105dc9181906001600160a01b0385811691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a46000526004602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b005b60405163a9fbf51f60e01b8152336004820152602490fd5b506001600160a01b038116600090815260056020908152604080832033845290915290205460ff161561058c565b506001600160a01b038116331415610586565b346102fe5760203660031901126102fe576104346040806060815161067a81610a41565b6000918183809352826020820152828582015201526004358152600c60205220906001600160801b038151926106af84610a41565b5460ff81161515845260ff8160081c161515602085015260ff8160101c1615158385015260181c166060830152519182918291909160606001600160801b03816080840195805115158552602081015115156020860152604081015115156040860152015116910152565b346102fe5760803660031901126102fe57610736600435610542565b610741602435610542565b6064356001600160401b038082116102fe57366023830112156102fe5781600401359081116102fe57369101602401116102fe57604051630a85bd0160e11b8152602090f35b346102fe5760003660031901126102fe5760206040516109c48152f35b60609060031901126102fe576004356107bc81610542565b906024356107c981610542565b9060443590565b346102fe576105fb6107e1366107a4565b916119f6565b346102fe5760003660031901126102fe57602060405163ffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346102fe5760003660031901126102fe5760206040516705f7aab8c56b00008152f35b346102fe576000806003193601126104bc577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036108c157600160ff19600a541617600a557f251f6d17a349e94e170ba983a0d79962271c3be5fe0c255d050ddc40f35aa8758180a180f35b6040516356620d4b60e11b8152600490fd5b346102fe5760203660031901126102fe5760048035906108f1612379565b61090d610908836000526008602052604060002090565b611b76565b9161091f61091a8261239c565b611bd0565b6109288161244c565b939060005b8251811015610a21576109626109566109566109498487611bed565b516001600160a01b031690565b6001600160a01b031690565b90813b156102fe5760408051632f79b7e960e11b8152808801858152602081018890526001600160a01b038a16928101929092526000606083018190529093909184919082908490829060800103925af1918215610a1c57600192610a03575b50818060a01b036109d66109498387611bed565b16857fb4ce698fd4c4f80fa2d06d863ce77e9c0fdf8e24c64ecfbb8c852ed20000430b600080a30161092d565b80610a10610a1692610a61565b80610371565b386109c2565b611c17565b6105fb6001600655565b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b03821117610a5c57604052565b610a2b565b6001600160401b038111610a5c57604052565b606081019081106001600160401b03821117610a5c57604052565b604081019081106001600160401b03821117610a5c57604052565b602081019081106001600160401b03821117610a5c57604052565b90601f801991011681019081106001600160401b03821117610a5c57604052565b6001600160401b038111610a5c57601f01601f191660200190565b929192610b0d82610ae6565b91610b1b6040519384610ac5565b8294818452818301116102fe578281602093846000960137010152565b346102fe5760403660031901126102fe576004356024356001600160401b0381116102fe57366023820112156102fe57610b7c903690602481600401359101610b01565b80518015908115610c49575b50610c3757610c1a82610b9d6105fb94612526565b610ba68161263b565b50806000526009602052610bbd6040600020611c23565b610c1f575b610bd78382610bd182826128bf565b906129c9565b807f70a8f52a5cc7cf2d25e71645299888cb2ed1590225e7fca72f35ac61cf61d32460405180610c0787826103c4565b0390a26000526009602052604060002090565b611c89565b610c3281610c2c8161244c565b90612779565b610bc2565b604051631ae3550b60e01b8152600490fd5b601d91501138610b88565b346102fe576105fb610c65366107a4565b9060405192610c7384610aaa565b60008452610c828383836119f6565b612dfe565b90600182811c92168015610cb7575b6020831014610ca157565b634e487b7160e01b600052602260045260246000fd5b91607f1691610c96565b90604051918260008254610cd481610c87565b90818452602094600191600181169081600014610d445750600114610d05575b505050610d0392500383610ac5565b565b600090815285812095935091905b818310610d2c575050610d039350820101388080610cf4565b85548884018501529485019487945091830191610d13565b92505050610d0394925060ff191682840152151560051b820101388080610cf4565b346102fe5760203660031901126102fe576004356000526009602052610434610d926040600020610cc1565b60405191829160208352602083019061039f565b346102fe5760003660031901126102fe57602060ff600a54166040519015158152f35b346102fe5760003660031901126102fe57602060405167016345785d8a00008152f35b346102fe5760203660031901126102fe576004356000526007602052610434610d926040600020610cc1565b346102fe5760203660031901126102fe57610e3460043561263b565b15610e3b57005b604051633536de7360e21b8152600490fd5b346102fe5760203660031901126102fe576020610e6b60043561233e565b6040516001600160a01b039091168152f35b346102fe5760203660031901126102fe57600435610e9a81610542565b6001600160a01b03168015610ec15760005260036020526020604060002054604051908152f35b6040516322718ad960e21b815260006004820152602490fd5b346102fe5760003660031901126102fe576020610ef5611dbb565b6001600160801b0360405191168152f35b346102fe5760003660031901126102fe576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346102fe5760203660031901126102fe576040610f6960043561244c565b82519182526001600160a01b03166020820152f35b346102fe576000806003193601126104bc5760405190806001805490610fa382610c87565b808652926020926001811690811561048f5750600114610fcd576104348661042881880382610ac5565b9350600184527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b838510611012575050505081016020016104288261043438610418565b8054868601840152938201938101610ff5565b346102fe5760003660031901126102fe576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346102fe5760403660031901126102fe5760043561108781610542565b602435801515908181036102fe576001600160a01b03831692831561111257906110d36110e49233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b6040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b604051630b61174360e31b815260048101859052602490fd5b346102fe5760003660031901126102fe5760206040517f000000000000000000000000000000000000000000000000000000000000000015158152f35b90815180825260208080930193019160005b828110611188575050505090565b83516001600160a01b03168552938101939281019260010161117a565b9060206103d5928181520190611168565b346102fe576020806003193601126102fe5760043560005260086020526040600020906040519081602084549182815201936000526020600020916000905b828210611218576104348561120c81890382610ac5565b604051918291826111a5565b83546001600160a01b0316865294850194600193840193909101906111f5565b346102fe5760003660031901126102fe5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346102fe5760003660031901126102fe576020600b54604051908152f35b346102fe5760803660031901126102fe576004356112ae81610542565b602435906112bb82610542565b604435606435926001600160401b0384116102fe57366023850112156102fe576112f26105fb943690602481600401359101610b01565b92610c828383836119f6565b6040519061130b82610a8f565b60018252602360f81b6020830152565b346102fe5760003660031901126102fe57610434610d926112fe565b346102fe5760003660031901126102fe576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b6040519061138982610a8f565b60018252600b60fa1b6020830152565b346102fe5760003660031901126102fe57610434610d9261137c565b346102fe5760003660031901126102fe5760206040516729a2241af62c00008152f35b346102fe5760203660031901126102fe5761141161140c6004356113fb8161233e565b506000526009602052604060002090565b610cc1565b8051156115b0575b60405163320734f160e11b81527f00000000000000000000000000000000000000000000000000000000000000006004820152906000826024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa8015610a1c576114cd6115819261153861152a610428946104349760009161158d575b50604051683d913730b6b2911d1160b91b60208201529485946114c791906029870183565b90611eec565b7f222c226465736372697074696f6e223a22577261707065642056657273696f6e81527f206f6620616e2065787465726e616c20636f6c6c656374696f6e222c22696d6160208201526433b2911d1160d91b604082015260450190565b61227d60f01b815260020190565b039061154c601f1992838101835282610ac5565b6040517f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c00000000006020820152938491603b83016114c7565b03908101835282610ac5565b6115aa91503d806000833e6115a28183610ac5565b810190611ec7565b386114a2565b506115b9611e62565b611419565b604051906115cb82610a8f565b60018252600160fe1b6020830152565b346102fe5760003660031901126102fe57610434610d926115be565b346102fe5760203660031901126102fe5760043561161f81600052600c602052604060002090565b61163161162d825460ff1690565b1590565b6117a05761165961164c836000526002602052604060002090565b546001600160a01b031690565b6001600160a01b039190339083160361178e576116dc9061167f61162d600a5460ff1690565b61177c575b61168d84612e95565b6116a96116a4856000526009602052604060002090565b611f03565b6116c06116a4856000526007602052604060002090565b805472ffffffffffffffffffffffffffffffff0000ff19169055565b7f00000000000000000000000000000000000000000000000000000000000000001690813b156102fe57604051632142170760e11b81523060048201523360248201526044810182905260009283908290606490829084905af18015610a1c57611769575b507fbeaa92c6354c6dcf375d2c514352b2c11bc865784722e5dd9b267e606eb5fc5f8280a280f35b80610a1061177692610a61565b38611741565b61178984610c2c8161244c565b611684565b604051633617438360e11b8152600490fd5b604051634d5e5fb360e01b8152600490fd5b346102fe5760403660031901126102fe57602060ff61180e6004356117d681610542565b602435906117e382610542565b60018060a01b03166000526005845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b346102fe5760003660031901126102fe5760206040517f000000000000000000000000000000000000000000000000000000000000000015158152f35b60203660031901126102fe576105fb600435611f8e565b346102fe5760003660031901126102fe576020604051601d8152f35b9092916040820191604081528451809352606081019260208096019060005b8181106118c6575050506103d59394506020818403910152611168565b8251865294870194918701916001016118a9565b346102fe5760203660031901126102fe576004803561190f611909610908836000526008602052604060002090565b9161244c565b5061191a82516122f0565b61192483516122f0565b9360005b84518110156119e7576119446109566109566109498489611bed565b60408051633506307760e21b81528481018781526000602082015291939290918491839182908190850103915afa8015610a1c576001936119af9260009182936119b5575b50506119958488611bed565b526119a0838a611bed565b6001600160a01b039091169052565b01611928565b6119d8935080919250903d106119e0575b6119d08183610ac5565b810190612322565b903880611989565b503d6119c6565b6040518061043488868361188a565b91906001600160a01b039081811615611b5d57611a1d83600052600c602052604060002090565b9082611a3661164c866000526002602052604060002090565b16611b4b57611a43611dbb565b90837f000000000000000000000000000000000000000000000000000000000000000016803b156102fe57604051631093e42d60e01b81526001600160a01b03831660048201526001600160801b038416602482015260016044820152906000908290606490829084905af18015610a1c57611af984611adf611b049689988b9660008051602061386e83398151915296611b38575b50611f4c565b6040516001600160801b0390911681529081906020820190565b0390a28433916132d1565b9316921690828203611b1557505050565b60649350604051926364283d7b60e01b8452600484015260248301526044820152fd5b80610a10611b4592610a61565b38611ad9565b604051631a05867560e21b8152600490fd5b604051633250574960e11b815260006004820152602490fd5b90604051918281549182825260209260208301916000526020600020936000905b828210611bad57505050610d0392500383610ac5565b85546001600160a01b031684526001958601958895509381019390910190611b97565b15611bd757565b634e487b7160e01b600052600160045260246000fd5b8051821015611c015760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b6040513d6000823e3d90fd5b6103d59054610c87565b818110611c38575050565b60008155600101611c2d565b9190601f8111611c5357505050565b610d03926000526020600020906020601f840160051c83019310611c7f575b601f0160051c0190611c2d565b9091508190611c72565b91909182516001600160401b038111610a5c57611cb081611caa8454610c87565b84611c44565b602080601f8311600114611cf357508190611ce4939495600092611ce8575b50508160011b916000199060031b1c19161790565b9055565b015190503880611ccf565b90601f19831695611d0985600052602060002090565b926000905b888210611d4657505083600195969710611d2d575b505050811b019055565b015160001960f88460031b161c19169055388080611d23565b80600185968294968601518155019501930190611d0e565b634e487b7160e01b600052601160045260246000fd5b600019810191908211611d8357565b611d5e565b6020039060208211611d8357565b91908203918211611d8357565b600381901b91906001600160fd1b03811603611d8357565b7f0000000000000000000000000000000000000000000000000000000000000000611e565763ffffffff7f0000000000000000000000000000000000000000000000000000000000000000164203428111611d83576301e187e090046705f7aab8c56b000090818102918183041490151715611d83576001600160801b03906729a2241af62c000080821015611e5057501690565b90501690565b6729a2241af62c000090565b60405190611e6f82610a8f565b6007825266155b9b985b595960ca1b6020830152565b81601f820112156102fe578051611e9b81610ae6565b92611ea96040519485610ac5565b818452602082840101116102fe576103d5916020808501910161037c565b906020828203126102fe5781516001600160401b0381116102fe576103d59201611e85565b90611eff6020928281519485920161037c565b0190565b611f0d8154610c87565b9081611f17575050565b81601f60009311600114611f29575055565b908083918252611f48601f60208420940160051c840160018501611c2d565b5555565b906301000000600160981b0382549160181b16906301000000600160981b031916179055565b908160209103126102fe575190565b8015611d83576000190190565b600a5460ff166122c757604080516370a0823160e01b81523360048083019190915291906001600160a01b03906020816024817f000000000000000000000000000000000000000000000000000000000000000086165afa908115610a1c57600091612298575b501561228a57600b5415158061225a575b61201a85600052600c602052604060002090565b805460ff808260101c16911661224a5782159283612243575b8061223a575b61222a578280612222575b80612210575b61220057815460ff19166001178255837f000000000000000000000000000000000000000000000000000000000000000016803b156102fe5785516323b872dd60e01b815233818901908152306020820152604081018a9052909160009183919082908490829060600103925af18015610a1c576121ed575b506120ce8733612fb3565b867f5b8cd8f3a67af1dee11ad4321a05f79a76cc7ea517810fc56d6d96c1e60d3686600080a26121e557805462ff000019166201000017905515612192577f000000000000000000000000000000000000000000000000000000000000000016803b156102fe576000915192838092633d3dd45b60e21b825234905af18015610a1c5761217f575b50337f38e5238102ce2a59567903a1637a95729503851bddda3a844436f29c80ee6e52600080a3565b80610a1061218c92610a61565b38612156565b507fa0af932cc5cbdd6147bf8bdcaea54634cf27abe631044f1f4f9f2daddaf3567792506121e091506121ce6121c9600b54611f81565b600b55565b600b5490519081529081906020820190565b0390a1565b505050505050565b80610a106121fa92610a61565b386120c3565b8451635d197e5160e01b81528690fd5b5067016345785d8a000034141561204a565b508015612044565b84516378fc2c5160e01b81528690fd5b50341515612039565b5080612033565b8451631bbdf5c560e31b81528690fd5b506001808516147f0000000000000000000000000000000000000000000000000000000000000000151514612006565b5051635c95168760e11b8152fd5b6122ba915060203d6020116122c0575b6122b28183610ac5565b810190611f72565b38611ff5565b503d6122a8565b60405163c3603d0960e01b8152600490fd5b6001600160401b038111610a5c5760051b60200190565b906122fa826122d9565b6123076040519182610ac5565b8281528092612318601f19916122d9565b0190602036910137565b91908260409103126102fe57602082519201516103d581610542565b6000818152600260205260409020546001600160a01b0316908115612361575090565b60249060405190637e27328960e01b82526004820152fd5b60026006541461238a576002600655565b604051633ee5aeb560e01b8152600490fd5b6000908152600260205260409020546001600160a01b0316330361178e57600190565b906020828203126102fe5781516001600160401b03928382116102fe57016060818303126102fe57604051926123f484610a74565b81519081116102fe5760409261240b918301611e85565b8352602081015161241b81610542565b6020840152015160ff811681036102fe57604082015290565b9060406103d59260008152816020820152019061039f565b60005260076020526124616040600020610cc1565b906124b0600060405160208101906020825261249281612484604082018961039f565b03601f198101835282610ac5565b51902093604051809381926365a3ccf960e11b835260048301612434565b03817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a1c576103d591602091600091612503575b5001516001600160a01b031690565b61252091503d806000833e6125188183610ac5565b8101906123bf565b386124f4565b61253a81600052600c602052604060002090565b80549160ff8316156117a05761164c61255d916000526002602052604060002090565b6001600160a01b039290339084160361178e577f00000000000000000000000000000000000000000000000000000000000000009081612613575b5061260357507f000000000000000000000000000000000000000000000000000000000000000016803b156102fe57604051634b1946fb60e01b8152336004820152906000908290602490829084905af18015610a1c576125f65750565b80610a10610d0392610a61565b805461ff00191661010017905550565b60ff915060081c161538612598565b6001600160801b039182169082160391908211611d8357565b61264f81600052600c602052604060002090565b61266661164c836000526002602052604060002090565b6001600160a01b039190339083160361178e57612695612684611dbb565b915460181c6001600160801b031690565b916001600160801b0380841690831614612770576126d6907f0000000000000000000000000000000000000000000000000000000000000000169282612622565b91803b156102fe57604051631093e42d60e01b81523360048201526001600160801b03939093166024840152600060448401819052908390606490829084905af1908115610a1c5760008051602061386e833981519152926127559261275d575b50611adf8161275086600052600c602052604060002090565b611f4c565b0390a2600190565b80610a1061276a92610a61565b38612737565b50505050600090565b909291612784612379565b61279b610908826000526008602052604060002090565b6127b76127b2836000526008602052604060002090565b61287e565b60005b815181101561286e576001600160a01b036127d86109498385611bed565b1690813b156102fe5760405163bcfb29af60e01b815260048101869052602481018590526001600160a01b03881660448201526000606482018190529092908360848183855af1928315610a1c5760019361285b575b50847f1e7dc9151e44edb4fc142dbf645faec2bf01b5de5e0ac6cd20e90ef5d0422871600080a3016127ba565b80610a1061286892610a61565b3861282e565b505050509050610d036001600655565b8054600082558061288d575050565b610d0391600052602060002090810190611c2d565b604051906128af82610a8f565b60018252600160fd1b6020830152565b91906129036128f26128d361290893613487565b6128ed6128e66128e16115be565b613487565b80926134ad565b6134ee565b6128fd6128e16128a2565b90613565565b6135ee565b6040516365a3ccf960e11b81526001600160a01b039390600081806129308660048301612434565b0381887f0000000000000000000000000000000000000000000000000000000000000000165afa908115610a1c5761297b91602091600091612503575001516001600160a01b031690565b938416156129b75781610c1a61299b926000526007602052604060002090565b6040516129b0816124846020820194856103c4565b5190209190565b604051631d538a9160e01b8152600490fd5b9193926128f26129de6129ec926128e1612379565b6128ed6128e66128e16112fe565b906129f86128e161137c565b92612a13612a0e612a0986866136b2565b612bb8565b6122f0565b936001600160a01b03937f00000000000000000000000000000000000000000000000000000000000000008516919060005b8751811015612b8a57612a5b6129038484613565565b90815115612b81576040918251906386304ba960e01b8252602091828180612a876004958683016103c4565b03818b5afa928315610a1c57600093612b52575b5050898216918b8315612b4557906119a085612ab693611bed565b813b156102fe57925163067a619d60e51b8152928301878152602081018d90526001600160a01b038916604082015260009084908190606001038183855af1928315610a1c57600193612b32575b508b7fc0011caead85c5a7acde281295df035f6bfe8aa69af2b3d723cf601f99cfa797600080a35b01612a45565b80610a10612b3f92610a61565b38612b04565b5050505060019150612b2c565b612b72929350803d10612b7a575b612b6a8183610ac5565b810190612bd3565b903880612a9b565b503d612b60565b60019150612b2c565b50505050505050612ba9612bae92936000526008602052604060002090565b612be8565b610d036001600655565b9060018201809211611d8357565b91908201809211611d8357565b908160209103126102fe57516103d581610542565b8151916001600160401b038311610a5c57680100000000000000008311610a5c578154838355808410612c52575b5060208091019160005260206000209060005b848110612c37575050505050565b83516001600160a01b03168382015592810192600101612c29565b612c6a90836000528460206000209182019101611c2d565b38612c16565b908160209103126102fe57516103d5816102ec565b6103d5939260809260018060a01b03168252600060208301526040820152816060820152019061039f565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526103d59291019061039f565b3d15612d0c573d90612cf282610ae6565b91612d006040519384610ac5565b82523d6000602084013e565b606090565b91823b612d1d57505050565b6020612d409160405180938192630a85bd0160e11b968784523360048501612c85565b038160006001600160a01b0388165af160009181612dcd575b50612d985782612d67612ce1565b8051919082612d9157604051633250574960e11b81526001600160a01b0383166004820152602490fd5b9050602001fd5b6001600160e01b03191603612daa5750565b604051633250574960e11b81526001600160a01b03919091166004820152602490fd5b612df091925060203d602011612df7575b612de88183610ac5565b810190612c70565b9038612d59565b503d612dde565b91929092833b612e0f575b50505050565b612e34916020916040519384928392630a85bd0160e11b978885523360048601612cb0565b038160006001600160a01b0388165af160009181612e74575b50612e5b5782612d67612ce1565b6001600160e01b03191603612daa575038808080612e09565b612e8e91925060203d602011612df757612de88183610ac5565b9038612e4d565b612ea981600052600c602052604060002090565b60008281526002602052604090206001600160a01b03919082905416906001600160801b03815460181c1691837f00000000000000000000000000000000000000000000000000000000000000001692833b156102fe5760405163402412bf60e11b81526001600160a01b039290921660048301526001600160801b03166024820152916000908390604490829084905af1918215610a1c57612f6892612fa0575b50805472ffffffffffffffffffffffffffffffff00000019169055565b8160008051602061386e83398151915260405180612f8b81906000602083019252565b0390a2612f9782613147565b16156123615750565b80610a10612fad92610a61565b38612f4b565b919091604092835191612fc583610aaa565b60008084526001600160a01b038281161561310b57612fee84600052600c602052604060002090565b8161300661164c876000526002602052604060002090565b166130fa57613013611dbb565b827f00000000000000000000000000000000000000000000000000000000000000001691823b156130f6578951631093e42d60e01b81526001600160a01b03871660048201526001600160801b0383166024820152600160448201529285908490606490829084905af1918215610a1c576130a8816130c1938a9660008051602061386e83398151915296611b385750611f4c565b8a516001600160801b0390911681529081906020820190565b0390a26130ce84846131f9565b166130df5750610d03939450612d11565b6024908651906339e3563760e11b82526004820152fd5b8480fd5b8751631a05867560e21b8152600490fd5b8651633250574960e11b815260048101839052602490fd5b613137906000526004602052604060002090565b80546001600160a01b0319169055565b6000818152600260205260409020546001600160a01b031690816131b2575b61317a816000526002602052604060002090565b80546001600160a01b03191690556000827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a490565b6131c6816000526004602052604060002090565b80546001600160a01b03191690556001600160a01b03821660009081526003602052604090208054600019019055613166565b6000828152600260205260409020546001600160a01b0390811692919061323d908461328a575b82169182613266575b6105dc846000526002602052604060002090565b827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a490565b6001600160a01b038116600090815260036020526040902060018154019055613229565b61329e846000526004602052604060002090565b80546001600160a01b03191690556001600160a01b03851660009081526003602052604090208054600019019055613220565b6000828152600260205260408120546001600160a01b03908116948592919081811680151590816133a0575b505050906133497fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9284613372575b8516948561334e575b6105dc876000526002602052604060002090565b80a490565b6001600160a01b038116600090815260036020526040902060018154019055613335565b61337b87613123565b6001600160a01b0385166000908152600360205260409020805460001901905561332c565b9080929394955091613409575b50156133be579081808794936132fd565b8490866133de57604051637e27328960e01b815260048101839052602490fd5b60405163177e802f60e01b81526001600160a01b039190911660048201526024810191909152604490fd5b8781149150811561343b575b8115613423575b50386133ad565b9050858452600460205282604085205416143861341c565b9050868452600560205260ff61346683604087209060018060a01b0316600052602052604060002090565b541690613415565b6040519061347b82610a8f565b60006020838281520152565b61348f61346e565b506020815191604051926134a284610a8f565b835201602082015290565b906134b661346e565b506134d0825160208401928351602082519201519261374c565b9080518203828111611d83578351908103908111611d835783525290565b906134f761346e565b5081519080519182811061355f576001926020850193845182602086015180830361354f575b50505061352c575b5050505090565b8103908111611d8357835251908051918201809211611d83575238808080613525565b819293502091201438828161351d565b50505090565b919061356f61346e565b9261357861346e565b508051916135946020830193845183519060208501519261374c565b908351602087015283518203828111611d83578652835183518101809111611d835782036135c55750506000915052565b85519281518401809411611d83576135e16135ea948251611d96565b90525190612bc6565b9052565b8051906136136135fd83610ae6565b9261360b6040519485610ac5565b808452610ae6565b601f19919060208481019184013683378083015192519291935b8184101561367657506000199280613650575b5050518251821691191617905290565b908092935003908111611d835761366961366e9161385e565b611d74565b903880613640565b92919384518152818101809111611d835793818101809111611d835791838101908111611d83579261362d565b6000198114611d835760010190565b91600083519360208101916136d28351968651602088019889519261374c565b85518101809111611d8357905b835183518101809111611d83578211613734576136fb906136a3565b9082519084518103818111611d83578203918211611d835761372e91613726918851908a519261374c565b865190612bc6565b906136df565b95505050509050565b60ff8111611d83576001901b90565b9192819383811115613765575b50506103d59250612bc6565b909291906020811161380757600093816137dd575b518416939291906137949061378f8484612bc6565b611d96565b84848751165b036137a757505050505090565b9091929394818110156137ce576137bd906136a3565b94848651169080959493929161379a565b50509091506103d59250612bc6565b93506137946137fe6136696137f96137f485611d88565b611da3565b61373d565b1994905061377a565b8091959320916000945b61381b8383611d96565b861161384c5782812084146138425761383661383c91612bb8565b956136a3565b94613811565b9450505050915090565b5092949150506103d592503880613759565b601f8111611d83576101000a9056fe154c1641fa45e45c3964d7c08068cde47e8e5eec0330ba974330b7f98a95592ea2646970667358221220f541242f70c7c31def3d60a444890edc0afe987a0a08d125b6701ea407b412cd64736f6c63430008190033290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f2000000000000000000000000c3f733ca98e0dad0386979eb96fb1722a1a05e690000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005d4d5aa600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c806301ffc9a7146102e757806306fdde03146102e257806307eefa09146102dd578063081812fc146102d8578063095ea7b3146102d35780630ad4c4f4146102ce578063150b7a02146102c957806321ac8eb4146102c457806323b872dd146102bf5780632da2d6e1146102ba57806330866abe146102b557806336301533146102b0578063379607f5146102ab5780633ec2d836146102a657806342842e0e146102a15780634622ab031461029c5780635747e69f146102975780635cec72a4146102925780635f7c95311461028d5780635ffe6146146102885780636352211e1461028357806370a082311461027e57806370ec6e1b1461027957806388124bd914610274578063947d56101461026f57806395d89b411461026a5780639915e23d14610265578063a22cb46514610260578063a50053901461025b578063b153673014610256578063b3cea21714610251578063b449810f1461024c578063b88d4fde14610247578063b90aac9c14610242578063bb5f943f1461023d578063c15319bf14610238578063c24dbebd14610233578063c87b56dd1461022e578063d2d4d77d14610229578063de0e9a3e14610224578063e985e9c51461021f578063ea3696ca1461021a578063ea598cb014610215578063f3239a18146102105763f9f87c181461020b57600080fd5b6118da565b61186e565b611857565b61181a565b6117b2565b6115f7565b6115db565b6113d8565b6113b5565b611399565b611337565b61131b565b611291565b611273565b611238565b6111b6565b61112b565b61106a565b611025565b610f7e565b610f4b565b610f06565b610eda565b610e7d565b610e4d565b610e18565b610dec565b610dc9565b610da6565b610d66565b610c54565b610b38565b6108d3565b61084b565b610828565b6107e7565b6107d0565b610787565b61071a565b610656565b610553565b610504565b6104bf565b6103d8565b610303565b6001600160e01b03198116036102fe57565b600080fd5b346102fe5760203660031901126102fe576020600435610322816102ec565b63ffffffff60e01b166380ac58cd60e01b8114908115610360575b811561034f575b506040519015158152f35b6301ffc9a760e01b14905038610344565b635b5e139f60e01b8114915061033d565b60009103126102fe57565b60005b83811061038f5750506000910152565b818101518382015260200161037f565b906020916103b88151809281855285808601910161037c565b601f01601f1916010190565b9060206103d592818152019061039f565b90565b346102fe576000806003193601126104bc5760405190808054906103fb82610c87565b8085529160209160019182811690811561048f5750600114610438575b6104348661042881880382610ac5565b604051918291826103c4565b0390f35b80809550527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b83851061047c575050505081016020016104288261043438610418565b805486860184015293820193810161045f565b90508695506104349693506020925061042894915060ff191682840152151560051b820101929338610418565b80fd5b346102fe5760003660031901126102fe576040517f000000000000000000000000c3f733ca98e0dad0386979eb96fb1722a1a05e696001600160a01b03168152602090f35b346102fe5760203660031901126102fe576004356105218161233e565b506000526004602052602060018060a01b0360406000205416604051908152f35b6001600160a01b038116036102fe57565b346102fe5760403660031901126102fe5760043561057081610542565b6024359061057d8261233e565b33151580610643575b80610615575b6105fd576105fb926105dc9181906001600160a01b0385811691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a46000526004602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b005b60405163a9fbf51f60e01b8152336004820152602490fd5b506001600160a01b038116600090815260056020908152604080832033845290915290205460ff161561058c565b506001600160a01b038116331415610586565b346102fe5760203660031901126102fe576104346040806060815161067a81610a41565b6000918183809352826020820152828582015201526004358152600c60205220906001600160801b038151926106af84610a41565b5460ff81161515845260ff8160081c161515602085015260ff8160101c1615158385015260181c166060830152519182918291909160606001600160801b03816080840195805115158552602081015115156020860152604081015115156040860152015116910152565b346102fe5760803660031901126102fe57610736600435610542565b610741602435610542565b6064356001600160401b038082116102fe57366023830112156102fe5781600401359081116102fe57369101602401116102fe57604051630a85bd0160e11b8152602090f35b346102fe5760003660031901126102fe5760206040516109c48152f35b60609060031901126102fe576004356107bc81610542565b906024356107c981610542565b9060443590565b346102fe576105fb6107e1366107a4565b916119f6565b346102fe5760003660031901126102fe57602060405163ffffffff7f000000000000000000000000000000000000000000000000000000005d4d5aa6168152f35b346102fe5760003660031901126102fe5760206040516705f7aab8c56b00008152f35b346102fe576000806003193601126104bc577f0000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a946001600160a01b031633036108c157600160ff19600a541617600a557f251f6d17a349e94e170ba983a0d79962271c3be5fe0c255d050ddc40f35aa8758180a180f35b6040516356620d4b60e11b8152600490fd5b346102fe5760203660031901126102fe5760048035906108f1612379565b61090d610908836000526008602052604060002090565b611b76565b9161091f61091a8261239c565b611bd0565b6109288161244c565b939060005b8251811015610a21576109626109566109566109498487611bed565b516001600160a01b031690565b6001600160a01b031690565b90813b156102fe5760408051632f79b7e960e11b8152808801858152602081018890526001600160a01b038a16928101929092526000606083018190529093909184919082908490829060800103925af1918215610a1c57600192610a03575b50818060a01b036109d66109498387611bed565b16857fb4ce698fd4c4f80fa2d06d863ce77e9c0fdf8e24c64ecfbb8c852ed20000430b600080a30161092d565b80610a10610a1692610a61565b80610371565b386109c2565b611c17565b6105fb6001600655565b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b03821117610a5c57604052565b610a2b565b6001600160401b038111610a5c57604052565b606081019081106001600160401b03821117610a5c57604052565b604081019081106001600160401b03821117610a5c57604052565b602081019081106001600160401b03821117610a5c57604052565b90601f801991011681019081106001600160401b03821117610a5c57604052565b6001600160401b038111610a5c57601f01601f191660200190565b929192610b0d82610ae6565b91610b1b6040519384610ac5565b8294818452818301116102fe578281602093846000960137010152565b346102fe5760403660031901126102fe576004356024356001600160401b0381116102fe57366023820112156102fe57610b7c903690602481600401359101610b01565b80518015908115610c49575b50610c3757610c1a82610b9d6105fb94612526565b610ba68161263b565b50806000526009602052610bbd6040600020611c23565b610c1f575b610bd78382610bd182826128bf565b906129c9565b807f70a8f52a5cc7cf2d25e71645299888cb2ed1590225e7fca72f35ac61cf61d32460405180610c0787826103c4565b0390a26000526009602052604060002090565b611c89565b610c3281610c2c8161244c565b90612779565b610bc2565b604051631ae3550b60e01b8152600490fd5b601d91501138610b88565b346102fe576105fb610c65366107a4565b9060405192610c7384610aaa565b60008452610c828383836119f6565b612dfe565b90600182811c92168015610cb7575b6020831014610ca157565b634e487b7160e01b600052602260045260246000fd5b91607f1691610c96565b90604051918260008254610cd481610c87565b90818452602094600191600181169081600014610d445750600114610d05575b505050610d0392500383610ac5565b565b600090815285812095935091905b818310610d2c575050610d039350820101388080610cf4565b85548884018501529485019487945091830191610d13565b92505050610d0394925060ff191682840152151560051b820101388080610cf4565b346102fe5760203660031901126102fe576004356000526009602052610434610d926040600020610cc1565b60405191829160208352602083019061039f565b346102fe5760003660031901126102fe57602060ff600a54166040519015158152f35b346102fe5760003660031901126102fe57602060405167016345785d8a00008152f35b346102fe5760203660031901126102fe576004356000526007602052610434610d926040600020610cc1565b346102fe5760203660031901126102fe57610e3460043561263b565b15610e3b57005b604051633536de7360e21b8152600490fd5b346102fe5760203660031901126102fe576020610e6b60043561233e565b6040516001600160a01b039091168152f35b346102fe5760203660031901126102fe57600435610e9a81610542565b6001600160a01b03168015610ec15760005260036020526020604060002054604051908152f35b6040516322718ad960e21b815260006004820152602490fd5b346102fe5760003660031901126102fe576020610ef5611dbb565b6001600160801b0360405191168152f35b346102fe5760003660031901126102fe576040517f000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f26001600160a01b03168152602090f35b346102fe5760203660031901126102fe576040610f6960043561244c565b82519182526001600160a01b03166020820152f35b346102fe576000806003193601126104bc5760405190806001805490610fa382610c87565b808652926020926001811690811561048f5750600114610fcd576104348661042881880382610ac5565b9350600184527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b838510611012575050505081016020016104288261043438610418565b8054868601840152938201938101610ff5565b346102fe5760003660031901126102fe576040517f0000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a946001600160a01b03168152602090f35b346102fe5760403660031901126102fe5760043561108781610542565b602435801515908181036102fe576001600160a01b03831692831561111257906110d36110e49233600052600560205260406000209060018060a01b0316600052602052604060002090565b9060ff801983541691151516179055565b6040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b604051630b61174360e31b815260048101859052602490fd5b346102fe5760003660031901126102fe5760206040517f000000000000000000000000000000000000000000000000000000000000000115158152f35b90815180825260208080930193019160005b828110611188575050505090565b83516001600160a01b03168552938101939281019260010161117a565b9060206103d5928181520190611168565b346102fe576020806003193601126102fe5760043560005260086020526040600020906040519081602084549182815201936000526020600020916000905b828210611218576104348561120c81890382610ac5565b604051918291826111a5565b83546001600160a01b0316865294850194600193840193909101906111f5565b346102fe5760003660031901126102fe5760206040517f00000000000000000000000000000000000000000000000000000000000000048152f35b346102fe5760003660031901126102fe576020600b54604051908152f35b346102fe5760803660031901126102fe576004356112ae81610542565b602435906112bb82610542565b604435606435926001600160401b0384116102fe57366023850112156102fe576112f26105fb943690602481600401359101610b01565b92610c828383836119f6565b6040519061130b82610a8f565b60018252602360f81b6020830152565b346102fe5760003660031901126102fe57610434610d926112fe565b346102fe5760003660031901126102fe576040517f000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b6001600160a01b03168152602090f35b6040519061138982610a8f565b60018252600b60fa1b6020830152565b346102fe5760003660031901126102fe57610434610d9261137c565b346102fe5760003660031901126102fe5760206040516729a2241af62c00008152f35b346102fe5760203660031901126102fe5761141161140c6004356113fb8161233e565b506000526009602052604060002090565b610cc1565b8051156115b0575b60405163320734f160e11b81527f00000000000000000000000000000000000000000000000000000000000000046004820152906000826024816001600160a01b037f0000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a94165afa8015610a1c576114cd6115819261153861152a610428946104349760009161158d575b50604051683d913730b6b2911d1160b91b60208201529485946114c791906029870183565b90611eec565b7f222c226465736372697074696f6e223a22577261707065642056657273696f6e81527f206f6620616e2065787465726e616c20636f6c6c656374696f6e222c22696d6160208201526433b2911d1160d91b604082015260450190565b61227d60f01b815260020190565b039061154c601f1992838101835282610ac5565b6040517f646174613a6170706c69636174696f6e2f6a736f6e3b757466382c00000000006020820152938491603b83016114c7565b03908101835282610ac5565b6115aa91503d806000833e6115a28183610ac5565b810190611ec7565b386114a2565b506115b9611e62565b611419565b604051906115cb82610a8f565b60018252600160fe1b6020830152565b346102fe5760003660031901126102fe57610434610d926115be565b346102fe5760203660031901126102fe5760043561161f81600052600c602052604060002090565b61163161162d825460ff1690565b1590565b6117a05761165961164c836000526002602052604060002090565b546001600160a01b031690565b6001600160a01b039190339083160361178e576116dc9061167f61162d600a5460ff1690565b61177c575b61168d84612e95565b6116a96116a4856000526009602052604060002090565b611f03565b6116c06116a4856000526007602052604060002090565b805472ffffffffffffffffffffffffffffffff0000ff19169055565b7f000000000000000000000000c3f733ca98e0dad0386979eb96fb1722a1a05e691690813b156102fe57604051632142170760e11b81523060048201523360248201526044810182905260009283908290606490829084905af18015610a1c57611769575b507fbeaa92c6354c6dcf375d2c514352b2c11bc865784722e5dd9b267e606eb5fc5f8280a280f35b80610a1061177692610a61565b38611741565b61178984610c2c8161244c565b611684565b604051633617438360e11b8152600490fd5b604051634d5e5fb360e01b8152600490fd5b346102fe5760403660031901126102fe57602060ff61180e6004356117d681610542565b602435906117e382610542565b60018060a01b03166000526005845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b346102fe5760003660031901126102fe5760206040517f000000000000000000000000000000000000000000000000000000000000000015158152f35b60203660031901126102fe576105fb600435611f8e565b346102fe5760003660031901126102fe576020604051601d8152f35b9092916040820191604081528451809352606081019260208096019060005b8181106118c6575050506103d59394506020818403910152611168565b8251865294870194918701916001016118a9565b346102fe5760203660031901126102fe576004803561190f611909610908836000526008602052604060002090565b9161244c565b5061191a82516122f0565b61192483516122f0565b9360005b84518110156119e7576119446109566109566109498489611bed565b60408051633506307760e21b81528481018781526000602082015291939290918491839182908190850103915afa8015610a1c576001936119af9260009182936119b5575b50506119958488611bed565b526119a0838a611bed565b6001600160a01b039091169052565b01611928565b6119d8935080919250903d106119e0575b6119d08183610ac5565b810190612322565b903880611989565b503d6119c6565b6040518061043488868361188a565b91906001600160a01b039081811615611b5d57611a1d83600052600c602052604060002090565b9082611a3661164c866000526002602052604060002090565b16611b4b57611a43611dbb565b90837f000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b16803b156102fe57604051631093e42d60e01b81526001600160a01b03831660048201526001600160801b038416602482015260016044820152906000908290606490829084905af18015610a1c57611af984611adf611b049689988b9660008051602061386e83398151915296611b38575b50611f4c565b6040516001600160801b0390911681529081906020820190565b0390a28433916132d1565b9316921690828203611b1557505050565b60649350604051926364283d7b60e01b8452600484015260248301526044820152fd5b80610a10611b4592610a61565b38611ad9565b604051631a05867560e21b8152600490fd5b604051633250574960e11b815260006004820152602490fd5b90604051918281549182825260209260208301916000526020600020936000905b828210611bad57505050610d0392500383610ac5565b85546001600160a01b031684526001958601958895509381019390910190611b97565b15611bd757565b634e487b7160e01b600052600160045260246000fd5b8051821015611c015760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b6040513d6000823e3d90fd5b6103d59054610c87565b818110611c38575050565b60008155600101611c2d565b9190601f8111611c5357505050565b610d03926000526020600020906020601f840160051c83019310611c7f575b601f0160051c0190611c2d565b9091508190611c72565b91909182516001600160401b038111610a5c57611cb081611caa8454610c87565b84611c44565b602080601f8311600114611cf357508190611ce4939495600092611ce8575b50508160011b916000199060031b1c19161790565b9055565b015190503880611ccf565b90601f19831695611d0985600052602060002090565b926000905b888210611d4657505083600195969710611d2d575b505050811b019055565b015160001960f88460031b161c19169055388080611d23565b80600185968294968601518155019501930190611d0e565b634e487b7160e01b600052601160045260246000fd5b600019810191908211611d8357565b611d5e565b6020039060208211611d8357565b91908203918211611d8357565b600381901b91906001600160fd1b03811603611d8357565b7f0000000000000000000000000000000000000000000000000000000000000000611e565763ffffffff7f000000000000000000000000000000000000000000000000000000005d4d5aa6164203428111611d83576301e187e090046705f7aab8c56b000090818102918183041490151715611d83576001600160801b03906729a2241af62c000080821015611e5057501690565b90501690565b6729a2241af62c000090565b60405190611e6f82610a8f565b6007825266155b9b985b595960ca1b6020830152565b81601f820112156102fe578051611e9b81610ae6565b92611ea96040519485610ac5565b818452602082840101116102fe576103d5916020808501910161037c565b906020828203126102fe5781516001600160401b0381116102fe576103d59201611e85565b90611eff6020928281519485920161037c565b0190565b611f0d8154610c87565b9081611f17575050565b81601f60009311600114611f29575055565b908083918252611f48601f60208420940160051c840160018501611c2d565b5555565b906301000000600160981b0382549160181b16906301000000600160981b031916179055565b908160209103126102fe575190565b8015611d83576000190190565b600a5460ff166122c757604080516370a0823160e01b81523360048083019190915291906001600160a01b03906020816024817f000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f286165afa908115610a1c57600091612298575b501561228a57600b5415158061225a575b61201a85600052600c602052604060002090565b805460ff808260101c16911661224a5782159283612243575b8061223a575b61222a578280612222575b80612210575b61220057815460ff19166001178255837f000000000000000000000000c3f733ca98e0dad0386979eb96fb1722a1a05e6916803b156102fe5785516323b872dd60e01b815233818901908152306020820152604081018a9052909160009183919082908490829060600103925af18015610a1c576121ed575b506120ce8733612fb3565b867f5b8cd8f3a67af1dee11ad4321a05f79a76cc7ea517810fc56d6d96c1e60d3686600080a26121e557805462ff000019166201000017905515612192577f0000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a9416803b156102fe576000915192838092633d3dd45b60e21b825234905af18015610a1c5761217f575b50337f38e5238102ce2a59567903a1637a95729503851bddda3a844436f29c80ee6e52600080a3565b80610a1061218c92610a61565b38612156565b507fa0af932cc5cbdd6147bf8bdcaea54634cf27abe631044f1f4f9f2daddaf3567792506121e091506121ce6121c9600b54611f81565b600b55565b600b5490519081529081906020820190565b0390a1565b505050505050565b80610a106121fa92610a61565b386120c3565b8451635d197e5160e01b81528690fd5b5067016345785d8a000034141561204a565b508015612044565b84516378fc2c5160e01b81528690fd5b50341515612039565b5080612033565b8451631bbdf5c560e31b81528690fd5b506001808516147f0000000000000000000000000000000000000000000000000000000000000001151514612006565b5051635c95168760e11b8152fd5b6122ba915060203d6020116122c0575b6122b28183610ac5565b810190611f72565b38611ff5565b503d6122a8565b60405163c3603d0960e01b8152600490fd5b6001600160401b038111610a5c5760051b60200190565b906122fa826122d9565b6123076040519182610ac5565b8281528092612318601f19916122d9565b0190602036910137565b91908260409103126102fe57602082519201516103d581610542565b6000818152600260205260409020546001600160a01b0316908115612361575090565b60249060405190637e27328960e01b82526004820152fd5b60026006541461238a576002600655565b604051633ee5aeb560e01b8152600490fd5b6000908152600260205260409020546001600160a01b0316330361178e57600190565b906020828203126102fe5781516001600160401b03928382116102fe57016060818303126102fe57604051926123f484610a74565b81519081116102fe5760409261240b918301611e85565b8352602081015161241b81610542565b6020840152015160ff811681036102fe57604082015290565b9060406103d59260008152816020820152019061039f565b60005260076020526124616040600020610cc1565b906124b0600060405160208101906020825261249281612484604082018961039f565b03601f198101835282610ac5565b51902093604051809381926365a3ccf960e11b835260048301612434565b03817f000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f26001600160a01b03165afa908115610a1c576103d591602091600091612503575b5001516001600160a01b031690565b61252091503d806000833e6125188183610ac5565b8101906123bf565b386124f4565b61253a81600052600c602052604060002090565b80549160ff8316156117a05761164c61255d916000526002602052604060002090565b6001600160a01b039290339084160361178e577f00000000000000000000000000000000000000000000000000000000000000009081612613575b5061260357507f000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b16803b156102fe57604051634b1946fb60e01b8152336004820152906000908290602490829084905af18015610a1c576125f65750565b80610a10610d0392610a61565b805461ff00191661010017905550565b60ff915060081c161538612598565b6001600160801b039182169082160391908211611d8357565b61264f81600052600c602052604060002090565b61266661164c836000526002602052604060002090565b6001600160a01b039190339083160361178e57612695612684611dbb565b915460181c6001600160801b031690565b916001600160801b0380841690831614612770576126d6907f000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b169282612622565b91803b156102fe57604051631093e42d60e01b81523360048201526001600160801b03939093166024840152600060448401819052908390606490829084905af1908115610a1c5760008051602061386e833981519152926127559261275d575b50611adf8161275086600052600c602052604060002090565b611f4c565b0390a2600190565b80610a1061276a92610a61565b38612737565b50505050600090565b909291612784612379565b61279b610908826000526008602052604060002090565b6127b76127b2836000526008602052604060002090565b61287e565b60005b815181101561286e576001600160a01b036127d86109498385611bed565b1690813b156102fe5760405163bcfb29af60e01b815260048101869052602481018590526001600160a01b03881660448201526000606482018190529092908360848183855af1928315610a1c5760019361285b575b50847f1e7dc9151e44edb4fc142dbf645faec2bf01b5de5e0ac6cd20e90ef5d0422871600080a3016127ba565b80610a1061286892610a61565b3861282e565b505050509050610d036001600655565b8054600082558061288d575050565b610d0391600052602060002090810190611c2d565b604051906128af82610a8f565b60018252600160fd1b6020830152565b91906129036128f26128d361290893613487565b6128ed6128e66128e16115be565b613487565b80926134ad565b6134ee565b6128fd6128e16128a2565b90613565565b6135ee565b6040516365a3ccf960e11b81526001600160a01b039390600081806129308660048301612434565b0381887f000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f2165afa908115610a1c5761297b91602091600091612503575001516001600160a01b031690565b938416156129b75781610c1a61299b926000526007602052604060002090565b6040516129b0816124846020820194856103c4565b5190209190565b604051631d538a9160e01b8152600490fd5b9193926128f26129de6129ec926128e1612379565b6128ed6128e66128e16112fe565b906129f86128e161137c565b92612a13612a0e612a0986866136b2565b612bb8565b6122f0565b936001600160a01b03937f0000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a948516919060005b8751811015612b8a57612a5b6129038484613565565b90815115612b81576040918251906386304ba960e01b8252602091828180612a876004958683016103c4565b03818b5afa928315610a1c57600093612b52575b5050898216918b8315612b4557906119a085612ab693611bed565b813b156102fe57925163067a619d60e51b8152928301878152602081018d90526001600160a01b038916604082015260009084908190606001038183855af1928315610a1c57600193612b32575b508b7fc0011caead85c5a7acde281295df035f6bfe8aa69af2b3d723cf601f99cfa797600080a35b01612a45565b80610a10612b3f92610a61565b38612b04565b5050505060019150612b2c565b612b72929350803d10612b7a575b612b6a8183610ac5565b810190612bd3565b903880612a9b565b503d612b60565b60019150612b2c565b50505050505050612ba9612bae92936000526008602052604060002090565b612be8565b610d036001600655565b9060018201809211611d8357565b91908201809211611d8357565b908160209103126102fe57516103d581610542565b8151916001600160401b038311610a5c57680100000000000000008311610a5c578154838355808410612c52575b5060208091019160005260206000209060005b848110612c37575050505050565b83516001600160a01b03168382015592810192600101612c29565b612c6a90836000528460206000209182019101611c2d565b38612c16565b908160209103126102fe57516103d5816102ec565b6103d5939260809260018060a01b03168252600060208301526040820152816060820152019061039f565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526103d59291019061039f565b3d15612d0c573d90612cf282610ae6565b91612d006040519384610ac5565b82523d6000602084013e565b606090565b91823b612d1d57505050565b6020612d409160405180938192630a85bd0160e11b968784523360048501612c85565b038160006001600160a01b0388165af160009181612dcd575b50612d985782612d67612ce1565b8051919082612d9157604051633250574960e11b81526001600160a01b0383166004820152602490fd5b9050602001fd5b6001600160e01b03191603612daa5750565b604051633250574960e11b81526001600160a01b03919091166004820152602490fd5b612df091925060203d602011612df7575b612de88183610ac5565b810190612c70565b9038612d59565b503d612dde565b91929092833b612e0f575b50505050565b612e34916020916040519384928392630a85bd0160e11b978885523360048601612cb0565b038160006001600160a01b0388165af160009181612e74575b50612e5b5782612d67612ce1565b6001600160e01b03191603612daa575038808080612e09565b612e8e91925060203d602011612df757612de88183610ac5565b9038612e4d565b612ea981600052600c602052604060002090565b60008281526002602052604090206001600160a01b03919082905416906001600160801b03815460181c1691837f000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b1692833b156102fe5760405163402412bf60e11b81526001600160a01b039290921660048301526001600160801b03166024820152916000908390604490829084905af1918215610a1c57612f6892612fa0575b50805472ffffffffffffffffffffffffffffffff00000019169055565b8160008051602061386e83398151915260405180612f8b81906000602083019252565b0390a2612f9782613147565b16156123615750565b80610a10612fad92610a61565b38612f4b565b919091604092835191612fc583610aaa565b60008084526001600160a01b038281161561310b57612fee84600052600c602052604060002090565b8161300661164c876000526002602052604060002090565b166130fa57613013611dbb565b827f000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b1691823b156130f6578951631093e42d60e01b81526001600160a01b03871660048201526001600160801b0383166024820152600160448201529285908490606490829084905af1918215610a1c576130a8816130c1938a9660008051602061386e83398151915296611b385750611f4c565b8a516001600160801b0390911681529081906020820190565b0390a26130ce84846131f9565b166130df5750610d03939450612d11565b6024908651906339e3563760e11b82526004820152fd5b8480fd5b8751631a05867560e21b8152600490fd5b8651633250574960e11b815260048101839052602490fd5b613137906000526004602052604060002090565b80546001600160a01b0319169055565b6000818152600260205260409020546001600160a01b031690816131b2575b61317a816000526002602052604060002090565b80546001600160a01b03191690556000827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a490565b6131c6816000526004602052604060002090565b80546001600160a01b03191690556001600160a01b03821660009081526003602052604090208054600019019055613166565b6000828152600260205260409020546001600160a01b0390811692919061323d908461328a575b82169182613266575b6105dc846000526002602052604060002090565b827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a490565b6001600160a01b038116600090815260036020526040902060018154019055613229565b61329e846000526004602052604060002090565b80546001600160a01b03191690556001600160a01b03851660009081526003602052604090208054600019019055613220565b6000828152600260205260408120546001600160a01b03908116948592919081811680151590816133a0575b505050906133497fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9284613372575b8516948561334e575b6105dc876000526002602052604060002090565b80a490565b6001600160a01b038116600090815260036020526040902060018154019055613335565b61337b87613123565b6001600160a01b0385166000908152600360205260409020805460001901905561332c565b9080929394955091613409575b50156133be579081808794936132fd565b8490866133de57604051637e27328960e01b815260048101839052602490fd5b60405163177e802f60e01b81526001600160a01b039190911660048201526024810191909152604490fd5b8781149150811561343b575b8115613423575b50386133ad565b9050858452600460205282604085205416143861341c565b9050868452600560205260ff61346683604087209060018060a01b0316600052602052604060002090565b541690613415565b6040519061347b82610a8f565b60006020838281520152565b61348f61346e565b506020815191604051926134a284610a8f565b835201602082015290565b906134b661346e565b506134d0825160208401928351602082519201519261374c565b9080518203828111611d83578351908103908111611d835783525290565b906134f761346e565b5081519080519182811061355f576001926020850193845182602086015180830361354f575b50505061352c575b5050505090565b8103908111611d8357835251908051918201809211611d83575238808080613525565b819293502091201438828161351d565b50505090565b919061356f61346e565b9261357861346e565b508051916135946020830193845183519060208501519261374c565b908351602087015283518203828111611d83578652835183518101809111611d835782036135c55750506000915052565b85519281518401809411611d83576135e16135ea948251611d96565b90525190612bc6565b9052565b8051906136136135fd83610ae6565b9261360b6040519485610ac5565b808452610ae6565b601f19919060208481019184013683378083015192519291935b8184101561367657506000199280613650575b5050518251821691191617905290565b908092935003908111611d835761366961366e9161385e565b611d74565b903880613640565b92919384518152818101809111611d835793818101809111611d835791838101908111611d83579261362d565b6000198114611d835760010190565b91600083519360208101916136d28351968651602088019889519261374c565b85518101809111611d8357905b835183518101809111611d83578211613734576136fb906136a3565b9082519084518103818111611d83578203918211611d835761372e91613726918851908a519261374c565b865190612bc6565b906136df565b95505050509050565b60ff8111611d83576001901b90565b9192819383811115613765575b50506103d59250612bc6565b909291906020811161380757600093816137dd575b518416939291906137949061378f8484612bc6565b611d96565b84848751165b036137a757505050505090565b9091929394818110156137ce576137bd906136a3565b94848651169080959493929161379a565b50509091506103d59250612bc6565b93506137946137fe6136696137f96137f485611d88565b611da3565b61373d565b1994905061377a565b8091959320916000945b61381b8383611d96565b861161384c5782812084146138425761383661383c91612bb8565b956136a3565b94613811565b9450505050915090565b5092949150506103d592503880613759565b601f8111611d83576101000a9056fe154c1641fa45e45c3964d7c08068cde47e8e5eec0330ba974330b7f98a95592ea2646970667358221220f541242f70c7c31def3d60a444890edc0afe987a0a08d125b6701ea407b412cd64736f6c63430008190033

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

000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f2000000000000000000000000c3f733ca98e0dad0386979eb96fb1722a1a05e690000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005d4d5aa600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004

-----Decoded View---------------
Arg [0] : _HCT (address): 0xc597a71A49C49b4A0554B3110bab25A51c76847b
Arg [1] : _nftPass (address): 0xC88d37B7ae9b6d781678Cf12155A69d6d4Eb82F2
Arg [2] : _inputCollection (address): 0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69
Arg [3] : _obeliskRegistry (address): 0x8416c04998F4bc5D34e3f817e1A581C8077d5A94
Arg [4] : _currentSupply (uint256): 0
Arg [5] : _collectionStartedUnixTime (uint32): 1565350566
Arg [6] : _premium (bool): False
Arg [7] : _id (uint256): 4

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000c597a71a49c49b4a0554b3110bab25a51c76847b
Arg [1] : 000000000000000000000000c88d37b7ae9b6d781678cf12155a69d6d4eb82f2
Arg [2] : 000000000000000000000000c3f733ca98e0dad0386979eb96fb1722a1a05e69
Arg [3] : 0000000000000000000000008416c04998f4bc5d34e3f817e1a581c8077d5a94
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 000000000000000000000000000000000000000000000000000000005d4d5aa6
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000004


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.