ETH Price: $3,919.38 (+0.35%)

Token

DigiDaigakuDragonEssence (DIDE)
 

Overview

Max Total Supply

0 DIDE

Holders

525

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
yebok.eth
Balance
0 DIDE
0x98b7db9fb1f587504c18766b29a248a9ffa3e427
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

This collection consists of Dragon Essences needed to create DigiDaigaku Adult Dragons.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DigiDaigakuDragonEssence

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

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

import "@limit-break/presets/BlacklistedTransferAdventureNFT.sol";
import "@limit-break/utils/tokens/ClaimableHolderMint.sol";
import "@limit-break/utils/tokens/SignedApprovalMint.sol";

/**
 * @title DigiDaigakuDragonEssence
 * @author Limit Break, Inc.
 * @notice Dragon Essences designed to enhance your baby dragon.
 */
contract DigiDaigakuDragonEssence is BlacklistedTransferAdventureNFT, ClaimableHolderMint, SignedApprovalMint {
    constructor(address royaltyReceiver_, uint96 royaltyFeeNumerator_)
        ERC721("", "")
        EIP712("DigiDaigakuDragonEssence", "1")
    {
        initializeERC721("DigiDaigakuDragonEssence", "DIDE");
        initializeURI("https://digidaigaku.com/dragon-essences/metadata/", ".json");
        initializeAdventureERC721(100);
        initializeRoyalties(royaltyReceiver_, royaltyFeeNumerator_);
        initializeOperatorFilterer(address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6), true);
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(AdventureNFT, IERC165) returns (bool) {
        return interfaceId == type(ISignedApprovalInitializer).interfaceId
            || interfaceId == type(IRootCollectionInitializer).interfaceId || super.supportsInterface(interfaceId);
    }

    function _safeMintToken(address to, uint256 tokenId) internal virtual override {
        _safeMint(to, tokenId);
    }

    function _mintToken(address to, uint256 tokenId) internal virtual override {
        _mint(to, tokenId);
    }
}

File 2 of 41 : AdventureERC721.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./IAdventurous.sol";
import "./AdventureWhitelist.sol";
import "../initializable/IAdventureERC721Initializer.sol";
import "../utils/tokens/InitializableERC721.sol";

error AdventureApprovalToCaller();
error AlreadyInitializedAdventureERC721();
error AlreadyOnQuest();
error AnActiveQuestIsPreventingTransfers();
error CallerNotApprovedForAdventure();
error CallerNotTokenOwner();
error MaxSimultaneousQuestsCannotBeZero();
error MaxSimultaneousQuestsExceeded();
error NotOnQuest();
error QuestIdOutOfRange();
error TooManyActiveQuests();

/**
 * @title AdventureERC721
 * @author Limit Break, Inc.
 * @notice Implements the {IAdventurous} token standard for ERC721-compliant tokens.
 * Includes a user approval mechanism specific to {IAdventurous} functionality.
 * @dev Inherits {InitializableERC721} to provide the option to support EIP-1167.
 */
abstract contract AdventureERC721 is InitializableERC721, AdventureWhitelist, IAdventurous, IAdventureERC721Initializer {

    /// @notice Specifies an upper bound for the maximum number of simultaneous quests per adventure.
    uint256 private constant MAX_CONCURRENT_QUESTS = 100;

    /// @dev A value denoting a transfer originating from transferFrom or safeTransferFrom
    uint256 internal constant TRANSFERRING_VIA_ERC721 = 1;

    /// @dev A value denoting a transfer originating from adventureTransferFrom or adventureSafeTransferFrom
    uint256 internal constant TRANSFERRING_VIA_ADVENTURE = 2;

    /// @notice Specifies whether or not the contract is initialized
    bool private initializedAdventureERC721;

    /// @dev Specifies the type of transfer that is actively being used
    uint256 internal transferType;

    /// @dev The most simultaneous quests the token may participate in at a time
    uint256 private _maxSimultaneousQuests;

    /// @dev Maps each token id to the number of blocking quests it is currently entered into
    mapping (uint256 => uint256) internal blockingQuestCounts;

    /// @dev Mapping from owner to operator approvals for special gameplay behavior
    mapping (address => mapping (address => bool)) private operatorAdventureApprovals;

    /// @dev Maps each token id to a mapping that can enumerate all active quests within an adventure
    mapping (uint256 => mapping (address => uint32[])) public activeQuestList;

    /// @dev Maps each token id to a mapping from adventure address to a mapping of quest ids to quest details
    mapping (uint256 => mapping (address => mapping (uint32 => Quest))) public activeQuestLookup;

    /// @dev Initializes parameters of AdventureERC721 tokens.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeAdventureERC721(uint256 maxSimultaneousQuests_) public override onlyOwner {
        if(initializedAdventureERC721) {
            revert AlreadyInitializedAdventureERC721();
        }

        _validateMaxSimultaneousQuests(maxSimultaneousQuests_);
        _maxSimultaneousQuests = maxSimultaneousQuests_;

        initializedAdventureERC721 = true;
        transferType = TRANSFERRING_VIA_ERC721;
    }

    /// @dev ERC-165 interface support
    function supportsInterface(bytes4 interfaceId) public view virtual override (InitializableERC721, IERC165) returns (bool) {
        return 
        interfaceId == type(IAdventurous).interfaceId || 
        interfaceId == type(IAdventureERC721Initializer).interfaceId ||
        super.supportsInterface(interfaceId);
    }

    /// @notice Transfers a player's token if they have opted into an authorized, whitelisted adventure.
    function adventureTransferFrom(address from, address to, uint256 tokenId) external override {
        _requireCallerIsWhitelistedAdventure();
        _requireCallerApprovedForAdventure(tokenId);
        transferType = TRANSFERRING_VIA_ADVENTURE;
        _transfer(from, to, tokenId);
        transferType = TRANSFERRING_VIA_ERC721;
    }

    /// @notice Safe transfers a player's token if they have opted into an authorized, whitelisted adventure.
    function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external override {
        _requireCallerIsWhitelistedAdventure();
        _requireCallerApprovedForAdventure(tokenId);
        transferType = TRANSFERRING_VIA_ADVENTURE;
        _safeTransfer(from, to, tokenId, "");
        transferType = TRANSFERRING_VIA_ERC721;
    }

    /// @notice Burns a player's token if they have opted into an authorized, whitelisted adventure.
    function adventureBurn(uint256 tokenId) external override {
        _requireCallerIsWhitelistedAdventure();
        _requireCallerApprovedForAdventure(tokenId);
        transferType = TRANSFERRING_VIA_ADVENTURE;
        _burn(tokenId);
        transferType = TRANSFERRING_VIA_ERC721;
    }

    /// @notice Enters a player's token into a quest if they have opted into an authorized, whitelisted adventure.
    function enterQuest(uint256 tokenId, uint256 questId) external override {
        _requireCallerIsWhitelistedAdventure();
        _requireCallerApprovedForAdventure(tokenId);
        _enterQuest(tokenId, _msgSender(), questId);
    }

    /// @notice Exits a player's token from a quest if they have opted into an authorized, whitelisted adventure.
    /// For developers of adventure contracts that perform adventure burns, be aware that the adventure must exitQuest
    /// before the adventure burn occurs, as _exitQuest emits the owner of the token, which would revert after burning.
    function exitQuest(uint256 tokenId, uint256 questId) external override {
        _requireCallerIsWhitelistedAdventure();
        _requireCallerApprovedForAdventure(tokenId);
        _exitQuest(tokenId, _msgSender(), questId);
    }

    /// @notice Admin-only ability to boot a token from all quests on an adventure.
    /// This ability is only unlocked in the event that an adventure has been unwhitelisted, as early exiting
    /// from quests can cause out of sync state between the ERC721 token contract and the adventure/quest.
    function bootFromAllQuests(uint256 tokenId, address adventure) external onlyOwner {
        _requireAdventureRemovedFromWhitelist(adventure);
        _exitAllQuests(tokenId, adventure, true);
    }

    /// @notice Gives the player the ability to exit a quest without interacting directly with the approved, whitelisted adventure
    /// This ability is only unlocked in the event that an adventure has been unwhitelisted, as early exiting
    /// from quests can cause out of sync state between the ERC721 token contract and the adventure/quest.
    function userExitQuest(uint256 tokenId, address adventure, uint256 questId) external {
        _requireAdventureRemovedFromWhitelist(adventure);
        _requireCallerOwnsToken(tokenId);
        _exitQuest(tokenId, adventure, questId);
    }

    /// @notice Gives the player the ability to exit all quests on an adventure without interacting directly with the approved, whitelisted adventure
    /// This ability is only unlocked in the event that an adventure has been unwhitelisted, as early exiting
    /// from quests can cause out of sync state between the ERC721 token contract and the adventure/quest.
    function userExitAllQuests(uint256 tokenId, address adventure) external {
        _requireAdventureRemovedFromWhitelist(adventure);
        _requireCallerOwnsToken(tokenId);
        _exitAllQuests(tokenId, adventure, false);
    }

    /// @notice Similar to {IERC721-setApprovalForAll}, but for special in-game adventures only
    function setAdventuresApprovedForAll(address operator, bool approved) external {
        address tokenOwner = _msgSender();

        if(tokenOwner == operator) {
            revert AdventureApprovalToCaller();
        }
        operatorAdventureApprovals[tokenOwner][operator] = approved;
        emit AdventureApprovalForAll(tokenOwner, operator, approved);
    }

    /// @notice Similar to {IERC721-isApprovedForAll}, but for special in-game adventures only
    function areAdventuresApprovedForAll(address owner, address operator) public view returns (bool) {
        return operatorAdventureApprovals[owner][operator];
    }    
    
    /// @notice Returns the number of quests a token is actively participating in for a specified adventure
    function getQuestCount(uint256 tokenId, address adventure) public override view returns (uint256) {
        return activeQuestList[tokenId][adventure].length;
    }

    /// @notice Returns the amount of time a token has been participating in the specified quest
    function getTimeOnQuest(uint256 tokenId, address adventure, uint256 questId) public override view returns (uint256) {
        (bool participatingInQuest, uint256 startTimestamp,) = isParticipatingInQuest(tokenId, adventure, questId);
        return participatingInQuest ? (block.timestamp - startTimestamp) : 0;
    } 

    /// @notice Returns whether or not a token is currently participating in the specified quest as well as the time it was started and the quest index
    function isParticipatingInQuest(uint256 tokenId, address adventure, uint256 questId) public override view returns (bool participatingInQuest, uint256 startTimestamp, uint256 index) {
        if(questId > type(uint32).max) {
            revert QuestIdOutOfRange();
        }

        Quest storage quest = activeQuestLookup[tokenId][adventure][uint32(questId)];
        participatingInQuest = quest.isActive;
        startTimestamp = quest.startTimestamp;
        index = quest.arrayIndex;
        return (participatingInQuest, startTimestamp, index);
    }

    /// @notice Returns a list of all active quests for the specified token id and adventure
    function getActiveQuests(uint256 tokenId, address adventure) public override view returns (Quest[] memory activeQuests) {
        uint256 questCount = getQuestCount(tokenId, adventure);
        activeQuests = new Quest[](questCount);
        uint32[] memory activeQuestIdList = activeQuestList[tokenId][adventure];

        for(uint256 i = 0; i < questCount; ++i) {
            activeQuests[i] = activeQuestLookup[tokenId][adventure][activeQuestIdList[i]];
        }

        return activeQuests;
    }

    /// @notice Returns the maximum number of simultaneous quests the token can be in per adventure.
    function maxSimultaneousQuests() public view returns (uint256) {
        return _maxSimultaneousQuests;
    }

    /// @dev Enters the specified quest for a token id.
    /// Throws if the token is already participating in the specified quest.
    /// Throws if the number of active quests exceeds the max allowable for the given adventure.
    /// Emits a QuestUpdated event for off-chain processing.
    function _enterQuest(uint256 tokenId, address adventure, uint256 questId) internal {
        (bool participatingInQuest,,) = isParticipatingInQuest(tokenId, adventure, questId);
        if(participatingInQuest) {
            revert AlreadyOnQuest();
        }

        uint256 currentQuestCount = getQuestCount(tokenId, adventure);
        if(currentQuestCount >= _maxSimultaneousQuests) {
            revert TooManyActiveQuests();
        }

        uint32 castedQuestId = uint32(questId);
        activeQuestList[tokenId][adventure].push(castedQuestId);
        activeQuestLookup[tokenId][adventure][castedQuestId].isActive = true;
        activeQuestLookup[tokenId][adventure][castedQuestId].startTimestamp = uint64(block.timestamp);
        activeQuestLookup[tokenId][adventure][castedQuestId].questId = castedQuestId;
        activeQuestLookup[tokenId][adventure][castedQuestId].arrayIndex = uint32(currentQuestCount);

        address ownerOfToken = ownerOf(tokenId);
        emit QuestUpdated(tokenId, ownerOfToken, adventure, questId, true, false);

        if(IAdventure(adventure).questsLockTokens()) {
            unchecked {
                ++blockingQuestCounts[tokenId];
            }
        }

        // Invoke callback to the adventure to facilitate state synchronization as needed
        IAdventure(adventure).onQuestEntered(ownerOfToken, tokenId, questId);
    }

    /// @dev Exits the specified quest for a token id.
    /// Throws if the token is not currently participating on the specified quest.
    /// Emits a QuestUpdated event for off-chain processing.
    function _exitQuest(uint256 tokenId, address adventure, uint256 questId) internal {
        (bool participatingInQuest, uint256 startTimestamp, uint256 index) = isParticipatingInQuest(tokenId, adventure, questId);
        if(!participatingInQuest) {
            revert NotOnQuest();
        }

        uint32 castedQuestId = uint32(questId);
        uint256 lastArrayIndex = getQuestCount(tokenId, adventure) - 1;
        if(index != lastArrayIndex) {
            activeQuestList[tokenId][adventure][index] = activeQuestList[tokenId][adventure][lastArrayIndex];
            activeQuestLookup[tokenId][adventure][activeQuestList[tokenId][adventure][lastArrayIndex]].arrayIndex = uint32(index);
        }

        activeQuestList[tokenId][adventure].pop();
        delete activeQuestLookup[tokenId][adventure][castedQuestId];

        address ownerOfToken = ownerOf(tokenId);
        emit QuestUpdated(tokenId, ownerOfToken, adventure, questId, false, false);

        if(IAdventure(adventure).questsLockTokens()) {
            --blockingQuestCounts[tokenId];
        }

        // Invoke callback to the adventure to facilitate state synchronization as needed
        IAdventure(adventure).onQuestExited(ownerOfToken, tokenId, questId, startTimestamp);
    }

    /// @dev Removes the specified token id from all quests on the specified adventure
    function _exitAllQuests(uint256 tokenId, address adventure, bool booted) internal {
        address tokenOwner = ownerOf(tokenId);
        uint256 questCount = getQuestCount(tokenId, adventure);

        if(IAdventure(adventure).questsLockTokens()) {
            blockingQuestCounts[tokenId] -= questCount;
        }

        for(uint256 i = 0; i < questCount;) {
            uint32 questId = activeQuestList[tokenId][adventure][i];

            Quest memory quest = activeQuestLookup[tokenId][adventure][questId];
            uint256 startTimestamp = quest.startTimestamp;

            emit QuestUpdated(tokenId, tokenOwner, adventure, questId, false, booted);
            delete activeQuestLookup[tokenId][adventure][questId];
            
            // Invoke callback to the adventure to facilitate state synchronization as needed
            IAdventure(adventure).onQuestExited(tokenOwner, tokenId, questId, startTimestamp);

            unchecked {
                ++i;
            }
        }

        delete activeQuestList[tokenId][adventure];
    }

    /// @dev By default, tokens that are participating in quests are transferrable.  However, if a token is participating
    /// in a quest on an adventure that was designated as a token locker, the transfer will revert and keep the token
    /// locked.
    function _beforeTokenTransfer(address /*from*/, address /*to*/, uint256 tokenId) internal virtual override {
        if(blockingQuestCounts[tokenId] > 0) {
            revert AnActiveQuestIsPreventingTransfers();
        }
    }

    /// @dev Validates that the caller is approved for adventure on the specified token id
    /// Throws when the caller has not been approved by the user.
    function _requireCallerApprovedForAdventure(uint256 tokenId) internal view {
        if(!areAdventuresApprovedForAll(ownerOf(tokenId), _msgSender())) {
            revert CallerNotApprovedForAdventure();
        }
    }

    /// @dev Validates that the caller owns the specified token
    /// Throws when the caller does not own the specified token.
    function _requireCallerOwnsToken(uint256 tokenId) internal view {
        if(ownerOf(tokenId) != _msgSender()) {
            revert CallerNotTokenOwner();
        }
    }

    /// @dev Validates that the specified value of max simultaneous quests is in range [1-MAX_CONCURRENT_QUESTS]
    /// Throws when `maxSimultaneousQuests_` is zero.
    /// Throws when `maxSimultaneousQuests_` is more than MAX_CONCURRENT_QUESTS.
    function _validateMaxSimultaneousQuests(uint256 maxSimultaneousQuests_) internal pure {
        if(maxSimultaneousQuests_ == 0) {
            revert MaxSimultaneousQuestsCannotBeZero();
        }

        if(maxSimultaneousQuests_ > MAX_CONCURRENT_QUESTS) {
            revert MaxSimultaneousQuestsExceeded();
        }
    }
}

File 3 of 41 : AdventureNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./AdventureERC721.sol";
import "../initializable/IRoyaltiesInitializer.sol";
import "../initializable/IURIInitializer.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";

error AlreadyInitializedRoyalties();
error AlreadyInitializedURI();
error ExceedsMaxRoyaltyFee();
error NonexistentToken();

/**
 * @title AdventureNFT
 * @author Limit Break, Inc.
 * @notice Standardizes commonly shared boilerplate code that adds base/suffix URI and EIP-2981 royalties to {AdventureERC721} contracts.
 */
abstract contract AdventureNFT is AdventureERC721, ERC2981, IRoyaltiesInitializer, IURIInitializer {
    using Strings for uint256;

    /// @dev The maximum allowable royalty fee is 100%
    uint96 private constant MAX_ROYALTY_FEE_NUMERATOR = 10000;

    /// @notice Specifies whether or not the contract is initialized
    bool private initializedRoyalties;

    /// @notice Specifies whether or not the contract is initialized
    bool private initializedURI;

    /// @dev Base token uri
    string public baseTokenURI;

    /// @dev Token uri suffix/extension
    string public suffixURI = ".json";

    /// @dev Emitted when base URI is set.
    event BaseURISet(string baseTokenURI);

    /// @dev Emitted when suffix URI is set.
    event SuffixURISet(string suffixURI);

    /// @dev Emitted when royalty is set.
    event RoyaltySet(address receiver, uint96 feeNumerator);

    /// @dev Initializes parameters of tokens with royalties.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeRoyalties(address receiver, uint96 feeNumerator) public override onlyOwner {
        if(initializedRoyalties) {
            revert AlreadyInitializedRoyalties();
        }

        setRoyaltyInfo(receiver, feeNumerator);

        initializedRoyalties = true;
    }

    /// @dev Initializes parameters of tokens with uri values.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeURI(string memory baseURI_, string memory suffixURI_) public override onlyOwner {
        if(initializedURI) {
            revert AlreadyInitializedURI();
        }

        setBaseURI(baseURI_);
        setSuffixURI(suffixURI_);

        initializedURI = true;
    }

    /// @dev Required to return baseTokenURI for tokenURI
    function _baseURI() internal view virtual override returns (string memory) {
        return baseTokenURI;
    }

    /// @notice Sets base URI
    function setBaseURI(string memory baseTokenURI_) public onlyOwner {
        baseTokenURI = baseTokenURI_;

        emit BaseURISet(baseTokenURI_);
    }

    /// @notice Sets suffix URI
    function setSuffixURI(string memory suffixURI_) public onlyOwner {
        suffixURI = suffixURI_;

        emit SuffixURISet(suffixURI_);
    }

    /// @notice Sets royalty information
    function setRoyaltyInfo(address receiver, uint96 feeNumerator) public onlyOwner {
        if(feeNumerator > MAX_ROYALTY_FEE_NUMERATOR) {
            revert ExceedsMaxRoyaltyFee();
        }
        _setDefaultRoyalty(receiver, feeNumerator);

        emit RoyaltySet(receiver, feeNumerator);
    }

    /// @notice Returns tokenURI if baseURI is set
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if(!_exists(tokenId)) {
            revert NonexistentToken();
        }

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

    function supportsInterface(bytes4 interfaceId) public view virtual override (AdventureERC721, ERC2981, IERC165) returns (bool) {
        return
        interfaceId == type(IRoyaltiesInitializer).interfaceId ||
        interfaceId == type(IURIInitializer).interfaceId ||
        super.supportsInterface(interfaceId);
    }
}

File 4 of 41 : AdventureWhitelist.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./IAdventure.sol";
import "../utils/access/InitializableOwnable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

error AdventureIsStillWhitelisted();
error AlreadyWhitelisted();
error ArrayIndexOverflowsUint128();
error CallerNotAWhitelistedAdventure();
error InvalidAdventureContract();
error NotWhitelisted();

/**
 * @title AdventureWhitelist
 * @author Limit Break, Inc.
 * @notice Implements the basic security features of the {IAdventurous} token standard for ERC721-compliant tokens.
 * This includes a whitelist for trusted Adventure contracts designed to interoperate with this token.
 */
abstract contract AdventureWhitelist is InitializableOwnable {

    struct AdventureDetails {
        bool isWhitelisted;
        uint128 arrayIndex;
    }

    /// @dev Emitted when the adventure whitelist is updated
    event AdventureWhitelistUpdated(address indexed adventure, bool whitelisted);
    
    /// @dev Whitelist array for iteration
    address[] public whitelistedAdventureList;

    /// @dev Whitelist mapping
    mapping (address => AdventureDetails) public whitelistedAdventures;

    /// @notice Returns whether the specified account is a whitelisted adventure
    function isAdventureWhitelisted(address account) public view returns (bool) {
        return whitelistedAdventures[account].isWhitelisted;
    }

    /// @notice Whitelists an adventure and specifies whether or not the quests in that adventure lock token transfers
    /// Throws when the adventure is already in the whitelist.
    /// Throws when the specified address does not implement the IAdventure interface.
    ///
    /// Postconditions:
    /// The specified adventure contract is in the whitelist.
    /// An `AdventureWhitelistUpdate` event has been emitted.
    function whitelistAdventure(address adventure) external onlyOwner {
        if(isAdventureWhitelisted(adventure)) {
            revert AlreadyWhitelisted();
        }

        if(!IERC165(adventure).supportsInterface(type(IAdventure).interfaceId)) {
            revert InvalidAdventureContract();
        }

        uint256 arrayIndex = whitelistedAdventureList.length;
        if(arrayIndex > type(uint128).max) {
            revert ArrayIndexOverflowsUint128();
        }

        whitelistedAdventures[adventure].isWhitelisted = true;
        whitelistedAdventures[adventure].arrayIndex = uint128(arrayIndex);
        whitelistedAdventureList.push(adventure);

        emit AdventureWhitelistUpdated(adventure, true);
    }

    /// @notice Removes an adventure from the whitelist
    /// Throws when the adventure is not in the whitelist.
    ///
    /// Postconditions:
    /// The specified adventure contract is no longer in the whitelist.
    /// An `AdventureWhitelistUpdate` event has been emitted.
    function unwhitelistAdventure(address adventure) external onlyOwner {
        if(!isAdventureWhitelisted(adventure)) {
            revert NotWhitelisted();
        }
        
        uint128 itemPositionToDelete = whitelistedAdventures[adventure].arrayIndex;
        uint256 arrayEndIndex = whitelistedAdventureList.length - 1;
        if(itemPositionToDelete != arrayEndIndex) {
            whitelistedAdventureList[itemPositionToDelete] = whitelistedAdventureList[arrayEndIndex];
            whitelistedAdventures[whitelistedAdventureList[itemPositionToDelete]].arrayIndex = itemPositionToDelete;
        }

        whitelistedAdventureList.pop();
        delete whitelistedAdventures[adventure];

        emit AdventureWhitelistUpdated(adventure, false);
    }

    /// @dev Validates that the caller is a whitelisted adventure
    /// Throws when the caller is not in the adventure whitelist.
    function _requireCallerIsWhitelistedAdventure() internal view {
        if(!isAdventureWhitelisted(_msgSender())) {
            revert CallerNotAWhitelistedAdventure();
        }
    }

    /// @dev Validates that the specified adventure has been removed from the whitelist
    /// to prevent early backdoor exiting from adventures.
    /// Throws when specified adventure is still whitelisted.
    function _requireAdventureRemovedFromWhitelist(address adventure) internal view {
        if(isAdventureWhitelisted(adventure)) {
            revert AdventureIsStillWhitelisted();
        }
    }
}

File 5 of 41 : IAdventure.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IAdventure
 * @author Limit Break, Inc.
 * @notice The base interface that all `Adventure` contracts must conform to.
 * @dev All contracts that implement the adventure/quest system and interact with an {IAdventurous} token are required to implement this interface.
 */
interface IAdventure is IERC165 {

    /**
     * @dev Returns whether or not quests on this adventure lock tokens.
     * Developers of adventure contract should ensure that this is immutable 
     * after deployment of the adventure contract.  Failure to do so
     * can lead to error that deadlock token transfers.
     */
    function questsLockTokens() external view returns (bool);

    /**
     * @dev A callback function that AdventureERC721 must invoke when a quest has been successfully entered.
     * Throws if the caller is not an expected AdventureERC721 contract designed to work with the Adventure.
     * Not permitted to throw in any other case, as this could lead to tokens being locked in quests.
     */
    function onQuestEntered(address adventurer, uint256 tokenId, uint256 questId) external;

    /**
     * @dev A callback function that AdventureERC721 must invoke when a quest has been successfully exited.
     * Throws if the caller is not an expected AdventureERC721 contract designed to work with the Adventure.
     * Not permitted to throw in any other case, as this could lead to tokens being locked in quests.
     */
    function onQuestExited(address adventurer, uint256 tokenId, uint256 questId, uint256 questStartTimestamp) external;
}

File 6 of 41 : IAdventurous.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./Quest.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IAdventurous
 * @author Limit Break, Inc.
 * @notice The base interface that all `Adventurous` token contracts must conform to in order to support adventures and quests.
 * @dev All contracts that support adventures and quests are required to implement this interface.
 */
interface IAdventurous is IERC165 {

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets, for special in-game adventures.
     */ 
    event AdventureApprovalForAll(address indexed tokenOwner, address indexed operator, bool approved);

    /**
     * @dev Emitted when a token enters or exits a quest
     */
    event QuestUpdated(uint256 indexed tokenId, address indexed tokenOwner, address indexed adventure, uint256 questId, bool active, bool booted);

    /**
     * @notice Transfers a player's token if they have opted into an authorized, whitelisted adventure.
     */
    function adventureTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @notice Safe transfers a player's token if they have opted into an authorized, whitelisted adventure.
     */
    function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @notice Burns a player's token if they have opted into an authorized, whitelisted adventure.
     */
    function adventureBurn(uint256 tokenId) external;

    /**
     * @notice Enters a player's token into a quest if they have opted into an authorized, whitelisted adventure.
     */
    function enterQuest(uint256 tokenId, uint256 questId) external;

    /**
     * @notice Exits a player's token from a quest if they have opted into an authorized, whitelisted adventure.
     */
    function exitQuest(uint256 tokenId, uint256 questId) external;

    /**
     * @notice Returns the number of quests a token is actively participating in for a specified adventure
     */
    function getQuestCount(uint256 tokenId, address adventure) external view returns (uint256);

    /**
     * @notice Returns the amount of time a token has been participating in the specified quest
     */
    function getTimeOnQuest(uint256 tokenId, address adventure, uint256 questId) external view returns (uint256);

    /**
     * @notice Returns whether or not a token is currently participating in the specified quest as well as the time it was started and the quest index
     */
    function isParticipatingInQuest(uint256 tokenId, address adventure, uint256 questId) external view returns (bool participatingInQuest, uint256 startTimestamp, uint256 index);

    /**
     * @notice Returns a list of all active quests for the specified token id and adventure
     */
    function getActiveQuests(uint256 tokenId, address adventure) external view returns (Quest[] memory activeQuests);
}

File 7 of 41 : Quest.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

/**
 * @title Quest
 * @author Limit Break, Inc.
 * @notice Quest data structure for {IAdventurous} contracts.
 */
struct Quest {
    bool isActive;
    uint32 questId;
    uint64 startTimestamp;
    uint32 arrayIndex;
}

File 8 of 41 : IAdventureERC721Initializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IAdventureERC721Initializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include Adventure ERC721 functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IAdventureERC721Initializer is IERC165 {

    /**
     * @notice Initializes parameters of {AdventureERC721} contracts
     */
    function initializeAdventureERC721(uint256 maxSimultaneousQuests_) external;
}

File 9 of 41 : IERC721Initializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/**
 * @title IERC721Initializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include OpenZeppelin ERC721 functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IERC721Initializer is IERC721 {

    /**
     * @notice Initializes parameters of {ERC721} contracts
     */
    function initializeERC721(string memory name_, string memory symbol_) external;
}

File 10 of 41 : IOperatorFiltererInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

/**
 * @title IOperatorFiltererInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include OpenSea's OperatorFilterer functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IOperatorFiltererInitializer {

    /**
     * @notice Initializes parameters of OperatorFilterer contracts
     */
    function initializeOperatorFilterer(address subscriptionOrRegistrantToCopy, bool subscribe) external;
}

File 11 of 41 : IOwnableInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IOwnableInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include OpenZeppelin Ownable functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IOwnableInitializer is IERC165 {

    /**
     * @notice Initializes the contract owner to the specified address
     */
    function initializeOwner(address owner_) external;

    /**
     * @notice Transfers ownership of the contract to the specified owner
     */
    function transferOwnership(address newOwner) external;
}

File 12 of 41 : IRootCollectionInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IRootCollectionInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to be tied to a root ERC-721 collection.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IRootCollectionInitializer is IERC165 {

    /**
     * @notice Initializes root collection parameters
     */
    function initializeRootCollections(address[] memory rootCollection_, uint256[] memory rootCollectionMaxSupply_, uint256[] memory tokensPerClaim_) external;
}

File 13 of 41 : IRoyaltiesInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IRoyaltiesInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include OpenZeppelin ERC2981 functionality.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IRoyaltiesInitializer is IERC165 {

    /**
     * @notice Initializes royalty parameters
     */
    function initializeRoyalties(address receiver, uint96 feeNumerator) external;
}

File 14 of 41 : ISignedApprovalInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title ISignedApprovalInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to be assigned an approver to sign transactions allowing mints.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface ISignedApprovalInitializer is IERC165 {

    /**
     * @notice Initializes approver.
     */
    function initializeSigner(address signer, uint256 maxQuantity) external;
}

File 15 of 41 : IURIInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IURIInitializer
 * @author Limit Break, Inc.
 * @notice Allows cloneable contracts to include a base uri and suffix uri.
 * @dev See https://eips.ethereum.org/EIPS/eip-1167 for details.
 */
interface IURIInitializer is IERC165 {

    /**
     * @notice Initializes uri parameters
     */
    function initializeURI(string memory baseURI_, string memory suffixURI_) external;
}

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

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 17 of 41 : InitializableDefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

/**
 * @title  InitializableDefaultOperatorFilterer
 * @notice Inherits from InitializableOperatorFilterer and automatically subscribes to the default OpenSea subscription during initialization.
 */
abstract contract InitializableDefaultOperatorFilterer is InitializableOperatorFilterer {
    
    /// @dev The default subscription address
    address internal constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

    /// @dev The parameters are ignored, and the default subscription values are used instead.
    function initializeOperatorFilterer(address /*subscriptionOrRegistrantToCopy*/, bool /*subscribe*/) public virtual override {
        super.initializeOperatorFilterer(DEFAULT_SUBSCRIPTION, true);
    }
}

File 18 of 41 : InitializableOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

/**
 * @title  InitializableOperatorFilterer
 * @notice Abstract contract whose initializer function 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.
 *         This is safe for use in EIP-1167 clones
 */
abstract contract InitializableOperatorFilterer is IOperatorFiltererInitializer {
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY = IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

    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 initializeOperatorFilterer(address subscriptionOrRegistrantToCopy, bool subscribe) public virtual override {
        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));
                }
            }
        }
    }

    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 19 of 41 : BlacklistedTransferAdventureNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../adventures/AdventureNFT.sol";
import "../opensea/operator-filter-registry/InitializableDefaultOperatorFilterer.sol";

/**
 * @title BlacklistedTransferAdventureNFT
 * @author Limit Break, Inc.
 * @notice Extends AdventureNFT, adding whitelisted transfer mechanisms.
 */
abstract contract BlacklistedTransferAdventureNFT is AdventureNFT, InitializableDefaultOperatorFilterer {

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

    function approve(address operator, uint256 tokenId) public virtual override onlyAllowedOperatorApproval(operator) {
        super.approve(operator, tokenId);
    }

    function transferFrom(address from, address to, uint256 tokenId) public virtual override onlyAllowedOperator(from) {
        super.transferFrom(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId);
    }

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override onlyAllowedOperator(from) {
        super.safeTransferFrom(from, to, tokenId, data);
    }
}

File 20 of 41 : InitializableOwnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "../../initializable/IOwnableInitializer.sol";
import "@openzeppelin/contracts/utils/Context.sol";

error CallerIsNotTheContractOwner();
error NewOwnerIsTheZeroAddress();
error OwnerAlreadyInitialized();

/**
 * @title InitializableOwnable
 * @author Limit Break, Inc. and OpenZeppelin
 * @notice A tailored version of the {Ownable}  permissions component from OpenZeppelin that is compatible with EIP-1167.
 * @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.
 *
 * Based on OpenZeppelin contracts commit hash 3dac7bbed7b4c0dbf504180c33e8ed8e350b93eb.
 *
 * 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.
 *
 * This version adds an `initializeOwner` call for use with EIP-1167, 
 * as the constructor will not be called during an EIP-1167 operation.
 * Because initializeOwner should only be called once and requires that 
 * the owner is not assigned, the `renounceOwnership` function has been removed to avoid
 * a scenario where a contract could be left without an owner to perform admin protected functions.
 */
abstract contract InitializableOwnable is Context, IOwnableInitializer {
    address private _owner;

    /// @dev Emitted when contract ownership has been transferred.
    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 When EIP-1167 is used to clone a contract that inherits Ownable permissions,
     * this is required to assign the initial contract owner, as the constructor is
     * not called during the cloning process.
     */
    function initializeOwner(address owner_) public override {
      if(_owner != address(0)) {
          revert OwnerAlreadyInitialized();
      }

      _transferOwnership(owner_);
    }

    /**
     * @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 {
        if(owner() != _msgSender()) {
            revert CallerIsNotTheContractOwner();
        }
    }

    /**
     * @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 override onlyOwner {
        if(newOwner == address(0)) {
            revert NewOwnerIsTheZeroAddress();
        }

        _transferOwnership(newOwner);
    }

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

File 21 of 41 : ClaimPeriodBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/InitializableOwnable.sol";


error ClaimsMustBeClosedToReopen();
error ClaimPeriodAlreadyInitialized();
error ClaimPeriodIsNotOpen();
error ClaimPeriodMustBeClosedInTheFuture();
error ClaimPeriodMustBeInitialized();

/**
 * @title ClaimPeriodController
 * @author Limit Break, Inc.
 * @notice In order to support multiple contracts with enforced claim periods, the claim period has been moved to this base contract.
 *
 */
abstract contract ClaimPeriodBase is InitializableOwnable {

    /// @dev True if claims have been initalized, false otherwise.
    bool private claimPeriodInitialized;

    /// @dev The timestamp when the claim period closes - when this value is zero and claims are open, the claim period is open indefinitely
    uint256 private claimPeriodClosingTimestamp;

    /// @dev Emitted when a claim period is scheduled to be closed.
    event ClaimPeriodClosing(uint256 claimPeriodClosingTimestamp);

    /// @dev Emitted when a claim period is scheduled to be opened.
    event ClaimPeriodOpened(uint256 claimPeriodClosingTimestamp);

    /// @dev Opens the claim period.  Claims can be closed with a custom amount of warning time using the closeClaims function.
    /// Accepts a claimPeriodClosingTimestamp_ timestamp which will open the period ending at that time (in seconds)
    /// NOTE: Use as high a window as possible to prevent gas wars for claiming
    /// For an unbounded claim window, pass in type(uint256).max
    function openClaims(uint256 claimPeriodClosingTimestamp_) external onlyOwner {
        if(claimPeriodClosingTimestamp_ <= block.timestamp) {
            revert ClaimPeriodMustBeClosedInTheFuture();
        }

        _onClaimPeriodOpening();

        if(claimPeriodInitialized) {
            if(block.timestamp < claimPeriodClosingTimestamp) {
                revert ClaimsMustBeClosedToReopen();
            }
        } else {
            claimPeriodInitialized = true;
        }

        claimPeriodClosingTimestamp = claimPeriodClosingTimestamp_;

        emit ClaimPeriodOpened(claimPeriodClosingTimestamp_);
    }

    /// @dev Closes claims at a specified timestamp.
    ///
    /// Throws when the specified timestamp is not in the future.
    function closeClaims(uint256 claimPeriodClosingTimestamp_) external onlyOwner {
        _requireClaimsOpen();

        if(claimPeriodClosingTimestamp_ <= block.timestamp) {
            revert ClaimPeriodMustBeClosedInTheFuture();
        }

        claimPeriodClosingTimestamp = claimPeriodClosingTimestamp_;
        
        emit ClaimPeriodClosing(claimPeriodClosingTimestamp_);
    }

    /// @dev Returns the Claim Period Timestamp
    function getClaimPeriodClosingTimestamp() external view returns (uint256) {
        return claimPeriodClosingTimestamp;
    }

    /// @notice Returns true if the claim period has been opened, false otherwise
    function isClaimPeriodOpen() external view returns (bool) {
        return _isClaimPeriodOpen();
    }

    /// @dev Returns true if claim period is open, false otherwise.
    function _isClaimPeriodOpen() internal view returns (bool) {
        return claimPeriodInitialized && block.timestamp < claimPeriodClosingTimestamp;
    }

    /// @dev Validates that the claim period is open.
    /// Throws if claims are not open.
    function _requireClaimsOpen() internal view {
        if(!_isClaimPeriodOpen()) {
            revert ClaimPeriodIsNotOpen();
        }
    }

    /// @dev Hook to allow inheriting contracts to perform state validation when opening the claim period
    function _onClaimPeriodOpening() internal virtual {}
}

File 22 of 41 : ClaimableHolderMint.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./ClaimPeriodBase.sol";
import "./MintTokenBase.sol";
import "./SequentialMintBase.sol";
import "../access/InitializableOwnable.sol";
import "../../initializable/IRootCollectionInitializer.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

error CallerDoesNotOwnRootTokenId();
error CannotInitializeIneligibleTokensAfterClaimsOpen();
error CollectionAddressIsNotAnERC721Token();
error IneligibleTokensAlreadyInitialized();
error IneligibleTokenArrayMustBeInAscendingOrder();
error IneligibleTokensFinalized();
error IneligibleTokensHaveNotBeenFinalized();
error IneligibleTokenMustBeWithinMaxSupply();
error InputArrayLengthMismatch();
error InvalidRootCollectionAddress();
error InvalidRootCollectionTokenId();
error MaxSupplyOfRootTokenCannotBeZero();
error MustSpecifyAtLeastOneIneligibleToken();
error MustSpecifyAtLeastOneRootCollection();
error RootCollectionsAlreadyInitialized();
error RootCollectionsHaveNotBeenInitialized();
error TokenIdAlreadyClaimed();
error TokensPerClaimMustBeBetweenOneAndTen();
error MaxNumberOfRootCollectionsExceeded();
error BatchSizeMustBeGreaterThanZero();
error BatchSizeGreaterThanMaximum();

/**
 * @title ClaimableHolderMint
 * @author Limit Break, Inc.
 * @notice A contract mix-in that may optionally be used with extend ERC-721 tokens with sequential role-based minting capabilities.
 * @dev Inheriting contracts must implement `_mintToken` and implement EIP-165 support as shown:
 *
 * function supportsInterface(bytes4 interfaceId) public view virtual override(AdventureNFT, IERC165) returns (bool) {
 *     return
 *     interfaceId == type(IRootCollectionInitializer).interfaceId ||
 *     super.supportsInterface(interfaceId);
 *  }
 *
 */
abstract contract ClaimableHolderMint is InitializableOwnable, ClaimPeriodBase, MintTokenBase, SequentialMintBase, IRootCollectionInitializer {

    struct ClaimableRootCollection {
        /// @dev Indicates whether or not this is a root collection
        bool isRootCollection;

        /// @dev This is the root ERC-721 contract from which claims can be made
        IERC721 rootCollection;

        /// @dev Max supply of the root collection
        uint256 maxSupply;

        /// @dev Number of tokens each user should get per token id claim
        uint256 tokensPerClaim;

        /// @dev Bitmap that helps determine if a token was ever claimed previously
        uint256[] claimedTokenTracker;

        /// @dev Mapping from slot to ineligible token bitmap
        mapping(uint256 => uint256) ineligibleTokenBitmaps;
    }

    /// @dev The maximum amount of minted tokens from one batch submission.
    uint256 private constant MAX_MINTS_PER_TRANSACTION = 300;

    /// @dev The maximum amount of Root Collections permitted
    uint256 private constant MAX_ROOT_COLLECTIONS = 25;

    /// @dev True if root collections have been initialized, false otherwise.
    bool private initializedRootCollections;

    /// @dev True if ineligible token lists have been finalized, false otherwise.
    bool private finalizedIneligibleTokens;

    /// @dev Mapping from root collection address to claim details
    mapping (address => ClaimableRootCollection) private rootCollectionLookup;

    /// @dev Emitted when a holder claims a mint
    event ClaimMinted(address indexed rootCollection, uint256 indexed rootCollectionTokenId, uint256 startTokenId, uint256 endTokenId);

    /// @dev Emitted when a root collection is initialized
    event RootCollectionInitialized(address indexed rootCollection, uint256 maxSupply, uint256 tokensPerClaim);

    /// @dev Emitted when a set of ineligible token slots and bitmaps are set for a root collection
    event IneligibleTokensInitialized(address indexed rootCollectionAddress, uint256[] ineligibleTokenSlots, uint256[] ineligibleTokenBitmaps);

    /// @dev Initializes root collection parameters that determine how the claims will work.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    /// Params are memory to allow for initialization within constructors.
    /// The sum of all root collections max supplies cannot exceed 256,000 tokens.
    ///
    /// Throws when called by non-owner of contract.
    /// Throws when the root collection has already been initialized.
    /// Throws when the specified root collection is not an ERC721 token.
    /// Throws when the number of tokens per claim is not between 1 and 10.
    /// Throws when a provided ineligible token is greater than the max supply.
    function initializeRootCollections(address[] memory rootCollections_, uint256[] memory rootCollectionMaxSupplies_, uint256[] memory tokensPerClaimArray_) public override onlyOwner {
        if(initializedRootCollections) {
            revert RootCollectionsAlreadyInitialized();
        }

        uint256 rootCollectionsArrayLength = rootCollections_.length;

        _requireInputArrayLengthsMatch(rootCollectionsArrayLength, rootCollectionMaxSupplies_.length);
        _requireInputArrayLengthsMatch(rootCollectionsArrayLength, tokensPerClaimArray_.length);

        if(rootCollectionsArrayLength == 0) {
            revert MustSpecifyAtLeastOneRootCollection();
        }
        if(rootCollectionsArrayLength > MAX_ROOT_COLLECTIONS) {
            revert MaxNumberOfRootCollectionsExceeded();
        }

        for(uint256 i = 0; i < rootCollectionsArrayLength;) {
            address rootCollection_ = rootCollections_[i];
            uint256 rootCollectionMaxSupply_ = rootCollectionMaxSupplies_[i];
            uint256 tokensPerClaim_ = tokensPerClaimArray_[i];

            emit RootCollectionInitialized(address(rootCollection_), rootCollectionMaxSupply_, tokensPerClaim_);

            if(!IERC165(rootCollection_).supportsInterface(type(IERC721).interfaceId)) {
                revert CollectionAddressIsNotAnERC721Token();
            }

            if(tokensPerClaim_ == 0 || tokensPerClaim_ > 10) {
                revert TokensPerClaimMustBeBetweenOneAndTen();
            }

            if(rootCollectionMaxSupply_ == 0) {
                revert MaxSupplyOfRootTokenCannotBeZero();
            }

            rootCollectionLookup[rootCollection_].isRootCollection = true;
            rootCollectionLookup[rootCollection_].rootCollection = IERC721(rootCollection_);
            rootCollectionLookup[rootCollection_].maxSupply = rootCollectionMaxSupply_;
            rootCollectionLookup[rootCollection_].tokensPerClaim = tokensPerClaim_;

            unchecked {
                // Initialize memory to use for tracking token ids that have been minted
                // The bit corresponding to token id defaults to 1 when unminted,
                // and will be set to 0 upon mint.
                uint256 numberOfTokenTrackerSlots = _getNumberOfTokenTrackerSlots(rootCollectionMaxSupply_);
                for(uint256 j = 0; j < numberOfTokenTrackerSlots; ++j) {
                    rootCollectionLookup[rootCollection_].claimedTokenTracker.push(type(uint256).max);
                }
                ++i;
            }
        }

        _initializeNextTokenIdCounter();
        initializedRootCollections = true;
    }

    /// @notice Accepts a list of slot and bitmaps to mark tokens ineligible for claim for the provided root collection address
    /// @dev You can generate the inputs for `ineligibleTokenSlots` and `ineligibleTokenBitmaps` by using the helper function `getIneligibleTokensBitmap`
    /// @dev Params are memory to allow for initialization within constructors.
    ///
    /// Throws when the root collections have not been initialized.
    /// Throws when ineligible tokens have already been finalized.
    /// Throws if the ineligible token slots & bitmap array lengths do not match.
    /// Postconditions:
    /// ---------------
    /// The ineligible token bitmaps are set on the root collection details.
    function initializeIneligibleTokens(bool finalize, address rootCollectionAddress, uint256[] memory ineligibleTokenSlots, uint256[] memory ineligibleTokenBitmaps) external {
        if(!initializedRootCollections) {
            revert RootCollectionsHaveNotBeenInitialized();
        }
        if(finalizedIneligibleTokens) {
            revert IneligibleTokensFinalized();
        }

        if(ineligibleTokenSlots.length != ineligibleTokenBitmaps.length) {
            revert InputArrayLengthMismatch();
        }

        ClaimableRootCollection storage rootCollectionDetails = _getRootCollectionDetailsSafe(rootCollectionAddress);

        if(finalize) {
            finalizedIneligibleTokens = true;
        }

        unchecked {
            for (uint256 i = 0; i < ineligibleTokenSlots.length; ++i) {
                rootCollectionDetails.claimedTokenTracker[ineligibleTokenSlots[i]] = ~ineligibleTokenBitmaps[i];
                rootCollectionDetails.ineligibleTokenBitmaps[ineligibleTokenSlots[i]] = ineligibleTokenBitmaps[i];
            }
        }

        emit IneligibleTokensInitialized(rootCollectionAddress, ineligibleTokenSlots, ineligibleTokenBitmaps);
    }

    /// @notice Allows a user to claim/mint one or more tokens pegged to their ownership of a list of specified token ids
    ///
    /// Throws when an empty array of root collection token ids is provided.
    /// Throws when the amount of claimed tokens exceeds the max claimable amount.
    /// Throws when the claim period has not opened.
    /// Throws when the claim period has closed.
    /// Throws when the caller does not own the specified token id from the root collection.
    /// Throws when the root token id has already been claimed.
    /// Throws if safe mint receiver is not an EOA or a contract that can receive tokens.
    /// Postconditions:
    /// ---------------
    /// The root collection and token ID combinations are marked as claimed in the root collection's claimed token tracker.
    /// `quantity` tokens are minted to the msg.sender, where `quantity` is the amount of tokens per claim * length of the rootCollectionTokenIds array.
    /// `quantity` ClaimMinted events have been emitted, where `quantity` is the amount of tokens per claim * length of the rootCollectionTokenIds array.
    function claimBatch(address rootCollectionAddress, uint256[] calldata rootCollectionTokenIds) external {
        _requireClaimsOpen();

        if (rootCollectionTokenIds.length == 0) {
            revert BatchSizeMustBeGreaterThanZero();
        }

        ClaimableRootCollection storage rootCollectionDetails = _getRootCollectionDetailsSafe(rootCollectionAddress);

        uint256 maxBatchSize = MAX_MINTS_PER_TRANSACTION / rootCollectionDetails.tokensPerClaim;

        if (rootCollectionTokenIds.length > maxBatchSize) {
            revert BatchSizeGreaterThanMaximum();
        }

        for(uint256 i = 0; i < rootCollectionTokenIds.length;) {
            _claim(rootCollectionDetails, rootCollectionTokenIds[i]);
            unchecked {
                ++i;
            }
        }
    }

    /// @dev Processes a claim for a Root Collection + Root Collection Token ID Combination
    ///
    /// Throws when the caller does not own the specified token id from the root collection.
    /// Throws when the root token id has already been claimed.
    /// Throws if safe mint receiver is not an EOA or a contract that can receive tokens.
    /// Postconditions:
    /// ---------------
    /// The root collection and tokenID combination are marked as claimed in the root collection's claimed token tracker.
    /// `quantity` tokens are minted to the msg.sender, where `quantity` is the amount of tokens per claim.
    /// The nextTokenId counter is advanced by the `quantity` of tokens minted.
    /// `quantity` ClaimMinted events have been emitted, where `quantity` is the amount of tokens per claim.
    function _claim(ClaimableRootCollection storage rootCollectionDetails, uint256 rootCollectionTokenId) internal {
        if(rootCollectionDetails.rootCollection.ownerOf(rootCollectionTokenId) != _msgSender()) {
            revert CallerDoesNotOwnRootTokenId();
        }

        (bool claimed, uint256 slot, uint256 offset, uint256 slotValue) = _isClaimed(rootCollectionDetails, rootCollectionTokenId);
        if(claimed) {
            revert TokenIdAlreadyClaimed();
        }

        uint256 claimedTokenId = getNextTokenId();
        uint256 tokensPerClaim_ = rootCollectionDetails.tokensPerClaim;
        emit ClaimMinted(address(rootCollectionDetails.rootCollection), rootCollectionTokenId, claimedTokenId, claimedTokenId + tokensPerClaim_ - 1);

        rootCollectionDetails.claimedTokenTracker[slot] = slotValue & ~(uint256(1) << offset);

        unchecked {
            _advanceNextTokenIdCounter(tokensPerClaim_);

            for(uint256 i = 0; i < tokensPerClaim_; ++i) {
                _mintToken(_msgSender(), claimedTokenId + i);
            }
        }
    }

    /// @notice Helper function to return slots and formatted bitmap given an array of ineligible tokens
    /// @dev Do not use this in any contract calls as there is unoptimized gas usage.  You should use this to
    /// @dev generate the input for `initializeIneligibleTokens`
    /// @dev `ineligibleTokenIds` must be a sorted list of token IDs to return the bitmap and slot arrays
    function computeIneligibleTokensBitmap(uint256[] calldata ineligibleTokenIds) external pure returns (uint256[] memory, uint256[] memory) {
        if (ineligibleTokenIds.length == 0) {
            revert MustSpecifyAtLeastOneIneligibleToken();
        }

        uint256 lastTokenId = ineligibleTokenIds[ineligibleTokenIds.length - 1];
        uint256 lastSeenId = 0;

        uint256 numberOfTokenTrackerSlots = _getNumberOfTokenTrackerSlots(lastTokenId);
        uint256[] memory tempBitmapArray = new uint256[](numberOfTokenTrackerSlots);

        unchecked {
            // Modify bitmaps for each token
            // Note: an individual slot may be modified more than once
            for (uint256 i = 0; i < ineligibleTokenIds.length; ++i) {
                uint256 tokenId = ineligibleTokenIds[i];

                if(i > 0 && tokenId <= lastSeenId) {
                    revert IneligibleTokenArrayMustBeInAscendingOrder();
                }

                lastSeenId = tokenId;

                uint256 slot = tokenId / 256;
                uint256 offset = tokenId % 256;

                uint256 bitmap = tempBitmapArray[slot];
                tempBitmapArray[slot] = bitmap | (uint256(1) << offset);
            }

            uint256 count;

            // Iterate over all slots to identify modified values
            for (uint256 i = 0; i < numberOfTokenTrackerSlots; ++i) {
                if(tempBitmapArray[i] > 0) {
                    ++count;
                }
            }

            // Initialize arrays with values = count of modified slots
            uint256[] memory bitmapArray = new uint256[](count);
            uint256[] memory slotArray = new uint256[](count);

            uint256 index;

            // Populate return values
            for (uint256 i = 0; i < numberOfTokenTrackerSlots; ++i) {
                if(tempBitmapArray[i] > 0) {
                    bitmapArray[index] = tempBitmapArray[i];
                    slotArray[index] = i;
                    ++index;
                }
            }

            return (slotArray, bitmapArray);
        }
    }

    /// @notice Returns the amount of tokens minted per claim for the provided root collection
    function getTokensPerClaim(address rootCollectionAddress) public view returns (uint256) {
        ClaimableRootCollection storage rootCollectionDetails = _getRootCollectionDetailsSafe(rootCollectionAddress);

        return rootCollectionDetails.tokensPerClaim;
    }

    /// @notice Returns true if the specified token id is eligible for claiming, false otherwise
    function isEligible(address rootCollectionAddress, uint256 tokenId) public view returns (bool) {
        ClaimableRootCollection storage rootCollectionDetails = _getRootCollectionDetailsSafe(rootCollectionAddress);
        if(tokenId > rootCollectionDetails.maxSupply) {
            revert InvalidRootCollectionTokenId();
        }
        uint256 slot = tokenId / 256;
        uint256 offset = tokenId % 256;
        uint256 slotValue = rootCollectionDetails.ineligibleTokenBitmaps[slot];
        bool ineligible = ((slotValue >> offset) & uint256(1)) == 1;
        return !ineligible;
    }

    /// @notice Returns true if the specified token id has been claimed
    function isClaimed(address rootCollectionAddress, uint256 tokenId) public view returns (bool) {
        ClaimableRootCollection storage rootCollectionDetails = _getRootCollectionDetailsSafe(rootCollectionAddress);
        
        if(tokenId > rootCollectionDetails.maxSupply) {
            revert InvalidRootCollectionTokenId();
        }

        (bool claimed,,,) = _isClaimed(rootCollectionDetails, tokenId);
        return claimed;
    }

    /// @dev Returns whether or not the specified token id has been claimed/minted as well as the bitmap slot/offset/slot value of the token id
    function _isClaimed(ClaimableRootCollection storage rootCollectionDetails, uint256 tokenId) internal view returns (bool claimed, uint256 slot, uint256 offset, uint256 slotValue) {
        unchecked {
            slot = tokenId / 256;
            offset = tokenId % 256;
            slotValue = rootCollectionDetails.claimedTokenTracker[slot];
            claimed = ((slotValue >> offset) & uint256(1)) == 0;
        }
        
        return (claimed, slot, offset, slotValue);
    }

    /// @dev Determines number of slots required to track minted tokens across the max supply
    function _getNumberOfTokenTrackerSlots(uint256 maxSupply_) internal pure returns (uint256 tokenTrackerSlotsRequired) {
        unchecked {
            // Add 1 because we are starting valid token id range at 1 instead of 0
            uint256 maxSupplyPlusOne = 1 + maxSupply_;
            tokenTrackerSlotsRequired = maxSupplyPlusOne / 256;
            if(maxSupplyPlusOne % 256 > 0) {
                ++tokenTrackerSlotsRequired;
            }
        }

        return tokenTrackerSlotsRequired;
    }

    /// @dev Validates that the length of two input arrays matched.
    /// Throws if the array lengths are mismatched.
    function _requireInputArrayLengthsMatch(uint256 inputArray1Length, uint256 inputArray2Length) internal pure {
        if(inputArray1Length != inputArray2Length) {
            revert InputArrayLengthMismatch();
        }
    }

    /// @dev Safely gets a storage pointer to the details of a root collection.  Performs validation and throws if the value is not present in the mapping, preventing
    /// the possibility of overwriting an unexpected storage slot.
    ///
    /// Throws when the specified root collection address has not been explicitly set as a key in the mapping.
    function _getRootCollectionDetailsSafe(address rootCollectionAddress) private view returns (ClaimableRootCollection storage) {
        ClaimableRootCollection storage rootCollectionDetails = rootCollectionLookup[rootCollectionAddress];

        if(!rootCollectionDetails.isRootCollection) {
            revert InvalidRootCollectionAddress();
        }

        return rootCollectionDetails;
    }

    function _onClaimPeriodOpening() internal virtual override {
        if(!initializedRootCollections) {
            revert RootCollectionsHaveNotBeenInitialized();
        }

        if(!finalizedIneligibleTokens) {
            revert IneligibleTokensHaveNotBeenFinalized();
        }
    }
}

File 23 of 41 : InitializableERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

import "../access/InitializableOwnable.sol";
import "../../initializable/IERC721Initializer.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

error AlreadyInitializedERC721();

/**
 * @title InitializableERC721
 * @author Limit Break, Inc.
 * @notice Wraps OpenZeppelin ERC721 implementation and makes it compatible with EIP-1167.
 * @dev Because OpenZeppelin's `_name` and `_symbol` storage variables are private and inaccessible, 
 * this contract defines two new storage variables `_contractName` and `_contractSymbol` and returns them
 * from the `name()` and `symbol()` functions instead.
 */
abstract contract InitializableERC721 is InitializableOwnable, ERC721, IERC721Initializer {

    /// @notice Specifies whether or not the contract is initialized
    bool private initializedERC721;

    // Token name
    string internal _contractName;

    // Token symbol
    string internal _contractSymbol;

    /// @dev Initializes parameters of ERC721 tokens.
    /// These cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    function initializeERC721(string memory name_, string memory symbol_) public override onlyOwner {
        if(initializedERC721) {
            revert AlreadyInitializedERC721();
        }

        _contractName = name_;
        _contractSymbol = symbol_;

        initializedERC721 = true;
    }

    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721Initializer).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    function name() public view virtual override returns (string memory) {
        return _contractName;
    }

    function symbol() public view virtual override returns (string memory) {
        return _contractSymbol;
    }
}

File 24 of 41 : MintTokenBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

abstract contract MintTokenBase {
    /// @dev Inheriting contracts must implement the token minting logic - inheriting contract should use _mint, or something equivalent
    /// The minting function should throw if `to` is address(0)
    function _mintToken(address to, uint256 tokenId) internal virtual;
}

File 25 of 41 : SafeMintTokenBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

abstract contract SafeMintTokenBase {
    /// @dev Inheriting contracts must implement the token minting logic - inheriting contract should use _safeMint, or something equivalent
    /// The minting function should throw if `to` is address(0) or `to` is a contract that does not implement IERC721Receiver.
    function _safeMintToken(address to, uint256 tokenId) internal virtual;
}

File 26 of 41 : SequentialMintBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/InitializableOwnable.sol";
import "../../initializable/IRootCollectionInitializer.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

/**
 * @title SequentialMintBase
 * @author Limit Break, Inc.
 * @dev In order to support multiple sequential mint mix-ins in a single contract, the token id counter has been moved to this based contract.
 */
abstract contract SequentialMintBase {

    /// @dev The next token id that will be minted - if zero, the next minted token id will be 1
    uint256 private nextTokenIdCounter;

    /// @dev Minting mixins must use this function to advance the next token id counter.
    function _initializeNextTokenIdCounter() internal {
        if(nextTokenIdCounter == 0) {
            nextTokenIdCounter = 1;
        }
    }

    /// @dev Minting mixins must use this function to advance the next token id counter.
    function _advanceNextTokenIdCounter(uint256 amount) internal {
        nextTokenIdCounter += amount;
    }

    /// @dev Returns the next token id counter value
    function getNextTokenId() public view returns (uint256) {
        return nextTokenIdCounter;
    }
}

File 27 of 41 : SignedApprovalMint.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "./SafeMintTokenBase.sol";
import "./SequentialMintBase.sol";
import "../access/InitializableOwnable.sol";
import "../../initializable/ISignedApprovalInitializer.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

error AddressAlreadyMinted();
error InvalidSignature();
error MaxQuantityMustBeGreaterThanZero();
error MintExceedsMaximumAmountBySignedApproval();
error SignedClaimsAreDecommissioned();
error SignerAlreadyInitialized();
error SignerCannotBeInitializedAsAddressZero();
error SignerIsAddressZero();


/**
* @title SignedApprovalMint
* @author Limit Break, Inc.
* @notice A contract mix-in that may optionally be used with extend ERC-721 tokens with Signed Approval minting capabilities, allowing an approved signer to issue a limited amount of mints.
* @dev Inheriting contracts must implement `_mintToken` and implement EIP-165 support as shown:
*
* function supportsInterface(bytes4 interfaceId) public view virtual override(AdventureNFT, IERC165) returns (bool) {
*     return
*     interfaceId == type(ISignedApproverInitializer).interfaceId ||
*     super.supportsInterface(interfaceId);
*  }
*
*/
abstract contract SignedApprovalMint is InitializableOwnable, SafeMintTokenBase, SequentialMintBase, EIP712, ISignedApprovalInitializer {

    /// @dev Returns true if signed claims have been decommissioned, false otherwise.
    bool private _signedClaimsDecommissioned;

    /// @dev The address of the signer for approved mints.
    address private _approvalSigner;

    /// @dev The maximum amount of mints done by the approval signer
    /// NOTE: This is an aggregate of all signers, updating signer will not reset or modify this amount.
    uint256 private _maxQuantityMintable;

    /// @dev The amount minted by all signers.
    /// NOTE: This is an aggregate of all signers, updating signer will not reset or modify this amount.
    uint256 private _mintedAmount;

    /// @dev Mapping of addresses who have already minted 
    mapping(address => bool) private addressMinted;

    /// @dev Emitted when signatures are decommissioned
    event SignedClaimsDecommissioned();

    /// @dev Emitted when a signed mint is claimed
    event SignedMintClaimed(address indexed minter, uint256 startTokenId, uint256 endTokenId);

    /// @dev Emitted when a signer is updated
    event SignerUpdated(address oldSigner, address newSigner); 

    /// @notice Allows a user to claim/mint one or more tokens as approved by the approved signer
    ///
    /// Throws when a signature is invalid.
    /// Throws when the quantity provided does not match the quantity on the signature provided.
    /// Throws when the address has already claimed a token.
    /// Throws if safe mint receiver is not an EOA or a contract that can receive tokens.
    function claimSignedMint(bytes calldata signature, uint256 quantity) external {
        if (addressMinted[_msgSender()]) {
            revert AddressAlreadyMinted();
        }

        if (_approvalSigner == address(0)) { 
            revert SignerIsAddressZero();
        }

        _requireSignedClaimsActive();

        uint256 newTotal = _mintedAmount + quantity;
        if (newTotal > _maxQuantityMintable) {
            revert MintExceedsMaximumAmountBySignedApproval();
        }

        _mintedAmount = newTotal;

        bytes32 hash = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    keccak256("Approved(address wallet,uint256 quantity)"),
                    _msgSender(),
                    quantity
                )
            )
        );

        if (_approvalSigner != ECDSA.recover(hash, signature)) {
            revert InvalidSignature();
        }

        addressMinted[_msgSender()] = true;

        uint256 tokenIdToMint = getNextTokenId();

        emit SignedMintClaimed(_msgSender(), tokenIdToMint, tokenIdToMint + quantity - 1);

        unchecked {
            _advanceNextTokenIdCounter(quantity);

            for(uint256 i = 0; i < quantity; ++i) {
                _safeMintToken(_msgSender(), tokenIdToMint + i);
            }
        }
    }

    /// @notice Decommissions signed approvals
    /// This is a permanent decommissioning, once this is set, no further signatures can be claimed
    ///
    /// Throws if caller is not owner
    /// Throws if already decommissioned
    function decommissionSignedApprovals() external onlyOwner {
        _requireSignedClaimsActive();
        _signedClaimsDecommissioned = true;
        emit SignedClaimsDecommissioned();
    }

    /// @dev Initializes the signer address for signed approvals
    /// This cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    ///
    /// Throws when called by non-owner of contract.
    /// Throws when the signer has already been initialized.
    /// Throws when the provided signer is address(0).
    /// Throws when maxQuantity = 0
    function initializeSigner(address signer, uint256 maxQuantity) public override onlyOwner {
        if(_approvalSigner != address(0)) {
            revert SignerAlreadyInitialized();
        }
        if(signer == address(0)) {
            revert SignerCannotBeInitializedAsAddressZero();
        }
        if(maxQuantity == 0) {
            revert MaxQuantityMustBeGreaterThanZero();
        }
        _initializeNextTokenIdCounter();
        _approvalSigner = signer;
        _maxQuantityMintable = maxQuantity;
    }

    /// @dev Allows signer to update the signer address
    /// This allows the signer to set new signer to address(0) to prevent future allowed mints
    /// NOTE: Setting signer to address(0) is irreversible - approvals will be disabled permanently and all outstanding signatures will be invalid.
    ///
    /// Throws when caller is not owner
    /// Throws when current signer is address(0)
    function setSigner(address newSigner) public onlyOwner {
        if(_signedClaimsDecommissioned) {
            revert SignedClaimsAreDecommissioned();
        }

        emit SignerUpdated(_approvalSigner, newSigner);
        _approvalSigner = newSigner;
    }

    /// @notice Returns true if the provided account has already minted, false otherwise
    function hasMintedBySignedApproval(address account) public view returns (bool) {
        return addressMinted[account];
    }

    /// @notice Returns the address of the approved signer
    function approvalSigner() public view returns (address) {
        return _approvalSigner;
    }

    /// @notice Returns the maximum amount mintable by approved signers
    function maxQuantityMintable() public view returns (uint256) {
        return _maxQuantityMintable;
    }

    /// @notice Returns the current amount minted by approved signers
    function mintedAmount() public view returns (uint256) {
        return _mintedAmount;
    }

    /// @notice Returns true if signed claims have been decommissioned, false otherwise
    function signedClaimsDecommissioned() public view returns (bool) {
        return _signedClaimsDecommissioned;
    }

    /// @dev Internal function used to revert if signed claims are decommissioned.
    function _requireSignedClaimsActive() internal view {
        if(_signedClaimsDecommissioned) {
            revert SignedClaimsAreDecommissioned();
        }
    }
}

File 28 of 41 : 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 29 of 41 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 30 of 41 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

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

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

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

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

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

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

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

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

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner nor approved for all"
        );

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
        _safeTransfer(from, to, tokenId, data);
    }

    /**
     * @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.
     *
     * `data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @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 (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits an {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * 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, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

File 31 of 41 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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;

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

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the 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);
}

File 32 of 41 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

File 33 of 41 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 34 of 41 : ERC2981.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)

pragma solidity ^0.8.0;

import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
 *
 * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
 * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
 *
 * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
 * fee is specified in basis points by default.
 *
 * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
 * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
 * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
 *
 * _Available since v4.5._
 */
abstract contract ERC2981 is IERC2981, ERC165 {
    struct RoyaltyInfo {
        address receiver;
        uint96 royaltyFraction;
    }

    RoyaltyInfo private _defaultRoyaltyInfo;
    mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;

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

    /**
     * @inheritdoc IERC2981
     */
    function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
        RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];

        if (royalty.receiver == address(0)) {
            royalty = _defaultRoyaltyInfo;
        }

        uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();

        return (royalty.receiver, royaltyAmount);
    }

    /**
     * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
     * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
     * override.
     */
    function _feeDenominator() internal pure virtual returns (uint96) {
        return 10000;
    }

    /**
     * @dev Sets the royalty information that all ids in this contract will default to.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: invalid receiver");

        _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Removes default royalty information.
     */
    function _deleteDefaultRoyalty() internal virtual {
        delete _defaultRoyaltyInfo;
    }

    /**
     * @dev Sets the royalty information for a specific token id, overriding the global default.
     *
     * Requirements:
     *
     * - `receiver` cannot be the zero address.
     * - `feeNumerator` cannot be greater than the fee denominator.
     */
    function _setTokenRoyalty(
        uint256 tokenId,
        address receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
        require(receiver != address(0), "ERC2981: Invalid parameters");

        _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
    }

    /**
     * @dev Resets royalty information for the token id back to the global default.
     */
    function _resetTokenRoyalty(uint256 tokenId) internal virtual {
        delete _tokenRoyaltyInfo[tokenId];
    }
}

File 35 of 41 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 36 of 41 : 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 37 of 41 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_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 38 of 41 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 39 of 41 : draft-EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

File 40 of 41 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

Settings
{
  "remappings": [
    "@creator-token-contracts/=lib/creator-token-contracts/",
    "@hypermint/=lib/hypermint-contracts/",
    "@limit-break/=lib/limit-break-contracts/contracts/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "ERC721A/=lib/ERC721A/contracts/",
    "creator-token-contracts/=lib/creator-token-contracts/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc721a/=lib/ERC721A/",
    "forge-std/=lib/forge-std/src/",
    "hypermint-contracts/=lib/hypermint-contracts/contracts/",
    "limit-break-contracts/=lib/limit-break-contracts/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator_","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressAlreadyMinted","type":"error"},{"inputs":[],"name":"AdventureApprovalToCaller","type":"error"},{"inputs":[],"name":"AdventureIsStillWhitelisted","type":"error"},{"inputs":[],"name":"AlreadyInitializedAdventureERC721","type":"error"},{"inputs":[],"name":"AlreadyInitializedERC721","type":"error"},{"inputs":[],"name":"AlreadyInitializedRoyalties","type":"error"},{"inputs":[],"name":"AlreadyInitializedURI","type":"error"},{"inputs":[],"name":"AlreadyOnQuest","type":"error"},{"inputs":[],"name":"AlreadyWhitelisted","type":"error"},{"inputs":[],"name":"AnActiveQuestIsPreventingTransfers","type":"error"},{"inputs":[],"name":"ArrayIndexOverflowsUint128","type":"error"},{"inputs":[],"name":"BatchSizeGreaterThanMaximum","type":"error"},{"inputs":[],"name":"BatchSizeMustBeGreaterThanZero","type":"error"},{"inputs":[],"name":"CallerDoesNotOwnRootTokenId","type":"error"},{"inputs":[],"name":"CallerIsNotTheContractOwner","type":"error"},{"inputs":[],"name":"CallerNotAWhitelistedAdventure","type":"error"},{"inputs":[],"name":"CallerNotApprovedForAdventure","type":"error"},{"inputs":[],"name":"CallerNotTokenOwner","type":"error"},{"inputs":[],"name":"ClaimPeriodIsNotOpen","type":"error"},{"inputs":[],"name":"ClaimPeriodMustBeClosedInTheFuture","type":"error"},{"inputs":[],"name":"ClaimsMustBeClosedToReopen","type":"error"},{"inputs":[],"name":"CollectionAddressIsNotAnERC721Token","type":"error"},{"inputs":[],"name":"ExceedsMaxRoyaltyFee","type":"error"},{"inputs":[],"name":"IneligibleTokenArrayMustBeInAscendingOrder","type":"error"},{"inputs":[],"name":"IneligibleTokensFinalized","type":"error"},{"inputs":[],"name":"IneligibleTokensHaveNotBeenFinalized","type":"error"},{"inputs":[],"name":"InputArrayLengthMismatch","type":"error"},{"inputs":[],"name":"InvalidAdventureContract","type":"error"},{"inputs":[],"name":"InvalidRootCollectionAddress","type":"error"},{"inputs":[],"name":"InvalidRootCollectionTokenId","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MaxNumberOfRootCollectionsExceeded","type":"error"},{"inputs":[],"name":"MaxQuantityMustBeGreaterThanZero","type":"error"},{"inputs":[],"name":"MaxSimultaneousQuestsCannotBeZero","type":"error"},{"inputs":[],"name":"MaxSimultaneousQuestsExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyOfRootTokenCannotBeZero","type":"error"},{"inputs":[],"name":"MintExceedsMaximumAmountBySignedApproval","type":"error"},{"inputs":[],"name":"MustSpecifyAtLeastOneIneligibleToken","type":"error"},{"inputs":[],"name":"MustSpecifyAtLeastOneRootCollection","type":"error"},{"inputs":[],"name":"NewOwnerIsTheZeroAddress","type":"error"},{"inputs":[],"name":"NonexistentToken","type":"error"},{"inputs":[],"name":"NotOnQuest","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerAlreadyInitialized","type":"error"},{"inputs":[],"name":"QuestIdOutOfRange","type":"error"},{"inputs":[],"name":"RootCollectionsAlreadyInitialized","type":"error"},{"inputs":[],"name":"RootCollectionsHaveNotBeenInitialized","type":"error"},{"inputs":[],"name":"SignedClaimsAreDecommissioned","type":"error"},{"inputs":[],"name":"SignerAlreadyInitialized","type":"error"},{"inputs":[],"name":"SignerCannotBeInitializedAsAddressZero","type":"error"},{"inputs":[],"name":"SignerIsAddressZero","type":"error"},{"inputs":[],"name":"TokenIdAlreadyClaimed","type":"error"},{"inputs":[],"name":"TokensPerClaimMustBeBetweenOneAndTen","type":"error"},{"inputs":[],"name":"TooManyActiveQuests","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"AdventureApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"adventure","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"AdventureWhitelistUpdated","type":"event"},{"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":false,"internalType":"string","name":"baseTokenURI","type":"string"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootCollection","type":"address"},{"indexed":true,"internalType":"uint256","name":"rootCollectionTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTokenId","type":"uint256"}],"name":"ClaimMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"claimPeriodClosingTimestamp","type":"uint256"}],"name":"ClaimPeriodClosing","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"claimPeriodClosingTimestamp","type":"uint256"}],"name":"ClaimPeriodOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootCollectionAddress","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ineligibleTokenSlots","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"ineligibleTokenBitmaps","type":"uint256[]"}],"name":"IneligibleTokensInitialized","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"},{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"address","name":"adventure","type":"address"},{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"},{"indexed":false,"internalType":"bool","name":"booted","type":"bool"}],"name":"QuestUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"rootCollection","type":"address"},{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensPerClaim","type":"uint256"}],"name":"RootCollectionInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"RoyaltySet","type":"event"},{"anonymous":false,"inputs":[],"name":"SignedClaimsDecommissioned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTokenId","type":"uint256"}],"name":"SignedMintClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldSigner","type":"address"},{"indexed":false,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"suffixURI","type":"string"}],"name":"SuffixURISet","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":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"activeQuestList","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"activeQuestLookup","outputs":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint32","name":"questId","type":"uint32"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint32","name":"arrayIndex","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureSafeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"approvalSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"areAdventuresApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"bootFromAllQuests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rootCollectionAddress","type":"address"},{"internalType":"uint256[]","name":"rootCollectionTokenIds","type":"uint256[]"}],"name":"claimBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"claimSignedMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"claimPeriodClosingTimestamp_","type":"uint256"}],"name":"closeClaims","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ineligibleTokenIds","type":"uint256[]"}],"name":"computeIneligibleTokensBitmap","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"decommissionSignedApprovals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"enterQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"exitQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"getActiveQuests","outputs":[{"components":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint32","name":"questId","type":"uint32"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint32","name":"arrayIndex","type":"uint32"}],"internalType":"struct Quest[]","name":"activeQuests","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":[],"name":"getClaimPeriodClosingTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"getQuestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"getTimeOnQuest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rootCollectionAddress","type":"address"}],"name":"getTokensPerClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"hasMintedBySignedApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxSimultaneousQuests_","type":"uint256"}],"name":"initializeAdventureERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"initializeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"finalize","type":"bool"},{"internalType":"address","name":"rootCollectionAddress","type":"address"},{"internalType":"uint256[]","name":"ineligibleTokenSlots","type":"uint256[]"},{"internalType":"uint256[]","name":"ineligibleTokenBitmaps","type":"uint256[]"}],"name":"initializeIneligibleTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bool","name":"","type":"bool"}],"name":"initializeOperatorFilterer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"initializeOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"rootCollections_","type":"address[]"},{"internalType":"uint256[]","name":"rootCollectionMaxSupplies_","type":"uint256[]"},{"internalType":"uint256[]","name":"tokensPerClaimArray_","type":"uint256[]"}],"name":"initializeRootCollections","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"initializeRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"uint256","name":"maxQuantity","type":"uint256"}],"name":"initializeSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI_","type":"string"},{"internalType":"string","name":"suffixURI_","type":"string"}],"name":"initializeURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAdventureWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isClaimPeriodOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rootCollectionAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rootCollectionAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"isParticipatingInQuest","outputs":[{"internalType":"bool","name":"participatingInQuest","type":"bool"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxQuantityMintable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSimultaneousQuests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"claimPeriodClosingTimestamp_","type":"uint256"}],"name":"openClaims","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"_tokenId","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setAdventuresApprovedForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseTokenURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"suffixURI_","type":"string"}],"name":"setSuffixURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signedClaimsDecommissioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"suffixURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adventure","type":"address"}],"name":"unwhitelistAdventure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"userExitAllQuests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"userExitQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adventure","type":"address"}],"name":"whitelistAdventure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"whitelistedAdventureList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedAdventures","outputs":[{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"uint128","name":"arrayIndex","type":"uint128"}],"stateMutability":"view","type":"function"}]

610180604052600561014081905264173539b7b760d91b6101609081526200002b916017919062000836565b503480156200003957600080fd5b50604051620060a6380380620060a68339810160408190526200005c91620008dc565b6040518060400160405280601881526020017f4469676944616967616b75447261676f6e457373656e63650000000000000000815250604051806040016040528060018152602001603160f81b8152506040518060200160405280600081525060405180602001604052806000815250620000e6620000e06200028160201b60201c565b62000285565b8151620000fb90600190602085019062000836565b5080516200011190600290602084019062000836565b5050825160208085019190912083518483012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c0019052805194019390932091935091906080523060c052610120525050604080518082018252601881527f4469676944616967616b75447261676f6e457373656e63650000000000000000602080830191909152825180840190935260048352634449444560e01b908301526200020093509150620002d5565b620002406040518060600160405280603181526020016200607560319139604080518082019091526005815264173539b7b760d91b602082015262000341565b6200024c60646200039e565b620002588282620003f0565b62000279733cc6cdda760b79bafa08df41ecfa224f810dceb660016200043c565b5050620009c6565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620002df6200046c565b60075460ff161562000304576040516376f1a0b360e01b815260040160405180910390fd5b81516200031990600890602085019062000836565b5080516200032f90600990602084019062000836565b50506007805460ff1916600117905550565b6200034b6200046c565b601554610100900460ff16156200037557604051635b79f68360e01b815260040160405180910390fd5b62000380826200049a565b6200038b81620004f6565b50506015805461ff001916610100179055565b620003a86200046c565b600c5460ff1615620003cd57604051630e009cb560e11b815260040160405180910390fd5b620003d88162000547565b600e55600c805460ff19166001908117909155600d55565b620003fa6200046c565b60155460ff16156200041f57604051639383013960e01b815260040160405180910390fd5b6200042b82826200058c565b50506015805460ff19166001179055565b62000468733cc6cdda760b79bafa08df41ecfa224f810dceb660016200061d60201b620028bb1760201c565b5050565b6000546001600160a01b03163314620004985760405163097b5fdb60e31b815260040160405180910390fd5b565b620004a46200046c565b8051620004b990601690602084019062000836565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f681604051620004eb919062000931565b60405180910390a150565b620005006200046c565b80516200051590601790602084019062000836565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba081604051620004eb919062000931565b80620005665760405163318ccdef60e11b815260040160405180910390fd5b60648111156200058957604051639cb75faf60e01b815260040160405180910390fd5b50565b620005966200046c565b6127106001600160601b0382161115620005c357604051631557c04f60e21b815260040160405180910390fd5b620005cf828262000731565b604080516001600160a01b03841681526001600160601b03831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b6daaeb6d7670e522a718067333cd4e3b1562000468578015620006ae57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200069157600080fd5b505af1158015620006a6573d6000803e3d6000fd5b505050505050565b6001600160a01b03821615620006ff5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af29039060440162000676565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e4869060240162000676565b6127106001600160601b0382161115620007a55760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620007fd5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016200079c565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b828054620008449062000989565b90600052602060002090601f016020900481019282620008685760008555620008b3565b82601f106200088357805160ff1916838001178555620008b3565b82800160010185558215620008b3579182015b82811115620008b357825182559160200191906001019062000896565b50620008c1929150620008c5565b5090565b5b80821115620008c15760008155600101620008c6565b60008060408385031215620008f057600080fd5b82516001600160a01b03811681146200090857600080fd5b60208401519092506001600160601b03811681146200092657600080fd5b809150509250929050565b600060208083528351808285015260005b81811015620009605785810183015185820160400152820162000942565b8181111562000973576000604083870101525b50601f01601f1916929092016040019392505050565b600181811c908216806200099e57607f821691505b60208210811415620009c057634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161565f62000a16600039600061435d015260006143ac01526000614387015260006142e00152600061430a01526000614334015261565f6000f3fe608060405234801561001057600080fd5b506004361061041d5760003560e01c80637e10b35b1161022b578063b3bcea4811610130578063e2989f4c116100b8578063ee0471e411610087578063ee0471e414610a94578063f1e923c514610a9c578063f2fde38b14610aaf578063f3d73e9514610ac2578063f979293914610aca57600080fd5b8063e2989f4c14610a1f578063e370ab4614610a32578063e985e9c514610a45578063ec8f70c414610a8157600080fd5b8063caa0f92a116100ff578063caa0f92a146109d6578063d147c97a146109de578063d547cfb7146109f1578063d80a8434146109f9578063d96effe914610a0c57600080fd5b8063b3bcea4814610995578063b88d4fde1461099d578063c05e2f44146109b0578063c87b56dd146109c357600080fd5b806395d89b41116101b35780639bc17ea4116101825780639bc17ea4146108f7578063a22cb4651461090a578063aa6cab5a1461091d578063aca139f71461096f578063b39fa0001461098257600080fd5b806395d89b41146108c157806395fa0ff5146108c9578063970f9fc8146108dc5780639967fb65146108e457600080fd5b80638be18e57116101fa5780638be18e57146108565780638c5f36bb146108695780638da5cb5b1461087c578063916237181461088d578063954abd5e146108a057600080fd5b80637e10b35b146107ec5780637f1a5ce1146107ff578063816a15011461083b578063869f91101461084e57600080fd5b8063301be740116103315780636352211e116102b9578063703fa92911610288578063703fa9291461077057806370a08231146107a057806372be0d8b146107b3578063772bcfb9146107c65780637c04c80a146107d957600080fd5b80636352211e1461072c5780636c19e7831461073f5780636c6473c5146107525780636c9346201461076557600080fd5b80634f350253116103005780634f350253146106a057806351dadc28146106cb57806353401df9146106f357806355f804b314610706578063562beba81461071957600080fd5b8063301be7401461063957806341f434341461066557806342842e0e1461067a5780634e02c0781461068d57600080fd5b806311ad4081116103b4578063247946c911610383578063247946c9146105c757806324933ba6146105da5780632a55205a146105e25780632d380242146106145780632ebb386a1461062657600080fd5b806311ad40811461057857806318b1b60e1461058b578063225848cf146105a157806323b872dd146105b457600080fd5b8063081812fc116103f0578063081812fc14610487578063095ea7b3146104b25780630f3d911c146104c557806311340557146104e557600080fd5b806301ffc9a71461042257806302fa7c471461044a57806306fdde031461045f578063070cba1714610474575b600080fd5b610435610430366004614a62565b610add565b60405190151581526020015b60405180910390f35b61045d610458366004614a94565b610b23565b005b610467610baf565b6040516104419190614b31565b61045d610482366004614b44565b610c41565b61049a610495366004614b61565b610e47565b6040516001600160a01b039091168152602001610441565b61045d6104c0366004614b7a565b610e6e565b6104d86104d3366004614ba6565b610e87565b6040516104419190614bcb565b6105426104f3366004614c36565b601260209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff61010082048116916001600160401b03600160281b82041691600160681b9091041684565b60408051941515855263ffffffff93841660208601526001600160401b0390921691840191909152166060820152608001610441565b61045d610586366004614c81565b611087565b601d5461010090046001600160a01b031661049a565b61045d6105af366004614cb1565b6110a7565b61045d6105c2366004614cdf565b6110c6565b61045d6105d5366004614ddd565b6110f1565b610435611147565b6105f56105f0366004614c81565b611156565b604080516001600160a01b039093168352602083019190915201610441565b601f545b604051908152602001610441565b61045d610634366004614ba6565b611204565b610435610647366004614b44565b6001600160a01b03166000908152600b602052604090205460ff1690565b61049a6daaeb6d7670e522a718067333cd4e81565b61045d610688366004614cdf565b611222565b61045d61069b366004614e40565b611247565b6104356106ae366004614b44565b6001600160a01b0316600090815260208052604090205460ff1690565b6106de6106d9366004614e40565b611264565b60405163ffffffff9091168152602001610441565b61045d610701366004614c81565b6112ba565b61045d610714366004614e67565b6112d6565b610435610727366004614b7a565b61132c565b61049a61073a366004614b61565b611378565b61045d61074d366004614b44565b6113dd565b61045d610760366004614f29565b61147d565b601d5460ff16610435565b61078361077e366004614e40565b611613565b604080519315158452602084019290925290820152606001610441565b6106186107ae366004614b44565b611697565b61045d6107c1366004614b61565b61171d565b61045d6107d4366004614b61565b6117c3565b61045d6107e7366004614ff5565b611828565b61045d6107fa366004614b44565b6118cf565b61043561080d366004615049565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b610618610849366004614e40565b611a88565b600e54610618565b61045d610864366004614e67565b611abd565b61045d610877366004614b44565b611b08565b6000546001600160a01b031661049a565b61061861089b366004614ba6565b611b3e565b6108b36108ae366004615077565b611b66565b6040516104419291906150f3565b610467611e31565b61045d6108d7366004614a94565b611e40565b601954610618565b61045d6108f2366004615121565b611e87565b61045d610905366004614b61565b612161565b61045d610918366004614cb1565b612188565b61095061092b366004614b44565b600b6020526000908152604090205460ff81169061010090046001600160801b031682565b6040805192151583526001600160801b03909116602083015201610441565b61045d61097d366004614cdf565b61219c565b61045d610990366004614b61565b6121da565b610467612227565b61045d6109ab366004615206565b6122b5565b61045d6109be366004614cb1565b6122e2565b6104676109d1366004614b61565b61237b565b601a54610618565b61045d6109ec366004614ddd565b612412565b610467612477565b610435610a07366004614b7a565b612484565b61045d610a1a366004615279565b6124f8565b61049a610a2d366004614b61565b612716565b61045d610a40366004614cdf565b612740565b610435610a53366004615049565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b61045d610a8f366004614b7a565b612761565b601e54610618565b61045d610aaa366004614ba6565b612810565b61045d610abd366004614b44565b61282d565b61045d61285c565b610618610ad8366004614b44565b6128a4565b60006001600160e01b03198216633b23dc3160e21b1480610b0e57506001600160e01b03198216639967fb6560e01b145b80610b1d5750610b1d826129c0565b92915050565b610b2b612a00565b6127106001600160601b0382161115610b5757604051631557c04f60e21b815260040160405180910390fd5b610b618282612a2d565b604080516001600160a01b03841681526001600160601b03831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b606060088054610bbe906152f0565b80601f0160208091040260200160405190810160405280929190818152602001828054610bea906152f0565b8015610c375780601f10610c0c57610100808354040283529160200191610c37565b820191906000526020600020905b815481529060010190602001808311610c1a57829003601f168201915b5050505050905090565b610c49612a00565b6001600160a01b0381166000908152600b602052604090205460ff16610c8257604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812054600a546101009091046001600160801b03169190610cbb9060019061533b565b905080826001600160801b031614610db757600a8181548110610ce057610ce0615352565b600091825260209091200154600a80546001600160a01b03909216916001600160801b038516908110610d1557610d15615352565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a856001600160801b031681548110610d6457610d64615352565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546001600160801b03929092166101000270ffffffffffffffffffffffffffffffff00199092169190911790555b600a805480610dc857610dc8615368565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038516808352600b8252604080842080546001600160881b031916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a2505050565b6000610e5282612b2a565b506000908152600560205260409020546001600160a01b031690565b81610e7881612b89565b610e828383612c51565b505050565b60606000610e958484611b3e565b9050806001600160401b03811115610eaf57610eaf614d20565b604051908082528060200260200182016040528015610f0157816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610ecd5790505b5060008581526011602090815260408083206001600160a01b0388168452825280832080548251818502810185019093528083529496509293909291830182828015610f9857602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610f5b5790505b5050505050905060005b8281101561107e5760008681526012602090815260408083206001600160a01b038916845290915281208351909190849084908110610fe357610fe3615352565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff81161515825261010081048516928201929092526001600160401b03600160281b83041692810192909252600160681b90049091166060820152845185908390811061106257611062615352565b6020026020010181905250806110779061537e565b9050610fa2565b50505092915050565b61108f612d62565b61109882612d88565b6110a3823383612db7565b5050565b6110a3733cc6cdda760b79bafa08df41ecfa224f810dceb660016128bb565b826001600160a01b03811633146110e0576110e033612b89565b6110eb848484613186565b50505050565b6110f9612a00565b601554610100900460ff161561112257604051635b79f68360e01b815260040160405180910390fd5b61112b826112d6565b61113481611abd565b50506015805461ff001916610100179055565b60006111516131b7565b905090565b60008281526014602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916111cb5750604080518082019091526013546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906111ea906001600160601b031687615399565b6111f491906153ce565b91519350909150505b9250929050565b61120d816131d0565b6112168261320a565b6110a38282600061323b565b826001600160a01b038116331461123c5761123c33612b89565b6110eb8484846134f9565b611250826131d0565b6112598361320a565b610e82838383612db7565b6011602052826000526040600020602052816000526040600020818154811061128c57600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b6112c2612d62565b6112cb82612d88565b6110a3823383613514565b6112de612a00565b80516112f1906016906020840190614992565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040516113219190614b31565b60405180910390a150565b600080611338846137a4565b9050806001015483111561135f576040516346bcc34b60e01b815260040160405180910390fd5b600061136b82856137de565b5091979650505050505050565b6000818152600360205260408120546001600160a01b031680610b1d5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b6113e5612a00565b601d5460ff1615611409576040516363056b0560e11b815260040160405180910390fd5b601d54604080516001600160a01b036101009093048316815291831660208301527f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb910160405180910390a1601d80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b601b5460ff166114a057604051630324d93f60e51b815260040160405180910390fd5b601b54610100900460ff16156114c9576040516307a4f1e760e31b815260040160405180910390fd5b80518251146114eb576040516343714afd60e01b815260040160405180910390fd5b60006114f6846137a4565b9050841561150e57601b805461ff0019166101001790555b60005b83518110156115c85782818151811061152c5761152c615352565b6020026020010151198260030185838151811061154b5761154b615352565b60200260200101518154811061156357611563615352565b906000526020600020018190555082818151811061158357611583615352565b60200260200101518260040160008684815181106115a3576115a3615352565b6020026020010151815260200190815260200160002081905550806001019050611511565b50836001600160a01b03167f20905c4058e8e6d2545885b2acd068e2c8ec5161540f396d423bf870156689a384846040516116049291906150f3565b60405180910390a25050505050565b6000808063ffffffff84111561163c576040516307f159d160e31b815260040160405180910390fd5b50505060009283526012602090815260408085206001600160a01b0394909416855292815282842063ffffffff9283168552905291205460ff811692600160281b82046001600160401b031692600160681b90920490911690565b60006001600160a01b0382166117015760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016113d4565b506001600160a01b031660009081526004602052604090205490565b611725612a00565b42811161174557604051631205a88f60e31b815260040160405180910390fd5b61174d613826565b60185460ff16156117805760195442101561177b57604051632e02a5a360e21b815260040160405180910390fd5b61178e565b6018805460ff191660011790555b60198190556040518181527ff05c67ac09cc489b8b8a4713b524acfbf22fca066ee972319956423eca41e81d90602001611321565b6117cb612a00565b6117d3613871565b4281116117f357604051631205a88f60e31b815260040160405180910390fd5b60198190556040518181527f8ef44b9f15cd912828f8c65a0bc6364c6918b2128c541fa639a6b21f7fdb6b6b90602001611321565b611830613871565b8061184e576040516375a5e88160e01b815260040160405180910390fd5b6000611859846137a4565b90506000816002015461012c61186f91906153ce565b90508083111561189257604051631002d45960e21b815260040160405180910390fd5b60005b838110156118c7576118bf838686848181106118b3576118b3615352565b90506020020135613896565b600101611895565b505050505050565b6118d7612a00565b6001600160a01b0381166000908152600b602052604090205460ff16156119115760405163b73e95e160e01b815260040160405180910390fd5b6040516301ffc9a760e01b81526325df830760e21b60048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561195757600080fd5b505afa15801561196b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198f91906153e2565b6119ac576040516390c51dd760e01b815260040160405180910390fd5b600a546001600160801b038111156119d757604051636ab8f7f960e11b815260040160405180910390fd5b6001600160a01b0382166000818152600b60209081526040808320805460016001600160881b03199091166101006001600160801b03891602178117909155600a8054808301825594527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890930180546001600160a01b03191685179055519182527fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b6000806000611a98868686611613565b509150915081611aa9576000611ab3565b611ab3814261533b565b9695505050505050565b611ac5612a00565b8051611ad8906017906020840190614992565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba0816040516113219190614b31565b6000546001600160a01b031615611b3257604051631360e86560e31b815260040160405180910390fd5b611b3b81613a4c565b50565b60009182526011602090815260408084206001600160a01b0393909316845291905290205490565b60608082611b875760405163dddd8f4560e01b815260040160405180910390fd5b60008484611b9660018261533b565b818110611ba557611ba5615352565b905060200201359050600080611bba83613a9c565b90506000816001600160401b03811115611bd657611bd6614d20565b604051908082528060200260200182016040528015611bff578160200160208202803683370190505b50905060005b87811015611cbf576000898983818110611c2157611c21615352565b905060200201359050600082118015611c3a5750848111155b15611c585760405163157f19f560e01b815260040160405180910390fd5b9350836000610100820490506000610100830690506000858381518110611c8157611c81615352565b60200260200101519050816001901b8117868481518110611ca457611ca4615352565b60200260200101818152505050505050806001019050611c05565b506000805b83811015611cfd576000838281518110611ce057611ce0615352565b60200260200101511115611cf5578160010191505b600101611cc4565b506000816001600160401b03811115611d1857611d18614d20565b604051908082528060200260200182016040528015611d41578160200160208202803683370190505b5090506000826001600160401b03811115611d5e57611d5e614d20565b604051908082528060200260200182016040528015611d87578160200160208202803683370190505b5090506000805b86811015611e1e576000868281518110611daa57611daa615352565b60200260200101511115611e1657858181518110611dca57611dca615352565b6020026020010151848381518110611de457611de4615352565b60200260200101818152505080838381518110611e0357611e03615352565b6020026020010181815250508160010191505b600101611d8e565b50909b919a509098505050505050505050565b606060098054610bbe906152f0565b611e48612a00565b60155460ff1615611e6c57604051639383013960e01b815260040160405180910390fd5b611e768282610b23565b50506015805460ff19166001179055565b611e8f612a00565b601b5460ff1615611eb357604051633fb0268b60e21b815260040160405180910390fd5b82518251611ec2908290613abd565b611ecd818351613abd565b80611eeb5760405163d6bf7c7560e01b815260040160405180910390fd5b6019811115611f0d57604051634ac9dcf160e01b815260040160405180910390fd5b60005b81811015612145576000858281518110611f2c57611f2c615352565b602002602001015190506000858381518110611f4a57611f4a615352565b602002602001015190506000858481518110611f6857611f68615352565b60200260200101519050826001600160a01b03167fd4f7e42db75a28d1d87e96cd3b09c3584d1ebdf218a5402741601a7cae7288c18383604051611fb6929190918252602082015260400190565b60405180910390a26040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038416906301ffc9a79060240160206040518083038186803b15801561200457600080fd5b505afa158015612018573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203c91906153e2565b61205957604051636ef24c5560e11b815260040160405180910390fd5b8015806120665750600a81115b1561208457604051632fa4e28f60e11b815260040160405180910390fd5b816120a25760405163194c24a160e21b815260040160405180910390fd5b6001600160a01b0383166000818152601c6020526040812080546101009093026001600160a81b03199093169290921760019081178355820184905560029091018290556120ef83613a9c565b905060005b81811015612135576001600160a01b0385166000908152601c60209081526040822060030180546001818101835591845291909220600019910155016120f4565b5084600101945050505050611f10565b5061214e613add565b5050601b805460ff191660011790555050565b612169612d62565b61217281612d88565b6002600d5561218081613aeb565b506001600d55565b8161219281612b89565b610e828383613b92565b6121a4612d62565b6121ad81612d88565b6002600d819055506121d083838360405180602001604052806000815250613b9d565b50506001600d5550565b6121e2612a00565b600c5460ff161561220657604051630e009cb560e11b815260040160405180910390fd5b61220f81613bd0565b600e55600c805460ff19166001908117909155600d55565b60178054612234906152f0565b80601f0160208091040260200160405190810160405280929190818152602001828054612260906152f0565b80156122ad5780601f10612282576101008083540402835291602001916122ad565b820191906000526020600020905b81548152906001019060200180831161229057829003601f168201915b505050505081565b836001600160a01b03811633146122cf576122cf33612b89565b6122db85858585613c10565b5050505050565b336001600160a01b03831681141561230d576040516353ff677360e11b815260040160405180910390fd5b6001600160a01b03818116600081815260106020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c05691015b60405180910390a3505050565b6000818152600360205260409020546060906001600160a01b03166123b35760405163163a09e160e31b815260040160405180910390fd5b60006123bd613c42565b905060008151116123dd576040518060200160405280600081525061240b565b806123e784613c51565b60176040516020016123fb939291906153ff565b6040516020818303038152906040525b9392505050565b61241a612a00565b60075460ff161561243e576040516376f1a0b360e01b815260040160405180910390fd5b8151612451906008906020850190614992565b508051612465906009906020840190614992565b50506007805460ff1916600117905550565b60168054612234906152f0565b600080612490846137a4565b905080600101548311156124b7576040516346bcc34b60e01b815260040160405180910390fd5b60006124c5610100856153ce565b905060006124d5610100866154c3565b60009283526004939093016020525060409020546001911c811614159392505050565b33600090815260208052604090205460ff161561252857604051630f5f915f60e41b815260040160405180910390fd5b601d5461010090046001600160a01b031661255657604051634ca2023760e11b815260040160405180910390fd5b61255e613d56565b600081601f5461256e91906154d7565b9050601e54811115612593576040516328c06e1360e01b815260040160405180910390fd5b601f81905560006125ff7fc0fdf125e87206a394c0bd622ce60a53bc2a9f9a841cabce9655320c90da0b68336040805160208101939093526001600160a01b03909116908201526060810185905260800160405160208183030381529060405280519060200120613d7a565b90506126418186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613dc892505050565b601d5461010090046001600160a01b0390811691161461267457604051638baa579f60e01b815260040160405180910390fd5b3360008181526020805260409020805460ff19166001908117909155601a5491907f68d71ff4fd8d7a0d31adc26ab618a68895f33dff2f5bfc297fa49975157a76709083906126c388836154d7565b6126cd919061533b565b6040805192835260208301919091520160405180910390a26126ee84613dec565b60005b8481101561270d5761270533828401613e06565b6001016126f1565b50505050505050565b600a818154811061272657600080fd5b6000918252602090912001546001600160a01b0316905081565b612748612d62565b61275181612d88565b6002600d556121d0838383613e10565b612769612a00565b601d5461010090046001600160a01b0316156127975760405162ab123160e81b815260040160405180910390fd5b6001600160a01b0382166127be5760405163487a40cd60e01b815260040160405180910390fd5b806127dc576040516372198a6d60e01b815260040160405180910390fd5b6127e4613add565b601d80546001600160a01b0390931661010002610100600160a81b031990931692909217909155601e55565b612818612a00565b612821816131d0565b6110a38282600161323b565b612835612a00565b6001600160a01b038116611b325760405163f82d512f60e01b815260040160405180910390fd5b612864612a00565b61286c613d56565b601d805460ff191660011790556040517f43a0371893d0cbfd9e3892248a769a55c4fd6131a91f13b27fb2f57c8d5f70d690600090a1565b6000806128b0836137a4565b600201549392505050565b6daaeb6d7670e522a718067333cd4e3b156110a357801561294057604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b15801561292c57600080fd5b505af11580156118c7573d6000803e3d6000fd5b6001600160a01b0382161561298f5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401612912565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401612912565b60006001600160e01b031982166395fa0ff560e01b14806129f157506001600160e01b0319821663247946c960e01b145b80610b1d5750610b1d82613fb7565b6000546001600160a01b03163314612a2b5760405163097b5fdb60e31b815260040160405180910390fd5b565b6127106001600160601b0382161115612a9b5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016113d4565b6001600160a01b038216612af15760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016113d4565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b6000818152600360205260409020546001600160a01b0316611b3b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016113d4565b6daaeb6d7670e522a718067333cd4e3b15611b3b57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015612bf157600080fd5b505afa158015612c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2991906153e2565b611b3b57604051633b79c77360e21b81526001600160a01b03821660048201526024016113d4565b6000612c5c82611378565b9050806001600160a01b0316836001600160a01b03161415612cca5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016113d4565b336001600160a01b0382161480612ce65750612ce68133610a53565b612d585760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016113d4565b610e828383613fdc565b612d6b33610647565b612a2b57604051639eea455560e01b815260040160405180910390fd5b612d9a612d9482611378565b3361080d565b611b3b576040516306c5be1b60e31b815260040160405180910390fd5b6000806000612dc7868686611613565b92509250925082612deb5760405163107acf8360e11b815260040160405180910390fd5b8360006001612dfa8989611b3e565b612e04919061533b565b9050808314612f695760008881526011602090815260408083206001600160a01b038b1684529091529020805482908110612e4157612e41615352565b600091825260208083206008830401548b84526011825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff16919085908110612e9757612e97615352565b600091825260208083206008830401805460079093166004026101000a63ffffffff8181021990941695909316929092029390931790558981526012825260408082206001600160a01b038b168084529084528183208c845260118552828420918452935281208054869392919085908110612f1557612f15615352565b6000918252602080832060088304015460079092166004026101000a90910463ffffffff90811684529083019390935260409091019020805463ffffffff60681b1916600160681b93909216929092021790555b60008881526011602090815260408083206001600160a01b038b1684529091529020805480612f9a57612f9a615368565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a81526012835260408082206001600160a01b038c1683528452808220928616825291909252812080546001600160881b031916905561300e89611378565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a60008060405161306c9392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156130ad57600080fd5b505afa1580156130c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e591906153e2565b1561310b576000898152600f602052604081208054909190613106906154ef565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b15801561316357600080fd5b505af1158015613177573d6000803e3d6000fd5b50505050505050505050505050565b613190338261404a565b6131ac5760405162461bcd60e51b81526004016113d490615506565b610e82838383613e10565b60185460009060ff168015611151575050601954421090565b6001600160a01b0381166000908152600b602052604090205460ff1615611b3b5760405163c0f8cffb60e01b815260040160405180910390fd5b3361321482611378565b6001600160a01b031614611b3b5760405163b23b68b760e01b815260040160405180910390fd5b600061324684611378565b905060006132548585611b3e565b9050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561328f57600080fd5b505afa1580156132a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c791906153e2565b156132f0576000858152600f6020526040812080548392906132ea90849061533b565b90915550505b60005b818110156134cd5760008681526011602090815260408083206001600160a01b0389168452909152812080548390811061332f5761332f615352565b600091825260208083206008830401548a84526012825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff811615158252958604821681880152600160281b86046001600160401b0316818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a460008981526012602090815260408083206001600160a01b038c811680865291845282852063ffffffff891680875294529382902080546001600160881b03191690559051636d4229c960e01b81529289166004840152602483018c905260448301919091526064820183905290636d4229c990608401600060405180830381600087803b1580156134a757600080fd5b505af11580156134bb573d6000803e3d6000fd5b505050508360010193505050506132f3565b5060008581526011602090815260408083206001600160a01b038816845290915281206122db91614a16565b610e82838383604051806020016040528060008152506122b5565b6000613521848484611613565b50509050801561354457604051637f53cfe360e01b815260040160405180910390fd5b60006135508585611b3e565b9050600e5481106135745760405163f8315a8760e01b815260040160405180910390fd5b60008581526011602090815260408083206001600160a01b03881680855290835281842080546001808201835591865284862060088204018054600790921660040261010090810a63ffffffff818102199094168c8516918202179092558c88526012875285882094885293865284872081885290955292852080546cffffffffffffffff00000000ff1916600160281b426001600160401b0316021790911770ffffffff0000000000000000ffffffff0019169190930263ffffffff60681b191617600160681b91851691909102179055839061365187611378565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156136df57600080fd5b505afa1580156136f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061371791906153e2565b15613732576000878152600f60205260409020805460010190555b60405163688a374160e01b81526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b15801561378357600080fd5b505af1158015613797573d6000803e3d6000fd5b5050505050505050505050565b6001600160a01b0381166000908152601c60205260408120805460ff16610b1d57604051636b62b4c160e11b815260040160405180910390fd5b60038201805460009161010084049160ff85169184918490811061380457613804615352565b9060005260206000200154905060018282901c16600014935092959194509250565b601b5460ff1661384957604051630324d93f60e51b815260040160405180910390fd5b601b54610100900460ff16612a2b5760405163a9fd57fb60e01b815260040160405180910390fd5b6138796131b7565b612a2b576040516318f63a1360e21b815260040160405180910390fd5b3382546040516331a9108f60e11b8152600481018490526001600160a01b039283169261010090920490911690636352211e9060240160206040518083038186803b1580156138e457600080fd5b505afa1580156138f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061391c9190615554565b6001600160a01b03161461394357604051637004d82160e01b815260040160405180910390fd5b60008060008061395386866137de565b9350935093509350831561397a576040516326ab198160e11b815260040160405180910390fd5b6000613985601a5490565b6002880154885491925090879061010090046001600160a01b03167fae8f914c8af222221e50256a64e9f2812cd4e16dd5b5ec6d846ee5459dbf8dee8460016139ce86836154d7565b6139d8919061533b565b6040805192835260208301919091520160405180910390a3836001901b198316886003018681548110613a0d57613a0d615352565b600091825260209091200155613a2281613dec565b60005b81811015613a4157613a39338285016140c8565b600101613a25565b505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610100600182019081049060ff811615613ab7578160010191505b50919050565b8082146110a3576040516343714afd60e01b815260040160405180910390fd5b601a54612a2b576001601a55565b6000613af682611378565b9050613b04816000846140d2565b613b0f600083613fdc565b6001600160a01b0381166000908152600460205260408120805460019290613b3890849061533b565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6110a33383836140ff565b613ba8848484613e10565b613bb4848484846141c6565b6110eb5760405162461bcd60e51b81526004016113d490615571565b80613bee5760405163318ccdef60e11b815260040160405180910390fd5b6064811115611b3b57604051639cb75faf60e01b815260040160405180910390fd5b613c1a338361404a565b613c365760405162461bcd60e51b81526004016113d490615506565b6110eb84848484613b9d565b606060168054610bbe906152f0565b606081613c755750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613c9f5780613c898161537e565b9150613c989050600a836153ce565b9150613c79565b6000816001600160401b03811115613cb957613cb9614d20565b6040519080825280601f01601f191660200182016040528015613ce3576020820181803683370190505b5090505b8415613d4e57613cf860018361533b565b9150613d05600a866154c3565b613d109060306154d7565b60f81b818381518110613d2557613d25615352565b60200101906001600160f81b031916908160001a905350613d47600a866153ce565b9450613ce7565b949350505050565b601d5460ff1615612a2b576040516363056b0560e11b815260040160405180910390fd5b6000610b1d613d876142d3565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000613dd785856143fa565b91509150613de481614467565b509392505050565b80601a6000828254613dfe91906154d7565b909155505050565b6110a38282614622565b826001600160a01b0316613e2382611378565b6001600160a01b031614613e875760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016113d4565b6001600160a01b038216613ee95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016113d4565b613ef48383836140d2565b613eff600082613fdc565b6001600160a01b0383166000908152600460205260408120805460019290613f2890849061533b565b90915550506001600160a01b0382166000908152600460205260408120805460019290613f569084906154d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160e01b0319821663152a902d60e11b1480610b1d5750610b1d8261463c565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061401182611378565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061405683611378565b9050806001600160a01b0316846001600160a01b0316148061409d57506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b80613d4e5750836001600160a01b03166140b684610e47565b6001600160a01b031614949350505050565b6110a3828261467b565b6000818152600f602052604090205415610e82576040516302579f0160e61b815260040160405180910390fd5b816001600160a01b0316836001600160a01b031614156141615760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016113d4565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161236e565b60006001600160a01b0384163b156142c857604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061420a9033908990889088906004016155c3565b602060405180830381600087803b15801561422457600080fd5b505af1925050508015614254575060408051601f3d908101601f19168201909252614251918101906155f6565b60015b6142ae573d808015614282576040519150601f19603f3d011682016040523d82523d6000602084013e614287565b606091505b5080516142a65760405162461bcd60e51b81526004016113d490615571565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613d4e565b506001949350505050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561432c57507f000000000000000000000000000000000000000000000000000000000000000046145b1561435657507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604114156144315760208301516040840151606085015160001a614425878285856147c9565b945094505050506111fd565b82516040141561445b57602083015160408401516144508683836148b6565b9350935050506111fd565b506000905060026111fd565b600081600481111561447b5761447b615613565b14156144845750565b600181600481111561449857614498615613565b14156144e65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016113d4565b60028160048111156144fa576144fa615613565b14156145485760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016113d4565b600381600481111561455c5761455c615613565b14156145b55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016113d4565b60048160048111156145c9576145c9615613565b1415611b3b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016113d4565b6110a38282604051806020016040528060008152506148ef565b60006001600160e01b0319821663f9f7ab4160e01b148061466c57506001600160e01b0319821662059cfd60ed1b145b80610b1d5750610b1d82614922565b6001600160a01b0382166146d15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016113d4565b6000818152600360205260409020546001600160a01b0316156147365760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016113d4565b614742600083836140d2565b6001600160a01b038216600090815260046020526040812080546001929061476b9084906154d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561480057506000905060036148ad565b8460ff16601b1415801561481857508460ff16601c14155b1561482957506000905060046148ad565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561487d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166148a6576000600192509250506148ad565b9150600090505b94509492505050565b6000806001600160ff1b038316816148d360ff86901c601b6154d7565b90506148e1878288856147c9565b935093505050935093915050565b6148f9838361467b565b61490660008484846141c6565b610e825760405162461bcd60e51b81526004016113d490615571565b60006001600160e01b031982166368a3e4bd60e11b1480610b1d5750610b1d8260006001600160e01b031982166380ac58cd60e01b148061497357506001600160e01b03198216635b5e139f60e01b145b80610b1d57506301ffc9a760e01b6001600160e01b0319831614610b1d565b82805461499e906152f0565b90600052602060002090601f0160209004810192826149c05760008555614a06565b82601f106149d957805160ff1916838001178555614a06565b82800160010185558215614a06579182015b82811115614a065782518255916020019190600101906149eb565b50614a12929150614a37565b5090565b508054600082556007016008900490600052602060002090810190611b3b91905b5b80821115614a125760008155600101614a38565b6001600160e01b031981168114611b3b57600080fd5b600060208284031215614a7457600080fd5b813561240b81614a4c565b6001600160a01b0381168114611b3b57600080fd5b60008060408385031215614aa757600080fd5b8235614ab281614a7f565b915060208301356001600160601b0381168114614ace57600080fd5b809150509250929050565b60005b83811015614af4578181015183820152602001614adc565b838111156110eb5750506000910152565b60008151808452614b1d816020860160208601614ad9565b601f01601f19169290920160200192915050565b60208152600061240b6020830184614b05565b600060208284031215614b5657600080fd5b813561240b81614a7f565b600060208284031215614b7357600080fd5b5035919050565b60008060408385031215614b8d57600080fd5b8235614b9881614a7f565b946020939093013593505050565b60008060408385031215614bb957600080fd5b823591506020830135614ace81614a7f565b602080825282518282018190526000919060409081850190868401855b8281101561136b5781518051151585528681015163ffffffff90811688870152868201516001600160401b031687870152606091820151169085015260809093019290850190600101614be8565b600080600060608486031215614c4b57600080fd5b833592506020840135614c5d81614a7f565b9150604084013563ffffffff81168114614c7657600080fd5b809150509250925092565b60008060408385031215614c9457600080fd5b50508035926020909101359150565b8015158114611b3b57600080fd5b60008060408385031215614cc457600080fd5b8235614ccf81614a7f565b91506020830135614ace81614ca3565b600080600060608486031215614cf457600080fd5b8335614cff81614a7f565b92506020840135614d0f81614a7f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614d5e57614d5e614d20565b604052919050565b60006001600160401b03831115614d7f57614d7f614d20565b614d92601f8401601f1916602001614d36565b9050828152838383011115614da657600080fd5b828260208301376000602084830101529392505050565b600082601f830112614dce57600080fd5b61240b83833560208501614d66565b60008060408385031215614df057600080fd5b82356001600160401b0380821115614e0757600080fd5b614e1386838701614dbd565b93506020850135915080821115614e2957600080fd5b50614e3685828601614dbd565b9150509250929050565b600080600060608486031215614e5557600080fd5b833592506020840135614d0f81614a7f565b600060208284031215614e7957600080fd5b81356001600160401b03811115614e8f57600080fd5b613d4e84828501614dbd565b60006001600160401b03821115614eb457614eb4614d20565b5060051b60200190565b600082601f830112614ecf57600080fd5b81356020614ee4614edf83614e9b565b614d36565b82815260059290921b84018101918181019086841115614f0357600080fd5b8286015b84811015614f1e5780358352918301918301614f07565b509695505050505050565b60008060008060808587031215614f3f57600080fd5b8435614f4a81614ca3565b93506020850135614f5a81614a7f565b925060408501356001600160401b0380821115614f7657600080fd5b614f8288838901614ebe565b93506060870135915080821115614f9857600080fd5b50614fa587828801614ebe565b91505092959194509250565b60008083601f840112614fc357600080fd5b5081356001600160401b03811115614fda57600080fd5b6020830191508360208260051b85010111156111fd57600080fd5b60008060006040848603121561500a57600080fd5b833561501581614a7f565b925060208401356001600160401b0381111561503057600080fd5b61503c86828701614fb1565b9497909650939450505050565b6000806040838503121561505c57600080fd5b823561506781614a7f565b91506020830135614ace81614a7f565b6000806020838503121561508a57600080fd5b82356001600160401b038111156150a057600080fd5b6150ac85828601614fb1565b90969095509350505050565b600081518084526020808501945080840160005b838110156150e8578151875295820195908201906001016150cc565b509495945050505050565b60408152600061510660408301856150b8565b828103602084015261511881856150b8565b95945050505050565b60008060006060848603121561513657600080fd5b83356001600160401b038082111561514d57600080fd5b818601915086601f83011261516157600080fd5b81356020615171614edf83614e9b565b82815260059290921b8401810191818101908a84111561519057600080fd5b948201945b838610156151b75785356151a881614a7f565b82529482019490820190615195565b975050870135925050808211156151cd57600080fd5b6151d987838801614ebe565b935060408601359150808211156151ef57600080fd5b506151fc86828701614ebe565b9150509250925092565b6000806000806080858703121561521c57600080fd5b843561522781614a7f565b9350602085013561523781614a7f565b92506040850135915060608501356001600160401b0381111561525957600080fd5b8501601f8101871361526a57600080fd5b614fa587823560208401614d66565b60008060006040848603121561528e57600080fd5b83356001600160401b03808211156152a557600080fd5b818601915086601f8301126152b957600080fd5b8135818111156152c857600080fd5b8760208285010111156152da57600080fd5b6020928301989097509590910135949350505050565b600181811c9082168061530457607f821691505b60208210811415613ab757634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561534d5761534d615325565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060001982141561539257615392615325565b5060010190565b60008160001904831182151516156153b3576153b3615325565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826153dd576153dd6153b8565b500490565b6000602082840312156153f457600080fd5b815161240b81614ca3565b6000845160206154128285838a01614ad9565b8551918401916154258184848a01614ad9565b8554920191600090600181811c908083168061544257607f831692505b85831081141561546057634e487b7160e01b85526022600452602485fd5b8080156154745760018114615485576154b2565b60ff198516885283880195506154b2565b60008b81526020902060005b858110156154aa5781548a820152908401908801615491565b505083880195505b50939b9a5050505050505050505050565b6000826154d2576154d26153b8565b500690565b600082198211156154ea576154ea615325565b500190565b6000816154fe576154fe615325565b506000190190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561556657600080fd5b815161240b81614a7f565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611ab390830184614b05565b60006020828403121561560857600080fd5b815161240b81614a4c565b634e487b7160e01b600052602160045260246000fdfea26469706673582212202dad922c679117665a947d3f33db3294d5ece70f2225e8d333a4c785c09758e564736f6c6343000809003368747470733a2f2f6469676964616967616b752e636f6d2f647261676f6e2d657373656e6365732f6d657461646174612f0000000000000000000000008645e6ae2c000d27c223a0d1ee590786ee61400100000000000000000000000000000000000000000000000000000000000003e8

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061041d5760003560e01c80637e10b35b1161022b578063b3bcea4811610130578063e2989f4c116100b8578063ee0471e411610087578063ee0471e414610a94578063f1e923c514610a9c578063f2fde38b14610aaf578063f3d73e9514610ac2578063f979293914610aca57600080fd5b8063e2989f4c14610a1f578063e370ab4614610a32578063e985e9c514610a45578063ec8f70c414610a8157600080fd5b8063caa0f92a116100ff578063caa0f92a146109d6578063d147c97a146109de578063d547cfb7146109f1578063d80a8434146109f9578063d96effe914610a0c57600080fd5b8063b3bcea4814610995578063b88d4fde1461099d578063c05e2f44146109b0578063c87b56dd146109c357600080fd5b806395d89b41116101b35780639bc17ea4116101825780639bc17ea4146108f7578063a22cb4651461090a578063aa6cab5a1461091d578063aca139f71461096f578063b39fa0001461098257600080fd5b806395d89b41146108c157806395fa0ff5146108c9578063970f9fc8146108dc5780639967fb65146108e457600080fd5b80638be18e57116101fa5780638be18e57146108565780638c5f36bb146108695780638da5cb5b1461087c578063916237181461088d578063954abd5e146108a057600080fd5b80637e10b35b146107ec5780637f1a5ce1146107ff578063816a15011461083b578063869f91101461084e57600080fd5b8063301be740116103315780636352211e116102b9578063703fa92911610288578063703fa9291461077057806370a08231146107a057806372be0d8b146107b3578063772bcfb9146107c65780637c04c80a146107d957600080fd5b80636352211e1461072c5780636c19e7831461073f5780636c6473c5146107525780636c9346201461076557600080fd5b80634f350253116103005780634f350253146106a057806351dadc28146106cb57806353401df9146106f357806355f804b314610706578063562beba81461071957600080fd5b8063301be7401461063957806341f434341461066557806342842e0e1461067a5780634e02c0781461068d57600080fd5b806311ad4081116103b4578063247946c911610383578063247946c9146105c757806324933ba6146105da5780632a55205a146105e25780632d380242146106145780632ebb386a1461062657600080fd5b806311ad40811461057857806318b1b60e1461058b578063225848cf146105a157806323b872dd146105b457600080fd5b8063081812fc116103f0578063081812fc14610487578063095ea7b3146104b25780630f3d911c146104c557806311340557146104e557600080fd5b806301ffc9a71461042257806302fa7c471461044a57806306fdde031461045f578063070cba1714610474575b600080fd5b610435610430366004614a62565b610add565b60405190151581526020015b60405180910390f35b61045d610458366004614a94565b610b23565b005b610467610baf565b6040516104419190614b31565b61045d610482366004614b44565b610c41565b61049a610495366004614b61565b610e47565b6040516001600160a01b039091168152602001610441565b61045d6104c0366004614b7a565b610e6e565b6104d86104d3366004614ba6565b610e87565b6040516104419190614bcb565b6105426104f3366004614c36565b601260209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff61010082048116916001600160401b03600160281b82041691600160681b9091041684565b60408051941515855263ffffffff93841660208601526001600160401b0390921691840191909152166060820152608001610441565b61045d610586366004614c81565b611087565b601d5461010090046001600160a01b031661049a565b61045d6105af366004614cb1565b6110a7565b61045d6105c2366004614cdf565b6110c6565b61045d6105d5366004614ddd565b6110f1565b610435611147565b6105f56105f0366004614c81565b611156565b604080516001600160a01b039093168352602083019190915201610441565b601f545b604051908152602001610441565b61045d610634366004614ba6565b611204565b610435610647366004614b44565b6001600160a01b03166000908152600b602052604090205460ff1690565b61049a6daaeb6d7670e522a718067333cd4e81565b61045d610688366004614cdf565b611222565b61045d61069b366004614e40565b611247565b6104356106ae366004614b44565b6001600160a01b0316600090815260208052604090205460ff1690565b6106de6106d9366004614e40565b611264565b60405163ffffffff9091168152602001610441565b61045d610701366004614c81565b6112ba565b61045d610714366004614e67565b6112d6565b610435610727366004614b7a565b61132c565b61049a61073a366004614b61565b611378565b61045d61074d366004614b44565b6113dd565b61045d610760366004614f29565b61147d565b601d5460ff16610435565b61078361077e366004614e40565b611613565b604080519315158452602084019290925290820152606001610441565b6106186107ae366004614b44565b611697565b61045d6107c1366004614b61565b61171d565b61045d6107d4366004614b61565b6117c3565b61045d6107e7366004614ff5565b611828565b61045d6107fa366004614b44565b6118cf565b61043561080d366004615049565b6001600160a01b03918216600090815260106020908152604080832093909416825291909152205460ff1690565b610618610849366004614e40565b611a88565b600e54610618565b61045d610864366004614e67565b611abd565b61045d610877366004614b44565b611b08565b6000546001600160a01b031661049a565b61061861089b366004614ba6565b611b3e565b6108b36108ae366004615077565b611b66565b6040516104419291906150f3565b610467611e31565b61045d6108d7366004614a94565b611e40565b601954610618565b61045d6108f2366004615121565b611e87565b61045d610905366004614b61565b612161565b61045d610918366004614cb1565b612188565b61095061092b366004614b44565b600b6020526000908152604090205460ff81169061010090046001600160801b031682565b6040805192151583526001600160801b03909116602083015201610441565b61045d61097d366004614cdf565b61219c565b61045d610990366004614b61565b6121da565b610467612227565b61045d6109ab366004615206565b6122b5565b61045d6109be366004614cb1565b6122e2565b6104676109d1366004614b61565b61237b565b601a54610618565b61045d6109ec366004614ddd565b612412565b610467612477565b610435610a07366004614b7a565b612484565b61045d610a1a366004615279565b6124f8565b61049a610a2d366004614b61565b612716565b61045d610a40366004614cdf565b612740565b610435610a53366004615049565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b61045d610a8f366004614b7a565b612761565b601e54610618565b61045d610aaa366004614ba6565b612810565b61045d610abd366004614b44565b61282d565b61045d61285c565b610618610ad8366004614b44565b6128a4565b60006001600160e01b03198216633b23dc3160e21b1480610b0e57506001600160e01b03198216639967fb6560e01b145b80610b1d5750610b1d826129c0565b92915050565b610b2b612a00565b6127106001600160601b0382161115610b5757604051631557c04f60e21b815260040160405180910390fd5b610b618282612a2d565b604080516001600160a01b03841681526001600160601b03831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b606060088054610bbe906152f0565b80601f0160208091040260200160405190810160405280929190818152602001828054610bea906152f0565b8015610c375780601f10610c0c57610100808354040283529160200191610c37565b820191906000526020600020905b815481529060010190602001808311610c1a57829003601f168201915b5050505050905090565b610c49612a00565b6001600160a01b0381166000908152600b602052604090205460ff16610c8257604051630b094f2760e31b815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812054600a546101009091046001600160801b03169190610cbb9060019061533b565b905080826001600160801b031614610db757600a8181548110610ce057610ce0615352565b600091825260209091200154600a80546001600160a01b03909216916001600160801b038516908110610d1557610d15615352565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a856001600160801b031681548110610d6457610d64615352565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546001600160801b03929092166101000270ffffffffffffffffffffffffffffffff00199092169190911790555b600a805480610dc857610dc8615368565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038516808352600b8252604080842080546001600160881b031916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a2505050565b6000610e5282612b2a565b506000908152600560205260409020546001600160a01b031690565b81610e7881612b89565b610e828383612c51565b505050565b60606000610e958484611b3e565b9050806001600160401b03811115610eaf57610eaf614d20565b604051908082528060200260200182016040528015610f0157816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610ecd5790505b5060008581526011602090815260408083206001600160a01b0388168452825280832080548251818502810185019093528083529496509293909291830182828015610f9857602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610f5b5790505b5050505050905060005b8281101561107e5760008681526012602090815260408083206001600160a01b038916845290915281208351909190849084908110610fe357610fe3615352565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff81161515825261010081048516928201929092526001600160401b03600160281b83041692810192909252600160681b90049091166060820152845185908390811061106257611062615352565b6020026020010181905250806110779061537e565b9050610fa2565b50505092915050565b61108f612d62565b61109882612d88565b6110a3823383612db7565b5050565b6110a3733cc6cdda760b79bafa08df41ecfa224f810dceb660016128bb565b826001600160a01b03811633146110e0576110e033612b89565b6110eb848484613186565b50505050565b6110f9612a00565b601554610100900460ff161561112257604051635b79f68360e01b815260040160405180910390fd5b61112b826112d6565b61113481611abd565b50506015805461ff001916610100179055565b60006111516131b7565b905090565b60008281526014602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916111cb5750604080518082019091526013546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906111ea906001600160601b031687615399565b6111f491906153ce565b91519350909150505b9250929050565b61120d816131d0565b6112168261320a565b6110a38282600061323b565b826001600160a01b038116331461123c5761123c33612b89565b6110eb8484846134f9565b611250826131d0565b6112598361320a565b610e82838383612db7565b6011602052826000526040600020602052816000526040600020818154811061128c57600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b6112c2612d62565b6112cb82612d88565b6110a3823383613514565b6112de612a00565b80516112f1906016906020840190614992565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040516113219190614b31565b60405180910390a150565b600080611338846137a4565b9050806001015483111561135f576040516346bcc34b60e01b815260040160405180910390fd5b600061136b82856137de565b5091979650505050505050565b6000818152600360205260408120546001600160a01b031680610b1d5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064015b60405180910390fd5b6113e5612a00565b601d5460ff1615611409576040516363056b0560e11b815260040160405180910390fd5b601d54604080516001600160a01b036101009093048316815291831660208301527f2d025324f0a785e8c12d0a0d91a9caa49df4ef20ff87e0df7213a1d4f3157beb910160405180910390a1601d80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b601b5460ff166114a057604051630324d93f60e51b815260040160405180910390fd5b601b54610100900460ff16156114c9576040516307a4f1e760e31b815260040160405180910390fd5b80518251146114eb576040516343714afd60e01b815260040160405180910390fd5b60006114f6846137a4565b9050841561150e57601b805461ff0019166101001790555b60005b83518110156115c85782818151811061152c5761152c615352565b6020026020010151198260030185838151811061154b5761154b615352565b60200260200101518154811061156357611563615352565b906000526020600020018190555082818151811061158357611583615352565b60200260200101518260040160008684815181106115a3576115a3615352565b6020026020010151815260200190815260200160002081905550806001019050611511565b50836001600160a01b03167f20905c4058e8e6d2545885b2acd068e2c8ec5161540f396d423bf870156689a384846040516116049291906150f3565b60405180910390a25050505050565b6000808063ffffffff84111561163c576040516307f159d160e31b815260040160405180910390fd5b50505060009283526012602090815260408085206001600160a01b0394909416855292815282842063ffffffff9283168552905291205460ff811692600160281b82046001600160401b031692600160681b90920490911690565b60006001600160a01b0382166117015760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016113d4565b506001600160a01b031660009081526004602052604090205490565b611725612a00565b42811161174557604051631205a88f60e31b815260040160405180910390fd5b61174d613826565b60185460ff16156117805760195442101561177b57604051632e02a5a360e21b815260040160405180910390fd5b61178e565b6018805460ff191660011790555b60198190556040518181527ff05c67ac09cc489b8b8a4713b524acfbf22fca066ee972319956423eca41e81d90602001611321565b6117cb612a00565b6117d3613871565b4281116117f357604051631205a88f60e31b815260040160405180910390fd5b60198190556040518181527f8ef44b9f15cd912828f8c65a0bc6364c6918b2128c541fa639a6b21f7fdb6b6b90602001611321565b611830613871565b8061184e576040516375a5e88160e01b815260040160405180910390fd5b6000611859846137a4565b90506000816002015461012c61186f91906153ce565b90508083111561189257604051631002d45960e21b815260040160405180910390fd5b60005b838110156118c7576118bf838686848181106118b3576118b3615352565b90506020020135613896565b600101611895565b505050505050565b6118d7612a00565b6001600160a01b0381166000908152600b602052604090205460ff16156119115760405163b73e95e160e01b815260040160405180910390fd5b6040516301ffc9a760e01b81526325df830760e21b60048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561195757600080fd5b505afa15801561196b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198f91906153e2565b6119ac576040516390c51dd760e01b815260040160405180910390fd5b600a546001600160801b038111156119d757604051636ab8f7f960e11b815260040160405180910390fd5b6001600160a01b0382166000818152600b60209081526040808320805460016001600160881b03199091166101006001600160801b03891602178117909155600a8054808301825594527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890930180546001600160a01b03191685179055519182527fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b6000806000611a98868686611613565b509150915081611aa9576000611ab3565b611ab3814261533b565b9695505050505050565b611ac5612a00565b8051611ad8906017906020840190614992565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba0816040516113219190614b31565b6000546001600160a01b031615611b3257604051631360e86560e31b815260040160405180910390fd5b611b3b81613a4c565b50565b60009182526011602090815260408084206001600160a01b0393909316845291905290205490565b60608082611b875760405163dddd8f4560e01b815260040160405180910390fd5b60008484611b9660018261533b565b818110611ba557611ba5615352565b905060200201359050600080611bba83613a9c565b90506000816001600160401b03811115611bd657611bd6614d20565b604051908082528060200260200182016040528015611bff578160200160208202803683370190505b50905060005b87811015611cbf576000898983818110611c2157611c21615352565b905060200201359050600082118015611c3a5750848111155b15611c585760405163157f19f560e01b815260040160405180910390fd5b9350836000610100820490506000610100830690506000858381518110611c8157611c81615352565b60200260200101519050816001901b8117868481518110611ca457611ca4615352565b60200260200101818152505050505050806001019050611c05565b506000805b83811015611cfd576000838281518110611ce057611ce0615352565b60200260200101511115611cf5578160010191505b600101611cc4565b506000816001600160401b03811115611d1857611d18614d20565b604051908082528060200260200182016040528015611d41578160200160208202803683370190505b5090506000826001600160401b03811115611d5e57611d5e614d20565b604051908082528060200260200182016040528015611d87578160200160208202803683370190505b5090506000805b86811015611e1e576000868281518110611daa57611daa615352565b60200260200101511115611e1657858181518110611dca57611dca615352565b6020026020010151848381518110611de457611de4615352565b60200260200101818152505080838381518110611e0357611e03615352565b6020026020010181815250508160010191505b600101611d8e565b50909b919a509098505050505050505050565b606060098054610bbe906152f0565b611e48612a00565b60155460ff1615611e6c57604051639383013960e01b815260040160405180910390fd5b611e768282610b23565b50506015805460ff19166001179055565b611e8f612a00565b601b5460ff1615611eb357604051633fb0268b60e21b815260040160405180910390fd5b82518251611ec2908290613abd565b611ecd818351613abd565b80611eeb5760405163d6bf7c7560e01b815260040160405180910390fd5b6019811115611f0d57604051634ac9dcf160e01b815260040160405180910390fd5b60005b81811015612145576000858281518110611f2c57611f2c615352565b602002602001015190506000858381518110611f4a57611f4a615352565b602002602001015190506000858481518110611f6857611f68615352565b60200260200101519050826001600160a01b03167fd4f7e42db75a28d1d87e96cd3b09c3584d1ebdf218a5402741601a7cae7288c18383604051611fb6929190918252602082015260400190565b60405180910390a26040516301ffc9a760e01b81526380ac58cd60e01b60048201526001600160a01b038416906301ffc9a79060240160206040518083038186803b15801561200457600080fd5b505afa158015612018573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203c91906153e2565b61205957604051636ef24c5560e11b815260040160405180910390fd5b8015806120665750600a81115b1561208457604051632fa4e28f60e11b815260040160405180910390fd5b816120a25760405163194c24a160e21b815260040160405180910390fd5b6001600160a01b0383166000818152601c6020526040812080546101009093026001600160a81b03199093169290921760019081178355820184905560029091018290556120ef83613a9c565b905060005b81811015612135576001600160a01b0385166000908152601c60209081526040822060030180546001818101835591845291909220600019910155016120f4565b5084600101945050505050611f10565b5061214e613add565b5050601b805460ff191660011790555050565b612169612d62565b61217281612d88565b6002600d5561218081613aeb565b506001600d55565b8161219281612b89565b610e828383613b92565b6121a4612d62565b6121ad81612d88565b6002600d819055506121d083838360405180602001604052806000815250613b9d565b50506001600d5550565b6121e2612a00565b600c5460ff161561220657604051630e009cb560e11b815260040160405180910390fd5b61220f81613bd0565b600e55600c805460ff19166001908117909155600d55565b60178054612234906152f0565b80601f0160208091040260200160405190810160405280929190818152602001828054612260906152f0565b80156122ad5780601f10612282576101008083540402835291602001916122ad565b820191906000526020600020905b81548152906001019060200180831161229057829003601f168201915b505050505081565b836001600160a01b03811633146122cf576122cf33612b89565b6122db85858585613c10565b5050505050565b336001600160a01b03831681141561230d576040516353ff677360e11b815260040160405180910390fd5b6001600160a01b03818116600081815260106020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c05691015b60405180910390a3505050565b6000818152600360205260409020546060906001600160a01b03166123b35760405163163a09e160e31b815260040160405180910390fd5b60006123bd613c42565b905060008151116123dd576040518060200160405280600081525061240b565b806123e784613c51565b60176040516020016123fb939291906153ff565b6040516020818303038152906040525b9392505050565b61241a612a00565b60075460ff161561243e576040516376f1a0b360e01b815260040160405180910390fd5b8151612451906008906020850190614992565b508051612465906009906020840190614992565b50506007805460ff1916600117905550565b60168054612234906152f0565b600080612490846137a4565b905080600101548311156124b7576040516346bcc34b60e01b815260040160405180910390fd5b60006124c5610100856153ce565b905060006124d5610100866154c3565b60009283526004939093016020525060409020546001911c811614159392505050565b33600090815260208052604090205460ff161561252857604051630f5f915f60e41b815260040160405180910390fd5b601d5461010090046001600160a01b031661255657604051634ca2023760e11b815260040160405180910390fd5b61255e613d56565b600081601f5461256e91906154d7565b9050601e54811115612593576040516328c06e1360e01b815260040160405180910390fd5b601f81905560006125ff7fc0fdf125e87206a394c0bd622ce60a53bc2a9f9a841cabce9655320c90da0b68336040805160208101939093526001600160a01b03909116908201526060810185905260800160405160208183030381529060405280519060200120613d7a565b90506126418186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613dc892505050565b601d5461010090046001600160a01b0390811691161461267457604051638baa579f60e01b815260040160405180910390fd5b3360008181526020805260409020805460ff19166001908117909155601a5491907f68d71ff4fd8d7a0d31adc26ab618a68895f33dff2f5bfc297fa49975157a76709083906126c388836154d7565b6126cd919061533b565b6040805192835260208301919091520160405180910390a26126ee84613dec565b60005b8481101561270d5761270533828401613e06565b6001016126f1565b50505050505050565b600a818154811061272657600080fd5b6000918252602090912001546001600160a01b0316905081565b612748612d62565b61275181612d88565b6002600d556121d0838383613e10565b612769612a00565b601d5461010090046001600160a01b0316156127975760405162ab123160e81b815260040160405180910390fd5b6001600160a01b0382166127be5760405163487a40cd60e01b815260040160405180910390fd5b806127dc576040516372198a6d60e01b815260040160405180910390fd5b6127e4613add565b601d80546001600160a01b0390931661010002610100600160a81b031990931692909217909155601e55565b612818612a00565b612821816131d0565b6110a38282600161323b565b612835612a00565b6001600160a01b038116611b325760405163f82d512f60e01b815260040160405180910390fd5b612864612a00565b61286c613d56565b601d805460ff191660011790556040517f43a0371893d0cbfd9e3892248a769a55c4fd6131a91f13b27fb2f57c8d5f70d690600090a1565b6000806128b0836137a4565b600201549392505050565b6daaeb6d7670e522a718067333cd4e3b156110a357801561294057604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b15801561292c57600080fd5b505af11580156118c7573d6000803e3d6000fd5b6001600160a01b0382161561298f5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401612912565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401612912565b60006001600160e01b031982166395fa0ff560e01b14806129f157506001600160e01b0319821663247946c960e01b145b80610b1d5750610b1d82613fb7565b6000546001600160a01b03163314612a2b5760405163097b5fdb60e31b815260040160405180910390fd5b565b6127106001600160601b0382161115612a9b5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084016113d4565b6001600160a01b038216612af15760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c69642072656365697665720000000000000060448201526064016113d4565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601355565b6000818152600360205260409020546001600160a01b0316611b3b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016113d4565b6daaeb6d7670e522a718067333cd4e3b15611b3b57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c61711349060440160206040518083038186803b158015612bf157600080fd5b505afa158015612c05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c2991906153e2565b611b3b57604051633b79c77360e21b81526001600160a01b03821660048201526024016113d4565b6000612c5c82611378565b9050806001600160a01b0316836001600160a01b03161415612cca5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016113d4565b336001600160a01b0382161480612ce65750612ce68133610a53565b612d585760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016113d4565b610e828383613fdc565b612d6b33610647565b612a2b57604051639eea455560e01b815260040160405180910390fd5b612d9a612d9482611378565b3361080d565b611b3b576040516306c5be1b60e31b815260040160405180910390fd5b6000806000612dc7868686611613565b92509250925082612deb5760405163107acf8360e11b815260040160405180910390fd5b8360006001612dfa8989611b3e565b612e04919061533b565b9050808314612f695760008881526011602090815260408083206001600160a01b038b1684529091529020805482908110612e4157612e41615352565b600091825260208083206008830401548b84526011825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff16919085908110612e9757612e97615352565b600091825260208083206008830401805460079093166004026101000a63ffffffff8181021990941695909316929092029390931790558981526012825260408082206001600160a01b038b168084529084528183208c845260118552828420918452935281208054869392919085908110612f1557612f15615352565b6000918252602080832060088304015460079092166004026101000a90910463ffffffff90811684529083019390935260409091019020805463ffffffff60681b1916600160681b93909216929092021790555b60008881526011602090815260408083206001600160a01b038b1684529091529020805480612f9a57612f9a615368565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a81526012835260408082206001600160a01b038c1683528452808220928616825291909252812080546001600160881b031916905561300e89611378565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a60008060405161306c9392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156130ad57600080fd5b505afa1580156130c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130e591906153e2565b1561310b576000898152600f602052604081208054909190613106906154ef565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b15801561316357600080fd5b505af1158015613177573d6000803e3d6000fd5b50505050505050505050505050565b613190338261404a565b6131ac5760405162461bcd60e51b81526004016113d490615506565b610e82838383613e10565b60185460009060ff168015611151575050601954421090565b6001600160a01b0381166000908152600b602052604090205460ff1615611b3b5760405163c0f8cffb60e01b815260040160405180910390fd5b3361321482611378565b6001600160a01b031614611b3b5760405163b23b68b760e01b815260040160405180910390fd5b600061324684611378565b905060006132548585611b3e565b9050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561328f57600080fd5b505afa1580156132a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c791906153e2565b156132f0576000858152600f6020526040812080548392906132ea90849061533b565b90915550505b60005b818110156134cd5760008681526011602090815260408083206001600160a01b0389168452909152812080548390811061332f5761332f615352565b600091825260208083206008830401548a84526012825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff811615158252958604821681880152600160281b86046001600160401b0316818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a460008981526012602090815260408083206001600160a01b038c811680865291845282852063ffffffff891680875294529382902080546001600160881b03191690559051636d4229c960e01b81529289166004840152602483018c905260448301919091526064820183905290636d4229c990608401600060405180830381600087803b1580156134a757600080fd5b505af11580156134bb573d6000803e3d6000fd5b505050508360010193505050506132f3565b5060008581526011602090815260408083206001600160a01b038816845290915281206122db91614a16565b610e82838383604051806020016040528060008152506122b5565b6000613521848484611613565b50509050801561354457604051637f53cfe360e01b815260040160405180910390fd5b60006135508585611b3e565b9050600e5481106135745760405163f8315a8760e01b815260040160405180910390fd5b60008581526011602090815260408083206001600160a01b03881680855290835281842080546001808201835591865284862060088204018054600790921660040261010090810a63ffffffff818102199094168c8516918202179092558c88526012875285882094885293865284872081885290955292852080546cffffffffffffffff00000000ff1916600160281b426001600160401b0316021790911770ffffffff0000000000000000ffffffff0019169190930263ffffffff60681b191617600160681b91851691909102179055839061365187611378565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156136df57600080fd5b505afa1580156136f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061371791906153e2565b15613732576000878152600f60205260409020805460010190555b60405163688a374160e01b81526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b15801561378357600080fd5b505af1158015613797573d6000803e3d6000fd5b5050505050505050505050565b6001600160a01b0381166000908152601c60205260408120805460ff16610b1d57604051636b62b4c160e11b815260040160405180910390fd5b60038201805460009161010084049160ff85169184918490811061380457613804615352565b9060005260206000200154905060018282901c16600014935092959194509250565b601b5460ff1661384957604051630324d93f60e51b815260040160405180910390fd5b601b54610100900460ff16612a2b5760405163a9fd57fb60e01b815260040160405180910390fd5b6138796131b7565b612a2b576040516318f63a1360e21b815260040160405180910390fd5b3382546040516331a9108f60e11b8152600481018490526001600160a01b039283169261010090920490911690636352211e9060240160206040518083038186803b1580156138e457600080fd5b505afa1580156138f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061391c9190615554565b6001600160a01b03161461394357604051637004d82160e01b815260040160405180910390fd5b60008060008061395386866137de565b9350935093509350831561397a576040516326ab198160e11b815260040160405180910390fd5b6000613985601a5490565b6002880154885491925090879061010090046001600160a01b03167fae8f914c8af222221e50256a64e9f2812cd4e16dd5b5ec6d846ee5459dbf8dee8460016139ce86836154d7565b6139d8919061533b565b6040805192835260208301919091520160405180910390a3836001901b198316886003018681548110613a0d57613a0d615352565b600091825260209091200155613a2281613dec565b60005b81811015613a4157613a39338285016140c8565b600101613a25565b505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610100600182019081049060ff811615613ab7578160010191505b50919050565b8082146110a3576040516343714afd60e01b815260040160405180910390fd5b601a54612a2b576001601a55565b6000613af682611378565b9050613b04816000846140d2565b613b0f600083613fdc565b6001600160a01b0381166000908152600460205260408120805460019290613b3890849061533b565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6110a33383836140ff565b613ba8848484613e10565b613bb4848484846141c6565b6110eb5760405162461bcd60e51b81526004016113d490615571565b80613bee5760405163318ccdef60e11b815260040160405180910390fd5b6064811115611b3b57604051639cb75faf60e01b815260040160405180910390fd5b613c1a338361404a565b613c365760405162461bcd60e51b81526004016113d490615506565b6110eb84848484613b9d565b606060168054610bbe906152f0565b606081613c755750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613c9f5780613c898161537e565b9150613c989050600a836153ce565b9150613c79565b6000816001600160401b03811115613cb957613cb9614d20565b6040519080825280601f01601f191660200182016040528015613ce3576020820181803683370190505b5090505b8415613d4e57613cf860018361533b565b9150613d05600a866154c3565b613d109060306154d7565b60f81b818381518110613d2557613d25615352565b60200101906001600160f81b031916908160001a905350613d47600a866153ce565b9450613ce7565b949350505050565b601d5460ff1615612a2b576040516363056b0560e11b815260040160405180910390fd5b6000610b1d613d876142d3565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000613dd785856143fa565b91509150613de481614467565b509392505050565b80601a6000828254613dfe91906154d7565b909155505050565b6110a38282614622565b826001600160a01b0316613e2382611378565b6001600160a01b031614613e875760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016113d4565b6001600160a01b038216613ee95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016113d4565b613ef48383836140d2565b613eff600082613fdc565b6001600160a01b0383166000908152600460205260408120805460019290613f2890849061533b565b90915550506001600160a01b0382166000908152600460205260408120805460019290613f569084906154d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160e01b0319821663152a902d60e11b1480610b1d5750610b1d8261463c565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061401182611378565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008061405683611378565b9050806001600160a01b0316846001600160a01b0316148061409d57506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b80613d4e5750836001600160a01b03166140b684610e47565b6001600160a01b031614949350505050565b6110a3828261467b565b6000818152600f602052604090205415610e82576040516302579f0160e61b815260040160405180910390fd5b816001600160a01b0316836001600160a01b031614156141615760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016113d4565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161236e565b60006001600160a01b0384163b156142c857604051630a85bd0160e11b81526001600160a01b0385169063150b7a029061420a9033908990889088906004016155c3565b602060405180830381600087803b15801561422457600080fd5b505af1925050508015614254575060408051601f3d908101601f19168201909252614251918101906155f6565b60015b6142ae573d808015614282576040519150601f19603f3d011682016040523d82523d6000602084013e614287565b606091505b5080516142a65760405162461bcd60e51b81526004016113d490615571565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613d4e565b506001949350505050565b6000306001600160a01b037f0000000000000000000000005434e17e9f4aa9521f85e57932b884d45037f0711614801561432c57507f000000000000000000000000000000000000000000000000000000000000000146145b1561435657507f0bb9fe44a4f119b9839f951ff22f21ff4b696dedc06c03811c06ff929e71deed90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f068070acfa4e053f42538e746fc2bdfca1ee165f3ba7f4ddcbbfe039faa4fc0c828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604114156144315760208301516040840151606085015160001a614425878285856147c9565b945094505050506111fd565b82516040141561445b57602083015160408401516144508683836148b6565b9350935050506111fd565b506000905060026111fd565b600081600481111561447b5761447b615613565b14156144845750565b600181600481111561449857614498615613565b14156144e65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016113d4565b60028160048111156144fa576144fa615613565b14156145485760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016113d4565b600381600481111561455c5761455c615613565b14156145b55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016113d4565b60048160048111156145c9576145c9615613565b1415611b3b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b60648201526084016113d4565b6110a38282604051806020016040528060008152506148ef565b60006001600160e01b0319821663f9f7ab4160e01b148061466c57506001600160e01b0319821662059cfd60ed1b145b80610b1d5750610b1d82614922565b6001600160a01b0382166146d15760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016113d4565b6000818152600360205260409020546001600160a01b0316156147365760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016113d4565b614742600083836140d2565b6001600160a01b038216600090815260046020526040812080546001929061476b9084906154d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561480057506000905060036148ad565b8460ff16601b1415801561481857508460ff16601c14155b1561482957506000905060046148ad565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561487d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166148a6576000600192509250506148ad565b9150600090505b94509492505050565b6000806001600160ff1b038316816148d360ff86901c601b6154d7565b90506148e1878288856147c9565b935093505050935093915050565b6148f9838361467b565b61490660008484846141c6565b610e825760405162461bcd60e51b81526004016113d490615571565b60006001600160e01b031982166368a3e4bd60e11b1480610b1d5750610b1d8260006001600160e01b031982166380ac58cd60e01b148061497357506001600160e01b03198216635b5e139f60e01b145b80610b1d57506301ffc9a760e01b6001600160e01b0319831614610b1d565b82805461499e906152f0565b90600052602060002090601f0160209004810192826149c05760008555614a06565b82601f106149d957805160ff1916838001178555614a06565b82800160010185558215614a06579182015b82811115614a065782518255916020019190600101906149eb565b50614a12929150614a37565b5090565b508054600082556007016008900490600052602060002090810190611b3b91905b5b80821115614a125760008155600101614a38565b6001600160e01b031981168114611b3b57600080fd5b600060208284031215614a7457600080fd5b813561240b81614a4c565b6001600160a01b0381168114611b3b57600080fd5b60008060408385031215614aa757600080fd5b8235614ab281614a7f565b915060208301356001600160601b0381168114614ace57600080fd5b809150509250929050565b60005b83811015614af4578181015183820152602001614adc565b838111156110eb5750506000910152565b60008151808452614b1d816020860160208601614ad9565b601f01601f19169290920160200192915050565b60208152600061240b6020830184614b05565b600060208284031215614b5657600080fd5b813561240b81614a7f565b600060208284031215614b7357600080fd5b5035919050565b60008060408385031215614b8d57600080fd5b8235614b9881614a7f565b946020939093013593505050565b60008060408385031215614bb957600080fd5b823591506020830135614ace81614a7f565b602080825282518282018190526000919060409081850190868401855b8281101561136b5781518051151585528681015163ffffffff90811688870152868201516001600160401b031687870152606091820151169085015260809093019290850190600101614be8565b600080600060608486031215614c4b57600080fd5b833592506020840135614c5d81614a7f565b9150604084013563ffffffff81168114614c7657600080fd5b809150509250925092565b60008060408385031215614c9457600080fd5b50508035926020909101359150565b8015158114611b3b57600080fd5b60008060408385031215614cc457600080fd5b8235614ccf81614a7f565b91506020830135614ace81614ca3565b600080600060608486031215614cf457600080fd5b8335614cff81614a7f565b92506020840135614d0f81614a7f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715614d5e57614d5e614d20565b604052919050565b60006001600160401b03831115614d7f57614d7f614d20565b614d92601f8401601f1916602001614d36565b9050828152838383011115614da657600080fd5b828260208301376000602084830101529392505050565b600082601f830112614dce57600080fd5b61240b83833560208501614d66565b60008060408385031215614df057600080fd5b82356001600160401b0380821115614e0757600080fd5b614e1386838701614dbd565b93506020850135915080821115614e2957600080fd5b50614e3685828601614dbd565b9150509250929050565b600080600060608486031215614e5557600080fd5b833592506020840135614d0f81614a7f565b600060208284031215614e7957600080fd5b81356001600160401b03811115614e8f57600080fd5b613d4e84828501614dbd565b60006001600160401b03821115614eb457614eb4614d20565b5060051b60200190565b600082601f830112614ecf57600080fd5b81356020614ee4614edf83614e9b565b614d36565b82815260059290921b84018101918181019086841115614f0357600080fd5b8286015b84811015614f1e5780358352918301918301614f07565b509695505050505050565b60008060008060808587031215614f3f57600080fd5b8435614f4a81614ca3565b93506020850135614f5a81614a7f565b925060408501356001600160401b0380821115614f7657600080fd5b614f8288838901614ebe565b93506060870135915080821115614f9857600080fd5b50614fa587828801614ebe565b91505092959194509250565b60008083601f840112614fc357600080fd5b5081356001600160401b03811115614fda57600080fd5b6020830191508360208260051b85010111156111fd57600080fd5b60008060006040848603121561500a57600080fd5b833561501581614a7f565b925060208401356001600160401b0381111561503057600080fd5b61503c86828701614fb1565b9497909650939450505050565b6000806040838503121561505c57600080fd5b823561506781614a7f565b91506020830135614ace81614a7f565b6000806020838503121561508a57600080fd5b82356001600160401b038111156150a057600080fd5b6150ac85828601614fb1565b90969095509350505050565b600081518084526020808501945080840160005b838110156150e8578151875295820195908201906001016150cc565b509495945050505050565b60408152600061510660408301856150b8565b828103602084015261511881856150b8565b95945050505050565b60008060006060848603121561513657600080fd5b83356001600160401b038082111561514d57600080fd5b818601915086601f83011261516157600080fd5b81356020615171614edf83614e9b565b82815260059290921b8401810191818101908a84111561519057600080fd5b948201945b838610156151b75785356151a881614a7f565b82529482019490820190615195565b975050870135925050808211156151cd57600080fd5b6151d987838801614ebe565b935060408601359150808211156151ef57600080fd5b506151fc86828701614ebe565b9150509250925092565b6000806000806080858703121561521c57600080fd5b843561522781614a7f565b9350602085013561523781614a7f565b92506040850135915060608501356001600160401b0381111561525957600080fd5b8501601f8101871361526a57600080fd5b614fa587823560208401614d66565b60008060006040848603121561528e57600080fd5b83356001600160401b03808211156152a557600080fd5b818601915086601f8301126152b957600080fd5b8135818111156152c857600080fd5b8760208285010111156152da57600080fd5b6020928301989097509590910135949350505050565b600181811c9082168061530457607f821691505b60208210811415613ab757634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561534d5761534d615325565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060001982141561539257615392615325565b5060010190565b60008160001904831182151516156153b3576153b3615325565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826153dd576153dd6153b8565b500490565b6000602082840312156153f457600080fd5b815161240b81614ca3565b6000845160206154128285838a01614ad9565b8551918401916154258184848a01614ad9565b8554920191600090600181811c908083168061544257607f831692505b85831081141561546057634e487b7160e01b85526022600452602485fd5b8080156154745760018114615485576154b2565b60ff198516885283880195506154b2565b60008b81526020902060005b858110156154aa5781548a820152908401908801615491565b505083880195505b50939b9a5050505050505050505050565b6000826154d2576154d26153b8565b500690565b600082198211156154ea576154ea615325565b500190565b6000816154fe576154fe615325565b506000190190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b60006020828403121561556657600080fd5b815161240b81614a7f565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611ab390830184614b05565b60006020828403121561560857600080fd5b815161240b81614a4c565b634e487b7160e01b600052602160045260246000fdfea26469706673582212202dad922c679117665a947d3f33db3294d5ece70f2225e8d333a4c785c09758e564736f6c63430008090033

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

0000000000000000000000008645e6ae2c000d27c223a0d1ee590786ee61400100000000000000000000000000000000000000000000000000000000000003e8

-----Decoded View---------------
Arg [0] : royaltyReceiver_ (address): 0x8645E6aE2C000d27c223A0d1EE590786ee614001
Arg [1] : royaltyFeeNumerator_ (uint96): 1000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008645e6ae2c000d27c223a0d1ee590786ee614001
Arg [1] : 00000000000000000000000000000000000000000000000000000000000003e8


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.