ETH Price: $3,074.26 (+2.55%)
Gas: 4 Gwei

Token

DigiDaigakuHeroes (DIHE)
 

Overview

Max Total Supply

0 DIHE

Holders

579

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
3 DIHE
0xb0226e96c71f94c44d998ce1b34f6a47c3a82404
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

DigiDaigaku Heroes is a collection of unique characters developed by Limit Break.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
DigiDaigakuHeroes

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 1500 runs

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

import "./AdventureERC721.sol";
import "./Bloodlines.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";

contract DigiDaigakuHeroes is AdventureERC721, ERC2981 {
    using Strings for uint256;

    /// @dev Largest unsigned int 256 bit value
    uint256 private constant MAX_UINT = type(uint256).max;

    /// @dev The maximum hero token supply
    uint256 public constant MAX_SUPPLY = 2022;

    /// @dev The maximum allowable royalty fee is 10%
    uint96 public constant MAX_ROYALTY_FEE_NUMERATOR = 1000;

    /// @dev Bloodline array - uses tight variable packing to save gas
    Bloodlines.Bloodline[MAX_SUPPLY] private bloodlines;

    /// @dev Bitmap that helps determine if a token was ever minted previously
    uint256[] private mintedTokenTracker;

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

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

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

    /// @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 Emitted when the minter whitelist is updated
    event MinterWhitelistUpdated(address indexed minter, bool whitelisted);

    /// @dev Emitted when a hero is minted
    event MintHero(address indexed to, uint256 indexed tokenId, uint256 indexed genesisTokenId, uint256 timestamp);

    constructor() ERC721("DigiDaigakuHeroes", "DIHE") {
        unchecked {
            // Initialize memory to use for tracking token ids that have been minted
            // The bit corresponding to token id defaults to 1 when unminted,
            // and will be set to 0 upon mint.
            uint256 numberOfTokenTrackerSlots = getNumberOfTokenTrackerSlots();
            for(uint256 i = 0; i < numberOfTokenTrackerSlots; ++i) {
                mintedTokenTracker.push(MAX_UINT);
            }
        }
    }
    
    modifier onlyMinter() {
        require(isMinterWhitelisted(_msgSender()), "Not a minter");
        _;
    }

    /// @notice Returns whether the specified account is a whitelisted minter
    function isMinterWhitelisted(address account) public view returns (bool) {
        return whitelistedMinters[account];
    }

    /// @notice Whitelists a minter
    function whitelistMinter(address minter) external onlyOwner {
        require(!whitelistedMinters[minter], "Already whitelisted");
        whitelistedMinters[minter] = true;

        emit MinterWhitelistUpdated(minter, true);
    }
    
    /// @notice Removes a minter from the whitelist
    function unwhitelistMinter(address minter) external onlyOwner {
        require(whitelistedMinters[minter], "Not whitelisted");
        delete whitelistedMinters[minter];

        emit MinterWhitelistUpdated(minter, false);
    }  

    /// @notice Allows whitelisted minters to mint a hero with the specified bloodline
    function mintHero(address to, uint256 tokenId, uint256 genesisTokenId) external onlyMinter {
        unchecked {            
            require(tokenId > 0, "Token id out of range");
            require(tokenId <= MAX_SUPPLY, "Token id out of range");
            require(genesisTokenId <= MAX_SUPPLY, "Genesis token id out of range");
        
            uint256 slot = tokenId / 256;
            uint256 offset = tokenId % 256;
            uint256 slotValue = mintedTokenTracker[slot];
            require(((slotValue >> offset) & uint256(1)) == 1, "Token already minted");

            mintedTokenTracker[slot] = slotValue & ~(uint256(1) << offset);
            bloodlines[tokenId - 1] = determineBloodline(tokenId, genesisTokenId);
            emit MintHero(to, tokenId, genesisTokenId, block.timestamp);
        }

        _mint(to, tokenId);
    }

    /// @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 calldata baseTokenURI_) external onlyOwner {
        baseTokenURI = baseTokenURI_;

        emit BaseURISet(baseTokenURI_);
    }

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

        emit SuffixURISet(suffixURI_);
    }

    /// @notice Sets royalty information
    function setRoyaltyInfo(address receiver, uint96 feeNumerator) external onlyOwner {
        require(feeNumerator <= MAX_ROYALTY_FEE_NUMERATOR, "Exceeds max royalty fee");
        _setDefaultRoyalty(receiver, feeNumerator);

        emit RoyaltySet(receiver, feeNumerator);
    }

    /// @notice Returns the bloodline of the specified hero token id.
    /// Throws if the token does not exist.
    function getBloodline(uint256 tokenId) external view returns (Bloodlines.Bloodline) {
        require(_exists(tokenId), "Nonexistent token");
        return bloodlines[tokenId - 1];
    }

    /// @notice Returns tokenURI if baseURI is set
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "Nonexistent token");

        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) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    /// @dev Returns the bloodline based on the combination of token id and genesis token id
    /// A rogue is created when only a spirit token was staked.
    /// A warrior is created when a spirit is staked with a genesis token and the token ids do not match.
    /// A royal is created when a spirit is staked with a genesis token and the token ids match.
    function determineBloodline(uint256 tokenId, uint256 genesisTokenId) internal pure returns (Bloodlines.Bloodline) {
        if(genesisTokenId == 0) {
            return Bloodlines.Bloodline.Rogue;
        } else if(tokenId != genesisTokenId) {
            return Bloodlines.Bloodline.Warrior;
        } else {
            return Bloodlines.Bloodline.Royal;
        }
    }

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

        return tokenTrackerSlotsRequired;
    }
}

File 2 of 19 : AdventureERC721.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./IQuestStaking.sol";
import "./AdventurePermissions.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

abstract contract AdventureERC721 is ERC721, AdventurePermissions, IQuestStaking {

    uint256 public constant MAX_UINT32 = type(uint32).max;
    uint256 public constant MAX_CONCURRENT_QUESTS = 100;

    /// @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 Maps each token id to the number of blocking quests it is currently entered into
    mapping (uint256 => uint256) public blockingQuestCounts;

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

    /// @notice Allows an authorized game contract to transfer a player's token if they have opted in
    function adventureTransferFrom(address from, address to, uint256 tokenId) external override onlyAdventure {
        require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
        _transfer(from, to, tokenId);
    }

    /// @notice Allows an authorized game contract to transfer a player's token if they have opted in
    function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external override onlyAdventure {
        require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
        _safeTransfer(from, to, tokenId, "");
    }

    /// @notice Allows an authorized game contract to burn a player's token if they have opted in
    function adventureBurn(uint256 tokenId) external override onlyAdventure {
        require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
        _burn(tokenId);
    }

    /// @notice Allows an authorized game contract to stake a player's token into a quest if they have opted in
    function enterQuest(uint256 tokenId, uint256 questId) external override onlyAdventure {
        require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
        _enterQuest(tokenId, _msgSender(), questId);
    }

    /// @notice Allows an authorized game contract to unstake a player's token from a quest if they have opted in
    /// 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 onlyAdventure {
        require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
        _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 onlyWhenRemovedFromWhitelist(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 onlyWhenRemovedFromWhitelist(adventure) {
        require(ownerOf(tokenId) == _msgSender(), "Only token owner may exit quest");
        _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 onlyWhenRemovedFromWhitelist(adventure) {
        require(ownerOf(tokenId) == _msgSender(), "Only token owner may exit quest");
        _exitAllQuests(tokenId, adventure, false);
    }
    
    /// @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) {
        Quest memory 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 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 {
        require(questId <= MAX_UINT32, "questId out of range");

        (bool participatingInQuest,,) = isParticipatingInQuest(tokenId, adventure, questId);
        require(!participatingInQuest, "Already on quest");

        uint256 currentQuestCount = getQuestCount(tokenId, adventure);
        require(currentQuestCount < MAX_CONCURRENT_QUESTS, "Too many active quests");

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

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

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

        IAdventure(adventure).onQuestEntered(ownerOfToken, tokenId, questId);
    }

    /// @notice 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 {
        require(questId <= MAX_UINT32, "questId out of range");

        (bool participatingInQuest, uint256 startTimestamp, uint256 index) = isParticipatingInQuest(tokenId, adventure, questId);
        require(participatingInQuest, "Not on quest");

        uint32 castedQuestId = uint32(questId);
        uint256 lastArrayIndex = getQuestCount(tokenId, adventure) - 1;
        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];
        }

        IAdventure(adventure).onQuestExited(ownerOfToken, tokenId, questId, startTimestamp);
    }

    /// @notice 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; ++i) {
            uint256 questId = activeQuestList[tokenId][adventure][i];

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

            emit QuestUpdated(tokenId, tokenOwner, adventure, questId, false, booted);
            delete activeQuestLookup[tokenId][adventure][uint32(questId)];
            
            IAdventure(adventure).onQuestExited(tokenOwner, tokenId, questId, startTimestamp);
        }

        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 {
        require(blockingQuestCounts[tokenId] == 0, "An active quest is preventing transfers");
    }
}

File 3 of 19 : Bloodlines.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

library Bloodlines {

    /// @notice 1 => Rogue, 2 => Warrior, 3 => Royal
    enum Bloodline { None, Rogue, Warrior, Royal }
}

File 4 of 19 : 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 5 of 19 : IQuestStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

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

/**
 * @dev Required interface of an ERC721 compliant contract that supports adventures and quest staking.
 */
interface IQuestStaking is IERC165 {

    /**
     * @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 Allows an authorized game contract to transfer a player's token if they have opted in
     */
    function adventureTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @notice Allows an authorized game contract to safe transfer a player's token if they have opted in
     */
    function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @notice Allows an authorized game contract to burn a player's token if they have opted in
     */
    function adventureBurn(uint256 tokenId) external;

    /**
     * @notice Allows an authorized game contract to stake a player's token into a quest if they have opted in
     */
    function enterQuest(uint256 tokenId, uint256 questId) external;

    /**
     * @notice Allows an authorized game contract to unstake a player's token from a quest if they have opted in
     */
    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 6 of 19 : AdventurePermissions.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

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

abstract contract AdventurePermissions is Ownable {

    struct AdventureDetails {
        bool isWhitelisted;
        uint128 arrayIndex;
    }

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

    /// @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 Whitelist array for iteration
    address[] public whitelistedAdventureList;

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

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

    modifier onlyAdventure() {
        require(isAdventureWhitelisted(_msgSender()), "Not an adventure.");
        _;
    }
    
    /// @notice This modifier is used to prevent early backdoor exiting from adventures,
    /// and action which can cause problems with data getting out of sync in the adventure.
    modifier onlyWhenRemovedFromWhitelist(address adventure) {
        require(!isAdventureWhitelisted(adventure), "Adventure is still whitelisted");
        _;
    }

    /// @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
    function whitelistAdventure(address adventure) external onlyOwner {
        require(!whitelistedAdventures[adventure].isWhitelisted, "Already whitelisted");
        require(IERC165(adventure).supportsInterface(type(IAdventure).interfaceId), "Invalid adventure contract");

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

        emit AdventureWhitelistUpdated(adventure, true);
    }

    /// @notice Removes an adventure from the whitelist
    function unwhitelistAdventure(address adventure) external onlyOwner {
        require(whitelistedAdventures[adventure].isWhitelisted, "Not whitelisted");
        
        uint128 itemPositionToDelete = whitelistedAdventures[adventure].arrayIndex;
        whitelistedAdventureList[itemPositionToDelete] = whitelistedAdventureList[whitelistedAdventureList.length - 1];
        whitelistedAdventures[whitelistedAdventureList[itemPositionToDelete]].arrayIndex = itemPositionToDelete;

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

        emit AdventureWhitelistUpdated(adventure, false);
    }    

    /// @notice Similar to {IERC721-setApprovalForAll}, but for special in-game adventures only
    function setAdventuresApprovedForAll(address operator, bool approved) public {
        _setAdventuresApprovedForAll(_msgSender(), 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];
    }    

    /// @dev Approve `operator` to operate on all of `owner` tokens for special in-game adventures only
    function _setAdventuresApprovedForAll(address tokenOwner, address operator, bool approved) internal {
        require(tokenOwner != operator, "approve to caller");
        _operatorAdventureApprovals[tokenOwner][operator] = approved;
        emit AdventureApprovalForAll(tokenOwner, operator, approved);
    }

    /// Modify to remove individual approval check
    /// @dev Returns whether `spender` is allowed to manage `tokenId`, for special in-game adventures only.
    function _isApprovedForAdventure(address spender, uint256 tokenId) internal view virtual returns (bool) {
        address tokenOwner = IERC721(address(this)).ownerOf(tokenId);
        return (areAdventuresApprovedForAll(tokenOwner, spender));
    }
}

File 7 of 19 : 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 8 of 19 : Quest.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

struct Quest {
    bool isActive;
    uint32 questId;
    uint64 startTimestamp;
    uint32 arrayIndex;
}

File 9 of 19 : 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 10 of 19 : IAdventure.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

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

/**
 * @dev Required interface of a contract that complies with the adventure/quest system that is permitted to interact with an AdventureERC721.
 */
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 11 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 12 of 19 : 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 13 of 19 : 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 14 of 19 : 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 15 of 19 : 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 16 of 19 : 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 17 of 19 : 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 18 of 19 : 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 19 of 19 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"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":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"genesisTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"MintHero","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"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":[],"name":"MAX_CONCURRENT_QUESTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ROYALTY_FEE_NUMERATOR","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UINT32","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"activeQuestList","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"activeQuestLookup","outputs":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint32","name":"questId","type":"uint32"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint32","name":"arrayIndex","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureSafeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"","type":"uint256"}],"name":"blockingQuestCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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"}],"name":"getBloodline","outputs":[{"internalType":"enum Bloodlines.Bloodline","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"getQuestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"getTimeOnQuest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"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":"address","name":"account","type":"address"}],"name":"isMinterWhitelisted","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":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"genesisTokenId","type":"uint256"}],"name":"mintHero","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","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"}]

60c06040526005608081905264173539b7b760d91b60a090815262000028916051919062000181565b503480156200003657600080fd5b5060408051808201825260118152704469676944616967616b754865726f657360781b6020808301918252835180850190945260048452634449484560e01b9084015281519192916200008c9160009162000181565b508051620000a290600190602084019062000181565b505050620000bf620000b96200012160201b60201c565b62000125565b6000620000cb62000177565b905060005b818110156200011957604f8054600181810183556000929092526000197fa2e8f972dc9f7d0b76177bb8be102e6bec069ee42c61080745e8825470e80c6c9091015501620000d0565b50506200025a565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60086107e75b5090565b8280546200018f906200021d565b90600052602060002090601f016020900481019282620001b35760008555620001fe565b82601f10620001ce57805160ff1916838001178555620001fe565b82800160010185558215620001fe579182015b82811115620001fe578251825591602001919060010190620001e1565b506200017d9291505b808211156200017d576000815560010162000207565b600181811c908216806200023257607f821691505b602082108114156200025457634e487b7160e01b600052602260045260246000fd5b50919050565b614806806200026a6000396000f3fe608060405234801561001057600080fd5b50600436106103625760003560e01c8063715018a6116101c8578063aca139f711610104578063e2989f4c116100a2578063e9b4f7aa1161007c578063e9b4f7aa1461099b578063ed1e0085146109ae578063f1e923c5146109d1578063f2fde38b146109e457600080fd5b8063e2989f4c14610939578063e370ab461461094c578063e985e9c51461095f57600080fd5b8063c05e2f44116100de578063c05e2f44146108f8578063c87b56dd1461090b578063d38f81191461091e578063d547cfb71461093157600080fd5b8063aca139f7146108ca578063b3bcea48146108dd578063b88d4fde146108e557600080fd5b80638da5cb5b116101715780639bb257ad1161014b5780639bb257ad1461082d5780639bc17ea414610840578063a22cb46514610853578063aa6cab5a1461086657600080fd5b80638da5cb5b146107de57806391623718146107ef57806395d89b411461082557600080fd5b80637f1a5ce1116101a25780637f1a5ce11461077c578063816a1501146107b85780638be18e57146107cb57600080fd5b8063715018a6146107415780637866ed6e146107495780637e10b35b1461076957600080fd5b8063301be740116102a257806355f804b3116102405780636352211e1161021a5780636352211e1461063c5780636c10315d1461064f578063703fa9291461067b57806370a082311461072e57600080fd5b806355f804b3146105fb5780635d3e3bad1461060e57806360bbcbdc1461061657600080fd5b806342842e0e1161027c57806342842e0e1461059a5780634e02c078146105ad57806351dadc28146105c057806353401df9146105e857600080fd5b8063301be7401461054557806332cb6b0c146105715780633a9d43d71461057a57600080fd5b8063095ea7b31161030f57806311ad4081116102e957806311ad4081146104da57806323b872dd146104ed5780632a55205a146105005780632ebb386a1461053257600080fd5b8063095ea7b3146104105780630f3d911c14610423578063113405571461044357600080fd5b806306fdde031161034057806306fdde03146103bd578063070cba17146103d2578063081812fc146103e557600080fd5b806301ffc9a71461036757806302fa7c471461038f57806304901b93146103a4575b600080fd5b61037a610375366004614018565b6109f7565b60405190151581526020015b60405180910390f35b6103a261039d36600461404a565b610a08565b005b6103af63ffffffff81565b604051908152602001610386565b6103c5610ad3565b60405161038691906140ec565b6103a26103e03660046140ff565b610b65565b6103f86103f336600461411c565b610dbf565b6040516001600160a01b039091168152602001610386565b6103a261041e366004614135565b610de6565b610436610431366004614161565b610f18565b6040516103869190614186565b6104a36104513660046141ff565b600b60209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff610100820481169167ffffffffffffffff6501000000000082041691600160681b9091041684565b60408051941515855263ffffffff938416602086015267ffffffffffffffff90921691840191909152166060820152608001610386565b6103a26104e836600461424a565b611132565b6103a26104fb36600461426c565b6111eb565b61051361050e36600461424a565b611272565b604080516001600160a01b039093168352602083019190915201610386565b6103a2610540366004614161565b61132d565b61037a6105533660046140ff565b6001600160a01b031660009081526008602052604090205460ff1690565b6103af6107e681565b6103af61058836600461411c565b600c6020526000908152604090205481565b6103a26105a836600461426c565b611409565b6103a26105bb3660046142ad565b611424565b6105d36105ce3660046142ad565b611505565b60405163ffffffff9091168152602001610386565b6103a26105f636600461424a565b61155b565b6103a26106093660046142d4565b61160e565b6103af606481565b61061f6103e881565b6040516bffffffffffffffffffffffff9091168152602001610386565b6103f861064a36600461411c565b611654565b61037a61065d3660046140ff565b6001600160a01b031660009081526052602052604090205460ff1690565b6107116106893660046142ad565b6000928352600b602090815260408085206001600160a01b0394909416855292815282842063ffffffff92831685528152928290208251608081018452905460ff81161515808352610100820484169583019590955265010000000000810467ffffffffffffffff16938201849052600160681b900490911660609091018190529192909190565b604080519315158452602084019290925290820152606001610386565b6103af61073c3660046140ff565b6116b9565b6103a2611753565b61075c61075736600461411c565b611767565b604051610386919061435c565b6103a26107773660046140ff565b611805565b61037a61078a366004614384565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b6103af6107c63660046142ad565b611a33565b6103a26107d93660046142d4565b611acf565b6006546001600160a01b03166103f8565b6103af6107fd366004614161565b6000918252600a602090815260408084206001600160a01b0393909316845291905290205490565b6103c5611b15565b6103a261083b3660046140ff565b611b24565b6103a261084e36600461411c565b611bec565b6103a26108613660046143c0565b611ca2565b6108a26108743660046140ff565b60086020526000908152604090205460ff81169061010090046fffffffffffffffffffffffffffffffff1682565b6040805192151583526fffffffffffffffffffffffffffffffff909116602083015201610386565b6103a26108d836600461426c565b611cad565b6103c5611d70565b6103a26108f3366004614404565b611dfe565b6103a26109063660046143c0565b611e86565b6103c561091936600461411c565b611e91565b6103a261092c3660046144e4565b611f57565b6103c56121ee565b6103f861094736600461411c565b6121fb565b6103a261095a36600461426c565b612225565b61037a61096d366004614384565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103a26109a93660046140ff565b6122cd565b61037a6109bc3660046140ff565b60526020526000908152604090205460ff1681565b6103a26109df366004614161565b61238c565b6103a26109f23660046140ff565b612410565b6000610a028261249d565b92915050565b610a106124db565b6103e86bffffffffffffffffffffffff82161115610a755760405162461bcd60e51b815260206004820152601760248201527f45786365656473206d617820726f79616c74792066656500000000000000000060448201526064015b60405180910390fd5b610a7f8282612535565b604080516001600160a01b03841681526bffffffffffffffffffffffff831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff6091015b60405180910390a15050565b606060008054610ae290614519565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0e90614519565b8015610b5b5780601f10610b3057610100808354040283529160200191610b5b565b820191906000526020600020905b815481529060010190602001808311610b3e57829003601f168201915b5050505050905090565b610b6d6124db565b6001600160a01b03811660009081526008602052604090205460ff16610bd55760405162461bcd60e51b815260206004820152600f60248201527f4e6f742077686974656c697374656400000000000000000000000000000000006044820152606401610a6c565b6001600160a01b038116600090815260086020526040902054600780546101009092046fffffffffffffffffffffffffffffffff1691610c179060019061456a565b81548110610c2757610c27614581565b600091825260209091200154600780546001600160a01b03909216916fffffffffffffffffffffffffffffffff8416908110610c6557610c65614581565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600860006007846fffffffffffffffffffffffffffffffff1681548110610cbd57610cbd614581565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546fffffffffffffffffffffffffffffffff92909216610100027fffffffffffffffffffffffffffffff00000000000000000000000000000000ff9092169190911790556007805480610d3757610d37614597565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038416808352600882526040808420805470ffffffffffffffffffffffffffffffffff1916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b6000610dca8261264f565b506000908152600460205260409020546001600160a01b031690565b6000610df182611654565b9050806001600160a01b0316836001600160a01b03161415610e7b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a6c565b336001600160a01b0382161480610e975750610e97813361096d565b610f095760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610a6c565b610f1383836126b3565b505050565b6000828152600a602090815260408083206001600160a01b03851684529091529020546060908067ffffffffffffffff811115610f5757610f576143ee565b604051908082528060200260200182016040528015610fa957816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610f755790505b506000858152600a602090815260408083206001600160a01b038816845282528083208054825181850281018501909352808352949650929390929183018282801561104057602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116110035790505b5050505050905060005b82811015611129576000868152600b602090815260408083206001600160a01b03891684529091528120835190919084908490811061108b5761108b614581565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff811615158252610100810485169282019290925267ffffffffffffffff6501000000000083041692810192909252600160681b90049091166060820152845185908390811061110d5761110d614581565b602002602001018190525080611122906145ad565b905061104a565b50505092915050565b61113b33610553565b61117b5760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b611186335b83612721565b6111dc5760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b6111e78233836127e3565b5050565b6111f53382612cd2565b6112675760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a6c565b610f13838383612d50565b6000828152600e602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff169282019290925282916112f1575060408051808201909152600d546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090611315906bffffffffffffffffffffffff16876145c8565b61131f91906145fd565b915196919550909350505050565b80611350816001600160a01b031660009081526008602052604090205460ff1690565b1561139d5760405162461bcd60e51b815260206004820152601e60248201527f416476656e74757265206973207374696c6c2077686974656c697374656400006044820152606401610a6c565b336113a784611654565b6001600160a01b0316146113fd5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920746f6b656e206f776e6572206d61792065786974207175657374006044820152606401610a6c565b610f1383836000612f28565b610f1383838360405180602001604052806000815250611dfe565b81611447816001600160a01b031660009081526008602052604090205460ff1690565b156114945760405162461bcd60e51b815260206004820152601e60248201527f416476656e74757265206973207374696c6c2077686974656c697374656400006044820152606401610a6c565b3361149e85611654565b6001600160a01b0316146114f45760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920746f6b656e206f776e6572206d61792065786974207175657374006044820152606401610a6c565b6114ff8484846127e3565b50505050565b600a602052826000526040600020602052816000526040600020818154811061152d57600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b61156433610553565b6115a45760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b6115ad33611180565b6116035760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b6111e7823383613214565b6116166124db565b61162260508383613f48565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f68282604051610ac7929190614611565b6000818152600260205260408120546001600160a01b031680610a025760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a6c565b60006001600160a01b0382166117375760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610a6c565b506001600160a01b031660009081526003602052604090205490565b61175b6124db565b61176560006136d5565b565b6000818152600260205260408120546001600160a01b03166117cb5760405162461bcd60e51b815260206004820152601160248201527f4e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006044820152606401610a6c565b600f6117d860018461456a565b6107e681106117e9576117e9614581565b602081049091015460ff601f9092166101000a90041692915050565b61180d6124db565b6001600160a01b03811660009081526008602052604090205460ff16156118765760405162461bcd60e51b815260206004820152601360248201527f416c72656164792077686974656c6973746564000000000000000000000000006044820152606401610a6c565b6040516301ffc9a760e01b81527f977e0c1c0000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156118d557600080fd5b505afa1580156118e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190d9190614640565b6119595760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616476656e7475726520636f6e74726163740000000000006044820152606401610a6c565b6001600160a01b038116600081815260086020526040808220805460ff19811660019081178355600780546fffffffffffffffffffffffffffffffff166101000270ffffffffffffffffffffffffffffffffff199093169290921781179092558054808301825593527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68890920180546001600160a01b03191684179055517fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e91611a2891901515815260200190565b60405180910390a250565b6000838152600b602090815260408083206001600160a01b0386168452825280832063ffffffff85811685529083528184208251608081018452905460ff81161515808352610100820484169583019590955265010000000000810467ffffffffffffffff16938201849052600160681b900490911660609091015281611abb576000611ac5565b611ac5814261456a565b9695505050505050565b611ad76124db565b611ae360518383613f48565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba08282604051610ac7929190614611565b606060018054610ae290614519565b611b2c6124db565b6001600160a01b03811660009081526052602052604090205460ff1615611b955760405162461bcd60e51b815260206004820152601360248201527f416c72656164792077686974656c6973746564000000000000000000000000006044820152606401610a6c565b6001600160a01b038116600081815260526020908152604091829020805460ff1916600190811790915591519182527f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa67689101611a28565b611bf533610553565b611c355760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b611c40335b82612721565b611c965760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b611c9f81613727565b50565b6111e73383836137ce565b611cb633610553565b611cf65760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b611cff33611c3a565b611d555760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b610f138383836040518060200160405280600081525061389e565b60518054611d7d90614519565b80601f0160208091040260200160405190810160405280929190818152602001828054611da990614519565b8015611df65780601f10611dcb57610100808354040283529160200191611df6565b820191906000526020600020905b815481529060010190602001808311611dd957829003601f168201915b505050505081565b611e083383612cd2565b611e7a5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a6c565b6114ff8484848461389e565b6111e7338383613927565b6000818152600260205260409020546060906001600160a01b0316611ef85760405162461bcd60e51b815260206004820152601160248201527f4e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006044820152606401610a6c565b6000611f026139ee565b90506000815111611f225760405180602001604052806000815250611f50565b80611f2c846139fd565b6051604051602001611f409392919061465d565b6040516020818303038152906040525b9392505050565b611f603361065d565b611fac5760405162461bcd60e51b815260206004820152600c60248201527f4e6f742061206d696e74657200000000000000000000000000000000000000006044820152606401610a6c565b60008211611ffc5760405162461bcd60e51b815260206004820152601560248201527f546f6b656e206964206f7574206f662072616e676500000000000000000000006044820152606401610a6c565b6107e682111561204e5760405162461bcd60e51b815260206004820152601560248201527f546f6b656e206964206f7574206f662072616e676500000000000000000000006044820152606401610a6c565b6107e68111156120a05760405162461bcd60e51b815260206004820152601d60248201527f47656e6573697320746f6b656e206964206f7574206f662072616e67650000006044820152606401610a6c565b604f805461010084049160ff85169160009190849081106120c3576120c3614581565b9060005260206000200154905060018282901c166001146121265760405162461bcd60e51b815260206004820152601460248201527f546f6b656e20616c7265616479206d696e7465640000000000000000000000006044820152606401610a6c565b816001901b198116604f848154811061214157612141614581565b6000918252602090912001556121578585613b2f565b600f600187036107e6811061216e5761216e614581565b602091828204019190066101000a81548160ff0219169083600381111561219757612197614346565b02179055508385876001600160a01b03167f5ab460a29d758cdef9230bd7aa3daa329c872d1bd16b6660246c29f5eb7a2129426040516121d991815260200190565b60405180910390a4505050610f138383613b55565b60508054611d7d90614519565b6007818154811061220b57600080fd5b6000918252602090912001546001600160a01b0316905081565b61222e33610553565b61226e5760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b61227733611c3a565b6112675760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b6122d56124db565b6001600160a01b03811660009081526052602052604090205460ff1661233d5760405162461bcd60e51b815260206004820152600f60248201527f4e6f742077686974656c697374656400000000000000000000000000000000006044820152606401610a6c565b6001600160a01b0381166000818152605260209081526040808320805460ff19169055519182527f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa67689101611a28565b6123946124db565b806123b7816001600160a01b031660009081526008602052604090205460ff1690565b156124045760405162461bcd60e51b815260206004820152601e60248201527f416476656e74757265206973207374696c6c2077686974656c697374656400006044820152606401610a6c565b610f1383836001612f28565b6124186124db565b6001600160a01b0381166124945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a6c565b611c9f816136d5565b60006001600160e01b031982167f2a55205a000000000000000000000000000000000000000000000000000000001480610a025750610a0282613ca3565b6006546001600160a01b031633146117655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a6c565b6127106bffffffffffffffffffffffff821611156125bb5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610a6c565b6001600160a01b0382166126115760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610a6c565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600d55565b6000818152600260205260409020546001600160a01b0316611c9f5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a6c565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906126e882611654565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810182905260009081903090636352211e9060240160206040518083038186803b15801561277657600080fd5b505afa15801561278a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ae9190614721565b6001600160a01b0380821660009081526009602090815260408083209389168352929052205490915060ff165b949350505050565b63ffffffff8111156128375760405162461bcd60e51b815260206004820152601460248201527f71756573744964206f7574206f662072616e67650000000000000000000000006044820152606401610a6c565b6000838152600b602090815260408083206001600160a01b0386168452825280832063ffffffff8581168552908352928190208151608081018352905460ff81161515808352610100820486169483019490945265010000000000810467ffffffffffffffff16928201839052600160681b900490931660609093018390529091826129055760405162461bcd60e51b815260206004820152600c60248201527f4e6f74206f6e20717565737400000000000000000000000000000000000000006044820152606401610a6c565b6000868152600a602090815260408083206001600160a01b03891684529091528120548591906129379060019061456a565b6000898152600a602090815260408083206001600160a01b038c16845290915290208054919250908290811061296f5761296f614581565b600091825260208083206008830401548b8452600a825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff169190859081106129c5576129c5614581565b600091825260208083206008830401805460079093166004026101000a63ffffffff818102199094169590931692909202939093179055898152600b825260408082206001600160a01b038b168084529084528183208c8452600a8552828420918452935281208054869392919085908110612a4357612a43614581565b6000918252602080832060088304015463ffffffff60046007909416939093026101000a9004821684528381019490945260409283018220805495909116600160681b027fffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffff909516949094179093558a8352600a82528083206001600160a01b038b1684529091529020805480612adc57612adc614597565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a8152600b835260408082206001600160a01b038c16835284528082209286168252919092528120805470ffffffffffffffffffffffffffffffffff19169055612b5a89611654565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a600080604051612bb89392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612bf957600080fd5b505afa158015612c0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c319190614640565b15612c57576000898152600c602052604081208054909190612c529061473e565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b158015612caf57600080fd5b505af1158015612cc3573d6000803e3d6000fd5b50505050505050505050505050565b600080612cde83611654565b9050806001600160a01b0316846001600160a01b03161480612d2557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806127db5750836001600160a01b0316612d3e84610dbf565b6001600160a01b031614949350505050565b826001600160a01b0316612d6382611654565b6001600160a01b031614612ddf5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610a6c565b6001600160a01b038216612e5a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a6c565b612e65838383613ce1565b612e706000826126b3565b6001600160a01b0383166000908152600360205260408120805460019290612e9990849061456a565b90915550506001600160a01b0382166000908152600360205260408120805460019290612ec7908490614755565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000612f3384611654565b6000858152600a602090815260408083206001600160a01b038816845290915281205491925050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612f9357600080fd5b505afa158015612fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fcb9190614640565b15612ff4576000858152600c602052604081208054839290612fee90849061456a565b90915550505b60005b818110156131e1576000868152600a602090815260408083206001600160a01b0389168452909152812080548390811061303357613033614581565b600091825260208083206008830401548a8452600b825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff81161515825295860482168188015265010000000000860467ffffffffffffffff16818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a46000898152600b602090815260408083206001600160a01b038c811680865291845282852063ffffffff8916865290935292819020805470ffffffffffffffffffffffffffffffffff1916905551636d4229c960e01b81529088166004820152602481018b90526044810185905260648101839052636d4229c990608401600060405180830381600087803b1580156131b557600080fd5b505af11580156131c9573d6000803e3d6000fd5b50505050505050806131da906145ad565b9050612ff7565b506000858152600a602090815260408083206001600160a01b0388168452909152812061320d91613fcc565b5050505050565b63ffffffff8111156132685760405162461bcd60e51b815260206004820152601460248201527f71756573744964206f7574206f662072616e67650000000000000000000000006044820152606401610a6c565b6000838152600b602090815260408083206001600160a01b0386168452825280832063ffffffff8581168552908352928190208151608081018352905460ff8116158015808452610100830487169584019590955265010000000000820467ffffffffffffffff1693830193909352600160681b9004909316606090930192909252906133375760405162461bcd60e51b815260206004820152601060248201527f416c7265616479206f6e207175657374000000000000000000000000000000006044820152606401610a6c565b6000848152600a602090815260408083206001600160a01b0387168452909152902054606481106133aa5760405162461bcd60e51b815260206004820152601660248201527f546f6f206d616e792061637469766520717565737473000000000000000000006044820152606401610a6c565b6000839050600a60008781526020019081526020016000206000866001600160a01b03166001600160a01b031681526020019081526020016000208190806001815401808255809150506001900390600052602060002090600891828204019190066004029091909190916101000a81548163ffffffff021916908363ffffffff16021790555060405180608001604052806001151581526020018263ffffffff1681526020014267ffffffffffffffff1681526020018363ffffffff16815250600b60008881526020019081526020016000206000876001600160a01b03166001600160a01b0316815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160056101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550606082015181600001600d6101000a81548163ffffffff021916908363ffffffff160217905550905050600061356987611654565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156135f757600080fd5b505afa15801561360b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061362f9190614640565b1561364a576000878152600c60205260409020805460010190555b6040517f688a37410000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b1580156136b457600080fd5b505af11580156136c8573d6000803e3d6000fd5b5050505050505050505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061373282611654565b905061374081600084613ce1565b61374b6000836126b3565b6001600160a01b038116600090815260036020526040812080546001929061377490849061456a565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031614156138305760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a6c565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a3505050565b6138a9848484612d50565b6138b584848484613d63565b6114ff5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a6c565b816001600160a01b0316836001600160a01b031614156139895760405162461bcd60e51b815260206004820152601160248201527f617070726f766520746f2063616c6c65720000000000000000000000000000006044820152606401610a6c565b6001600160a01b03838116600081815260096020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c0569101613891565b606060508054610ae290614519565b606081613a3d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613a675780613a51816145ad565b9150613a609050600a836145fd565b9150613a41565b60008167ffffffffffffffff811115613a8257613a826143ee565b6040519080825280601f01601f191660200182016040528015613aac576020820181803683370190505b5090505b84156127db57613ac160018361456a565b9150613ace600a8661476d565b613ad9906030614755565b60f81b818381518110613aee57613aee614581565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613b28600a866145fd565b9450613ab0565b600081613b3e57506001610a02565b818314613b4d57506002610a02565b506003610a02565b6001600160a01b038216613bab5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a6c565b6000818152600260205260409020546001600160a01b031615613c105760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a6c565b613c1c60008383613ce1565b6001600160a01b0382166000908152600360205260408120805460019290613c45908490614755565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b031982167ff9f7ab41000000000000000000000000000000000000000000000000000000001480610a025750610a0282613ec6565b6000818152600c602052604090205415610f135760405162461bcd60e51b815260206004820152602760248201527f416e206163746976652071756573742069732070726576656e74696e6720747260448201527f616e7366657273000000000000000000000000000000000000000000000000006064820152608401610a6c565b60006001600160a01b0384163b15613ebb57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613da7903390899088908890600401614781565b602060405180830381600087803b158015613dc157600080fd5b505af1925050508015613df1575060408051601f3d908101601f19168201909252613dee918101906147b3565b60015b613ea1573d808015613e1f576040519150601f19603f3d011682016040523d82523d6000602084013e613e24565b606091505b508051613e995760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a6c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127db565b506001949350505050565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480613f2957506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a0257506301ffc9a760e01b6001600160e01b0319831614610a02565b828054613f5490614519565b90600052602060002090601f016020900481019282613f765760008555613fbc565b82601f10613f8f5782800160ff19823516178555613fbc565b82800160010185558215613fbc579182015b82811115613fbc578235825591602001919060010190613fa1565b50613fc8929150613fed565b5090565b508054600082556007016008900490600052602060002090810190611c9f91905b5b80821115613fc85760008155600101613fee565b6001600160e01b031981168114611c9f57600080fd5b60006020828403121561402a57600080fd5b8135611f5081614002565b6001600160a01b0381168114611c9f57600080fd5b6000806040838503121561405d57600080fd5b823561406881614035565b915060208301356bffffffffffffffffffffffff8116811461408957600080fd5b809150509250929050565b60005b838110156140af578181015183820152602001614097565b838111156114ff5750506000910152565b600081518084526140d8816020860160208601614094565b601f01601f19169290920160200192915050565b602081526000611f5060208301846140c0565b60006020828403121561411157600080fd5b8135611f5081614035565b60006020828403121561412e57600080fd5b5035919050565b6000806040838503121561414857600080fd5b823561415381614035565b946020939093013593505050565b6000806040838503121561417457600080fd5b82359150602083013561408981614035565b602080825282518282018190526000919060409081850190868401855b828110156141f25781518051151585528681015163ffffffff908116888701528682015167ffffffffffffffff16878701526060918201511690850152608090930192908501906001016141a3565b5091979650505050505050565b60008060006060848603121561421457600080fd5b83359250602084013561422681614035565b9150604084013563ffffffff8116811461423f57600080fd5b809150509250925092565b6000806040838503121561425d57600080fd5b50508035926020909101359150565b60008060006060848603121561428157600080fd5b833561428c81614035565b9250602084013561429c81614035565b929592945050506040919091013590565b6000806000606084860312156142c257600080fd5b83359250602084013561429c81614035565b600080602083850312156142e757600080fd5b823567ffffffffffffffff808211156142ff57600080fd5b818501915085601f83011261431357600080fd5b81358181111561432257600080fd5b86602082850101111561433457600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052602160045260246000fd5b602081016004831061437e57634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561439757600080fd5b82356143a281614035565b9150602083013561408981614035565b8015158114611c9f57600080fd5b600080604083850312156143d357600080fd5b82356143de81614035565b91506020830135614089816143b2565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561441a57600080fd5b843561442581614035565b9350602085013561443581614035565b925060408501359150606085013567ffffffffffffffff8082111561445957600080fd5b818701915087601f83011261446d57600080fd5b81358181111561447f5761447f6143ee565b604051601f8201601f19908116603f011681019083821181831017156144a7576144a76143ee565b816040528281528a60208487010111156144c057600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806000606084860312156144f957600080fd5b833561450481614035565b95602085013595506040909401359392505050565b600181811c9082168061452d57607f821691505b6020821081141561454e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561457c5761457c614554565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006000198214156145c1576145c1614554565b5060010190565b60008160001904831182151516156145e2576145e2614554565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261460c5761460c6145e7565b500490565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561465257600080fd5b8151611f50816143b2565b6000845160206146708285838a01614094565b8551918401916146838184848a01614094565b8554920191600090600181811c90808316806146a057607f831692505b8583108114156146be57634e487b7160e01b85526022600452602485fd5b8080156146d257600181146146e357614710565b60ff19851688528388019550614710565b60008b81526020902060005b858110156147085781548a8201529084019088016146ef565b505083880195505b50939b9a5050505050505050505050565b60006020828403121561473357600080fd5b8151611f5081614035565b60008161474d5761474d614554565b506000190190565b6000821982111561476857614768614554565b500190565b60008261477c5761477c6145e7565b500690565b60006001600160a01b03808716835280861660208401525083604083015260806060830152611ac560808301846140c0565b6000602082840312156147c557600080fd5b8151611f508161400256fea264697066735822122046866779f3d04bce9290aa2de65f3ca32dce9a7f17a8dee70208e2ba9a5a5cb964736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103625760003560e01c8063715018a6116101c8578063aca139f711610104578063e2989f4c116100a2578063e9b4f7aa1161007c578063e9b4f7aa1461099b578063ed1e0085146109ae578063f1e923c5146109d1578063f2fde38b146109e457600080fd5b8063e2989f4c14610939578063e370ab461461094c578063e985e9c51461095f57600080fd5b8063c05e2f44116100de578063c05e2f44146108f8578063c87b56dd1461090b578063d38f81191461091e578063d547cfb71461093157600080fd5b8063aca139f7146108ca578063b3bcea48146108dd578063b88d4fde146108e557600080fd5b80638da5cb5b116101715780639bb257ad1161014b5780639bb257ad1461082d5780639bc17ea414610840578063a22cb46514610853578063aa6cab5a1461086657600080fd5b80638da5cb5b146107de57806391623718146107ef57806395d89b411461082557600080fd5b80637f1a5ce1116101a25780637f1a5ce11461077c578063816a1501146107b85780638be18e57146107cb57600080fd5b8063715018a6146107415780637866ed6e146107495780637e10b35b1461076957600080fd5b8063301be740116102a257806355f804b3116102405780636352211e1161021a5780636352211e1461063c5780636c10315d1461064f578063703fa9291461067b57806370a082311461072e57600080fd5b806355f804b3146105fb5780635d3e3bad1461060e57806360bbcbdc1461061657600080fd5b806342842e0e1161027c57806342842e0e1461059a5780634e02c078146105ad57806351dadc28146105c057806353401df9146105e857600080fd5b8063301be7401461054557806332cb6b0c146105715780633a9d43d71461057a57600080fd5b8063095ea7b31161030f57806311ad4081116102e957806311ad4081146104da57806323b872dd146104ed5780632a55205a146105005780632ebb386a1461053257600080fd5b8063095ea7b3146104105780630f3d911c14610423578063113405571461044357600080fd5b806306fdde031161034057806306fdde03146103bd578063070cba17146103d2578063081812fc146103e557600080fd5b806301ffc9a71461036757806302fa7c471461038f57806304901b93146103a4575b600080fd5b61037a610375366004614018565b6109f7565b60405190151581526020015b60405180910390f35b6103a261039d36600461404a565b610a08565b005b6103af63ffffffff81565b604051908152602001610386565b6103c5610ad3565b60405161038691906140ec565b6103a26103e03660046140ff565b610b65565b6103f86103f336600461411c565b610dbf565b6040516001600160a01b039091168152602001610386565b6103a261041e366004614135565b610de6565b610436610431366004614161565b610f18565b6040516103869190614186565b6104a36104513660046141ff565b600b60209081526000938452604080852082529284528284209052825290205460ff81169063ffffffff610100820481169167ffffffffffffffff6501000000000082041691600160681b9091041684565b60408051941515855263ffffffff938416602086015267ffffffffffffffff90921691840191909152166060820152608001610386565b6103a26104e836600461424a565b611132565b6103a26104fb36600461426c565b6111eb565b61051361050e36600461424a565b611272565b604080516001600160a01b039093168352602083019190915201610386565b6103a2610540366004614161565b61132d565b61037a6105533660046140ff565b6001600160a01b031660009081526008602052604090205460ff1690565b6103af6107e681565b6103af61058836600461411c565b600c6020526000908152604090205481565b6103a26105a836600461426c565b611409565b6103a26105bb3660046142ad565b611424565b6105d36105ce3660046142ad565b611505565b60405163ffffffff9091168152602001610386565b6103a26105f636600461424a565b61155b565b6103a26106093660046142d4565b61160e565b6103af606481565b61061f6103e881565b6040516bffffffffffffffffffffffff9091168152602001610386565b6103f861064a36600461411c565b611654565b61037a61065d3660046140ff565b6001600160a01b031660009081526052602052604090205460ff1690565b6107116106893660046142ad565b6000928352600b602090815260408085206001600160a01b0394909416855292815282842063ffffffff92831685528152928290208251608081018452905460ff81161515808352610100820484169583019590955265010000000000810467ffffffffffffffff16938201849052600160681b900490911660609091018190529192909190565b604080519315158452602084019290925290820152606001610386565b6103af61073c3660046140ff565b6116b9565b6103a2611753565b61075c61075736600461411c565b611767565b604051610386919061435c565b6103a26107773660046140ff565b611805565b61037a61078a366004614384565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205460ff1690565b6103af6107c63660046142ad565b611a33565b6103a26107d93660046142d4565b611acf565b6006546001600160a01b03166103f8565b6103af6107fd366004614161565b6000918252600a602090815260408084206001600160a01b0393909316845291905290205490565b6103c5611b15565b6103a261083b3660046140ff565b611b24565b6103a261084e36600461411c565b611bec565b6103a26108613660046143c0565b611ca2565b6108a26108743660046140ff565b60086020526000908152604090205460ff81169061010090046fffffffffffffffffffffffffffffffff1682565b6040805192151583526fffffffffffffffffffffffffffffffff909116602083015201610386565b6103a26108d836600461426c565b611cad565b6103c5611d70565b6103a26108f3366004614404565b611dfe565b6103a26109063660046143c0565b611e86565b6103c561091936600461411c565b611e91565b6103a261092c3660046144e4565b611f57565b6103c56121ee565b6103f861094736600461411c565b6121fb565b6103a261095a36600461426c565b612225565b61037a61096d366004614384565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6103a26109a93660046140ff565b6122cd565b61037a6109bc3660046140ff565b60526020526000908152604090205460ff1681565b6103a26109df366004614161565b61238c565b6103a26109f23660046140ff565b612410565b6000610a028261249d565b92915050565b610a106124db565b6103e86bffffffffffffffffffffffff82161115610a755760405162461bcd60e51b815260206004820152601760248201527f45786365656473206d617820726f79616c74792066656500000000000000000060448201526064015b60405180910390fd5b610a7f8282612535565b604080516001600160a01b03841681526bffffffffffffffffffffffff831660208201527f23813f5ad446622633cb58c75ceef768a2111751b0f30477a63e06fcaedcff6091015b60405180910390a15050565b606060008054610ae290614519565b80601f0160208091040260200160405190810160405280929190818152602001828054610b0e90614519565b8015610b5b5780601f10610b3057610100808354040283529160200191610b5b565b820191906000526020600020905b815481529060010190602001808311610b3e57829003601f168201915b5050505050905090565b610b6d6124db565b6001600160a01b03811660009081526008602052604090205460ff16610bd55760405162461bcd60e51b815260206004820152600f60248201527f4e6f742077686974656c697374656400000000000000000000000000000000006044820152606401610a6c565b6001600160a01b038116600090815260086020526040902054600780546101009092046fffffffffffffffffffffffffffffffff1691610c179060019061456a565b81548110610c2757610c27614581565b600091825260209091200154600780546001600160a01b03909216916fffffffffffffffffffffffffffffffff8416908110610c6557610c65614581565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600860006007846fffffffffffffffffffffffffffffffff1681548110610cbd57610cbd614581565b60009182526020808320909101546001600160a01b03168352820192909252604001902080546fffffffffffffffffffffffffffffffff92909216610100027fffffffffffffffffffffffffffffff00000000000000000000000000000000ff9092169190911790556007805480610d3757610d37614597565b60008281526020808220600019908401810180546001600160a01b03191690559092019092556001600160a01b038416808352600882526040808420805470ffffffffffffffffffffffffffffffffff1916905551928352917fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e910160405180910390a25050565b6000610dca8261264f565b506000908152600460205260409020546001600160a01b031690565b6000610df182611654565b9050806001600160a01b0316836001600160a01b03161415610e7b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610a6c565b336001600160a01b0382161480610e975750610e97813361096d565b610f095760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c00006064820152608401610a6c565b610f1383836126b3565b505050565b6000828152600a602090815260408083206001600160a01b03851684529091529020546060908067ffffffffffffffff811115610f5757610f576143ee565b604051908082528060200260200182016040528015610fa957816020015b604080516080810182526000808252602080830182905292820181905260608201528252600019909201910181610f755790505b506000858152600a602090815260408083206001600160a01b038816845282528083208054825181850281018501909352808352949650929390929183018282801561104057602002820191906000526020600020906000905b82829054906101000a900463ffffffff1663ffffffff16815260200190600401906020826003010492830192600103820291508084116110035790505b5050505050905060005b82811015611129576000868152600b602090815260408083206001600160a01b03891684529091528120835190919084908490811061108b5761108b614581565b60209081029190910181015163ffffffff90811683528282019390935260409182016000208251608081018452905460ff811615158252610100810485169282019290925267ffffffffffffffff6501000000000083041692810192909252600160681b90049091166060820152845185908390811061110d5761110d614581565b602002602001018190525080611122906145ad565b905061104a565b50505092915050565b61113b33610553565b61117b5760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b611186335b83612721565b6111dc5760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b6111e78233836127e3565b5050565b6111f53382612cd2565b6112675760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a6c565b610f13838383612d50565b6000828152600e602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff169282019290925282916112f1575060408051808201909152600d546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090611315906bffffffffffffffffffffffff16876145c8565b61131f91906145fd565b915196919550909350505050565b80611350816001600160a01b031660009081526008602052604090205460ff1690565b1561139d5760405162461bcd60e51b815260206004820152601e60248201527f416476656e74757265206973207374696c6c2077686974656c697374656400006044820152606401610a6c565b336113a784611654565b6001600160a01b0316146113fd5760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920746f6b656e206f776e6572206d61792065786974207175657374006044820152606401610a6c565b610f1383836000612f28565b610f1383838360405180602001604052806000815250611dfe565b81611447816001600160a01b031660009081526008602052604090205460ff1690565b156114945760405162461bcd60e51b815260206004820152601e60248201527f416476656e74757265206973207374696c6c2077686974656c697374656400006044820152606401610a6c565b3361149e85611654565b6001600160a01b0316146114f45760405162461bcd60e51b815260206004820152601f60248201527f4f6e6c7920746f6b656e206f776e6572206d61792065786974207175657374006044820152606401610a6c565b6114ff8484846127e3565b50505050565b600a602052826000526040600020602052816000526040600020818154811061152d57600080fd5b906000526020600020906008918282040191900660040292509250509054906101000a900463ffffffff1681565b61156433610553565b6115a45760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b6115ad33611180565b6116035760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b6111e7823383613214565b6116166124db565b61162260508383613f48565b507ff9c7803e94e0d3c02900d8a90893a6d5e90dd04d32a4cfe825520f82bf9f32f68282604051610ac7929190614611565b6000818152600260205260408120546001600160a01b031680610a025760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a6c565b60006001600160a01b0382166117375760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f74206120766160448201527f6c6964206f776e657200000000000000000000000000000000000000000000006064820152608401610a6c565b506001600160a01b031660009081526003602052604090205490565b61175b6124db565b61176560006136d5565b565b6000818152600260205260408120546001600160a01b03166117cb5760405162461bcd60e51b815260206004820152601160248201527f4e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006044820152606401610a6c565b600f6117d860018461456a565b6107e681106117e9576117e9614581565b602081049091015460ff601f9092166101000a90041692915050565b61180d6124db565b6001600160a01b03811660009081526008602052604090205460ff16156118765760405162461bcd60e51b815260206004820152601360248201527f416c72656164792077686974656c6973746564000000000000000000000000006044820152606401610a6c565b6040516301ffc9a760e01b81527f977e0c1c0000000000000000000000000000000000000000000000000000000060048201526001600160a01b038216906301ffc9a79060240160206040518083038186803b1580156118d557600080fd5b505afa1580156118e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190d9190614640565b6119595760405162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616476656e7475726520636f6e74726163740000000000006044820152606401610a6c565b6001600160a01b038116600081815260086020526040808220805460ff19811660019081178355600780546fffffffffffffffffffffffffffffffff166101000270ffffffffffffffffffffffffffffffffff199093169290921781179092558054808301825593527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68890920180546001600160a01b03191684179055517fe152843d7324c2cb58e95865f2b78d38f2dab6ce9eadf09438ec2c41e78c705e91611a2891901515815260200190565b60405180910390a250565b6000838152600b602090815260408083206001600160a01b0386168452825280832063ffffffff85811685529083528184208251608081018452905460ff81161515808352610100820484169583019590955265010000000000810467ffffffffffffffff16938201849052600160681b900490911660609091015281611abb576000611ac5565b611ac5814261456a565b9695505050505050565b611ad76124db565b611ae360518383613f48565b507f65ccd57f8a46e7a6cfc4d214d84094e8ba5561ab50fd328f26e4c44052ffeba08282604051610ac7929190614611565b606060018054610ae290614519565b611b2c6124db565b6001600160a01b03811660009081526052602052604090205460ff1615611b955760405162461bcd60e51b815260206004820152601360248201527f416c72656164792077686974656c6973746564000000000000000000000000006044820152606401610a6c565b6001600160a01b038116600081815260526020908152604091829020805460ff1916600190811790915591519182527f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa67689101611a28565b611bf533610553565b611c355760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b611c40335b82612721565b611c965760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b611c9f81613727565b50565b6111e73383836137ce565b611cb633610553565b611cf65760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b611cff33611c3a565b611d555760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b610f138383836040518060200160405280600081525061389e565b60518054611d7d90614519565b80601f0160208091040260200160405190810160405280929190818152602001828054611da990614519565b8015611df65780601f10611dcb57610100808354040283529160200191611df6565b820191906000526020600020905b815481529060010190602001808311611dd957829003601f168201915b505050505081565b611e083383612cd2565b611e7a5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201527f72206e6f7220617070726f7665640000000000000000000000000000000000006064820152608401610a6c565b6114ff8484848461389e565b6111e7338383613927565b6000818152600260205260409020546060906001600160a01b0316611ef85760405162461bcd60e51b815260206004820152601160248201527f4e6f6e6578697374656e7420746f6b656e0000000000000000000000000000006044820152606401610a6c565b6000611f026139ee565b90506000815111611f225760405180602001604052806000815250611f50565b80611f2c846139fd565b6051604051602001611f409392919061465d565b6040516020818303038152906040525b9392505050565b611f603361065d565b611fac5760405162461bcd60e51b815260206004820152600c60248201527f4e6f742061206d696e74657200000000000000000000000000000000000000006044820152606401610a6c565b60008211611ffc5760405162461bcd60e51b815260206004820152601560248201527f546f6b656e206964206f7574206f662072616e676500000000000000000000006044820152606401610a6c565b6107e682111561204e5760405162461bcd60e51b815260206004820152601560248201527f546f6b656e206964206f7574206f662072616e676500000000000000000000006044820152606401610a6c565b6107e68111156120a05760405162461bcd60e51b815260206004820152601d60248201527f47656e6573697320746f6b656e206964206f7574206f662072616e67650000006044820152606401610a6c565b604f805461010084049160ff85169160009190849081106120c3576120c3614581565b9060005260206000200154905060018282901c166001146121265760405162461bcd60e51b815260206004820152601460248201527f546f6b656e20616c7265616479206d696e7465640000000000000000000000006044820152606401610a6c565b816001901b198116604f848154811061214157612141614581565b6000918252602090912001556121578585613b2f565b600f600187036107e6811061216e5761216e614581565b602091828204019190066101000a81548160ff0219169083600381111561219757612197614346565b02179055508385876001600160a01b03167f5ab460a29d758cdef9230bd7aa3daa329c872d1bd16b6660246c29f5eb7a2129426040516121d991815260200190565b60405180910390a4505050610f138383613b55565b60508054611d7d90614519565b6007818154811061220b57600080fd5b6000918252602090912001546001600160a01b0316905081565b61222e33610553565b61226e5760405162461bcd60e51b81526020600482015260116024820152702737ba1030b71030b23b32b73a3ab9329760791b6044820152606401610a6c565b61227733611c3a565b6112675760405162461bcd60e51b815260206004820152602160248201527f43616c6c6572206e6f7420617070726f76656420666f7220616476656e7475726044820152606560f81b6064820152608401610a6c565b6122d56124db565b6001600160a01b03811660009081526052602052604090205460ff1661233d5760405162461bcd60e51b815260206004820152600f60248201527f4e6f742077686974656c697374656400000000000000000000000000000000006044820152606401610a6c565b6001600160a01b0381166000818152605260209081526040808320805460ff19169055519182527f04eca792f863d6d8cd8aba48f8ec67d4db239c7a3cb7ea94daffa825dafa67689101611a28565b6123946124db565b806123b7816001600160a01b031660009081526008602052604090205460ff1690565b156124045760405162461bcd60e51b815260206004820152601e60248201527f416476656e74757265206973207374696c6c2077686974656c697374656400006044820152606401610a6c565b610f1383836001612f28565b6124186124db565b6001600160a01b0381166124945760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a6c565b611c9f816136d5565b60006001600160e01b031982167f2a55205a000000000000000000000000000000000000000000000000000000001480610a025750610a0282613ca3565b6006546001600160a01b031633146117655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a6c565b6127106bffffffffffffffffffffffff821611156125bb5760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152608401610a6c565b6001600160a01b0382166126115760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610a6c565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217600d55565b6000818152600260205260409020546001600160a01b0316611c9f5760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a6c565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906126e882611654565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6040517f6352211e0000000000000000000000000000000000000000000000000000000081526004810182905260009081903090636352211e9060240160206040518083038186803b15801561277657600080fd5b505afa15801561278a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127ae9190614721565b6001600160a01b0380821660009081526009602090815260408083209389168352929052205490915060ff165b949350505050565b63ffffffff8111156128375760405162461bcd60e51b815260206004820152601460248201527f71756573744964206f7574206f662072616e67650000000000000000000000006044820152606401610a6c565b6000838152600b602090815260408083206001600160a01b0386168452825280832063ffffffff8581168552908352928190208151608081018352905460ff81161515808352610100820486169483019490945265010000000000810467ffffffffffffffff16928201839052600160681b900490931660609093018390529091826129055760405162461bcd60e51b815260206004820152600c60248201527f4e6f74206f6e20717565737400000000000000000000000000000000000000006044820152606401610a6c565b6000868152600a602090815260408083206001600160a01b03891684529091528120548591906129379060019061456a565b6000898152600a602090815260408083206001600160a01b038c16845290915290208054919250908290811061296f5761296f614581565b600091825260208083206008830401548b8452600a825260408085206001600160a01b038d1686529092529220805460079092166004026101000a90920463ffffffff169190859081106129c5576129c5614581565b600091825260208083206008830401805460079093166004026101000a63ffffffff818102199094169590931692909202939093179055898152600b825260408082206001600160a01b038b168084529084528183208c8452600a8552828420918452935281208054869392919085908110612a4357612a43614581565b6000918252602080832060088304015463ffffffff60046007909416939093026101000a9004821684528381019490945260409283018220805495909116600160681b027fffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffffff909516949094179093558a8352600a82528083206001600160a01b038b1684529091529020805480612adc57612adc614597565b60008281526020808220600860001990940193840401805463ffffffff600460078716026101000a810219909116909155929093558a8152600b835260408082206001600160a01b038c16835284528082209286168252919092528120805470ffffffffffffffffffffffffffffffffff19169055612b5a89611654565b9050876001600160a01b0316816001600160a01b03168a7f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee8a600080604051612bb89392919092835290151560208301521515604082015260600190565b60405180910390a4876001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612bf957600080fd5b505afa158015612c0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c319190614640565b15612c57576000898152600c602052604081208054909190612c529061473e565b909155505b604051636d4229c960e01b81526001600160a01b038281166004830152602482018b90526044820189905260648201879052891690636d4229c990608401600060405180830381600087803b158015612caf57600080fd5b505af1158015612cc3573d6000803e3d6000fd5b50505050505050505050505050565b600080612cde83611654565b9050806001600160a01b0316846001600160a01b03161480612d2557506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806127db5750836001600160a01b0316612d3e84610dbf565b6001600160a01b031614949350505050565b826001600160a01b0316612d6382611654565b6001600160a01b031614612ddf5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201527f6f776e65720000000000000000000000000000000000000000000000000000006064820152608401610a6c565b6001600160a01b038216612e5a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610a6c565b612e65838383613ce1565b612e706000826126b3565b6001600160a01b0383166000908152600360205260408120805460019290612e9990849061456a565b90915550506001600160a01b0382166000908152600360205260408120805460019290612ec7908490614755565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000612f3384611654565b6000858152600a602090815260408083206001600160a01b038816845290915281205491925050836001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b158015612f9357600080fd5b505afa158015612fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fcb9190614640565b15612ff4576000858152600c602052604081208054839290612fee90849061456a565b90915550505b60005b818110156131e1576000868152600a602090815260408083206001600160a01b0389168452909152812080548390811061303357613033614581565b600091825260208083206008830401548a8452600b825260408085206001600160a01b038c8116808852918552828720600790961660040261010090810a90940463ffffffff9081168089529686528388208451608081018652905460ff81161515825295860482168188015265010000000000860467ffffffffffffffff16818601819052600160681b9096049091166060808301919091528451888152968701989098528c151593860193909352949650909491939092908916918c917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee910160405180910390a46000898152600b602090815260408083206001600160a01b038c811680865291845282852063ffffffff8916865290935292819020805470ffffffffffffffffffffffffffffffffff1916905551636d4229c960e01b81529088166004820152602481018b90526044810185905260648101839052636d4229c990608401600060405180830381600087803b1580156131b557600080fd5b505af11580156131c9573d6000803e3d6000fd5b50505050505050806131da906145ad565b9050612ff7565b506000858152600a602090815260408083206001600160a01b0388168452909152812061320d91613fcc565b5050505050565b63ffffffff8111156132685760405162461bcd60e51b815260206004820152601460248201527f71756573744964206f7574206f662072616e67650000000000000000000000006044820152606401610a6c565b6000838152600b602090815260408083206001600160a01b0386168452825280832063ffffffff8581168552908352928190208151608081018352905460ff8116158015808452610100830487169584019590955265010000000000820467ffffffffffffffff1693830193909352600160681b9004909316606090930192909252906133375760405162461bcd60e51b815260206004820152601060248201527f416c7265616479206f6e207175657374000000000000000000000000000000006044820152606401610a6c565b6000848152600a602090815260408083206001600160a01b0387168452909152902054606481106133aa5760405162461bcd60e51b815260206004820152601660248201527f546f6f206d616e792061637469766520717565737473000000000000000000006044820152606401610a6c565b6000839050600a60008781526020019081526020016000206000866001600160a01b03166001600160a01b031681526020019081526020016000208190806001815401808255809150506001900390600052602060002090600891828204019190066004029091909190916101000a81548163ffffffff021916908363ffffffff16021790555060405180608001604052806001151581526020018263ffffffff1681526020014267ffffffffffffffff1681526020018363ffffffff16815250600b60008881526020019081526020016000206000876001600160a01b03166001600160a01b0316815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160056101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550606082015181600001600d6101000a81548163ffffffff021916908363ffffffff160217905550905050600061356987611654565b604080518781526001602082015260008183015290519192506001600160a01b0388811692908416918a917f1171d71105bda3fa01f863317a96e01684416ccb1e5416de7c09510bdfbe6aee9181900360600190a4856001600160a01b03166392b612946040518163ffffffff1660e01b815260040160206040518083038186803b1580156135f757600080fd5b505afa15801561360b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061362f9190614640565b1561364a576000878152600c60205260409020805460010190555b6040517f688a37410000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152602482018990526044820187905287169063688a374190606401600060405180830381600087803b1580156136b457600080fd5b505af11580156136c8573d6000803e3d6000fd5b5050505050505050505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600061373282611654565b905061374081600084613ce1565b61374b6000836126b3565b6001600160a01b038116600090815260036020526040812080546001929061377490849061456a565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031614156138305760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a6c565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a3505050565b6138a9848484612d50565b6138b584848484613d63565b6114ff5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a6c565b816001600160a01b0316836001600160a01b031614156139895760405162461bcd60e51b815260206004820152601160248201527f617070726f766520746f2063616c6c65720000000000000000000000000000006044820152606401610a6c565b6001600160a01b03838116600081815260096020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f83347dcc77580bb841ae3bac834b5b8ac5ccd2326276d265e638987eb6b2c0569101613891565b606060508054610ae290614519565b606081613a3d57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613a675780613a51816145ad565b9150613a609050600a836145fd565b9150613a41565b60008167ffffffffffffffff811115613a8257613a826143ee565b6040519080825280601f01601f191660200182016040528015613aac576020820181803683370190505b5090505b84156127db57613ac160018361456a565b9150613ace600a8661476d565b613ad9906030614755565b60f81b818381518110613aee57613aee614581565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613b28600a866145fd565b9450613ab0565b600081613b3e57506001610a02565b818314613b4d57506002610a02565b506003610a02565b6001600160a01b038216613bab5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a6c565b6000818152600260205260409020546001600160a01b031615613c105760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a6c565b613c1c60008383613ce1565b6001600160a01b0382166000908152600360205260408120805460019290613c45908490614755565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160e01b031982167ff9f7ab41000000000000000000000000000000000000000000000000000000001480610a025750610a0282613ec6565b6000818152600c602052604090205415610f135760405162461bcd60e51b815260206004820152602760248201527f416e206163746976652071756573742069732070726576656e74696e6720747260448201527f616e7366657273000000000000000000000000000000000000000000000000006064820152608401610a6c565b60006001600160a01b0384163b15613ebb57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613da7903390899088908890600401614781565b602060405180830381600087803b158015613dc157600080fd5b505af1925050508015613df1575060408051601f3d908101601f19168201909252613dee918101906147b3565b60015b613ea1573d808015613e1f576040519150601f19603f3d011682016040523d82523d6000602084013e613e24565b606091505b508051613e995760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610a6c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127db565b506001949350505050565b60006001600160e01b031982167f80ac58cd000000000000000000000000000000000000000000000000000000001480613f2957506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610a0257506301ffc9a760e01b6001600160e01b0319831614610a02565b828054613f5490614519565b90600052602060002090601f016020900481019282613f765760008555613fbc565b82601f10613f8f5782800160ff19823516178555613fbc565b82800160010185558215613fbc579182015b82811115613fbc578235825591602001919060010190613fa1565b50613fc8929150613fed565b5090565b508054600082556007016008900490600052602060002090810190611c9f91905b5b80821115613fc85760008155600101613fee565b6001600160e01b031981168114611c9f57600080fd5b60006020828403121561402a57600080fd5b8135611f5081614002565b6001600160a01b0381168114611c9f57600080fd5b6000806040838503121561405d57600080fd5b823561406881614035565b915060208301356bffffffffffffffffffffffff8116811461408957600080fd5b809150509250929050565b60005b838110156140af578181015183820152602001614097565b838111156114ff5750506000910152565b600081518084526140d8816020860160208601614094565b601f01601f19169290920160200192915050565b602081526000611f5060208301846140c0565b60006020828403121561411157600080fd5b8135611f5081614035565b60006020828403121561412e57600080fd5b5035919050565b6000806040838503121561414857600080fd5b823561415381614035565b946020939093013593505050565b6000806040838503121561417457600080fd5b82359150602083013561408981614035565b602080825282518282018190526000919060409081850190868401855b828110156141f25781518051151585528681015163ffffffff908116888701528682015167ffffffffffffffff16878701526060918201511690850152608090930192908501906001016141a3565b5091979650505050505050565b60008060006060848603121561421457600080fd5b83359250602084013561422681614035565b9150604084013563ffffffff8116811461423f57600080fd5b809150509250925092565b6000806040838503121561425d57600080fd5b50508035926020909101359150565b60008060006060848603121561428157600080fd5b833561428c81614035565b9250602084013561429c81614035565b929592945050506040919091013590565b6000806000606084860312156142c257600080fd5b83359250602084013561429c81614035565b600080602083850312156142e757600080fd5b823567ffffffffffffffff808211156142ff57600080fd5b818501915085601f83011261431357600080fd5b81358181111561432257600080fd5b86602082850101111561433457600080fd5b60209290920196919550909350505050565b634e487b7160e01b600052602160045260246000fd5b602081016004831061437e57634e487b7160e01b600052602160045260246000fd5b91905290565b6000806040838503121561439757600080fd5b82356143a281614035565b9150602083013561408981614035565b8015158114611c9f57600080fd5b600080604083850312156143d357600080fd5b82356143de81614035565b91506020830135614089816143b2565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561441a57600080fd5b843561442581614035565b9350602085013561443581614035565b925060408501359150606085013567ffffffffffffffff8082111561445957600080fd5b818701915087601f83011261446d57600080fd5b81358181111561447f5761447f6143ee565b604051601f8201601f19908116603f011681019083821181831017156144a7576144a76143ee565b816040528281528a60208487010111156144c057600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806000606084860312156144f957600080fd5b833561450481614035565b95602085013595506040909401359392505050565b600181811c9082168061452d57607f821691505b6020821081141561454e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561457c5761457c614554565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60006000198214156145c1576145c1614554565b5060010190565b60008160001904831182151516156145e2576145e2614554565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261460c5761460c6145e7565b500490565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b60006020828403121561465257600080fd5b8151611f50816143b2565b6000845160206146708285838a01614094565b8551918401916146838184848a01614094565b8554920191600090600181811c90808316806146a057607f831692505b8583108114156146be57634e487b7160e01b85526022600452602485fd5b8080156146d257600181146146e357614710565b60ff19851688528388019550614710565b60008b81526020902060005b858110156147085781548a8201529084019088016146ef565b505083880195505b50939b9a5050505050505050505050565b60006020828403121561473357600080fd5b8151611f5081614035565b60008161474d5761474d614554565b506000190190565b6000821982111561476857614768614554565b500190565b60008261477c5761477c6145e7565b500690565b60006001600160a01b03808716835280861660208401525083604083015260806060830152611ac560808301846140c0565b6000602082840312156147c557600080fd5b8151611f508161400256fea264697066735822122046866779f3d04bce9290aa2de65f3ca32dce9a7f17a8dee70208e2ba9a5a5cb964736f6c63430008090033

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

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