ETH Price: $2,633.66 (+7.95%)
 

Overview

TokenID

1653

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

This collection consists of Super Villain Potions needed to upgrade DigiDaigaku Villains.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DigiDaigakuSuperVillainPotions

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 1500 runs

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

import "./IMintablePotion.sol";
import "limit-break-contracts/contracts/adventures/AdventureNFT.sol";
import "limit-break-contracts/contracts/utils/tokens/SequentialRoleBasedMint.sol";

error BatchSizeMustBeGreaterThanOne();
error InputArrayLengthMismatch();
error UseOfMintEntrypointProhibittedUseMintPotionsBatch();

/**
 * @title DigiDaigakuSuperVillainsPotions
 * @author Limit Break, Inc.
 * @notice An Adventure ERC-721 token that upgrades villains to super villains.
 */
contract DigiDaigakuSuperVillainPotions is AdventureNFT, SequentialRoleBasedMint, IMintablePotion {

    uint256 private constant ENTRYPOINT_MINT = 1;
    uint256 private constant ENTRYPOINT_MINT_POTIONS_BATCH = 2;

    uint256 private mintFunctionEntrypoint;

    /// @dev Emitted when a potion is minted
    event MintPotion(address indexed to, uint256 indexed potionId, uint256 darkSpiritTokenId, uint256 darkHeroSpiritTokenId);

    constructor(uint256 maxSupply_, address royaltyReceiver_, uint96 royaltyFeeNumerator_) ERC721("", "") {
        initializeERC721("DigiDaigakuSuperVillainPotions", "DIDSVP");
        initializeURI("https://digidaigaku.com/supervillainpotions/metadata/", ".json");
        initializeAdventureERC721(10);
        initializeRoyalties(royaltyReceiver_, royaltyFeeNumerator_);
        initializeMaxSupply(maxSupply_);
        
        mintFunctionEntrypoint = ENTRYPOINT_MINT;
    }

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

    /// @notice Mints multiple potions crafted with the specified dark spirit and dark hero spirit tokens.
    ///
    /// Throws if `to` address is zero address.
    /// Throws if the quantity is zero.
    /// Throws if the caller is not a whitelisted minter.
    /// Throws if minting would exceed the max supply.
    /// Throws if token id array lengths don't match.
    ///
    /// Postconditions:
    /// ---------------
    /// `quantity` potions have been minted to the specified `to` address, where `quantity` is the length of the token id arrays.
    /// `quantity` MintPotion events has been emitted, where `quantity` is the length of the token id arrays.
    function mintPotionsBatch(address to, uint256[] calldata darkSpiritTokenIds, uint256[] calldata darkHeroSpiritTokenIds) external override {
        if(darkHeroSpiritTokenIds.length != darkSpiritTokenIds.length) {
            revert InputArrayLengthMismatch();
        }

        mintFunctionEntrypoint = ENTRYPOINT_MINT_POTIONS_BATCH;
        (uint256 firstPotionId,) = mint(to, darkSpiritTokenIds.length);
        mintFunctionEntrypoint = ENTRYPOINT_MINT;
        
        unchecked {
            for(uint256 i = 0; i < darkSpiritTokenIds.length; ++i) {
                emit MintPotion(to, firstPotionId + i, darkSpiritTokenIds[i], darkHeroSpiritTokenIds[i]);
            }
        }
    }

    /// @notice Direct use of the mint function is prohibitted in this contract.
    /// Throws if not called from mintPotionsBatch.
    /// Otherwise, functions according to the base contract mint implementation.
    function mint(address to, uint256 quantity) public override returns (uint256 firstTokenId, uint256 lastTokenId) {
        if(mintFunctionEntrypoint == ENTRYPOINT_MINT) {
            revert UseOfMintEntrypointProhibittedUseMintPotionsBatch();
        }

        return super.mint(to, quantity);
    }

    /// @dev Mints a token
    function _mintToken(address to, uint256 tokenId) internal virtual override {
        _mint(to, tokenId);
    }
}

File 2 of 28 : 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 3 of 28 : 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 4 of 28 : 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 5 of 28 : 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 6 of 28 : 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 7 of 28 : 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 8 of 28 : 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 9 of 28 : 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 10 of 28 : 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 11 of 28 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 12 of 28 : 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 13 of 28 : IMintablePotion.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @dev Required interface of mintable potion contracts.
 */
interface IMintablePotion {

    /**
     * @notice Mints multiple potions crafted with the specified dark spirit token ids and dark hero spirit token ids
     */
    function mintPotionsBatch(address to, uint256[] calldata darkSpiritTokenIds, uint256[] calldata darkHeroSpiritTokenIds) external;
}

File 14 of 28 : 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;

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

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

    /// @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);
        _transfer(from, to, tokenId);
    }

    /// @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);
        _safeTransfer(from, to, tokenId, "");
    }

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

    /// @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 15 of 28 : 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 10%
    uint96 private constant MAX_ROYALTY_FEE_NUMERATOR = 1000;

    /// @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 16 of 28 : 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 17 of 28 : 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 18 of 28 : 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 19 of 28 : 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 20 of 28 : 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 21 of 28 : 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 22 of 28 : IMaxSupplyInitializer.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;

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

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

    /**
     * @notice Initializes max supply parameters
     */
    function initializeMaxSupply(uint256 maxSupply_) external;
}

File 23 of 28 : 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 24 of 28 : 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 25 of 28 : 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 26 of 28 : 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 27 of 28 : 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 28 of 28 : SequentialRoleBasedMint.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../access/InitializableOwnable.sol";
import "../../initializable/IMaxSupplyInitializer.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

error CannotMintToZeroAddress();
error MaxSupplyAlreadyInitialized();
error MaxSupplyCannotBeSetToMaxUint256();
error MaxSupplyCannotBeSetToZero();
error MaxSupplyExceeded(uint256 supplyAfterMint, uint256 maxSupply);
error MintedQuantityMustBeGreaterThanZero();
error MinterAlreadyWhitelisted();
error MinterNotWhitelisted();

/**
 * @title SequentialRoleBasedMint
 * @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(IMaxSupplyInitializer).interfaceId ||
 *     super.supportsInterface(interfaceId);
 *  }
 *
 */
abstract contract SequentialRoleBasedMint is InitializableOwnable, IMaxSupplyInitializer {

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

    /// @dev The maximum token supply
    uint256 private _maxSupply;

    /// @dev Whitelisted minter mapping
    mapping (address => bool) public whitelistedMinters;

    /// @dev Emitted when the minter whitelist is updated
    event MinterWhitelistUpdated(address indexed minter, bool indexed whitelisted);

    /// @dev Initializes parameters of tokens with maximum supplies.
    /// This cannot be set in the constructor because this contract is optionally compatible with EIP-1167.
    /// Throws if maxSupply has already been set to a non-zero value.
    /// Throws if specified maxSupply_ is zero.
    /// Throws if specified maxSupply_ is set to max uint256.
    function initializeMaxSupply(uint256 maxSupply_) public override onlyOwner {
        if(_maxSupply > 0) {
            revert MaxSupplyAlreadyInitialized();
        }

        if(maxSupply_ == 0) {
            revert MaxSupplyCannotBeSetToZero();
        }

        if(maxSupply_ == type(uint256).max) {
            revert MaxSupplyCannotBeSetToMaxUint256();
        }

        _maxSupply = maxSupply_;
    }

    /// @notice Whitelists a minter
    function whitelistMinter(address minter) external onlyOwner {
        _requireMinterIsNotWhitelisted(minter);
        whitelistedMinters[minter] = true;
        emit MinterWhitelistUpdated(minter, true);
    }

    /// @notice Removes a minter from the whitelist
    function unwhitelistMinter(address minter) external onlyOwner {
        _requireMinterIsWhitelisted(minter);
        delete whitelistedMinters[minter];
        emit MinterWhitelistUpdated(minter, false);
    }

    function mint(address to, uint256 quantity) public virtual returns (uint256 firstTokenId, uint256 lastTokenId) {
        if(to == address(0)) {
            revert CannotMintToZeroAddress();
        }

        if(quantity == 0) {
            revert MintedQuantityMustBeGreaterThanZero();
        }

        _requireMinterIsWhitelisted(_msgSender());

        uint256 tokenIdToMint = nextTokenId;
        if(tokenIdToMint == 0) {
            tokenIdToMint = 1;
        }

        firstTokenId = tokenIdToMint;
        
        uint256 supplyAfterMint = tokenIdToMint + quantity - 1;
        uint256 maxSupply_ = _maxSupply;
        if(supplyAfterMint > maxSupply_) {
            revert MaxSupplyExceeded(supplyAfterMint, maxSupply_);
        }

        unchecked {
            nextTokenId = tokenIdToMint + quantity;

            for(uint256 i = 0; i < quantity; ++i) {
                _mintToken(to, tokenIdToMint + i);
            }
        }

        lastTokenId = supplyAfterMint;

        return (firstTokenId, lastTokenId);
    }

    /// @notice Returns the maximum mintable supply
    function maxSupply() public view returns (uint256) {
        return _maxSupply;
    }

    /// @dev Inheriting contracts must implement the token minting logic
    function _mintToken(address to, uint256 tokenId) internal virtual;

    function _requireMinterIsWhitelisted(address minter) private view {
        if(!whitelistedMinters[minter]) {
            revert MinterNotWhitelisted();
        }
    }

    function _requireMinterIsNotWhitelisted(address minter) private view {
        if(whitelistedMinters[minter]) {
            revert MinterAlreadyWhitelisted();
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"maxSupply_","type":"uint256"},{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator_","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"CallerIsNotTheContractOwner","type":"error"},{"inputs":[],"name":"CallerNotAWhitelistedAdventure","type":"error"},{"inputs":[],"name":"CallerNotApprovedForAdventure","type":"error"},{"inputs":[],"name":"CallerNotTokenOwner","type":"error"},{"inputs":[],"name":"CannotMintToZeroAddress","type":"error"},{"inputs":[],"name":"ExceedsMaxRoyaltyFee","type":"error"},{"inputs":[],"name":"InputArrayLengthMismatch","type":"error"},{"inputs":[],"name":"InvalidAdventureContract","type":"error"},{"inputs":[],"name":"MaxSimultaneousQuestsCannotBeZero","type":"error"},{"inputs":[],"name":"MaxSimultaneousQuestsExceeded","type":"error"},{"inputs":[],"name":"MaxSupplyAlreadyInitialized","type":"error"},{"inputs":[],"name":"MaxSupplyCannotBeSetToMaxUint256","type":"error"},{"inputs":[],"name":"MaxSupplyCannotBeSetToZero","type":"error"},{"inputs":[{"internalType":"uint256","name":"supplyAfterMint","type":"uint256"},{"internalType":"uint256","name":"maxSupply","type":"uint256"}],"name":"MaxSupplyExceeded","type":"error"},{"inputs":[],"name":"MintedQuantityMustBeGreaterThanZero","type":"error"},{"inputs":[],"name":"MinterAlreadyWhitelisted","type":"error"},{"inputs":[],"name":"MinterNotWhitelisted","type":"error"},{"inputs":[],"name":"NewOwnerIsTheZeroAddress","type":"error"},{"inputs":[],"name":"NonexistentToken","type":"error"},{"inputs":[],"name":"NotOnQuest","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"inputs":[],"name":"OwnerAlreadyInitialized","type":"error"},{"inputs":[],"name":"QuestIdOutOfRange","type":"error"},{"inputs":[],"name":"TooManyActiveQuests","type":"error"},{"inputs":[],"name":"UseOfMintEntrypointProhibittedUseMintPotionsBatch","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":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"potionId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"darkSpiritTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"darkHeroSpiritTokenId","type":"uint256"}],"name":"MintPotion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":true,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"MinterWhitelistUpdated","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":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"RoyaltySet","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":[{"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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"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":"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":[{"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":"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":"uint256","name":"maxSupply_","type":"uint256"}],"name":"initializeMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"initializeOwner","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":"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":[{"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":"maxSimultaneousQuests","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"firstTokenId","type":"uint256"},{"internalType":"uint256","name":"lastTokenId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"darkSpiritTokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"darkHeroSpiritTokenIds","type":"uint256[]"}],"name":"mintPotionsBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"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":"string","name":"suffixURI_","type":"string"}],"name":"setSuffixURI","outputs":[],"stateMutability":"nonpayable","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":"address","name":"minter","type":"address"}],"name":"unwhitelistMinter","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":"address","name":"minter","type":"address"}],"name":"whitelistMinter","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"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedMinters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60c06040526005608081905264173539b7b760d91b60a090815262000028916016919062000661565b503480156200003657600080fd5b5060405162004bc838038062004bc8833981016040819052620000599162000707565b60408051602080820183526000808352835191820190935291825290620000803362000184565b81516200009590600190602085019062000661565b508051620000ab90600290602084019062000661565b505050620001136040518060400160405280601e81526020017f4469676944616967616b75537570657256696c6c61696e506f74696f6e7300008152506040518060400160405280600681526020016504449445356560d41b815250620001d460201b60201c565b6200015360405180606001604052806035815260200162004b9360359139604080518082019091526005815264173539b7b760d91b602082015262000240565b6200015f600a6200029d565b6200016b8282620002e9565b620001768362000335565b50506001601a5550620007fb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620001de620003ab565b60075460ff161562000203576040516376f1a0b360e01b815260040160405180910390fd5b81516200021890600890602085019062000661565b5080516200022e90600990602084019062000661565b50506007805460ff1916600117905550565b6200024a620003ab565b601454610100900460ff16156200027457604051635b79f68360e01b815260040160405180910390fd5b6200027f82620003d9565b6200028a8162000435565b50506014805461ff001916610100179055565b620002a7620003ab565b600c5460ff1615620002cc57604051630e009cb560e11b815260040160405180910390fd5b620002d78162000486565b600d55600c805460ff19166001179055565b620002f3620003ab565b60145460ff16156200031857604051639383013960e01b815260040160405180910390fd5b620003248282620004cb565b50506014805460ff19166001179055565b6200033f620003ab565b601854156200036457604051600162056bb360e21b0319815260040160405180910390fd5b80620003835760405163e776bd1160e01b815260040160405180910390fd5b600019811415620003a657604051620e9cb160e71b815260040160405180910390fd5b601855565b6000546001600160a01b03163314620003d75760405163097b5fdb60e31b815260040160405180910390fd5b565b620003e3620003ab565b8051620003f890601590602084019062000661565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040516200042a919062000766565b60405180910390a150565b6200043f620003ab565b80516200045490601690602084019062000661565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba0816040516200042a919062000766565b80620004a55760405163318ccdef60e11b815260040160405180910390fd5b6064811115620004c857604051639cb75faf60e01b815260040160405180910390fd5b50565b620004d5620003ab565b6103e86001600160601b03821611156200050257604051631557c04f60e21b815260040160405180910390fd5b6200050e82826200055c565b604080516001600160a01b03841681526001600160601b03831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b6127106001600160601b0382161115620005d05760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620006285760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620005c7565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217601255565b8280546200066f90620007be565b90600052602060002090601f016020900481019282620006935760008555620006de565b82601f10620006ae57805160ff1916838001178555620006de565b82800160010185558215620006de579182015b82811115620006de578251825591602001919060010190620006c1565b50620006ec929150620006f0565b5090565b5b80821115620006ec5760008155600101620006f1565b6000806000606084860312156200071d57600080fd5b835160208501519093506001600160a01b03811681146200073d57600080fd5b60408501519092506001600160601b03811681146200075b57600080fd5b809150509250925092565b600060208083528351808285015260005b81811015620007955785810183015185820160400152820162000777565b81811115620007a8576000604083870101525b50601f01601f1916929092016040019392505050565b600181811c90821680620007d357607f821691505b60208210811415620007f557634e487b7160e01b600052602260045260246000fd5b50919050565b614388806200080b6000396000f3fe608060405234801561001057600080fd5b50600436106103785760003560e01c80638be18e57116101d3578063be85930811610104578063e370ab46116100a2578063ed1e00851161007c578063ed1e00851461092b578063f1e923c51461094e578063f2fde38b14610961578063f5234c561461097457600080fd5b8063e370ab46146108c9578063e985e9c5146108dc578063e9b4f7aa1461091857600080fd5b8063d147c97a116100de578063d147c97a14610893578063d547cfb7146108a6578063d5abeb01146108ae578063e2989f4c146108b657600080fd5b8063be8593081461085a578063c05e2f441461086d578063c87b56dd1461088057600080fd5b80639bc17ea411610171578063aca139f71161014b578063aca139f714610819578063b39fa0001461082c578063b3bcea481461083f578063b88d4fde1461084757600080fd5b80639bc17ea41461078f578063a22cb465146107a2578063aa6cab5a146107b557600080fd5b806391623718116101ad578063916237181461072b57806395d89b411461076157806395fa0ff5146107695780639bb257ad1461077c57600080fd5b80638be18e57146106f45780638c5f36bb146107075780638da5cb5b1461071a57600080fd5b806340c10f19116102ad578063703fa9291161024b5780637e10b35b116102255780637e10b35b1461068a5780637f1a5ce11461069d578063816a1501146106d9578063869f9110146106ec57600080fd5b8063703fa9291461063057806370a082311461066057806375794a3c1461068157600080fd5b806351dadc281161028757806351dadc28146105cf57806353401df9146105f757806355f804b31461060a5780636352211e1461061d57600080fd5b806340c10f191461058157806342842e0e146105a95780634e02c078146105bc57600080fd5b8063113405571161031a578063247946c9116102f4578063247946c9146104fd5780632a55205a146105105780632ebb386a14610542578063301be7401461055557600080fd5b8063113405571461044057806311ad4081146104d757806323b872dd146104ea57600080fd5b8063070cba1711610356578063070cba17146103cf578063081812fc146103e2578063095ea7b31461040d5780630f3d911c1461042057600080fd5b806301ffc9a71461037d57806302fa7c47146103a557806306fdde03146103ba575b600080fd5b61039061038b366004613b41565b610987565b60405190151581526020015b60405180910390f35b6103b86103b3366004613b7a565b6109cb565b005b6103c2610a7a565b60405161039c9190613c1a565b6103b86103dd366004613c2d565b610b0c565b6103f56103f0366004613c48565b610d70565b6040516001600160a01b03909116815260200161039c565b6103b861041b366004613c61565b610d97565b61043361042e366004613c8b565b610ece565b60405161039c9190613cb7565b6104a061044e366004613d30565b601160209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff610100820481169167ffffffffffffffff6501000000000082041691600160681b9091041684565b60408051941515855263ffffffff938416602086015267ffffffffffffffff9092169184019190915216606082015260800161039c565b6103b86104e5366004613d79565b6110e8565b6103b86104f8366004613d9b565b611108565b6103b861050b366004613e83565b61118f565b61052361051e366004613d79565b6111fe565b604080516001600160a01b03909316835260208301919091520161039c565b6103b8610550366004613c8b565b6112bb565b610390610563366004613c2d565b6001600160a01b03166000908152600b602052604090205460ff1690565b61059461058f366004613c61565b6112d9565b6040805192835260208301919091520161039c565b6103b86105b7366004613d9b565b61132e565b6103b86105ca366004613ee7565b611349565b6105e26105dd366004613ee7565b611366565b60405163ffffffff909116815260200161039c565b6103b8610605366004613d79565b6113bc565b6103b8610618366004613f0c565b6113d8565b6103f561062b366004613c48565b61142e565b61064361063e366004613ee7565b611493565b60408051931515845260208401929092529082015260600161039c565b61067361066e366004613c2d565b611533565b60405190815260200161039c565b61067360175481565b6103b8610698366004613c2d565b6115cd565b6103906106ab366004613f41565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205460ff1690565b6106736106e7366004613ee7565b611806565b600d54610673565b6103b8610702366004613f0c565b61183b565b6103b8610715366004613c2d565b611886565b6000546001600160a01b03166103f5565b610673610739366004613c8b565b60009182526010602090815260408084206001600160a01b0393909316845291905290205490565b6103c26118d5565b6103b8610777366004613b7a565b6118e4565b6103b861078a366004613c2d565b611944565b6103b861079d366004613c48565b6119a7565b6103b86107b0366004613f79565b6119c1565b6107f16107c3366004613c2d565b600b6020526000908152604090205460ff81169061010090046fffffffffffffffffffffffffffffffff1682565b6040805192151583526fffffffffffffffffffffffffffffffff90911660208301520161039c565b6103b8610827366004613d9b565b6119cc565b6103b861083a366004613c48565b6119f8565b6103c2611a58565b6103b8610855366004613fa5565b611ae6565b6103b8610868366004614066565b611b74565b6103b861087b366004613f79565b611c61565b6103c261088e366004613c48565b611d13565b6103b86108a1366004613e83565b611dc3565b6103c2611e41565b601854610673565b6103f56108c4366004613c48565b611e4e565b6103b86108d7366004613d9b565b611e78565b6103906108ea366004613f41565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6103b8610926366004613c2d565b611e89565b610390610939366004613c2d565b60196020526000908152604090205460ff1681565b6103b861095c366004613c8b565b611ee7565b6103b861096f366004613c2d565b611f04565b6103b8610982366004613c48565b611f4c565b60006001600160e01b031982167ff5234c560000000000000000000000000000000000000000000000000000000014806109c557506109c582612006565b92915050565b6109d3612078565b6103e86bffffffffffffffffffffffff82161115610a1d576040517f555f013c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a2782826120be565b604080516001600160a01b03841681526bffffffffffffffffffffffff831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b606060088054610a89906140e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab5906140e7565b8015610b025780601f10610ad757610100808354040283529160200191610b02565b820191906000526020600020905b815481529060010190602001808311610ae557829003601f168201915b5050505050905090565b610b14612078565b6001600160a01b0381166000908152600b602052604090205460ff16610b66576040517f584a793800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812054600a546101009091046fffffffffffffffffffffffffffffffff169190610ba890600190614138565b905080826fffffffffffffffffffffffffffffffff1614610cd657600a8181548110610bd657610bd661414f565b600091825260209091200154600a80546001600160a01b03909216916fffffffffffffffffffffffffffffffff8516908110610c1457610c1461414f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a856fffffffffffffffffffffffffffffffff1681548110610c6c57610c6c61414f565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546fffffffffffffffffffffffffffffffff92909216610100027fffffffffffffffffffffffffffffff00000000000000000000000000000000ff9092169190911790555b600a805480610ce757610ce7614165565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038516808352600b82526040808420805470ffffffffffffffffffffffffffffffffff1916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a2505050565b6000610d7b826121d8565b506000908152600560205260409020546001600160a01b031690565b6000610da28261142e565b9050806001600160a01b0316836001600160a01b03161415610e315760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b0382161480610e4d5750610e4d81336108ea565b610ebf5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610e28565b610ec9838361223c565b505050565b60008281526010602090815260408083206001600160a01b03851684529091529020546060908067ffffffffffffffff811115610f0d57610f0d613dd7565b604051908082528060200260200182016040528015610f5f57816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610f2b5790505b5060008581526010602090815260408083206001600160a01b0388168452825280832080548251818502810185019093528083529496509293909291830182828015610ff657602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610fb95790505b5050505050905060005b828110156110df5760008681526011602090815260408083206001600160a01b0389168452909152812083519091908490849081106110415761104161414f565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff811615158252610100810485169282019290925267ffffffffffffffff6501000000000083041692810192909252600160681b9004909116606082015284518590839081106110c3576110c361414f565b6020026020010181905250806110d89061417b565b9050611000565b50505092915050565b6110f06122aa565b6110f9826122e9565b611104823383612331565b5050565b6111123382612746565b6111845760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610e28565b610ec98383836127c5565b611197612078565b601454610100900460ff16156111d9576040517f5b79f68300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111e2826113d8565b6111eb8161183b565b50506014805461ff001916610100179055565b60008281526013602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff1692820192909252829161127d5750604080518082019091526012546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b6020810151600090612710906112a1906bffffffffffffffffffffffff1687614196565b6112ab91906141cb565b91519350909150505b9250929050565b6112c48161299d565b6112cd826129f0565b61110482826000612a3a565b6000806001601a541415611319576040517fbf1f503200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113238484612d23565b915091509250929050565b610ec983838360405180602001604052806000815250611ae6565b6113528261299d565b61135b836129f0565b610ec9838383612331565b6010602052826000526040600020602052816000526040600020818154811061138e57600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b6113c46122aa565b6113cd826122e9565b611104823383612e49565b6113e0612078565b80516113f3906015906020840190613a71565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040516114239190613c1a565b60405180910390a150565b6000818152600360205260408120546001600160a01b0316806109c55760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610e28565b6000808063ffffffff8411156114d5576040517f3f8ace8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505060009283526011602090815260408085206001600160a01b0394909416855292815282842063ffffffff9283168552905291205460ff81169265010000000000820467ffffffffffffffff1692600160681b90920490911690565b60006001600160a01b0382166115b15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610e28565b506001600160a01b031660009081526004602052604090205490565b6115d5612078565b6001600160a01b0381166000908152600b602052604090205460ff1615611628576040517fb73e95e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516301ffc9a760e01b81527f977e0c1c0000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561168757600080fd5b505afa15801561169b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bf91906141df565b6116f5576040517f90c51dd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a546fffffffffffffffffffffffffffffffff811115611742576040517fd571eff200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000818152600b602090815260408083208054600170ffffffffffffffffffffffffffffffffff199091166101006fffffffffffffffffffffffffffffffff891602178117909155600a8054808301825594527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890930180546001600160a01b03191685179055519182527fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b6000806000611816868686611493565b509150915081611827576000611831565b6118318142614138565b9695505050505050565b611843612078565b8051611856906016906020840190613a71565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba0816040516114239190613c1a565b6000546001600160a01b0316156118c9576040517f9b07432800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118d281613166565b50565b606060098054610a89906140e7565b6118ec612078565b60145460ff1615611929576040517f9383013900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61193382826109cb565b50506014805460ff19166001179055565b61194c612078565b611955816131b6565b6001600160a01b038116600081815260196020526040808220805460ff1916600190811790915590519092917f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa676891a350565b6119af6122aa565b6119b8816122e9565b6118d281613209565b6111043383836132b0565b6119d46122aa565b6119dd816122e9565b610ec983838360405180602001604052806000815250613377565b611a00612078565b600c5460ff1615611a3d576040517f1c01396a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a4681613400565b600d55600c805460ff19166001179055565b60168054611a65906140e7565b80601f0160208091040260200160405190810160405280929190818152602001828054611a91906140e7565b8015611ade5780601f10611ab357610100808354040283529160200191611ade565b820191906000526020600020905b815481529060010190602001808311611ac157829003601f168201915b505050505081565b611af03383612746565b611b625760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610e28565b611b6e84848484613377565b50505050565b808314611bad576040517f43714afd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002601a556000611bbe86856112d9565b506001601a55905060005b84811015611c5857808201876001600160a01b03167fa4c80acd99a5132fdb6fecbe030d4fa8090315bb97297667643dd6fd33fa7dda888885818110611c1157611c1161414f565b90506020020135878786818110611c2a57611c2a61414f565b90506020020135604051611c48929190918252602082015260400190565b60405180910390a3600101611bc9565b50505050505050565b336001600160a01b038316811415611ca5576040517fa7fecee600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038181166000818152600f6020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c05691015b60405180910390a3505050565b6000818152600360205260409020546060906001600160a01b0316611d64576040517fb1d04f0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611d6e613472565b90506000815111611d8e5760405180602001604052806000815250611dbc565b80611d9884613481565b6016604051602001611dac939291906141fc565b6040516020818303038152906040525b9392505050565b611dcb612078565b60075460ff1615611e08576040517f76f1a0b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151611e1b906008906020850190613a71565b508051611e2f906009906020840190613a71565b50506007805460ff1916600117905550565b60158054611a65906140e7565b600a8181548110611e5e57600080fd5b6000918252602090912001546001600160a01b0316905081565b611e806122aa565b611184816122e9565b611e91612078565b611e9a816135b3565b6001600160a01b038116600081815260196020526040808220805460ff19169055519091907f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa6768908390a350565b611eef612078565b611ef88161299d565b61110482826001612a3a565b611f0c612078565b6001600160a01b0381166118c9576040517ff82d512f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f54612078565b60185415611f8e576040517fffea513400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80611fc5576040517fe776bd1100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600019811415612001576040517f074e588000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601855565b60006001600160e01b031982167f95fa0ff500000000000000000000000000000000000000000000000000000000148061206957506001600160e01b031982167f247946c900000000000000000000000000000000000000000000000000000000145b806109c557506109c582613605565b6000546001600160a01b031633146120bc576040517f4bdafed800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6127106bffffffffffffffffffffffff821611156121445760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610e28565b6001600160a01b03821661219a5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610e28565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217601255565b6000818152600360205260409020546001600160a01b03166118d25760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610e28565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122718261142e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6122b333610563565b6120bc576040517f9eea455500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122fb6122f58261142e565b336106ab565b6118d2576040517f362df0d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000612341868686611493565b9250925092508261237e576040517f20f59f0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008681526010602090815260408083206001600160a01b03891684529091528120548591906123b090600190614138565b905080831461251f5760008881526010602090815260408083206001600160a01b038b16845290915290208054829081106123ed576123ed61414f565b600091825260208083206008830401548b84526010825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff169190859081106124435761244361414f565b600091825260208083206008830401805460079093166004026101000a63ffffffff8181021990941695909316929092029390931790558981526011825260408082206001600160a01b038b168084529084528183208c8452601085528284209184529352812080548693929190859081106124c1576124c161414f565b6000918252602080832060088304015460079092166004026101000a90910463ffffffff90811684529083019390935260409091019020805470ffffffff000000000000000000000000001916600160681b93909216929092021790555b60008881526010602090815260408083206001600160a01b038b168452909152902080548061255057612550614165565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a81526011835260408082206001600160a01b038c16835284528082209286168252919092528120805470ffffffffffffffffffffffffffffffffff191690556125ce8961142e565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a60008060405161262c9392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561266d57600080fd5b505afa158015612681573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a591906141df565b156126cb576000898152600e6020526040812080549091906126c6906142c0565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b15801561272357600080fd5b505af1158015612737573d6000803e3d6000fd5b50505050505050505050505050565b6000806127528361142e565b9050806001600160a01b0316846001600160a01b0316148061279957506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b806127bd5750836001600160a01b03166127b284610d70565b6001600160a01b0316145b949350505050565b826001600160a01b03166127d88261142e565b6001600160a01b0316146128545760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610e28565b6001600160a01b0382166128cf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610e28565b6128da838383613643565b6128e560008261223c565b6001600160a01b038316600090815260046020526040812080546001929061290e908490614138565b90915550506001600160a01b038216600090815260046020526040812080546001929061293c9084906142d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0381166000908152600b602052604090205460ff16156118d2576040517fc0f8cffb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336129fa8261142e565b6001600160a01b0316146118d2576040517fb23b68b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612a458461142e565b60008581526010602090815260408083206001600160a01b038816845290915281205491925050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612aa557600080fd5b505afa158015612ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612add91906141df565b15612b06576000858152600e602052604081208054839290612b00908490614138565b90915550505b60005b81811015612cf05760008681526010602090815260408083206001600160a01b03891684529091528120805483908110612b4557612b4561414f565b600091825260208083206008830401548a84526011825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff81161515825295860482168188015265010000000000860467ffffffffffffffff16818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a460008981526011602090815260408083206001600160a01b038c811680865291845282852063ffffffff8916808752945293829020805470ffffffffffffffffffffffffffffffffff191690559051636d4229c960e01b81529289166004840152602483018c905260448301919091526064820183905290636d4229c990608401600060405180830381600087803b158015612cca57600080fd5b505af1158015612cde573d6000803e3d6000fd5b50505050836001019350505050612b09565b5060008581526010602090815260408083206001600160a01b03881684529091528120612d1c91613af5565b5050505050565b6000806001600160a01b038416612d66576040517f89a4ea1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82612d9d576040517f2465b2bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612da6336135b3565b60175480612db2575060015b91508160006001612dc386846142d7565b612dcd9190614138565b60185490915080821115612e17576040517fea0582460000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610e28565b82860160175560005b86811015612e3c57612e3488828601613689565b600101612e20565b5090925050509250929050565b6000612e56848484611493565b505090508015612e92576040517f7f53cfe300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008481526010602090815260408083206001600160a01b0387168452909152902054600d548110612ef0576040517ff8315a8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526010602090815260408083206001600160a01b03881680855290835281842080546001808201835591865284862060088204018054600790921660040261010090810a63ffffffff818102199094168c8516918202179092558c88526011875285882094885293865284872081885290955292852080547fffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff0016650100000000004267ffffffffffffffff1602179091177fffffffffffffffffffffffffffffff00000000ffffffffffffffff00000000ff169190930270ffffffff00000000000000000000000000191617600160681b918516919091021790558390612ffa8761142e565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561308857600080fd5b505afa15801561309c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c091906141df565b156130db576000878152600e60205260409020805460010190555b6040517f688a37410000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b15801561314557600080fd5b505af1158015613159573d6000803e3d6000fd5b5050505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811660009081526019602052604090205460ff16156118d2576040517f119ce67800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006132148261142e565b905061322281600084613643565b61322d60008361223c565b6001600160a01b0381166000908152600460205260408120805460019290613256908490614138565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031614156133125760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e28565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101611d06565b6133828484846127c5565b61338e84848484613693565b611b6e5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610e28565b80613437576040517f63199bde00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60648111156118d2576040517f9cb75faf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060158054610a89906140e7565b6060816134c157505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156134eb57806134d58161417b565b91506134e49050600a836141cb565b91506134c5565b60008167ffffffffffffffff81111561350657613506613dd7565b6040519080825280601f01601f191660200182016040528015613530576020820181803683370190505b5090505b84156127bd57613545600183614138565b9150613552600a866142ef565b61355d9060306142d7565b60f81b8183815181106135725761357261414f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506135ac600a866141cb565b9450613534565b6001600160a01b03811660009081526019602052604090205460ff166118d2576040517f7e75cbe500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806109c557506109c5826137f6565b6000818152600e602052604090205415610ec9576040517f95e7c04000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111048282613868565b60006001600160a01b0384163b156137eb57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906136d7903390899088908890600401614303565b602060405180830381600087803b1580156136f157600080fd5b505af1925050508015613721575060408051601f3d908101601f1916820190925261371e91810190614335565b60015b6137d1573d80801561374f576040519150601f19603f3d011682016040523d82523d6000602084013e613754565b606091505b5080516137c95760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610e28565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127bd565b506001949350505050565b60006001600160e01b031982167ff9f7ab4100000000000000000000000000000000000000000000000000000000148061385957506001600160e01b031982167fb39fa00000000000000000000000000000000000000000000000000000000000145b806109c557506109c5826139b6565b6001600160a01b0382166138be5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e28565b6000818152600360205260409020546001600160a01b0316156139235760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e28565b61392f60008383613643565b6001600160a01b03821660009081526004602052604081208054600192906139589084906142d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b031982167fd147c97a0000000000000000000000000000000000000000000000000000000014806109c557506109c58260006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480613a5257506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109c557506301ffc9a760e01b6001600160e01b03198316146109c5565b828054613a7d906140e7565b90600052602060002090601f016020900481019282613a9f5760008555613ae5565b82601f10613ab857805160ff1916838001178555613ae5565b82800160010185558215613ae5579182015b82811115613ae5578251825591602001919060010190613aca565b50613af1929150613b16565b5090565b5080546000825560070160089004906000526020600020908101906118d291905b5b80821115613af15760008155600101613b17565b6001600160e01b0319811681146118d257600080fd5b600060208284031215613b5357600080fd5b8135611dbc81613b2b565b80356001600160a01b0381168114613b7557600080fd5b919050565b60008060408385031215613b8d57600080fd5b613b9683613b5e565b915060208301356bffffffffffffffffffffffff81168114613bb757600080fd5b809150509250929050565b60005b83811015613bdd578181015183820152602001613bc5565b83811115611b6e5750506000910152565b60008151808452613c06816020860160208601613bc2565b601f01601f19169290920160200192915050565b602081526000611dbc6020830184613bee565b600060208284031215613c3f57600080fd5b611dbc82613b5e565b600060208284031215613c5a57600080fd5b5035919050565b60008060408385031215613c7457600080fd5b613c7d83613b5e565b946020939093013593505050565b60008060408385031215613c9e57600080fd5b82359150613cae60208401613b5e565b90509250929050565b602080825282518282018190526000919060409081850190868401855b82811015613d235781518051151585528681015163ffffffff908116888701528682015167ffffffffffffffff1687870152606091820151169085015260809093019290850190600101613cd4565b5091979650505050505050565b600080600060608486031215613d4557600080fd5b83359250613d5560208501613b5e565b9150604084013563ffffffff81168114613d6e57600080fd5b809150509250925092565b60008060408385031215613d8c57600080fd5b50508035926020909101359150565b600080600060608486031215613db057600080fd5b613db984613b5e565b9250613dc760208501613b5e565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115613e0857613e08613dd7565b604051601f8501601f19908116603f01168101908282118183101715613e3057613e30613dd7565b81604052809350858152868686011115613e4957600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112613e7457600080fd5b611dbc83833560208501613ded565b60008060408385031215613e9657600080fd5b823567ffffffffffffffff80821115613eae57600080fd5b613eba86838701613e63565b93506020850135915080821115613ed057600080fd5b50613edd85828601613e63565b9150509250929050565b600080600060608486031215613efc57600080fd5b83359250613dc760208501613b5e565b600060208284031215613f1e57600080fd5b813567ffffffffffffffff811115613f3557600080fd5b6127bd84828501613e63565b60008060408385031215613f5457600080fd5b613f5d83613b5e565b9150613cae60208401613b5e565b80151581146118d257600080fd5b60008060408385031215613f8c57600080fd5b613f9583613b5e565b91506020830135613bb781613f6b565b60008060008060808587031215613fbb57600080fd5b613fc485613b5e565b9350613fd260208601613b5e565b925060408501359150606085013567ffffffffffffffff811115613ff557600080fd5b8501601f8101871361400657600080fd5b61401587823560208401613ded565b91505092959194509250565b60008083601f84011261403357600080fd5b50813567ffffffffffffffff81111561404b57600080fd5b6020830191508360208260051b85010111156112b457600080fd5b60008060008060006060868803121561407e57600080fd5b61408786613b5e565b9450602086013567ffffffffffffffff808211156140a457600080fd5b6140b089838a01614021565b909650945060408801359150808211156140c957600080fd5b506140d688828901614021565b969995985093965092949392505050565b600181811c908216806140fb57607f821691505b6020821081141561411c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561414a5761414a614122565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060001982141561418f5761418f614122565b5060010190565b60008160001904831182151516156141b0576141b0614122565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826141da576141da6141b5565b500490565b6000602082840312156141f157600080fd5b8151611dbc81613f6b565b60008451602061420f8285838a01613bc2565b8551918401916142228184848a01613bc2565b8554920191600090600181811c908083168061423f57607f831692505b85831081141561425d57634e487b7160e01b85526022600452602485fd5b8080156142715760018114614282576142af565b60ff198516885283880195506142af565b60008b81526020902060005b858110156142a75781548a82015290840190880161428e565b505083880195505b50939b9a5050505050505050505050565b6000816142cf576142cf614122565b506000190190565b600082198211156142ea576142ea614122565b500190565b6000826142fe576142fe6141b5565b500690565b60006001600160a01b038087168352808616602084015250836040830152608060608301526118316080830184613bee565b60006020828403121561434757600080fd5b8151611dbc81613b2b56fea264697066735822122020e35c88284bf42008de4278d46b639db6649d3d9dec0dc0ea24fe3ab564056264736f6c6343000809003368747470733a2f2f6469676964616967616b752e636f6d2f737570657276696c6c61696e706f74696f6e732f6d657461646174612f0000000000000000000000000000000000000000000000000000000000001f98000000000000000000000000b4592be0307a118868291706453d518531dd2b5300000000000000000000000000000000000000000000000000000000000003e8

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103785760003560e01c80638be18e57116101d3578063be85930811610104578063e370ab46116100a2578063ed1e00851161007c578063ed1e00851461092b578063f1e923c51461094e578063f2fde38b14610961578063f5234c561461097457600080fd5b8063e370ab46146108c9578063e985e9c5146108dc578063e9b4f7aa1461091857600080fd5b8063d147c97a116100de578063d147c97a14610893578063d547cfb7146108a6578063d5abeb01146108ae578063e2989f4c146108b657600080fd5b8063be8593081461085a578063c05e2f441461086d578063c87b56dd1461088057600080fd5b80639bc17ea411610171578063aca139f71161014b578063aca139f714610819578063b39fa0001461082c578063b3bcea481461083f578063b88d4fde1461084757600080fd5b80639bc17ea41461078f578063a22cb465146107a2578063aa6cab5a146107b557600080fd5b806391623718116101ad578063916237181461072b57806395d89b411461076157806395fa0ff5146107695780639bb257ad1461077c57600080fd5b80638be18e57146106f45780638c5f36bb146107075780638da5cb5b1461071a57600080fd5b806340c10f19116102ad578063703fa9291161024b5780637e10b35b116102255780637e10b35b1461068a5780637f1a5ce11461069d578063816a1501146106d9578063869f9110146106ec57600080fd5b8063703fa9291461063057806370a082311461066057806375794a3c1461068157600080fd5b806351dadc281161028757806351dadc28146105cf57806353401df9146105f757806355f804b31461060a5780636352211e1461061d57600080fd5b806340c10f191461058157806342842e0e146105a95780634e02c078146105bc57600080fd5b8063113405571161031a578063247946c9116102f4578063247946c9146104fd5780632a55205a146105105780632ebb386a14610542578063301be7401461055557600080fd5b8063113405571461044057806311ad4081146104d757806323b872dd146104ea57600080fd5b8063070cba1711610356578063070cba17146103cf578063081812fc146103e2578063095ea7b31461040d5780630f3d911c1461042057600080fd5b806301ffc9a71461037d57806302fa7c47146103a557806306fdde03146103ba575b600080fd5b61039061038b366004613b41565b610987565b60405190151581526020015b60405180910390f35b6103b86103b3366004613b7a565b6109cb565b005b6103c2610a7a565b60405161039c9190613c1a565b6103b86103dd366004613c2d565b610b0c565b6103f56103f0366004613c48565b610d70565b6040516001600160a01b03909116815260200161039c565b6103b861041b366004613c61565b610d97565b61043361042e366004613c8b565b610ece565b60405161039c9190613cb7565b6104a061044e366004613d30565b601160209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff610100820481169167ffffffffffffffff6501000000000082041691600160681b9091041684565b60408051941515855263ffffffff938416602086015267ffffffffffffffff9092169184019190915216606082015260800161039c565b6103b86104e5366004613d79565b6110e8565b6103b86104f8366004613d9b565b611108565b6103b861050b366004613e83565b61118f565b61052361051e366004613d79565b6111fe565b604080516001600160a01b03909316835260208301919091520161039c565b6103b8610550366004613c8b565b6112bb565b610390610563366004613c2d565b6001600160a01b03166000908152600b602052604090205460ff1690565b61059461058f366004613c61565b6112d9565b6040805192835260208301919091520161039c565b6103b86105b7366004613d9b565b61132e565b6103b86105ca366004613ee7565b611349565b6105e26105dd366004613ee7565b611366565b60405163ffffffff909116815260200161039c565b6103b8610605366004613d79565b6113bc565b6103b8610618366004613f0c565b6113d8565b6103f561062b366004613c48565b61142e565b61064361063e366004613ee7565b611493565b60408051931515845260208401929092529082015260600161039c565b61067361066e366004613c2d565b611533565b60405190815260200161039c565b61067360175481565b6103b8610698366004613c2d565b6115cd565b6103906106ab366004613f41565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205460ff1690565b6106736106e7366004613ee7565b611806565b600d54610673565b6103b8610702366004613f0c565b61183b565b6103b8610715366004613c2d565b611886565b6000546001600160a01b03166103f5565b610673610739366004613c8b565b60009182526010602090815260408084206001600160a01b0393909316845291905290205490565b6103c26118d5565b6103b8610777366004613b7a565b6118e4565b6103b861078a366004613c2d565b611944565b6103b861079d366004613c48565b6119a7565b6103b86107b0366004613f79565b6119c1565b6107f16107c3366004613c2d565b600b6020526000908152604090205460ff81169061010090046fffffffffffffffffffffffffffffffff1682565b6040805192151583526fffffffffffffffffffffffffffffffff90911660208301520161039c565b6103b8610827366004613d9b565b6119cc565b6103b861083a366004613c48565b6119f8565b6103c2611a58565b6103b8610855366004613fa5565b611ae6565b6103b8610868366004614066565b611b74565b6103b861087b366004613f79565b611c61565b6103c261088e366004613c48565b611d13565b6103b86108a1366004613e83565b611dc3565b6103c2611e41565b601854610673565b6103f56108c4366004613c48565b611e4e565b6103b86108d7366004613d9b565b611e78565b6103906108ea366004613f41565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6103b8610926366004613c2d565b611e89565b610390610939366004613c2d565b60196020526000908152604090205460ff1681565b6103b861095c366004613c8b565b611ee7565b6103b861096f366004613c2d565b611f04565b6103b8610982366004613c48565b611f4c565b60006001600160e01b031982167ff5234c560000000000000000000000000000000000000000000000000000000014806109c557506109c582612006565b92915050565b6109d3612078565b6103e86bffffffffffffffffffffffff82161115610a1d576040517f555f013c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a2782826120be565b604080516001600160a01b03841681526bffffffffffffffffffffffff831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff60910160405180910390a15050565b606060088054610a89906140e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab5906140e7565b8015610b025780601f10610ad757610100808354040283529160200191610b02565b820191906000526020600020905b815481529060010190602001808311610ae557829003601f168201915b5050505050905090565b610b14612078565b6001600160a01b0381166000908152600b602052604090205460ff16610b66576040517f584a793800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0381166000908152600b6020526040812054600a546101009091046fffffffffffffffffffffffffffffffff169190610ba890600190614138565b905080826fffffffffffffffffffffffffffffffff1614610cd657600a8181548110610bd657610bd661414f565b600091825260209091200154600a80546001600160a01b03909216916fffffffffffffffffffffffffffffffff8516908110610c1457610c1461414f565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600b6000600a856fffffffffffffffffffffffffffffffff1681548110610c6c57610c6c61414f565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546fffffffffffffffffffffffffffffffff92909216610100027fffffffffffffffffffffffffffffff00000000000000000000000000000000ff9092169190911790555b600a805480610ce757610ce7614165565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038516808352600b82526040808420805470ffffffffffffffffffffffffffffffffff1916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a2505050565b6000610d7b826121d8565b506000908152600560205260409020546001600160a01b031690565b6000610da28261142e565b9050806001600160a01b0316836001600160a01b03161415610e315760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b336001600160a01b0382161480610e4d5750610e4d81336108ea565b610ebf5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610e28565b610ec9838361223c565b505050565b60008281526010602090815260408083206001600160a01b03851684529091529020546060908067ffffffffffffffff811115610f0d57610f0d613dd7565b604051908082528060200260200182016040528015610f5f57816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610f2b5790505b5060008581526010602090815260408083206001600160a01b0388168452825280832080548251818502810185019093528083529496509293909291830182828015610ff657602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff1681526020019060040190602082600301049283019260010382029150808411610fb95790505b5050505050905060005b828110156110df5760008681526011602090815260408083206001600160a01b0389168452909152812083519091908490849081106110415761104161414f565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff811615158252610100810485169282019290925267ffffffffffffffff6501000000000083041692810192909252600160681b9004909116606082015284518590839081106110c3576110c361414f565b6020026020010181905250806110d89061417b565b9050611000565b50505092915050565b6110f06122aa565b6110f9826122e9565b611104823383612331565b5050565b6111123382612746565b6111845760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610e28565b610ec98383836127c5565b611197612078565b601454610100900460ff16156111d9576040517f5b79f68300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111e2826113d8565b6111eb8161183b565b50506014805461ff001916610100179055565b60008281526013602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff1692820192909252829161127d5750604080518082019091526012546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b6020810151600090612710906112a1906bffffffffffffffffffffffff1687614196565b6112ab91906141cb565b91519350909150505b9250929050565b6112c48161299d565b6112cd826129f0565b61110482826000612a3a565b6000806001601a541415611319576040517fbf1f503200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113238484612d23565b915091509250929050565b610ec983838360405180602001604052806000815250611ae6565b6113528261299d565b61135b836129f0565b610ec9838383612331565b6010602052826000526040600020602052816000526040600020818154811061138e57600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b6113c46122aa565b6113cd826122e9565b611104823383612e49565b6113e0612078565b80516113f3906015906020840190613a71565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f6816040516114239190613c1a565b60405180910390a150565b6000818152600360205260408120546001600160a01b0316806109c55760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610e28565b6000808063ffffffff8411156114d5576040517f3f8ace8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505060009283526011602090815260408085206001600160a01b0394909416855292815282842063ffffffff9283168552905291205460ff81169265010000000000820467ffffffffffffffff1692600160681b90920490911690565b60006001600160a01b0382166115b15760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610e28565b506001600160a01b031660009081526004602052604090205490565b6115d5612078565b6001600160a01b0381166000908152600b602052604090205460ff1615611628576040517fb73e95e100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516301ffc9a760e01b81527f977e0c1c0000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b15801561168757600080fd5b505afa15801561169b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116bf91906141df565b6116f5576040517f90c51dd700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a546fffffffffffffffffffffffffffffffff811115611742576040517fd571eff200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0382166000818152600b602090815260408083208054600170ffffffffffffffffffffffffffffffffff199091166101006fffffffffffffffffffffffffffffffff891602178117909155600a8054808301825594527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a890930180546001600160a01b03191685179055519182527fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b6000806000611816868686611493565b509150915081611827576000611831565b6118318142614138565b9695505050505050565b611843612078565b8051611856906016906020840190613a71565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba0816040516114239190613c1a565b6000546001600160a01b0316156118c9576040517f9b07432800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6118d281613166565b50565b606060098054610a89906140e7565b6118ec612078565b60145460ff1615611929576040517f9383013900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61193382826109cb565b50506014805460ff19166001179055565b61194c612078565b611955816131b6565b6001600160a01b038116600081815260196020526040808220805460ff1916600190811790915590519092917f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa676891a350565b6119af6122aa565b6119b8816122e9565b6118d281613209565b6111043383836132b0565b6119d46122aa565b6119dd816122e9565b610ec983838360405180602001604052806000815250613377565b611a00612078565b600c5460ff1615611a3d576040517f1c01396a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611a4681613400565b600d55600c805460ff19166001179055565b60168054611a65906140e7565b80601f0160208091040260200160405190810160405280929190818152602001828054611a91906140e7565b8015611ade5780601f10611ab357610100808354040283529160200191611ade565b820191906000526020600020905b815481529060010190602001808311611ac157829003601f168201915b505050505081565b611af03383612746565b611b625760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610e28565b611b6e84848484613377565b50505050565b808314611bad576040517f43714afd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002601a556000611bbe86856112d9565b506001601a55905060005b84811015611c5857808201876001600160a01b03167fa4c80acd99a5132fdb6fecbe030d4fa8090315bb97297667643dd6fd33fa7dda888885818110611c1157611c1161414f565b90506020020135878786818110611c2a57611c2a61414f565b90506020020135604051611c48929190918252602082015260400190565b60405180910390a3600101611bc9565b50505050505050565b336001600160a01b038316811415611ca5576040517fa7fecee600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038181166000818152600f6020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c05691015b60405180910390a3505050565b6000818152600360205260409020546060906001600160a01b0316611d64576040517fb1d04f0800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611d6e613472565b90506000815111611d8e5760405180602001604052806000815250611dbc565b80611d9884613481565b6016604051602001611dac939291906141fc565b6040516020818303038152906040525b9392505050565b611dcb612078565b60075460ff1615611e08576040517f76f1a0b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8151611e1b906008906020850190613a71565b508051611e2f906009906020840190613a71565b50506007805460ff1916600117905550565b60158054611a65906140e7565b600a8181548110611e5e57600080fd5b6000918252602090912001546001600160a01b0316905081565b611e806122aa565b611184816122e9565b611e91612078565b611e9a816135b3565b6001600160a01b038116600081815260196020526040808220805460ff19169055519091907f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa6768908390a350565b611eef612078565b611ef88161299d565b61110482826001612a3a565b611f0c612078565b6001600160a01b0381166118c9576040517ff82d512f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611f54612078565b60185415611f8e576040517fffea513400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80611fc5576040517fe776bd1100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600019811415612001576040517f074e588000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b601855565b60006001600160e01b031982167f95fa0ff500000000000000000000000000000000000000000000000000000000148061206957506001600160e01b031982167f247946c900000000000000000000000000000000000000000000000000000000145b806109c557506109c582613605565b6000546001600160a01b031633146120bc576040517f4bdafed800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6127106bffffffffffffffffffffffff821611156121445760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610e28565b6001600160a01b03821661219a5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610e28565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217601255565b6000818152600360205260409020546001600160a01b03166118d25760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610e28565b600081815260056020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122718261142e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6122b333610563565b6120bc576040517f9eea455500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122fb6122f58261142e565b336106ab565b6118d2576040517f362df0d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000806000612341868686611493565b9250925092508261237e576040517f20f59f0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008681526010602090815260408083206001600160a01b03891684529091528120548591906123b090600190614138565b905080831461251f5760008881526010602090815260408083206001600160a01b038b16845290915290208054829081106123ed576123ed61414f565b600091825260208083206008830401548b84526010825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff169190859081106124435761244361414f565b600091825260208083206008830401805460079093166004026101000a63ffffffff8181021990941695909316929092029390931790558981526011825260408082206001600160a01b038b168084529084528183208c8452601085528284209184529352812080548693929190859081106124c1576124c161414f565b6000918252602080832060088304015460079092166004026101000a90910463ffffffff90811684529083019390935260409091019020805470ffffffff000000000000000000000000001916600160681b93909216929092021790555b60008881526010602090815260408083206001600160a01b038b168452909152902080548061255057612550614165565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a81526011835260408082206001600160a01b038c16835284528082209286168252919092528120805470ffffffffffffffffffffffffffffffffff191690556125ce8961142e565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a60008060405161262c9392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561266d57600080fd5b505afa158015612681573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126a591906141df565b156126cb576000898152600e6020526040812080549091906126c6906142c0565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b15801561272357600080fd5b505af1158015612737573d6000803e3d6000fd5b50505050505050505050505050565b6000806127528361142e565b9050806001600160a01b0316846001600160a01b0316148061279957506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b806127bd5750836001600160a01b03166127b284610d70565b6001600160a01b0316145b949350505050565b826001600160a01b03166127d88261142e565b6001600160a01b0316146128545760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610e28565b6001600160a01b0382166128cf5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610e28565b6128da838383613643565b6128e560008261223c565b6001600160a01b038316600090815260046020526040812080546001929061290e908490614138565b90915550506001600160a01b038216600090815260046020526040812080546001929061293c9084906142d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b0381166000908152600b602052604090205460ff16156118d2576040517fc0f8cffb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336129fa8261142e565b6001600160a01b0316146118d2576040517fb23b68b700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612a458461142e565b60008581526010602090815260408083206001600160a01b038816845290915281205491925050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612aa557600080fd5b505afa158015612ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612add91906141df565b15612b06576000858152600e602052604081208054839290612b00908490614138565b90915550505b60005b81811015612cf05760008681526010602090815260408083206001600160a01b03891684529091528120805483908110612b4557612b4561414f565b600091825260208083206008830401548a84526011825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff81161515825295860482168188015265010000000000860467ffffffffffffffff16818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a460008981526011602090815260408083206001600160a01b038c811680865291845282852063ffffffff8916808752945293829020805470ffffffffffffffffffffffffffffffffff191690559051636d4229c960e01b81529289166004840152602483018c905260448301919091526064820183905290636d4229c990608401600060405180830381600087803b158015612cca57600080fd5b505af1158015612cde573d6000803e3d6000fd5b50505050836001019350505050612b09565b5060008581526010602090815260408083206001600160a01b03881684529091528120612d1c91613af5565b5050505050565b6000806001600160a01b038416612d66576040517f89a4ea1900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82612d9d576040517f2465b2bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612da6336135b3565b60175480612db2575060015b91508160006001612dc386846142d7565b612dcd9190614138565b60185490915080821115612e17576040517fea0582460000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610e28565b82860160175560005b86811015612e3c57612e3488828601613689565b600101612e20565b5090925050509250929050565b6000612e56848484611493565b505090508015612e92576040517f7f53cfe300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008481526010602090815260408083206001600160a01b0387168452909152902054600d548110612ef0576040517ff8315a8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526010602090815260408083206001600160a01b03881680855290835281842080546001808201835591865284862060088204018054600790921660040261010090810a63ffffffff818102199094168c8516918202179092558c88526011875285882094885293865284872081885290955292852080547fffffffffffffffffffffffffffffffffffffff0000000000000000ffffffff0016650100000000004267ffffffffffffffff1602179091177fffffffffffffffffffffffffffffff00000000ffffffffffffffff00000000ff169190930270ffffffff00000000000000000000000000191617600160681b918516919091021790558390612ffa8761142e565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b15801561308857600080fd5b505afa15801561309c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130c091906141df565b156130db576000878152600e60205260409020805460010190555b6040517f688a37410000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b15801561314557600080fd5b505af1158015613159573d6000803e3d6000fd5b5050505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811660009081526019602052604090205460ff16156118d2576040517f119ce67800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006132148261142e565b905061322281600084613643565b61322d60008361223c565b6001600160a01b0381166000908152600460205260408120805460019290613256908490614138565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031614156133125760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610e28565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101611d06565b6133828484846127c5565b61338e84848484613693565b611b6e5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610e28565b80613437576040517f63199bde00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60648111156118d2576040517f9cb75faf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060158054610a89906140e7565b6060816134c157505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156134eb57806134d58161417b565b91506134e49050600a836141cb565b91506134c5565b60008167ffffffffffffffff81111561350657613506613dd7565b6040519080825280601f01601f191660200182016040528015613530576020820181803683370190505b5090505b84156127bd57613545600183614138565b9150613552600a866142ef565b61355d9060306142d7565b60f81b8183815181106135725761357261414f565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506135ac600a866141cb565b9450613534565b6001600160a01b03811660009081526019602052604090205460ff166118d2576040517f7e75cbe500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006001600160e01b031982167f2a55205a0000000000000000000000000000000000000000000000000000000014806109c557506109c5826137f6565b6000818152600e602052604090205415610ec9576040517f95e7c04000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111048282613868565b60006001600160a01b0384163b156137eb57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906136d7903390899088908890600401614303565b602060405180830381600087803b1580156136f157600080fd5b505af1925050508015613721575060408051601f3d908101601f1916820190925261371e91810190614335565b60015b6137d1573d80801561374f576040519150601f19603f3d011682016040523d82523d6000602084013e613754565b606091505b5080516137c95760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610e28565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127bd565b506001949350505050565b60006001600160e01b031982167ff9f7ab4100000000000000000000000000000000000000000000000000000000148061385957506001600160e01b031982167fb39fa00000000000000000000000000000000000000000000000000000000000145b806109c557506109c5826139b6565b6001600160a01b0382166138be5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610e28565b6000818152600360205260409020546001600160a01b0316156139235760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610e28565b61392f60008383613643565b6001600160a01b03821660009081526004602052604081208054600192906139589084906142d7565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b031982167fd147c97a0000000000000000000000000000000000000000000000000000000014806109c557506109c58260006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480613a5257506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109c557506301ffc9a760e01b6001600160e01b03198316146109c5565b828054613a7d906140e7565b90600052602060002090601f016020900481019282613a9f5760008555613ae5565b82601f10613ab857805160ff1916838001178555613ae5565b82800160010185558215613ae5579182015b82811115613ae5578251825591602001919060010190613aca565b50613af1929150613b16565b5090565b5080546000825560070160089004906000526020600020908101906118d291905b5b80821115613af15760008155600101613b17565b6001600160e01b0319811681146118d257600080fd5b600060208284031215613b5357600080fd5b8135611dbc81613b2b565b80356001600160a01b0381168114613b7557600080fd5b919050565b60008060408385031215613b8d57600080fd5b613b9683613b5e565b915060208301356bffffffffffffffffffffffff81168114613bb757600080fd5b809150509250929050565b60005b83811015613bdd578181015183820152602001613bc5565b83811115611b6e5750506000910152565b60008151808452613c06816020860160208601613bc2565b601f01601f19169290920160200192915050565b602081526000611dbc6020830184613bee565b600060208284031215613c3f57600080fd5b611dbc82613b5e565b600060208284031215613c5a57600080fd5b5035919050565b60008060408385031215613c7457600080fd5b613c7d83613b5e565b946020939093013593505050565b60008060408385031215613c9e57600080fd5b82359150613cae60208401613b5e565b90509250929050565b602080825282518282018190526000919060409081850190868401855b82811015613d235781518051151585528681015163ffffffff908116888701528682015167ffffffffffffffff1687870152606091820151169085015260809093019290850190600101613cd4565b5091979650505050505050565b600080600060608486031215613d4557600080fd5b83359250613d5560208501613b5e565b9150604084013563ffffffff81168114613d6e57600080fd5b809150509250925092565b60008060408385031215613d8c57600080fd5b50508035926020909101359150565b600080600060608486031215613db057600080fd5b613db984613b5e565b9250613dc760208501613b5e565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115613e0857613e08613dd7565b604051601f8501601f19908116603f01168101908282118183101715613e3057613e30613dd7565b81604052809350858152868686011115613e4957600080fd5b858560208301376000602087830101525050509392505050565b600082601f830112613e7457600080fd5b611dbc83833560208501613ded565b60008060408385031215613e9657600080fd5b823567ffffffffffffffff80821115613eae57600080fd5b613eba86838701613e63565b93506020850135915080821115613ed057600080fd5b50613edd85828601613e63565b9150509250929050565b600080600060608486031215613efc57600080fd5b83359250613dc760208501613b5e565b600060208284031215613f1e57600080fd5b813567ffffffffffffffff811115613f3557600080fd5b6127bd84828501613e63565b60008060408385031215613f5457600080fd5b613f5d83613b5e565b9150613cae60208401613b5e565b80151581146118d257600080fd5b60008060408385031215613f8c57600080fd5b613f9583613b5e565b91506020830135613bb781613f6b565b60008060008060808587031215613fbb57600080fd5b613fc485613b5e565b9350613fd260208601613b5e565b925060408501359150606085013567ffffffffffffffff811115613ff557600080fd5b8501601f8101871361400657600080fd5b61401587823560208401613ded565b91505092959194509250565b60008083601f84011261403357600080fd5b50813567ffffffffffffffff81111561404b57600080fd5b6020830191508360208260051b85010111156112b457600080fd5b60008060008060006060868803121561407e57600080fd5b61408786613b5e565b9450602086013567ffffffffffffffff808211156140a457600080fd5b6140b089838a01614021565b909650945060408801359150808211156140c957600080fd5b506140d688828901614021565b969995985093965092949392505050565b600181811c908216806140fb57607f821691505b6020821081141561411c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561414a5761414a614122565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600060001982141561418f5761418f614122565b5060010190565b60008160001904831182151516156141b0576141b0614122565b500290565b634e487b7160e01b600052601260045260246000fd5b6000826141da576141da6141b5565b500490565b6000602082840312156141f157600080fd5b8151611dbc81613f6b565b60008451602061420f8285838a01613bc2565b8551918401916142228184848a01613bc2565b8554920191600090600181811c908083168061423f57607f831692505b85831081141561425d57634e487b7160e01b85526022600452602485fd5b8080156142715760018114614282576142af565b60ff198516885283880195506142af565b60008b81526020902060005b858110156142a75781548a82015290840190880161428e565b505083880195505b50939b9a5050505050505050505050565b6000816142cf576142cf614122565b506000190190565b600082198211156142ea576142ea614122565b500190565b6000826142fe576142fe6141b5565b500690565b60006001600160a01b038087168352808616602084015250836040830152608060608301526118316080830184613bee565b60006020828403121561434757600080fd5b8151611dbc81613b2b56fea264697066735822122020e35c88284bf42008de4278d46b639db6649d3d9dec0dc0ea24fe3ab564056264736f6c63430008090033

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

0000000000000000000000000000000000000000000000000000000000001f98000000000000000000000000b4592be0307a118868291706453d518531dd2b5300000000000000000000000000000000000000000000000000000000000003e8

-----Decoded View---------------
Arg [0] : maxSupply_ (uint256): 8088
Arg [1] : royaltyReceiver_ (address): 0xb4592bE0307A118868291706453d518531dD2b53
Arg [2] : royaltyFeeNumerator_ (uint96): 1000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000001f98
Arg [1] : 000000000000000000000000b4592be0307a118868291706453d518531dd2b53
Arg [2] : 00000000000000000000000000000000000000000000000000000000000003e8


Loading...
Loading
Loading...
Loading
[ 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.