ETH Price: $3,075.89 (+2.60%)
Gas: 4 Gwei

Token

heaven, hell or bitcoin? (HHBTC)
 

Overview

Max Total Supply

175 HHBTC

Holders

99

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Balance
1 HHBTC
0xbd059da0b703beeb9f400b111c1540c3ffdfb055
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
HHBTC

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : HHBTC.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/utils/Strings.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";

import "../Common/ERC721/ERC721FQueryable.sol";
import "../Common/Delegated.sol";
import "../Common/Royalties.sol";


interface Ipoobs{
  function ownerOf(uint256 tokenId) external view returns(address);
  function transferFrom(address account, address to, uint256 tokenId) external;
}

contract HHBTC is ERC721FQueryable, DefaultOperatorFilterer, Delegated, Royalties {
  using Strings for uint256;

  error WithdrawError(bytes);
  event Takeoff(uint256 indexed tokenId);

  struct MintConfig{
    uint64 ethPrice;
    uint16 maxSupply;

    SaleState saleState;
  }

  enum SaleState{
    CLOSED,
    OPEN
  }

  MintConfig public config = MintConfig(
    0.00 ether,
    5555,

    SaleState.CLOSED
  );

  address public burnTo = 0x3ba169F79b0129AD4b442285145818E0262E02F4;
  Ipoobs public poobs = Ipoobs(0x0bf3cf7960Ad8827c75d821f4B3353aF8D4fbca4);
  bool public isOsEnabled = true;
  string public tokenURIPrefix;
  string public tokenURISuffix;
  uint256 public immutable batchSize = 5;

  constructor()
    ERC721F("heaven, hell or bitcoin?", "HHBTC")
    DefaultOperatorFilterer()
    Royalties(owner(), 500, 10000)
    // solhint-disable-next-line no-empty-blocks
  {}


  modifier onlyAllowedOperator(address from) override {
    if (isOsEnabled && from != msg.sender) {
      _checkFilterOperator(msg.sender);
    }
    _;
  }

  modifier onlyAllowedOperatorApproval(address operator) override {
    if(isOsEnabled){
      _checkFilterOperator(operator);
    }
    _;
  }


  //public
  function takeoff(uint256 burnId, uint256 moonId) external{
    require(SaleState.OPEN == config.saleState, "takeoff is disabled");
    require(totalSupply() < config.maxSupply, "mint/order exceeds supply");
    require(poobs.ownerOf(burnId) == msg.sender, "owner check failed for burn token");
    require(poobs.ownerOf(moonId) == msg.sender, "owner check failed for moon token");

    poobs.transferFrom(msg.sender, burnTo, burnId);
    _mintBatch(msg.sender, 1);
    emit Takeoff(moonId);
  }


  //payable - onlyDelegates
  function mintTo(uint16[] calldata quantity, address[] calldata recipient) external payable onlyDelegates{
    //checks
    require(quantity.length == recipient.length, "Must provide equal quantities and recipients");

    uint256 totalQuantity = 0;
    unchecked{
      for(uint256 i = 0; i < quantity.length; ++i){
        totalQuantity += quantity[i];
      }
    }
    require(totalSupply() + totalQuantity <= config.maxSupply, "Mint/order exceeds supply");

    unchecked{
      for(uint256 i = 0; i < recipient.length; ++i){
        _mintBatch(recipient[i], quantity[i]);
      }
    }
  }


  //nonpayable - onlyDelegates
  function setConfig(
    MintConfig calldata newConfig,
    address poobs_,
    address burnTo_
  ) external onlyDelegates{
    require(totalSupply() <= newConfig.maxSupply, "max supply must be gte total supply" );
    require(uint8(newConfig.saleState) < 2, "invalid sale state" );

    config = newConfig;
    poobs = Ipoobs(poobs_);
    burnTo = burnTo_;
  }

  function setOsStatus(bool isEnabled) external onlyDelegates{
    isOsEnabled = isEnabled;
  }

  function setTokenURI(string calldata prefix, string calldata suffix) external onlyDelegates{
    tokenURIPrefix = prefix;
    tokenURISuffix = suffix;
  }


  //nonpayable - onlyOwner
  function setDefaultRoyalty( address receiver, uint16 feeNumerator, uint16 feeDenominator ) external onlyOwner {
    _setDefaultRoyalty( receiver, feeNumerator, feeDenominator );
  }


  //view - IERC165
  function supportsInterface(bytes4 interfaceId) public view override(ERC721F, IERC721F, Royalties) returns (bool) {
    return ERC721F.supportsInterface(interfaceId)
      || Royalties.supportsInterface(interfaceId);
  }


  //view - IERC721Metadata
  function tokenURI(uint256 tokenId) public view override(ERC721F, IERC721F) returns(string memory){
    if(!_exists(tokenId)) revert URIQueryForNonexistentToken();
    return string(abi.encodePacked(tokenURIPrefix, tokenId.toString(), tokenURISuffix));
  }


  //withdraw
  function withdraw() external onlyOwner {
    uint256 balance = address(this).balance;
    require(balance > 0, "No funds available");

    (bool success, bytes memory data) = payable(owner()).call{value: balance }("");
    if(!success)
      revert WithdrawError(data);
  }


  //OS overrides
  function approve(address operator, uint256 tokenId) public payable override(ERC721F, IERC721F) onlyAllowedOperatorApproval(operator) {
    ERC721F.approve(operator, tokenId);
  }

  function setApprovalForAll(address operator, bool approved) public override(ERC721F, IERC721F) onlyAllowedOperatorApproval(operator) {
    ERC721F.setApprovalForAll(operator, approved);
  }

  function transferFrom(address from, address to, uint256 tokenId) public payable override(ERC721F, IERC721F) onlyAllowedOperator(from) {
    ERC721F.transferFrom(from, to, tokenId);
  }


  //internal
  function _mintBatch(address to, uint256 quantity) internal {
    while(quantity > 0){
      if(quantity > batchSize){
        _mint(to, batchSize);
        quantity -= batchSize;
      }
      else{
        _mint(to, quantity);
        break;
      }
    }
  }

  function _startTokenId() internal pure override returns (uint256) {
    return 1;
  }
}

File 2 of 16 : Royalties.sol
// SPDX-License-Identifier: BSD-3
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/interfaces/IERC2981.sol";

contract Royalties is IERC2981{
  struct Fraction{
    uint16 numerator;
    uint16 denominator;
  }

  struct Royalty{
    address receiver;
    Fraction fraction;
  }

  Royalty public defaultRoyalty;
  //mapping(uint => Royalty) public tokenRoyalties;

  constructor(address receiver, uint16 royaltyNum, uint16 royaltyDenom){
    _setDefaultRoyalty(receiver, royaltyNum, royaltyDenom);
  }

  //view: IERC2981
  /**
   * @dev See {IERC2981-royaltyInfo}.
   **/
  function royaltyInfo(uint256, uint256 _salePrice) public view virtual returns (address, uint256) {
    /*
    Royalty memory royalty = _tokenRoyaltyInfo[_tokenId];
    if (royalty.receiver == address(0)) {
        royalty = _defaultRoyaltyInfo;
    }
    */

    uint256 royaltyAmount = (_salePrice * defaultRoyalty.fraction.numerator) / defaultRoyalty.fraction.denominator;
    return (defaultRoyalty.receiver, royaltyAmount);
  }

  //view: IERC165
  /**
   * @dev See {IERC165-supportsInterface}.
   **/
  function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
    return interfaceId == type(IERC2981).interfaceId;
  }


  function _setDefaultRoyalty( address receiver, uint16 royaltyNum, uint16 royaltyDenom ) internal {
    defaultRoyalty.receiver = receiver;
    defaultRoyalty.fraction = Fraction(royaltyNum, royaltyDenom);
  }
}

File 3 of 16 : IERC721FQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721F.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721FQueryable is IERC721F {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

File 4 of 16 : IERC721F.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721F {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Whether the next tokenId is initialized.
        bool nextInitialized;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint16 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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`,
     * 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 be 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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * 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 payable;

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 5 of 16 : ERC721FQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721FQueryable.sol';
import './ERC721F.sol';

/**
 * @title ERC721AQueryable.
 *
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721FQueryable is ERC721F, IERC721FQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
            return ownership;
        }
        ownership = _ownershipAt(tokenId);
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] calldata tokenIds)
        external
        view
        virtual
        override
        returns (TokenOwnership[] memory)
    {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view virtual override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _nextTokenId();
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, stopLimit)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownershipAt(i);
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 6 of 16 : ERC721F.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.9;

import "./IERC721F.sol";

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721F__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721F is IERC721F {
    struct OwnerData{
        uint64 balance;
        uint64 numberMinted;
        uint64 numberBurned;
        uint64 aux;
    }


    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }
    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => TokenOwnership) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => OwnerData) internal _packedAddressData;

    // Mapping from token ID to approved address.
    mapping(uint256 => TokenApprovalRef) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal pure virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        // Counter underflow is impossible as `_currentIndex` does not decrement,
        // and it is initialized to `_startTokenId()`.
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner].balance;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return _packedAddressData[owner].numberMinted;
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return _packedAddressData[owner].numberBurned;
    }

    /**
     * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return _packedAddressData[owner].aux;
    }

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        _packedAddressData[owner].aux = aux;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

    /**
     * @dev Returns the token collection name.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : "";
    }

    /**
     * @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, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return _unpackedOwnershipOf(tokenId).addr;
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _packedOwnerships[tokenId];
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _packedOwnerships[index];
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        TokenOwnership memory ownership = _unpackedOwnershipOf(tokenId);
        return uint256(bytes32(abi.encode(ownership)));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnershipOf(uint256 tokenId) private view returns (TokenOwnership memory ownership) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr) {
                if (curr < _currentIndex) {
                    TokenOwnership memory unpacked = _packedOwnerships[curr];
                    // If not burned.
                    if (!unpacked.burned) {
                        while (unpacked.addr == address(0)) {
                            unpacked = _packedOwnerships[--curr];
                        }
                        return unpacked;
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @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) public payable virtual override {
        address owner = ownerOf(tokenId);

        if (_msgSenderERC721A() != owner)
            if (!isApprovedForAll(owner, _msgSenderERC721A())) {
                revert ApprovalCallerNotOwnerNorApproved();
            }

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @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 caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

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

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            !_packedOwnerships[tokenId].burned; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        if(msgSender == owner)
            return true;

        if(msgSender == approvedAddress)
            return true;

        return false;
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * 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
    ) public payable virtual override {
        TokenOwnership memory prevOwnership = _unpackedOwnershipOf(tokenId);

        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from].balance; // Updates: `balance -= 1`.
            ++_packedAddressData[to].balance; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = TokenOwnership(
                to,
                uint64(block.timestamp),
                false,
                true,
                prevOwnership.extraData
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (!prevOwnership.nextInitialized) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId].startTimestamp == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = TokenOwnership(
                            prevOwnership.addr,
                            prevOwnership.startTimestamp,
                            false,
                            false,
                            prevOwnership.extraData
                        );
                    }
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @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 memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * `from` - Previous owner of the given token ID.
     * `to` - Target address that will receive the token.
     * `tokenId` - Token ID to be transferred.
     * `_data` - Optional data to send along with the call.
     *
     * Returns whether the call correctly returned the expected magic value.
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal returns (bool) {
        try ERC721F__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
            bytes4 retval
        ) {
            return retval == ERC721F__IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            _packedAddressData[to].balance += uint64(quantity);
            _packedAddressData[to].numberMinted += uint64(quantity);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = TokenOwnership(
                to,
                uint64(block.timestamp),
                false,
                quantity == 1,
                0
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

            _currentIndex = end;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            _packedAddressData[to].balance += uint64(quantity);
            _packedAddressData[to].numberMinted += uint64(quantity);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = TokenOwnership(
              to,
              uint64(block.timestamp),
              false,
              quantity == 1,
              0
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

            _currentIndex = startTokenId + quantity;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        TokenOwnership memory prevOwnership = _unpackedOwnershipOf(tokenId);

        address from = prevOwnership.addr;

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            --_packedAddressData[from].balance;
            ++_packedAddressData[from].numberBurned;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = TokenOwnership(
              address(0),
              uint64(block.timestamp),
              true,
              true,
              prevOwnership.extraData
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (!prevOwnership.nextInitialized) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId].startTimestamp == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnership;
                    }
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint16 extraData) internal virtual {
        TokenOwnership storage packed = _packedOwnerships[index];
        if (packed.startTimestamp == 0) revert OwnershipNotInitializedForExtraData();

        _packedOwnerships[index].extraData = extraData;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}


    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}

File 7 of 16 : Delegated.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

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

contract Delegated is Ownable{
  mapping(address => bool) internal _delegates;

  modifier onlyContracts {
    require(_delegates[msg.sender], "Unauthorized delegate" );
    require(msg.sender.code.length > 0, "Non-contract delegate" );
    _;
  }

  modifier onlyDelegates {
    require(_delegates[msg.sender], "Unauthorized delegate" );
    _;
  }

  constructor()
    Ownable(){
    setDelegate(owner(), true);
  }

  //onlyOwner
  function isDelegate(address addr) external view onlyOwner returns(bool) {
    return _delegates[addr];
  }

  function setDelegate(address addr, bool isDelegate_) public onlyOwner {
    _delegates[addr] = isDelegate_;
  }

  function transferOwnership(address newOwner) public virtual override onlyOwner {
    setDelegate(newOwner, true);
    super.transferOwnership(newOwner);
  }
}

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

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

/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFilterer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

File 9 of 16 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);
    function register(address registrant) external;
    function registerAndSubscribe(address registrant, address subscription) external;
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;
    function unregister(address addr) external;
    function updateOperator(address registrant, address operator, bool filtered) external;
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
    function subscribe(address registrant, address registrantToSubscribe) external;
    function unsubscribe(address registrant, bool copyExistingEntries) external;
    function subscriptionOf(address addr) external returns (address registrant);
    function subscribers(address registrant) external returns (address[] memory);
    function subscriberAt(address registrant, uint256 index) external returns (address);
    function copyEntriesOf(address registrant, address registrantToCopy) external;
    function isOperatorFiltered(address registrant, address operator) external returns (bool);
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
    function filteredOperators(address addr) external returns (address[] memory);
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
    function isRegistered(address addr) external returns (bool);
    function codeHashOf(address addr) external returns (bytes32);
}

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

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

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
    address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

File 11 of 16 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 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; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 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.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            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 (rounding == Rounding.Up && 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 down.
     *
     * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * 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 + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * 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 10, 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 + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

File 12 of 16 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @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 13 of 16 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

    /**
     * @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), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @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) {
        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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        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);
    }
}

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

pragma solidity ^0.8.0;

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

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

File 15 of 16 : IERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 16 of 16 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","type":"error"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"WithdrawError","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":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Takeoff","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"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"batchSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"burnTo","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"config","outputs":[{"internalType":"uint64","name":"ethPrice","type":"uint64"},{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"enum HHBTC.SaleState","name":"saleState","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultRoyalty","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"components":[{"internalType":"uint16","name":"numerator","type":"uint16"},{"internalType":"uint16","name":"denominator","type":"uint16"}],"internalType":"struct Royalties.Fraction","name":"fraction","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"bool","name":"nextInitialized","type":"bool"},{"internalType":"uint16","name":"extraData","type":"uint16"}],"internalType":"struct IERC721F.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"bool","name":"nextInitialized","type":"bool"},{"internalType":"uint16","name":"extraData","type":"uint16"}],"internalType":"struct IERC721F.TokenOwnership[]","name":"","type":"tuple[]"}],"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":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isDelegate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"quantity","type":"uint16[]"},{"internalType":"address[]","name":"recipient","type":"address[]"}],"name":"mintTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poobs","outputs":[{"internalType":"contract Ipoobs","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"payable","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"ethPrice","type":"uint64"},{"internalType":"uint16","name":"maxSupply","type":"uint16"},{"internalType":"enum HHBTC.SaleState","name":"saleState","type":"uint8"}],"internalType":"struct HHBTC.MintConfig","name":"newConfig","type":"tuple"},{"internalType":"address","name":"poobs_","type":"address"},{"internalType":"address","name":"burnTo_","type":"address"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint16","name":"feeNumerator","type":"uint16"},{"internalType":"uint16","name":"feeDenominator","type":"uint16"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"isDelegate_","type":"bool"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"isEnabled","type":"bool"}],"name":"setOsStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"prefix","type":"string"},{"internalType":"string","name":"suffix","type":"string"}],"name":"setTokenURI","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":"burnId","type":"uint256"},{"internalType":"uint256","name":"moonId","type":"uint256"}],"name":"takeoff","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIPrefix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURISuffix","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610100604052600060a08190526115b360c05260e052600c80546001600160581b0319166915b30000000000000000179055600d8054733ba169f79b0129ad4b442285145818e0262e02f46001600160a01b0319909116179055600e80546001600160a81b03191674010bf3cf7960ad8827c75d821f4b3353af8d4fbca417905560056080523480156200009257600080fd5b506008546001600160a01b03166101f4612710733cc6cdda760b79bafa08df41ecfa224f810dceb660016040518060400160405280601881526020017f68656176656e2c2068656c6c206f7220626974636f696e3f000000000000000081525060405180604001604052806005815260200164484842544360d81b815250816002908162000121919062000494565b50600362000130828262000494565b50600160005550506daaeb6d7670e522a718067333cd4e3b156200027d578015620001cb57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b158015620001ac57600080fd5b505af1158015620001c1573d6000803e3d6000fd5b505050506200027d565b6001600160a01b038216156200021c5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000191565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b1580156200026357600080fd5b505af115801562000278573d6000803e3d6000fd5b505050505b506200028b90503362000307565b620002aa620002a26008546001600160a01b031690565b600162000359565b600a80546001600160a01b0319166001600160a01b0385161790556040805180820190915261ffff8084168083529083166020909201829052600b805463ffffffff19169091176201000090920291909117905550505062000560565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b620003636200038e565b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b6008546001600160a01b03163314620003ed5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200041a57607f821691505b6020821081036200043b57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200048f57600081815260208120601f850160051c810160208610156200046a5750805b601f850160051c820191505b818110156200048b5782815560010162000476565b5050505b505050565b81516001600160401b03811115620004b057620004b0620003ef565b620004c881620004c1845462000405565b8462000441565b602080601f831160018114620005005760008415620004e75750858301515b600019600386901b1c1916600185901b1785556200048b565b600085815260208120601f198616915b82811015620005315788860151825594840194600190910190840162000510565b5085821015620005505787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805161301362000591600039600081816107e501528181611e9801528181611ec40152611eed01526130136000f3fe60806040526004361061023a5760003560e01c8063715018a61161012e578063ae7bf4c8116100ab578063d48ede991161006f578063d48ede9914610735578063dbbc853b14610755578063e985e9c51461076a578063f2fde38b146107b3578063f4daaba1146107d357600080fd5b8063ae7bf4c8146106ad578063b88d4fde146106c0578063c0ac9983146106d3578063c23dc68f146106e8578063c87b56dd1461071557600080fd5b80638da5cb5b116100f25780638da5cb5b1461061a57806394d8ec0a1461063857806395d89b411461065857806399a2557a1461066d578063a22cb4651461068d57600080fd5b8063715018a6146104f95780637885fdc71461050e57806379502c55146105865780638065b454146105cd5780638462151c146105ed57600080fd5b80632a55205a116101bc57806342842e0e1161018057806342842e0e146104595780634a994eef1461046c5780635bbb21771461048c5780636352211e146104b957806370a08231146104d957600080fd5b80632a55205a146103a35780633ba061d9146103e25780633ccfd60b1461040257806341acc66a1461041757806341f434341461043757600080fd5b8063095ea7b311610203578063095ea7b314610310578063109e943f1461032357806318160ddd14610344578063211f9e2f1461037057806323b872dd1461039057600080fd5b806292aa4e1461023f57806301ffc9a71461026157806306fdde031461029657806307779627146102b8578063081812fc146102d8575b600080fd5b34801561024b57600080fd5b5061025f61025a36600461253f565b610807565b005b34801561026d57600080fd5b5061028161027c3660046125a6565b610964565b60405190151581526020015b60405180910390f35b3480156102a257600080fd5b506102ab610990565b60405161028d9190612613565b3480156102c457600080fd5b506102816102d3366004612626565b610a22565b3480156102e457600080fd5b506102f86102f3366004612643565b610a4b565b6040516001600160a01b03909116815260200161028d565b61025f61031e36600461265c565b610a8f565b34801561032f57600080fd5b50600e5461028190600160a01b900460ff1681565b34801561035057600080fd5b50610362600154600054036000190190565b60405190815260200161028d565b34801561037c57600080fd5b5061025f61038b366004612696565b610abb565b61025f61039e3660046126b3565b610b08565b3480156103af57600080fd5b506103c36103be3660046126f4565b610b4b565b604080516001600160a01b03909316835260208301919091520161028d565b3480156103ee57600080fd5b50600d546102f8906001600160a01b031681565b34801561040e57600080fd5b5061025f610b8f565b34801561042357600080fd5b5061025f610432366004612726565b610c63565b34801561044357600080fd5b506102f86daaeb6d7670e522a718067333cd4e81565b61025f6104673660046126b3565b610cc4565b34801561047857600080fd5b5061025f610487366004612766565b610cdf565b34801561049857600080fd5b506104ac6104a73660046127e3565b610d12565b60405161028d919061286b565b3480156104c557600080fd5b506102f86104d4366004612643565b610dc4565b3480156104e557600080fd5b506103626104f4366004612626565b610dd6565b34801561050557600080fd5b5061025f610e24565b34801561051a57600080fd5b50600a5460408051808201909152600b5461ffff808216835262010000909104166020820152610551916001600160a01b03169082565b604080516001600160a01b039093168352815161ffff908116602080860191909152909201519091169082015260600161028d565b34801561059257600080fd5b50600c546105be906001600160401b03811690600160401b810461ffff1690600160501b900460ff1683565b60405161028d939291906128c3565b3480156105d957600080fd5b5061025f6105e83660046126f4565b610e38565b3480156105f957600080fd5b5061060d610608366004612626565b611149565b60405161028d9190612909565b34801561062657600080fd5b506008546001600160a01b03166102f8565b34801561064457600080fd5b50600e546102f8906001600160a01b031681565b34801561066457600080fd5b506102ab61122f565b34801561067957600080fd5b5061060d610688366004612941565b61123e565b34801561069957600080fd5b5061025f6106a8366004612766565b6113c5565b61025f6106bb366004612976565b6113ec565b61025f6106ce3660046129f7565b6115b1565b3480156106df57600080fd5b506102ab6115f5565b3480156106f457600080fd5b50610708610703366004612643565b611683565b60405161028d9190612ad6565b34801561072157600080fd5b506102ab610730366004612643565b6116d3565b34801561074157600080fd5b5061025f610750366004612b25565b611730565b34801561076157600080fd5b506102ab611781565b34801561077657600080fd5b50610281610785366004612b84565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156107bf57600080fd5b5061025f6107ce366004612626565b61178e565b3480156107df57600080fd5b506103627f000000000000000000000000000000000000000000000000000000000000000081565b3360009081526009602052604090205460ff1661083f5760405162461bcd60e51b815260040161083690612bb2565b60405180910390fd5b61084f6040840160208501612be1565b61ffff16610864600154600054036000190190565b11156108be5760405162461bcd60e51b815260206004820152602360248201527f6d617820737570706c79206d7573742062652067746520746f74616c20737570604482015262706c7960e81b6064820152608401610836565b60026108d06060850160408601612c0b565b60018111156108e1576108e16128ad565b60ff16106109265760405162461bcd60e51b8152602060048201526012602482015271696e76616c69642073616c6520737461746560701b6044820152606401610836565b82600c6109338282612c28565b5050600e80546001600160a01b039384166001600160a01b031991821617909155600d805492909316911617905550565b600061096f826117ad565b8061098a575063152a902d60e11b6001600160e01b03198316145b92915050565b60606002805461099f90612cd9565b80601f01602080910402602001604051908101604052809291908181526020018280546109cb90612cd9565b8015610a185780601f106109ed57610100808354040283529160200191610a18565b820191906000526020600020905b8154815290600101906020018083116109fb57829003601f168201915b5050505050905090565b6000610a2c6117fb565b506001600160a01b031660009081526009602052604090205460ff1690565b6000610a5682611855565b610a73576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600e548290600160a01b900460ff1615610aac57610aac8161188e565b610ab68383611947565b505050565b3360009081526009602052604090205460ff16610aea5760405162461bcd60e51b815260040161083690612bb2565b600e8054911515600160a01b0260ff60a01b19909216919091179055565b600e548390600160a01b900460ff168015610b2c57506001600160a01b0381163314155b15610b3a57610b3a3361188e565b610b458484846119e7565b50505050565b600b546000908190819061ffff620100008204811691610b6c911686612d29565b610b769190612d40565b600a546001600160a01b031693509150505b9250929050565b610b976117fb565b4780610bda5760405162461bcd60e51b81526020600482015260126024820152714e6f2066756e647320617661696c61626c6560701b6044820152606401610836565b600080610bef6008546001600160a01b031690565b6001600160a01b03168360405160006040518083038185875af1925050503d8060008114610c39576040519150601f19603f3d011682016040523d82523d6000602084013e610c3e565b606091505b509150915081610ab6578060405163764e2d2f60e11b81526004016108369190612613565b610c6b6117fb565b600a80546001600160a01b0319166001600160a01b0385161790556040805180820190915261ffff8084168083529083166020909201829052600b805463ffffffff191690911762010000909202919091179055505050565b610ab6838383604051806020016040528060008152506115b1565b610ce76117fb565b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b6060816000816001600160401b03811115610d2f57610d2f6129e1565b604051908082528060200260200182016040528015610d6857816020015b610d556124fc565b815260200190600190039081610d4d5790505b50905060005b828114610dbb57610d96868683818110610d8a57610d8a612d62565b90506020020135611683565b828281518110610da857610da8612d62565b6020908102919091010152600101610d6e565b50949350505050565b6000610dcf82611d01565b5192915050565b60006001600160a01b038216610dff576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b610e2c6117fb565b610e366000611e3e565b565b600c54600160501b900460ff166001811115610e5657610e566128ad565b600114610e9b5760405162461bcd60e51b81526020600482015260136024820152721d185ad95bd999881a5cc8191a5cd8589b1959606a1b6044820152606401610836565b600c54600160401b900461ffff16610eba600154600054036000190190565b10610f075760405162461bcd60e51b815260206004820152601960248201527f6d696e742f6f72646572206578636565647320737570706c79000000000000006044820152606401610836565b600e546040516331a9108f60e11b81526004810184905233916001600160a01b031690636352211e90602401602060405180830381865afa158015610f50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f749190612d78565b6001600160a01b031614610fd45760405162461bcd60e51b815260206004820152602160248201527f6f776e657220636865636b206661696c656420666f72206275726e20746f6b656044820152603760f91b6064820152608401610836565b600e546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561101d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110419190612d78565b6001600160a01b0316146110a15760405162461bcd60e51b815260206004820152602160248201527f6f776e657220636865636b206661696c656420666f72206d6f6f6e20746f6b656044820152603760f91b6064820152608401610836565b600e54600d546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018590529116906323b872dd90606401600060405180830381600087803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b5050505061111a336001611e90565b60405181907f46ff1194ae66818e3efe7e3b689f81f1e206e8dc293db1f4a4a77d0afed9378690600090a25050565b6060600080600061115985610dd6565b90506000816001600160401b03811115611175576111756129e1565b60405190808252806020026020018201604052801561119e578160200160208202803683370190505b5090506111a96124fc565b60015b838614611223576111bc81611f27565b9150816040015161121b5781516001600160a01b0316156111dc57815194505b876001600160a01b0316856001600160a01b03160361121b578083878060010198508151811061120e5761120e612d62565b6020026020010181815250505b6001016111ac565b50909695505050505050565b60606003805461099f90612cd9565b606081831061126057604051631960ccad60e11b815260040160405180910390fd5b60008061126c60005490565b9050600185101561127c57600194505b80841115611288578093505b600061129387610dd6565b9050848610156112b257858503818110156112ac578091505b506112b6565b5060005b6000816001600160401b038111156112d0576112d06129e1565b6040519080825280602002602001820160405280156112f9578160200160208202803683370190505b5090508160000361130f5793506113be92505050565b600061131a88611683565b90506000816040015161132b575080515b885b88811415801561133d5750848714155b156113b25761134b81611f27565b925082604001516113aa5782516001600160a01b03161561136b57825191505b8a6001600160a01b0316826001600160a01b0316036113aa578084888060010199508151811061139d5761139d612d62565b6020026020010181815250505b60010161132d565b50505092835250909150505b9392505050565b600e548290600160a01b900460ff16156113e2576113e28161188e565b610ab68383611fa8565b3360009081526009602052604090205460ff1661141b5760405162461bcd60e51b815260040161083690612bb2565b82811461147f5760405162461bcd60e51b815260206004820152602c60248201527f4d7573742070726f7669646520657175616c207175616e74697469657320616e60448201526b6420726563697069656e747360a01b6064820152608401610836565b6000805b848110156114c35785858281811061149d5761149d612d62565b90506020020160208101906114b29190612be1565b61ffff169190910190600101611483565b50600c54600160401b900461ffff16816114e4600154600054036000190190565b6114ee9190612d95565b111561153c5760405162461bcd60e51b815260206004820152601960248201527f4d696e742f6f72646572206578636565647320737570706c79000000000000006044820152606401610836565b60005b828110156115a9576115a184848381811061155c5761155c612d62565b90506020020160208101906115719190612626565b87878481811061158357611583612d62565b90506020020160208101906115989190612be1565b61ffff16611e90565b60010161153f565b505050505050565b6115bc848484610b08565b6001600160a01b0383163b15610b45576115d884848484612014565b610b45576040516368d2bf6b60e11b815260040160405180910390fd5b600f805461160290612cd9565b80601f016020809104026020016040519081016040528092919081815260200182805461162e90612cd9565b801561167b5780601f106116505761010080835404028352916020019161167b565b820191906000526020600020905b81548152906001019060200180831161165e57829003601f168201915b505050505081565b61168b6124fc565b6116936124fc565b60018310806116a457506000548310155b156116af5792915050565b6116b883611f27565b90508060400151156116ca5792915050565b6113be83611f27565b60606116de82611855565b6116fb57604051630a14c4b560e41b815260040160405180910390fd5b600f611706836120ff565b601060405160200161171a93929190612e1b565b6040516020818303038152906040529050919050565b3360009081526009602052604090205460ff1661175f5760405162461bcd60e51b815260040161083690612bb2565b600f61176c848683612e94565b50601061177a828483612e94565b5050505050565b6010805461160290612cd9565b6117966117fb565b6117a1816001610cdf565b6117aa81612191565b50565b60006301ffc9a760e01b6001600160e01b0319831614806117de57506380ac58cd60e01b6001600160e01b03198316145b8061098a5750506001600160e01b031916635b5e139f60e01b1490565b6008546001600160a01b03163314610e365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610836565b600081600111158015611869575060005482105b801561098a575050600090815260046020526040902054600160e01b900460ff161590565b6daaeb6d7670e522a718067333cd4e3b156117aa57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156118fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191f9190612f53565b6117aa57604051633b79c77360e21b81526001600160a01b0382166004820152602401610836565b600061195282610dc4565b9050336001600160a01b0382161461198b5761196e8133610785565b61198b576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006119f282611d01565b9050836001600160a01b031681600001516001600160a01b031614611a295760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054611a44818733612207565b611a6f57611a528633610785565b611a6f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611a9657604051633a954ecd60e21b815260040160405180910390fd5b8015611aa157600082555b6001600160a01b03808716600090815260056020908152604080832080546000196001600160401b0380831691909101811667ffffffffffffffff19928316179092558a861680865283862080548085166001908101861691909416179055835160a081018552908152428316818601908152818501878152606080840194855260808d81015161ffff9081169186019182528f8b52600490995296909820925183549251915194519651909716600160f01b026001600160f01b03961515600160e81b0260ff60e81b19951515600160e01b029590951661ffff60e01b1992909616600160a01b026001600160e01b03199093169790991696909617179490941691909117171692909217909155830151611cbb5760018401600081815260046020526040812054600160a01b90046001600160401b03169003611cb9576000548114611cb9576040805160a08101825285516001600160a01b0390811682526020808801516001600160401b039081168285019081526000858701818152606087018281526080808e015161ffff908116918a019182528b8552600490975298909220965187549351915192519851909516600160f01b026001600160f01b03981515600160e81b0260ff60e81b19931515600160e01b029390931661ffff60e01b1992909516600160a01b026001600160e01b0319909416959096169490941791909117929092161717929092169190911790555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46115a9565b611d096124fc565b8180600111611e2557600054811015611e2557600081815260046020908152604091829020825160a08101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b820460ff9081161515938201849052600160e81b83041615156060820152600160f01b90910461ffff16608082015290611e23575b80516001600160a01b03166113be575060001901600081815260046020908152604091829020825160a08101845290546001600160a01b03811682526001600160401b03600160a01b8204169282019290925260ff600160e01b83048116151593820193909352600160e81b82049092161515606083015261ffff600160f01b909104166080820152611d95565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8015611f23577f0000000000000000000000000000000000000000000000000000000000000000811115611f1957611ee8827f0000000000000000000000000000000000000000000000000000000000000000612255565b611f127f000000000000000000000000000000000000000000000000000000000000000082612f70565b9050611e90565b611f238282612255565b5050565b611f2f6124fc565b50600090815260046020908152604091829020825160a08101845290546001600160a01b03811682526001600160401b03600160a01b8204169282019290925260ff600160e01b83048116151593820193909352600160e81b82049092161515606083015261ffff600160f01b90910416608082015290565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612049903390899088908890600401612f83565b6020604051808303816000875af1925050508015612084575060408051601f3d908101601f1916820190925261208191810190612fc0565b60015b6120e2573d8080156120b2576040519150601f19603f3d011682016040523d82523d6000602084013e6120b7565b606091505b5080516000036120da576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060600061210c83612424565b60010190506000816001600160401b0381111561212b5761212b6129e1565b6040519080825280601f01601f191660200182016040528015612155576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461215f57509392505050565b6121996117fb565b6001600160a01b0381166121fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610836565b6117aa81611e3e565b6000826001600160a01b0316826001600160a01b03160361222a575060016113be565b836001600160a01b0316826001600160a01b03160361224b575060016113be565b5060009392505050565b600080549082900361227a5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0380841660008181526005602090815260408083208054600160401b6001600160401b038083168b01811667ffffffffffffffff198416811783900482168c0182169092026fffffffffffffffffffffffffffffffff1990931690911791909117909155815160a08101835285815242821681850190815281840186815260018b1460608401908152608084018881528b8952600490975294872092518354925191519551965161ffff16600160f01b026001600160f01b03971515600160e81b0260ff60e81b19971515600160e01b029790971661ffff60e01b1993909616600160a01b026001600160e01b031990941691909a16179190911716919091179190911791909116939093179092559082840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146123fa57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a46001016123c2565b508160000361241b57604051622e076360e81b815260040160405180910390fd5b60005550505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106124635772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061248f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106124ad57662386f26fc10000830492506010015b6305f5e10083106124c5576305f5e100830492506008015b61271083106124d957612710830492506004015b606483106124eb576064830492506002015b600a831061098a5760010192915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6001600160a01b03811681146117aa57600080fd5b600080600083850360a081121561255557600080fd5b606081121561256357600080fd5b5083925060608401356125758161252a565b915060808401356125858161252a565b809150509250925092565b6001600160e01b0319811681146117aa57600080fd5b6000602082840312156125b857600080fd5b81356113be81612590565b60005b838110156125de5781810151838201526020016125c6565b50506000910152565b600081518084526125ff8160208601602086016125c3565b601f01601f19169290920160200192915050565b6020815260006113be60208301846125e7565b60006020828403121561263857600080fd5b81356113be8161252a565b60006020828403121561265557600080fd5b5035919050565b6000806040838503121561266f57600080fd5b823561267a8161252a565b946020939093013593505050565b80151581146117aa57600080fd5b6000602082840312156126a857600080fd5b81356113be81612688565b6000806000606084860312156126c857600080fd5b83356126d38161252a565b925060208401356126e38161252a565b929592945050506040919091013590565b6000806040838503121561270757600080fd5b50508035926020909101359150565b61ffff811681146117aa57600080fd5b60008060006060848603121561273b57600080fd5b83356127468161252a565b9250602084013561275681612716565b9150604084013561258581612716565b6000806040838503121561277957600080fd5b82356127848161252a565b9150602083013561279481612688565b809150509250929050565b60008083601f8401126127b157600080fd5b5081356001600160401b038111156127c857600080fd5b6020830191508360208260051b8501011115610b8857600080fd5b600080602083850312156127f657600080fd5b82356001600160401b0381111561280c57600080fd5b6128188582860161279f565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260608082015115159083015260809081015161ffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156112235761289a838551612824565b9284019260a09290920191600101612887565b634e487b7160e01b600052602160045260246000fd5b6001600160401b038416815261ffff8316602082015260608101600283106128fb57634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561122357835183529284019291840191600101612925565b60008060006060848603121561295657600080fd5b83356129618161252a565b95602085013595506040909401359392505050565b6000806000806040858703121561298c57600080fd5b84356001600160401b03808211156129a357600080fd5b6129af8883890161279f565b909650945060208701359150808211156129c857600080fd5b506129d58782880161279f565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612a0d57600080fd5b8435612a188161252a565b93506020850135612a288161252a565b92506040850135915060608501356001600160401b0380821115612a4b57600080fd5b818701915087601f830112612a5f57600080fd5b813581811115612a7157612a716129e1565b604051601f8201601f19908116603f01168101908382118183101715612a9957612a996129e1565b816040528281528a6020848701011115612ab257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60a0810161098a8284612824565b60008083601f840112612af657600080fd5b5081356001600160401b03811115612b0d57600080fd5b602083019150836020828501011115610b8857600080fd5b60008060008060408587031215612b3b57600080fd5b84356001600160401b0380821115612b5257600080fd5b612b5e88838901612ae4565b90965094506020870135915080821115612b7757600080fd5b506129d587828801612ae4565b60008060408385031215612b9757600080fd5b8235612ba28161252a565b915060208301356127948161252a565b602080825260159082015274556e617574686f72697a65642064656c656761746560581b604082015260600190565b600060208284031215612bf357600080fd5b81356113be81612716565b600281106117aa57600080fd5b600060208284031215612c1d57600080fd5b81356113be81612bfe565b81356001600160401b038116808214612c4057600080fd5b825467ffffffffffffffff1981168217845591506020840135612c6281612716565b69ffff0000000000000000604091821b1669ffffffffffffffffffff19841683178117855590850135612c9481612bfe565b60028110612cb257634e487b7160e01b600052602160045260246000fd5b6affffffffffffffffffffff19939093169091171760509190911b60ff60501b1617905550565b600181811c90821680612ced57607f821691505b602082108103612d0d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761098a5761098a612d13565b600082612d5d57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612d8a57600080fd5b81516113be8161252a565b8082018082111561098a5761098a612d13565b60008154612db581612cd9565b60018281168015612dcd5760018114612de257612e11565b60ff1984168752821515830287019450612e11565b8560005260208060002060005b85811015612e085781548a820152908401908201612def565b50505082870194505b5050505092915050565b6000612e278286612da8565b8451612e378183602089016125c3565b612e4381830186612da8565b979650505050505050565b601f821115610ab657600081815260208120601f850160051c81016020861015612e755750805b601f850160051c820191505b818110156115a957828155600101612e81565b6001600160401b03831115612eab57612eab6129e1565b612ebf83612eb98354612cd9565b83612e4e565b6000601f841160018114612ef35760008515612edb5750838201355b600019600387901b1c1916600186901b17835561177a565b600083815260209020601f19861690835b82811015612f245786850135825560209485019460019092019101612f04565b5086821015612f415760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060208284031215612f6557600080fd5b81516113be81612688565b8181038181111561098a5761098a612d13565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612fb6908301846125e7565b9695505050505050565b600060208284031215612fd257600080fd5b81516113be8161259056fea2646970667358221220873d5fe87223953858204aead6088382f17265625b60006d826088b37c78e93f64736f6c63430008110033

Deployed Bytecode

0x60806040526004361061023a5760003560e01c8063715018a61161012e578063ae7bf4c8116100ab578063d48ede991161006f578063d48ede9914610735578063dbbc853b14610755578063e985e9c51461076a578063f2fde38b146107b3578063f4daaba1146107d357600080fd5b8063ae7bf4c8146106ad578063b88d4fde146106c0578063c0ac9983146106d3578063c23dc68f146106e8578063c87b56dd1461071557600080fd5b80638da5cb5b116100f25780638da5cb5b1461061a57806394d8ec0a1461063857806395d89b411461065857806399a2557a1461066d578063a22cb4651461068d57600080fd5b8063715018a6146104f95780637885fdc71461050e57806379502c55146105865780638065b454146105cd5780638462151c146105ed57600080fd5b80632a55205a116101bc57806342842e0e1161018057806342842e0e146104595780634a994eef1461046c5780635bbb21771461048c5780636352211e146104b957806370a08231146104d957600080fd5b80632a55205a146103a35780633ba061d9146103e25780633ccfd60b1461040257806341acc66a1461041757806341f434341461043757600080fd5b8063095ea7b311610203578063095ea7b314610310578063109e943f1461032357806318160ddd14610344578063211f9e2f1461037057806323b872dd1461039057600080fd5b806292aa4e1461023f57806301ffc9a71461026157806306fdde031461029657806307779627146102b8578063081812fc146102d8575b600080fd5b34801561024b57600080fd5b5061025f61025a36600461253f565b610807565b005b34801561026d57600080fd5b5061028161027c3660046125a6565b610964565b60405190151581526020015b60405180910390f35b3480156102a257600080fd5b506102ab610990565b60405161028d9190612613565b3480156102c457600080fd5b506102816102d3366004612626565b610a22565b3480156102e457600080fd5b506102f86102f3366004612643565b610a4b565b6040516001600160a01b03909116815260200161028d565b61025f61031e36600461265c565b610a8f565b34801561032f57600080fd5b50600e5461028190600160a01b900460ff1681565b34801561035057600080fd5b50610362600154600054036000190190565b60405190815260200161028d565b34801561037c57600080fd5b5061025f61038b366004612696565b610abb565b61025f61039e3660046126b3565b610b08565b3480156103af57600080fd5b506103c36103be3660046126f4565b610b4b565b604080516001600160a01b03909316835260208301919091520161028d565b3480156103ee57600080fd5b50600d546102f8906001600160a01b031681565b34801561040e57600080fd5b5061025f610b8f565b34801561042357600080fd5b5061025f610432366004612726565b610c63565b34801561044357600080fd5b506102f86daaeb6d7670e522a718067333cd4e81565b61025f6104673660046126b3565b610cc4565b34801561047857600080fd5b5061025f610487366004612766565b610cdf565b34801561049857600080fd5b506104ac6104a73660046127e3565b610d12565b60405161028d919061286b565b3480156104c557600080fd5b506102f86104d4366004612643565b610dc4565b3480156104e557600080fd5b506103626104f4366004612626565b610dd6565b34801561050557600080fd5b5061025f610e24565b34801561051a57600080fd5b50600a5460408051808201909152600b5461ffff808216835262010000909104166020820152610551916001600160a01b03169082565b604080516001600160a01b039093168352815161ffff908116602080860191909152909201519091169082015260600161028d565b34801561059257600080fd5b50600c546105be906001600160401b03811690600160401b810461ffff1690600160501b900460ff1683565b60405161028d939291906128c3565b3480156105d957600080fd5b5061025f6105e83660046126f4565b610e38565b3480156105f957600080fd5b5061060d610608366004612626565b611149565b60405161028d9190612909565b34801561062657600080fd5b506008546001600160a01b03166102f8565b34801561064457600080fd5b50600e546102f8906001600160a01b031681565b34801561066457600080fd5b506102ab61122f565b34801561067957600080fd5b5061060d610688366004612941565b61123e565b34801561069957600080fd5b5061025f6106a8366004612766565b6113c5565b61025f6106bb366004612976565b6113ec565b61025f6106ce3660046129f7565b6115b1565b3480156106df57600080fd5b506102ab6115f5565b3480156106f457600080fd5b50610708610703366004612643565b611683565b60405161028d9190612ad6565b34801561072157600080fd5b506102ab610730366004612643565b6116d3565b34801561074157600080fd5b5061025f610750366004612b25565b611730565b34801561076157600080fd5b506102ab611781565b34801561077657600080fd5b50610281610785366004612b84565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156107bf57600080fd5b5061025f6107ce366004612626565b61178e565b3480156107df57600080fd5b506103627f000000000000000000000000000000000000000000000000000000000000000581565b3360009081526009602052604090205460ff1661083f5760405162461bcd60e51b815260040161083690612bb2565b60405180910390fd5b61084f6040840160208501612be1565b61ffff16610864600154600054036000190190565b11156108be5760405162461bcd60e51b815260206004820152602360248201527f6d617820737570706c79206d7573742062652067746520746f74616c20737570604482015262706c7960e81b6064820152608401610836565b60026108d06060850160408601612c0b565b60018111156108e1576108e16128ad565b60ff16106109265760405162461bcd60e51b8152602060048201526012602482015271696e76616c69642073616c6520737461746560701b6044820152606401610836565b82600c6109338282612c28565b5050600e80546001600160a01b039384166001600160a01b031991821617909155600d805492909316911617905550565b600061096f826117ad565b8061098a575063152a902d60e11b6001600160e01b03198316145b92915050565b60606002805461099f90612cd9565b80601f01602080910402602001604051908101604052809291908181526020018280546109cb90612cd9565b8015610a185780601f106109ed57610100808354040283529160200191610a18565b820191906000526020600020905b8154815290600101906020018083116109fb57829003601f168201915b5050505050905090565b6000610a2c6117fb565b506001600160a01b031660009081526009602052604090205460ff1690565b6000610a5682611855565b610a73576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b600e548290600160a01b900460ff1615610aac57610aac8161188e565b610ab68383611947565b505050565b3360009081526009602052604090205460ff16610aea5760405162461bcd60e51b815260040161083690612bb2565b600e8054911515600160a01b0260ff60a01b19909216919091179055565b600e548390600160a01b900460ff168015610b2c57506001600160a01b0381163314155b15610b3a57610b3a3361188e565b610b458484846119e7565b50505050565b600b546000908190819061ffff620100008204811691610b6c911686612d29565b610b769190612d40565b600a546001600160a01b031693509150505b9250929050565b610b976117fb565b4780610bda5760405162461bcd60e51b81526020600482015260126024820152714e6f2066756e647320617661696c61626c6560701b6044820152606401610836565b600080610bef6008546001600160a01b031690565b6001600160a01b03168360405160006040518083038185875af1925050503d8060008114610c39576040519150601f19603f3d011682016040523d82523d6000602084013e610c3e565b606091505b509150915081610ab6578060405163764e2d2f60e11b81526004016108369190612613565b610c6b6117fb565b600a80546001600160a01b0319166001600160a01b0385161790556040805180820190915261ffff8084168083529083166020909201829052600b805463ffffffff191690911762010000909202919091179055505050565b610ab6838383604051806020016040528060008152506115b1565b610ce76117fb565b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b6060816000816001600160401b03811115610d2f57610d2f6129e1565b604051908082528060200260200182016040528015610d6857816020015b610d556124fc565b815260200190600190039081610d4d5790505b50905060005b828114610dbb57610d96868683818110610d8a57610d8a612d62565b90506020020135611683565b828281518110610da857610da8612d62565b6020908102919091010152600101610d6e565b50949350505050565b6000610dcf82611d01565b5192915050565b60006001600160a01b038216610dff576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b610e2c6117fb565b610e366000611e3e565b565b600c54600160501b900460ff166001811115610e5657610e566128ad565b600114610e9b5760405162461bcd60e51b81526020600482015260136024820152721d185ad95bd999881a5cc8191a5cd8589b1959606a1b6044820152606401610836565b600c54600160401b900461ffff16610eba600154600054036000190190565b10610f075760405162461bcd60e51b815260206004820152601960248201527f6d696e742f6f72646572206578636565647320737570706c79000000000000006044820152606401610836565b600e546040516331a9108f60e11b81526004810184905233916001600160a01b031690636352211e90602401602060405180830381865afa158015610f50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f749190612d78565b6001600160a01b031614610fd45760405162461bcd60e51b815260206004820152602160248201527f6f776e657220636865636b206661696c656420666f72206275726e20746f6b656044820152603760f91b6064820152608401610836565b600e546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa15801561101d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110419190612d78565b6001600160a01b0316146110a15760405162461bcd60e51b815260206004820152602160248201527f6f776e657220636865636b206661696c656420666f72206d6f6f6e20746f6b656044820152603760f91b6064820152608401610836565b600e54600d546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018590529116906323b872dd90606401600060405180830381600087803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b5050505061111a336001611e90565b60405181907f46ff1194ae66818e3efe7e3b689f81f1e206e8dc293db1f4a4a77d0afed9378690600090a25050565b6060600080600061115985610dd6565b90506000816001600160401b03811115611175576111756129e1565b60405190808252806020026020018201604052801561119e578160200160208202803683370190505b5090506111a96124fc565b60015b838614611223576111bc81611f27565b9150816040015161121b5781516001600160a01b0316156111dc57815194505b876001600160a01b0316856001600160a01b03160361121b578083878060010198508151811061120e5761120e612d62565b6020026020010181815250505b6001016111ac565b50909695505050505050565b60606003805461099f90612cd9565b606081831061126057604051631960ccad60e11b815260040160405180910390fd5b60008061126c60005490565b9050600185101561127c57600194505b80841115611288578093505b600061129387610dd6565b9050848610156112b257858503818110156112ac578091505b506112b6565b5060005b6000816001600160401b038111156112d0576112d06129e1565b6040519080825280602002602001820160405280156112f9578160200160208202803683370190505b5090508160000361130f5793506113be92505050565b600061131a88611683565b90506000816040015161132b575080515b885b88811415801561133d5750848714155b156113b25761134b81611f27565b925082604001516113aa5782516001600160a01b03161561136b57825191505b8a6001600160a01b0316826001600160a01b0316036113aa578084888060010199508151811061139d5761139d612d62565b6020026020010181815250505b60010161132d565b50505092835250909150505b9392505050565b600e548290600160a01b900460ff16156113e2576113e28161188e565b610ab68383611fa8565b3360009081526009602052604090205460ff1661141b5760405162461bcd60e51b815260040161083690612bb2565b82811461147f5760405162461bcd60e51b815260206004820152602c60248201527f4d7573742070726f7669646520657175616c207175616e74697469657320616e60448201526b6420726563697069656e747360a01b6064820152608401610836565b6000805b848110156114c35785858281811061149d5761149d612d62565b90506020020160208101906114b29190612be1565b61ffff169190910190600101611483565b50600c54600160401b900461ffff16816114e4600154600054036000190190565b6114ee9190612d95565b111561153c5760405162461bcd60e51b815260206004820152601960248201527f4d696e742f6f72646572206578636565647320737570706c79000000000000006044820152606401610836565b60005b828110156115a9576115a184848381811061155c5761155c612d62565b90506020020160208101906115719190612626565b87878481811061158357611583612d62565b90506020020160208101906115989190612be1565b61ffff16611e90565b60010161153f565b505050505050565b6115bc848484610b08565b6001600160a01b0383163b15610b45576115d884848484612014565b610b45576040516368d2bf6b60e11b815260040160405180910390fd5b600f805461160290612cd9565b80601f016020809104026020016040519081016040528092919081815260200182805461162e90612cd9565b801561167b5780601f106116505761010080835404028352916020019161167b565b820191906000526020600020905b81548152906001019060200180831161165e57829003601f168201915b505050505081565b61168b6124fc565b6116936124fc565b60018310806116a457506000548310155b156116af5792915050565b6116b883611f27565b90508060400151156116ca5792915050565b6113be83611f27565b60606116de82611855565b6116fb57604051630a14c4b560e41b815260040160405180910390fd5b600f611706836120ff565b601060405160200161171a93929190612e1b565b6040516020818303038152906040529050919050565b3360009081526009602052604090205460ff1661175f5760405162461bcd60e51b815260040161083690612bb2565b600f61176c848683612e94565b50601061177a828483612e94565b5050505050565b6010805461160290612cd9565b6117966117fb565b6117a1816001610cdf565b6117aa81612191565b50565b60006301ffc9a760e01b6001600160e01b0319831614806117de57506380ac58cd60e01b6001600160e01b03198316145b8061098a5750506001600160e01b031916635b5e139f60e01b1490565b6008546001600160a01b03163314610e365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610836565b600081600111158015611869575060005482105b801561098a575050600090815260046020526040902054600160e01b900460ff161590565b6daaeb6d7670e522a718067333cd4e3b156117aa57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156118fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191f9190612f53565b6117aa57604051633b79c77360e21b81526001600160a01b0382166004820152602401610836565b600061195282610dc4565b9050336001600160a01b0382161461198b5761196e8133610785565b61198b576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006119f282611d01565b9050836001600160a01b031681600001516001600160a01b031614611a295760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054611a44818733612207565b611a6f57611a528633610785565b611a6f57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516611a9657604051633a954ecd60e21b815260040160405180910390fd5b8015611aa157600082555b6001600160a01b03808716600090815260056020908152604080832080546000196001600160401b0380831691909101811667ffffffffffffffff19928316179092558a861680865283862080548085166001908101861691909416179055835160a081018552908152428316818601908152818501878152606080840194855260808d81015161ffff9081169186019182528f8b52600490995296909820925183549251915194519651909716600160f01b026001600160f01b03961515600160e81b0260ff60e81b19951515600160e01b029590951661ffff60e01b1992909616600160a01b026001600160e01b03199093169790991696909617179490941691909117171692909217909155830151611cbb5760018401600081815260046020526040812054600160a01b90046001600160401b03169003611cb9576000548114611cb9576040805160a08101825285516001600160a01b0390811682526020808801516001600160401b039081168285019081526000858701818152606087018281526080808e015161ffff908116918a019182528b8552600490975298909220965187549351915192519851909516600160f01b026001600160f01b03981515600160e81b0260ff60e81b19931515600160e01b029390931661ffff60e01b1992909516600160a01b026001600160e01b0319909416959096169490941791909117929092161717929092169190911790555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46115a9565b611d096124fc565b8180600111611e2557600054811015611e2557600081815260046020908152604091829020825160a08101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b820460ff9081161515938201849052600160e81b83041615156060820152600160f01b90910461ffff16608082015290611e23575b80516001600160a01b03166113be575060001901600081815260046020908152604091829020825160a08101845290546001600160a01b03811682526001600160401b03600160a01b8204169282019290925260ff600160e01b83048116151593820193909352600160e81b82049092161515606083015261ffff600160f01b909104166080820152611d95565b505b604051636f96cda160e11b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8015611f23577f0000000000000000000000000000000000000000000000000000000000000005811115611f1957611ee8827f0000000000000000000000000000000000000000000000000000000000000005612255565b611f127f000000000000000000000000000000000000000000000000000000000000000582612f70565b9050611e90565b611f238282612255565b5050565b611f2f6124fc565b50600090815260046020908152604091829020825160a08101845290546001600160a01b03811682526001600160401b03600160a01b8204169282019290925260ff600160e01b83048116151593820193909352600160e81b82049092161515606083015261ffff600160f01b90910416608082015290565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612049903390899088908890600401612f83565b6020604051808303816000875af1925050508015612084575060408051601f3d908101601f1916820190925261208191810190612fc0565b60015b6120e2573d8080156120b2576040519150601f19603f3d011682016040523d82523d6000602084013e6120b7565b606091505b5080516000036120da576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050949350505050565b6060600061210c83612424565b60010190506000816001600160401b0381111561212b5761212b6129e1565b6040519080825280601f01601f191660200182016040528015612155576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461215f57509392505050565b6121996117fb565b6001600160a01b0381166121fe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610836565b6117aa81611e3e565b6000826001600160a01b0316826001600160a01b03160361222a575060016113be565b836001600160a01b0316826001600160a01b03160361224b575060016113be565b5060009392505050565b600080549082900361227a5760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b0380841660008181526005602090815260408083208054600160401b6001600160401b038083168b01811667ffffffffffffffff198416811783900482168c0182169092026fffffffffffffffffffffffffffffffff1990931690911791909117909155815160a08101835285815242821681850190815281840186815260018b1460608401908152608084018881528b8952600490975294872092518354925191519551965161ffff16600160f01b026001600160f01b03971515600160e81b0260ff60e81b19971515600160e01b029790971661ffff60e01b1993909616600160a01b026001600160e01b031990941691909a16179190911716919091179190911791909116939093179092559082840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b8181146123fa57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a46001016123c2565b508160000361241b57604051622e076360e81b815260040160405180910390fd5b60005550505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106124635772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061248f576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106124ad57662386f26fc10000830492506010015b6305f5e10083106124c5576305f5e100830492506008015b61271083106124d957612710830492506004015b606483106124eb576064830492506002015b600a831061098a5760010192915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b6001600160a01b03811681146117aa57600080fd5b600080600083850360a081121561255557600080fd5b606081121561256357600080fd5b5083925060608401356125758161252a565b915060808401356125858161252a565b809150509250925092565b6001600160e01b0319811681146117aa57600080fd5b6000602082840312156125b857600080fd5b81356113be81612590565b60005b838110156125de5781810151838201526020016125c6565b50506000910152565b600081518084526125ff8160208601602086016125c3565b601f01601f19169290920160200192915050565b6020815260006113be60208301846125e7565b60006020828403121561263857600080fd5b81356113be8161252a565b60006020828403121561265557600080fd5b5035919050565b6000806040838503121561266f57600080fd5b823561267a8161252a565b946020939093013593505050565b80151581146117aa57600080fd5b6000602082840312156126a857600080fd5b81356113be81612688565b6000806000606084860312156126c857600080fd5b83356126d38161252a565b925060208401356126e38161252a565b929592945050506040919091013590565b6000806040838503121561270757600080fd5b50508035926020909101359150565b61ffff811681146117aa57600080fd5b60008060006060848603121561273b57600080fd5b83356127468161252a565b9250602084013561275681612716565b9150604084013561258581612716565b6000806040838503121561277957600080fd5b82356127848161252a565b9150602083013561279481612688565b809150509250929050565b60008083601f8401126127b157600080fd5b5081356001600160401b038111156127c857600080fd5b6020830191508360208260051b8501011115610b8857600080fd5b600080602083850312156127f657600080fd5b82356001600160401b0381111561280c57600080fd5b6128188582860161279f565b90969095509350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260608082015115159083015260809081015161ffff16910152565b6020808252825182820181905260009190848201906040850190845b818110156112235761289a838551612824565b9284019260a09290920191600101612887565b634e487b7160e01b600052602160045260246000fd5b6001600160401b038416815261ffff8316602082015260608101600283106128fb57634e487b7160e01b600052602160045260246000fd5b826040830152949350505050565b6020808252825182820181905260009190848201906040850190845b8181101561122357835183529284019291840191600101612925565b60008060006060848603121561295657600080fd5b83356129618161252a565b95602085013595506040909401359392505050565b6000806000806040858703121561298c57600080fd5b84356001600160401b03808211156129a357600080fd5b6129af8883890161279f565b909650945060208701359150808211156129c857600080fd5b506129d58782880161279f565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215612a0d57600080fd5b8435612a188161252a565b93506020850135612a288161252a565b92506040850135915060608501356001600160401b0380821115612a4b57600080fd5b818701915087601f830112612a5f57600080fd5b813581811115612a7157612a716129e1565b604051601f8201601f19908116603f01168101908382118183101715612a9957612a996129e1565b816040528281528a6020848701011115612ab257600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60a0810161098a8284612824565b60008083601f840112612af657600080fd5b5081356001600160401b03811115612b0d57600080fd5b602083019150836020828501011115610b8857600080fd5b60008060008060408587031215612b3b57600080fd5b84356001600160401b0380821115612b5257600080fd5b612b5e88838901612ae4565b90965094506020870135915080821115612b7757600080fd5b506129d587828801612ae4565b60008060408385031215612b9757600080fd5b8235612ba28161252a565b915060208301356127948161252a565b602080825260159082015274556e617574686f72697a65642064656c656761746560581b604082015260600190565b600060208284031215612bf357600080fd5b81356113be81612716565b600281106117aa57600080fd5b600060208284031215612c1d57600080fd5b81356113be81612bfe565b81356001600160401b038116808214612c4057600080fd5b825467ffffffffffffffff1981168217845591506020840135612c6281612716565b69ffff0000000000000000604091821b1669ffffffffffffffffffff19841683178117855590850135612c9481612bfe565b60028110612cb257634e487b7160e01b600052602160045260246000fd5b6affffffffffffffffffffff19939093169091171760509190911b60ff60501b1617905550565b600181811c90821680612ced57607f821691505b602082108103612d0d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761098a5761098a612d13565b600082612d5d57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612d8a57600080fd5b81516113be8161252a565b8082018082111561098a5761098a612d13565b60008154612db581612cd9565b60018281168015612dcd5760018114612de257612e11565b60ff1984168752821515830287019450612e11565b8560005260208060002060005b85811015612e085781548a820152908401908201612def565b50505082870194505b5050505092915050565b6000612e278286612da8565b8451612e378183602089016125c3565b612e4381830186612da8565b979650505050505050565b601f821115610ab657600081815260208120601f850160051c81016020861015612e755750805b601f850160051c820191505b818110156115a957828155600101612e81565b6001600160401b03831115612eab57612eab6129e1565b612ebf83612eb98354612cd9565b83612e4e565b6000601f841160018114612ef35760008515612edb5750838201355b600019600387901b1c1916600186901b17835561177a565b600083815260209020601f19861690835b82811015612f245786850135825560209485019460019092019101612f04565b5086821015612f415760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b600060208284031215612f6557600080fd5b81516113be81612688565b8181038181111561098a5761098a612d13565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090612fb6908301846125e7565b9695505050505050565b600060208284031215612fd257600080fd5b81516113be8161259056fea2646970667358221220873d5fe87223953858204aead6088382f17265625b60006d826088b37c78e93f64736f6c63430008110033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.