ETH Price: $2,635.12 (+8.01%)
 

Overview

Max Total Supply

8,785 CAVERNS

Holders

1,121

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
1 CAVERNS
0x162FfB7FAf46edccb81bef1fb59BfaE5B08Fb94c
Loading...
Loading
Loading...
Loading
Loading...
Loading

OVERVIEW

9000 generative on-chain dungeons. Each map is a minimal ‘lego’ that developers or game designers can call directly from the contract to build out adventures and games.

# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Dungeons

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 18 : dungeons.sol
// SPDX-License-Identifier: CC0-1.0

/// @title The Crypts and Caverns ERC-721 token

/*****************************************************
0000000                                        0000000
0001100  Crypts and Caverns                    0001100
0001100     9000 generative on-chain dungeons  0001100
0003300                                        0003300
*****************************************************/

/* Crypts and Caverns is an onchain map generator that produces an infinite set of dungeons.

Like Loot, these maps contain a minimal amount of information and structure so that game designers and developers can interpret the map as they see fit.

A dungeon map contains walls, floors, doors, and points of interest which make up the map. Each dungeon also has an environment and a name to set a mood for the dungeon. These are specific enough to allow each map to have its own identity but vague enough to allow substantial interpretation.

The tokenURI also outputs a simple pixel art representation of the dungeon to help visualize the map.

Crypts and Caverns are free to use however you want. 

Learn more at: https://threepwave.com/cryptsandcaverns


The dungeons API aims to be simple and is aimed at smart contract developers wanting to create onchain games:

getLayout(uint256 tokenId) - Returns a bytes array representing walls (0) and floor tiles (1). Length is always 64 bytes.
getSize(uint256 tokenId) - Returns a uint256 representing the width or height of a dungeon. All dungeons are square so size 7 is '7x7.'
getEntities(uint256 tokenId) - Returns an array of entities representing points (entityType 0) and doors (entitType 1). There are at most 32 entities.
getEnvironment(uint256 tokenId) - Returns a uint256 between 0->5 representing an environment or mood for the map.
getName(uint256 tokenId) - Returns a string with names for the dungeon. Names may be repeated across dungeons.
getNumPoints(uint256 tokenId) - Returs the number of points present in a given dungeon.
getNumDoors(uint256 tokenId) - Returns the number of doors present in a given dungeon.
getSvg(uint256 tokenId) - Returns a base64 encrypted svg with a visual representation of a given dungeon.
*/

pragma solidity ^0.8.0;

/* ERC-721 Boilerplate */
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

/* Dependencies */
import { IDungeons } from './interfaces/IDungeons.sol';
import { IDungeonsGenerator } from './interfaces/IDungeonsGenerator.sol';
import { IDungeonsRender } from './interfaces/IDungeonsRender.sol';
import { IDungeonsSeeder } from './interfaces/IDungeonsSeeder.sol';

 interface Loot {
    function ownerOf(uint256 tokenId) external view returns (address owner);
}

/* Dungeons contract code starts here */
contract Dungeons is IDungeons, ERC721Enumerable, ReentrancyGuard, Ownable {
    IDungeonsRender public render;  // Render to SVG
    IDungeonsGenerator public generator;  // Dungeon Generation
    IDungeonsSeeder public seeder;

    // Store seeds for our maps
    mapping(uint256 => uint256) public seeds;

    Loot internal lootContract;

    // Mint Supply
    uint256 public lastMint = 8000;
    uint256 public claimed = 0;
    bool public restricted = true;  // Restrict claim to loot owners by default

    // Pricing Information
    uint256 public price = 0.05 ether;     // 0.05ETH

    event Minted(address indexed account, uint256 tokenId);
    event Claimed(address indexed account, uint256 tokenId);

    /* Write Functions */
    /**
    * @dev Allow a user to claim/mint this token if they hold the loot. Accepts a single tokenId uint256.
    *       e.g. claim(43)
    */
    function claim(uint256 tokenId) override public payable nonReentrant {
        require(tokenId > 0 && tokenId < 7778, "Token ID invalid");
        require(!restricted || lootContract.ownerOf(tokenId) == msg.sender, "Not your LOOT");
        require(price <= msg.value, "Insufficient ETH");
        claimed++;
        seeds[tokenId] = seeder.getSeed(tokenId);
        
        _safeMint(_msgSender(), tokenId);
        emit Claimed(_msgSender(), tokenId);
    }
    
    /**
    * @dev Allow a user to claim many tokens as they hold loot. Accepts an array of uint256 token Id's.
    *      e.g. claimMany([1337, 43, 7105])
    */
    function claimMany(uint256[] memory tokenArray) override public payable nonReentrant {
        for(uint256 i=0; i < tokenArray.length; i++) {
            require(tokenArray[i] > 0 && tokenArray[i] < 7778, "Token ID invalid");
            require(!restricted || lootContract.ownerOf(tokenArray[i]) == msg.sender, "Not your LOOT");
            require(price * tokenArray.length <= msg.value, "Insufficient ETH");
            claimed++;
            seeds[tokenArray[i]] = seeder.getSeed(tokenArray[i]);
            _safeMint(_msgSender(), tokenArray[i]);
            emit Claimed(_msgSender(), tokenArray[i]);
        }
    }

    /**
    * @dev   Allows threep to mint a set of dungeons to hold for promotional purposes and to reward contributors.
    *        Token ID's 7778->7999.
    *        e.g. ownerClaim(7779)
    */
    function ownerClaim(uint256 tokenId) override public payable nonReentrant onlyOwner {
        require(tokenId > 7777 && tokenId < 8001, "Token ID invalid");
        seeds[tokenId] = seeder.getSeed(tokenId);
        _safeMint(owner(), tokenId);
        emit Claimed(_msgSender(), tokenId);
    }

    /**
    * @dev  Allows a user to mint a token. There is a supply of 1000 tokens available to mint.
    *       Minted tokens start at 8000 and ends at 9000.
    */
    function mint() override public payable nonReentrant {
        require(lastMint < 9000, "Token sold out");
        require(msg.value >= price, "Insufficient ETH");
        uint256 tokenId = ++lastMint;    // Grab the top token in the list
        seeds[tokenId] = seeder.getSeed(tokenId);
        _safeMint(_msgSender(), tokenId);
        emit Minted(_msgSender(), tokenId);
    }

    /**
    * @dev Allows anyone to claim #1-7777 (e.g. after initial Loot owner claim period)
    */
    function openClaim() override public nonReentrant onlyOwner {
        restricted = !restricted;
    }

    /**
    * @dev  Allows the owner to withdraw eth to another wallet.
    */
    function withdraw(address payable recipient, uint256 amount) override public nonReentrant onlyOwner {
        require(address(this).balance >= amount, "Insufficient balance");
        (bool succeed,) = recipient.call{value: amount}("");
        require(succeed, "Withdraw failed");
    }

    /* Read Functions */
    function tokenURI(uint256 tokenId) override (ERC721, IDungeons) public view returns (string memory) {
        // Generate full dungeon metadata (for opensea, etc) 
        isValid(tokenId);
        Dungeon memory dungeon = generateDungeon(tokenId);

        uint256[] memory entities = new uint256[](2);
        (entities[0], entities[1]) = generator.countEntities(dungeon.entities.entityType);
        
        return(render.tokenURI(tokenId, dungeon, entities));
    }

    /**
    * @dev Returns the width/height of the map (all maps are square). For example a size of '8' implies a 8x8 grid.
    * Size can be as small as 6x6 and as large as 30x30.
    * Example:  uint256 private size = 8;
    */
    function getSize(uint256 tokenId) public view override returns (uint8) {
        isValid(tokenId);

        return seeder.getSize(seeds[tokenId]);
    }

    /**
    * @dev Returns a representation of the floors and walls in a dungeon. 
    * Layout is returned as a 64-bit bytes array where each bit (From right to left) represents a wall (0) or a floor (1)
    * Example:  bytes layout = 0x0000000000000000018003000607ec0ff81fa03fc061f003e007c00000000000;
    */
    function getLayout(uint256 tokenId) public view override returns (bytes memory) {
        isValid(tokenId);
        (bytes memory layout, ) = generator.getLayout(seeds[tokenId], getSize(tokenId));
        return layout;
    }

    /**
    * @dev Returns a list of entities (e.g. doors, points of interest) in the dungeon
    * Entities have an x position, a y position, and a 'EntityType' which describes the entity.
    * Each value is returned as a series of 3 integers: [x, y, entityType]. 
    * If there are multiple entities, you'll have multiple sets of 3 [x1, y1, entityType1, x2, y2, entityType2]
    * In this case, all entities are either type 0 (Door) or 1 (Point of Interest).
    * It's up to the game designer to interpret what those represent.
    * Example:  Entity[] entities = [0, 5, 1, 6, 3, 0]
    */
    function getEntities(uint256 tokenId) public view override returns (uint8[] memory, uint8[] memory, uint8[] memory) {
        isValid(tokenId);
        // uint256 seed = seeder.getSeed(tokenId); // TODO - Test tokenId

        (uint8[] memory x, uint8[] memory y, uint8[] memory entityType) = generator.getEntities(seeds[tokenId], getSize(tokenId));
        return (x, y, entityType);
    }

    /**
    * @dev Returns the number (uint256) of points of interest present in a given map.
    * Example: uint256 numDoors = 2;
    */
    function getNumPoints(uint256 tokenId) public view override returns (uint256) {
        isValid(tokenId);

        ( , uint256 numPoints) = generator.getPoints(seeds[tokenId], getSize(tokenId));

        return numPoints;
    }

    /**
    * @dev Returns the number (uint256) of doors present in a given map.
    * Example: uint256 numDoors = 2;
    */
    function getNumDoors(uint256 tokenId) public view override returns (uint256) {
        isValid(tokenId);

        (, uint256 numDoors) = generator.getDoors(seeds[tokenId], getSize(tokenId));

        return numDoors;
    }

    /**
    * @dev Returns the environment which a given map takes place in. There are currently 6 environments defined with id's 0->5. Other maps may choose to define new environments or interpret these differently
    * Example: uint16 private environment = 0;
    */
    function getEnvironment(uint256 tokenId) public view override returns (uint8) {
        isValid(tokenId);

        return seeder.getEnvironment(seeds[tokenId]);
    }

    /**
    * @dev Returns the name of this dungeon. Names reference a place and typically look something like "Prisoner's Den."
    * Names can be as short as ___ characters and as long as ___ characters. Names do not contain special characters but may contain an apostrophe (').
    * export const genName = function(R) {
    * Base Land (30%)
    * Prefix + Base Land (30%)
    * Base Land + Suffix (22%)
    * Prefix + Base Land + Suffix (15%)
    * Name + Base Land (3%)
    * Unique Name (0.15%)
    * Example: string private dungeonName = "Den of the Keeper";
    */
    function getName(uint256 tokenId) public view override returns (string memory) {
        isValid(tokenId);
        (string memory dungeonName, , ) = seeder.getName(seeds[tokenId]);
        return dungeonName;
    }


   /**
    * @dev Returns a string containing a valid SVG representing the dungeon
    * The SVG is pixel-art resolution so the game developer can interpret it as they see fit
    * Colors are based on 'getEnvironment()'
    * Example: string svg = "<svg><rect x='100' y='20' height='10' widdth='10' /></svg>"
    */
    function getSvg(uint256 tokenId) public view override returns (string memory) {
        // Generate dungeon layout
        Dungeon memory dungeon = generateDungeon(tokenId);

        return render.draw(dungeon, dungeon.entities.x, dungeon.entities.y, dungeon.entities.entityType);
    }   

    function generateDungeon(uint256 tokenId) private view returns (Dungeon memory) {
    // Generates dungeon metadata from a given tokenId
        (uint8[] memory x, uint8[] memory y, uint8[] memory entityType) = getEntities(tokenId);
        (bytes memory layout, uint8 structure) = generator.getLayout(seeds[tokenId], getSize(tokenId));
        (string memory dungeonName, string memory affinity, uint8 legendary) = seeder.getName(seeds[tokenId]);
        return Dungeon(getSize(tokenId), getEnvironment(tokenId), structure, legendary, layout, EntityData(x, y, entityType), affinity, dungeonName);
    }

    /* Utility Functions */
    function isValid(uint256 tokenId) internal view {
    // Validate that the token is within range when querying
        require(tokenId > 0 && tokenId < 9001, "Token ID invalid");
        require(_exists(tokenId), "Token is not minted yet");
    }

    constructor(Loot _lootContract, IDungeonsRender _render, IDungeonsGenerator _generator, IDungeonsSeeder _seeder) ERC721("Crypts and Caverns", "CAVERNS") Ownable() {
        lootContract = _lootContract;
        render = _render;
        generator = _generator;
        seeder = _seeder;
    }


}

File 2 of 18 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @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` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * 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 override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

File 3 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT

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() {
        _setOwner(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 5 of 18 : IDungeons.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for Crypts and Caverns

/*****************************************************
0000000                                        0000000
0001100  Crypts and Caverns                    0001100
0001100     9000 generative on-chain dungeons  0001100
0003300                                        0003300
*****************************************************/

pragma solidity ^0.8.0;

interface IDungeons {
    struct Dungeon {
        uint8 size;
        uint8 environment;
        uint8 structure;  // crypt or cavern
        uint8 legendary;
        bytes layout;
        EntityData entities;
        string affinity;
        string dungeonName;
    }

    struct EntityData {
        uint8[] x;
        uint8[] y;
        uint8[] entityType;
    }

    function claim(uint256 tokenId) external payable;
    function claimMany(uint256[] memory tokenArray) external payable;
    function ownerClaim(uint256 tokenId) external payable;
    function mint() external payable;
    function openClaim() external;
    function withdraw(address payable recipient, uint256 amount) external;
    function tokenURI(uint256 tokenId) external view returns (string memory);
    function getLayout(uint256 tokenId) external view returns (bytes memory);
    function getSize(uint256 tokenId) external view returns (uint8);
    function getEntities(uint256 tokenId) external view returns (uint8[] memory, uint8[] memory, uint8[] memory);
    function getEnvironment(uint256 tokenId) external view returns (uint8);
    function getName(uint256 tokenId) external view returns (string memory);
    function getNumPoints(uint256 tokenId) external view returns (uint256);
    function getNumDoors(uint256 tokenId) external view returns (uint256);
    function getSvg(uint256 tokenId) external view returns (string memory);
}

File 6 of 18 : IDungeonsGenerator.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for dungeon generation

/*****************************************************
0000000                                        0000000
0001100  Crypts and Caverns                    0001100
0001100     9000 generative on-chain dungeons  0001100
0003300                                        0003300
*****************************************************/

pragma solidity ^0.8.0;

interface IDungeonsGenerator {

    struct EntityData {
        uint8 x;
        uint8 y;
        uint8 entityType;
    }

    function getLayout(uint256 seed, uint256 size) external view returns (bytes memory, uint8);
    function getEntities(uint256 seed, uint256 size) external view returns (uint8[] memory, uint8[] memory, uint8[] memory);
    function getEntitiesBytes(uint256 seed, uint256 size) external view returns (bytes memory, bytes memory);
    function getPoints(uint256 seed, uint256 size) external view returns (bytes memory, uint256);
    function getDoors(uint256 seed, uint256 size) external view returns (bytes memory, uint256);
    function countEntities(uint8[] memory entities) external pure returns(uint256, uint256);
}

File 7 of 18 : IDungeonsRender.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Rendering code to draw an svg of the dungeon

/*****************************************************
0000000                                        0000000
0001100  Crypts and Caverns                    0001100
0001100     9000 generative on-chain dungeons  0001100
0003300                                        0003300
*****************************************************/

pragma solidity ^0.8.0;

import { IDungeons } from './IDungeons.sol';

interface IDungeonsRender {

    function draw(IDungeons.Dungeon memory dungeon, uint8[] memory x, uint8[] memory y, uint8[] memory entityData) external view returns (string memory);
    function tokenURI(uint256 tokenId, IDungeons.Dungeon memory dungeon, uint256[] memory entities) external view returns(string memory);
}

File 8 of 18 : IDungeonsSeeder.sol
// SPDX-License-Identifier: GPL-3.0

/// @title Interface for generating seed and metadata

/*****************************************************
0000000                                        0000000
0001100  Crypts and Caverns                    0001100
0001100     9000 generative on-chain dungeons  0001100
0003300                                        0003300
*****************************************************/

pragma solidity ^0.8.0;

interface IDungeonsSeeder {
    function getSeed(uint256 tokenId) external view returns(uint256);
    function getSize(uint256 seed) external view returns (uint8);
    function getEnvironment(uint256 seed) external view returns (uint8);
    function getName(uint256 seed) external view returns(string memory, string memory, uint8);
}

File 9 of 18 : ERC721.sol
// SPDX-License-Identifier: MIT

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: balance query for the zero address");
        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: owner query for nonexistent token");
        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) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        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 overriden 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 owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_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: transfer caller is not 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: transfer caller is not 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) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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);
    }

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

    /**
     * @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 of token that is not own");
        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);
    }

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

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

File 10 of 18 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 11 of 18 : IERC721.sol
// SPDX-License-Identifier: MIT

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`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

File 12 of 18 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 13 of 18 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

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 14 of 18 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 15 of 18 : Context.sol
// SPDX-License-Identifier: MIT

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 16 of 18 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

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

File 17 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT

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 18 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract Loot","name":"_lootContract","type":"address"},{"internalType":"contract IDungeonsRender","name":"_render","type":"address"},{"internalType":"contract IDungeonsGenerator","name":"_generator","type":"address"},{"internalType":"contract IDungeonsSeeder","name":"_seeder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Minted","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":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenArray","type":"uint256[]"}],"name":"claimMany","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"generator","outputs":[{"internalType":"contract IDungeonsGenerator","name":"","type":"address"}],"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":"getEntities","outputs":[{"internalType":"uint8[]","name":"","type":"uint8[]"},{"internalType":"uint8[]","name":"","type":"uint8[]"},{"internalType":"uint8[]","name":"","type":"uint8[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getEnvironment","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getLayout","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getNumDoors","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getNumPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSize","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSvg","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerClaim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"render","outputs":[{"internalType":"contract IDungeonsRender","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"restricted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"seeder","outputs":[{"internalType":"contract IDungeonsSeeder","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"seeds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052611f4060115560006012556013805460ff1916600117905566b1a2bc2ec500006014553480156200003457600080fd5b5060405162003f5438038062003f54833981016040819052620000579162000245565b604080518082018252601281527143727970747320616e642043617665726e7360701b60208083019182528351808501909452600784526643415645524e5360c81b908401528151919291620000b0916000916200018c565b508051620000c69060019060208401906200018c565b50506001600a5550620000e2620000dc62000136565b6200013a565b601080546001600160a01b039586166001600160a01b031991821617909155600c805494861694821694909417909355600d805492851692841692909217909155600e805491909316911617905562000336565b3390565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200019a90620002d5565b90600052602060002090601f016020900481019282620001be576000855562000209565b82601f10620001d957805160ff191683800117855562000209565b8280016001018555821562000209579182015b8281111562000209578251825591602001919060010190620001ec565b50620002179291506200021b565b5090565b5b808211156200021757600081556001016200021c565b80516200023f816200031c565b92915050565b600080600080608085870312156200025c57600080fd5b60006200026a878762000232565b94505060206200027d8782880162000232565b9350506040620002908782880162000232565b9250506060620002a38782880162000232565b91505092959194509250565b60006200023f82620002c9565b60006200023f82620002af565b6001600160a01b031690565b600281046001821680620002ea57607f821691505b6020821081141562000300576200030062000306565b50919050565b634e487b7160e01b600052602260045260246000fd5b6200032781620002bc565b81146200033357600080fd5b50565b613c0e80620003466000396000f3fe6080604052600436106102465760003560e01c80636db4080011610139578063b0dc78fa116100b6578063db9ee4451161007a578063db9ee44514610650578063e834a83414610670578063e985e9c514610685578063f0503e80146106a5578063f2fde38b146106c5578063f3fef3a3146106e557610246565b8063b0dc78fa146105ac578063b88d4fde146105cc578063c87b56dd146105ec578063cc6dd9471461060c578063d607497a1461063b57610246565b80638da5cb5b116100fd5780638da5cb5b1461053a578063925489a81461054f57806395d89b4114610562578063a035b1fe14610577578063a22cb4651461058c57610246565b80636db40800146104bb5780637072c6b1146104db57806370a08231146104f0578063715018a6146105105780637afa1eed1461052557610246565b80632f745c59116101c75780634f6ccce71161018b5780634f6ccce714610424578063586fc5b5146104445780636352211e14610459578063684931ed146104795780636b8ff5741461049b57610246565b80632f745c591461039e578063379607f5146103be5780633bb31416146103d157806342842e0e146103f1578063434f48c41461041157610246565b8063095ea7b31161020e578063095ea7b31461031d5780631249c58b1461033f57806318160ddd1461034757806323b872dd14610369578063293cdbf11461038957610246565b8063012921351461024b57806301ffc9a714610281578063023c23db146102ae57806306fdde03146102db578063081812fc146102f0575b600080fd5b34801561025757600080fd5b5061026b610266366004612ce3565b610705565b60405161027891906136fc565b60405180910390f35b34801561028d57600080fd5b506102a161029c366004612b77565b6107b6565b60405161027891906136ee565b3480156102ba57600080fd5b506102ce6102c9366004612ce3565b6107e1565b6040516102789190613955565b3480156102e757600080fd5b5061026b61087a565b3480156102fc57600080fd5b5061031061030b366004612ce3565b61090c565b6040516102789190613652565b34801561032957600080fd5b5061033d61033836600461295d565b610958565b005b61033d6109f0565b34801561035357600080fd5b5061035c610b64565b60405161027891906138f8565b34801561037557600080fd5b5061033d6103843660046129c7565b610b6a565b34801561039557600080fd5b5061033d610ba2565b3480156103aa57600080fd5b5061035c6103b936600461295d565b610c22565b61033d6103cc366004612ce3565b610c74565b3480156103dd57600080fd5b5061035c6103ec366004612ce3565b610e8d565b3480156103fd57600080fd5b5061033d61040c3660046129c7565b610f3e565b61033d61041f366004612ce3565b610f59565b34801561043057600080fd5b5061035c61043f366004612ce3565b611088565b34801561045057600080fd5b5061035c6110e3565b34801561046557600080fd5b50610310610474366004612ce3565b6110e9565b34801561048557600080fd5b5061048e61111e565b604051610278919061370d565b3480156104a757600080fd5b5061026b6104b6366004612ce3565b61112d565b3480156104c757600080fd5b506102ce6104d6366004612ce3565b6111d3565b3480156104e757600080fd5b506102a161121b565b3480156104fc57600080fd5b5061035c61050b366004612921565b611224565b34801561051c57600080fd5b5061033d611268565b34801561053157600080fd5b5061048e6112b3565b34801561054657600080fd5b506103106112c2565b61033d61055d366004612abc565b6112d1565b34801561056e57600080fd5b5061026b61164d565b34801561058357600080fd5b5061035c61165c565b34801561059857600080fd5b5061033d6105a7366004612a8c565b611662565b3480156105b857600080fd5b5061026b6105c7366004612ce3565b611730565b3480156105d857600080fd5b5061033d6105e7366004612a14565b6117dd565b3480156105f857600080fd5b5061026b610607366004612ce3565b61181c565b34801561061857600080fd5b5061062c610627366004612ce3565b6119c0565b604051610278939291906136b5565b34801561064757600080fd5b5061048e611a80565b34801561065c57600080fd5b5061035c61066b366004612ce3565b611a8f565b34801561067c57600080fd5b5061035c611ac7565b34801561069157600080fd5b506102a16106a0366004612997565b611acd565b3480156106b157600080fd5b5061035c6106c0366004612ce3565b611afb565b3480156106d157600080fd5b5061033d6106e0366004612921565b611b0d565b3480156106f157600080fd5b5061033d61070036600461295d565b611b7e565b606061071082611c8b565b600d546000838152600f602052604081205490916001600160a01b03169063ff8f8c189061073d866107e1565b6040518363ffffffff1660e01b815260040161075a92919061393a565b60006040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107ae9190810190612bf9565b509392505050565b60006001600160e01b0319821663780e9d6360e01b14806107db57506107db82611cdd565b92915050565b60006107ec82611c8b565b600e546000838152600f60205260409081902054905163023c23db60e01b81526001600160a01b039092169163023c23db9161082a916004016138f8565b60206040518083038186803b15801561084257600080fd5b505afa158015610856573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190612d3e565b60606000805461088990613b01565b80601f01602080910402602001604051908101604052809291908181526020018280546108b590613b01565b80156109025780601f106108d757610100808354040283529160200191610902565b820191906000526020600020905b8154815290600101906020018083116108e557829003601f168201915b5050505050905090565b600061091782611d1d565b61093c5760405162461bcd60e51b81526004016109339061380b565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610963826110e9565b9050806001600160a01b0316836001600160a01b031614156109975760405162461bcd60e51b81526004016109339061384b565b806001600160a01b03166109a9611d3a565b6001600160a01b031614806109c557506109c5816106a0611d3a565b6109e15760405162461bcd60e51b8152600401610933906137cb565b6109eb8383611d3e565b505050565b6002600a541415610a135760405162461bcd60e51b81526004016109339061389b565b6002600a5560115461232811610a3b5760405162461bcd60e51b81526004016109339061385b565b601454341015610a5d5760405162461bcd60e51b81526004016109339061371b565b6000601160008154610a6e90613b2e565b9182905550600e5460405163e0d4ea3760e01b81529192506001600160a01b03169063e0d4ea3790610aa49084906004016138f8565b60206040518083038186803b158015610abc57600080fd5b505afa158015610ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af49190612d01565b6000828152600f6020526040902055610b14610b0e611d3a565b82611dac565b610b1c611d3a565b6001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe82604051610b5491906138f8565b60405180910390a2506001600a55565b60085490565b610b7b610b75611d3a565b82611dca565b610b975760405162461bcd60e51b81526004016109339061386b565b6109eb838383611e47565b6002600a541415610bc55760405162461bcd60e51b81526004016109339061389b565b6002600a55610bd2611d3a565b6001600160a01b0316610be36112c2565b6001600160a01b031614610c095760405162461bcd60e51b81526004016109339061381b565b6013805460ff19811660ff909116151790556001600a55565b6000610c2d83611224565b8210610c4b5760405162461bcd60e51b81526004016109339061372b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6002600a541415610c975760405162461bcd60e51b81526004016109339061389b565b6002600a558015801590610cac5750611e6281105b610cc85760405162461bcd60e51b81526004016109339061382b565b60135460ff161580610d6057506010546040516331a9108f60e11b815233916001600160a01b031690636352211e90610d059085906004016138f8565b60206040518083038186803b158015610d1d57600080fd5b505afa158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d55919061293f565b6001600160a01b0316145b610d7c5760405162461bcd60e51b81526004016109339061388b565b346014541115610d9e5760405162461bcd60e51b81526004016109339061371b565b60128054906000610dae83613b2e565b9091555050600e5460405163e0d4ea3760e01b81526001600160a01b039091169063e0d4ea3790610de39084906004016138f8565b60206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190612d01565b6000828152600f6020526040902055610e4d610b0e611d3a565b610e55611d3a565b6001600160a01b03167fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a82604051610b5491906138f8565b6000610e9882611c8b565b600d546000838152600f602052604081205490916001600160a01b031690634d4c71a390610ec5866107e1565b6040518363ffffffff1660e01b8152600401610ee292919061393a565b60006040518083038186803b158015610efa57600080fd5b505afa158015610f0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f369190810190612bb3565b949350505050565b6109eb838383604051806020016040528060008152506117dd565b6002600a541415610f7c5760405162461bcd60e51b81526004016109339061389b565b6002600a55610f89611d3a565b6001600160a01b0316610f9a6112c2565b6001600160a01b031614610fc05760405162461bcd60e51b81526004016109339061381b565b611e6181118015610fd25750611f4181105b610fee5760405162461bcd60e51b81526004016109339061382b565b600e5460405163e0d4ea3760e01b81526001600160a01b039091169063e0d4ea379061101e9084906004016138f8565b60206040518083038186803b15801561103657600080fd5b505afa15801561104a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106e9190612d01565b6000828152600f6020526040902055610e4d610b0e6112c2565b6000611092610b64565b82106110b05760405162461bcd60e51b81526004016109339061387b565b600882815481106110d157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60115481565b6000818152600260205260408120546001600160a01b0316806107db5760405162461bcd60e51b8152600401610933906137eb565b600e546001600160a01b031681565b606061113882611c8b565b600e546000838152600f6020526040808220549051631ae3fd5d60e21b815291926001600160a01b031691636b8ff57491611175916004016138f8565b60006040518083038186803b15801561118d57600080fd5b505afa1580156111a1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111c99190810190612c73565b5090949350505050565b60006111de82611c8b565b600e546000838152600f602052604090819020549051620db68160eb1b81526001600160a01b0390921691636db408009161082a916004016138f8565b60135460ff1681565b60006001600160a01b03821661124c5760405162461bcd60e51b8152600401610933906137db565b506001600160a01b031660009081526003602052604090205490565b611270611d3a565b6001600160a01b03166112816112c2565b6001600160a01b0316146112a75760405162461bcd60e51b81526004016109339061381b565b6112b16000611f74565b565b600d546001600160a01b031681565b600b546001600160a01b031690565b6002600a5414156112f45760405162461bcd60e51b81526004016109339061389b565b6002600a5560005b815181101561164457600082828151811061132757634e487b7160e01b600052603260045260246000fd5b60200260200101511180156113645750611e6282828151811061135a57634e487b7160e01b600052603260045260246000fd5b6020026020010151105b6113805760405162461bcd60e51b81526004016109339061382b565b60135460ff1615806114435750601054825133916001600160a01b031690636352211e908590859081106113c457634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b81526004016113e891906138f8565b60206040518083038186803b15801561140057600080fd5b505afa158015611414573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611438919061293f565b6001600160a01b0316145b61145f5760405162461bcd60e51b81526004016109339061388b565b34825160145461146f9190613a1f565b111561148d5760405162461bcd60e51b81526004016109339061371b565b6012805490600061149d83613b2e565b9091555050600e5482516001600160a01b039091169063e0d4ea37908490849081106114d957634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b81526004016114fd91906138f8565b60206040518083038186803b15801561151557600080fd5b505afa158015611529573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154d9190612d01565b600f600084848151811061157157634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020819055506115c3611596611d3a565b8383815181106115b657634e487b7160e01b600052603260045260246000fd5b6020026020010151611dac565b6115cb611d3a565b6001600160a01b03167fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a83838151811061161557634e487b7160e01b600052603260045260246000fd5b602002602001015160405161162a91906138f8565b60405180910390a28061163c81613b2e565b9150506112fc565b50506001600a55565b60606001805461088990613b01565b60145481565b61166a611d3a565b6001600160a01b0316826001600160a01b0316141561169b5760405162461bcd60e51b81526004016109339061379b565b80600560006116a8611d3a565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556116ec611d3a565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161172491906136ee565b60405180910390a35050565b6060600061173d83611fc6565b600c5460a08201518051602082015160409283015192516329010f4360e01b81529495506001600160a01b03909316936329010f4393611782938793926004016138ab565b60006040518083038186803b15801561179a57600080fd5b505afa1580156117ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117d69190810190612c3f565b9392505050565b6117ee6117e8611d3a565b83611dca565b61180a5760405162461bcd60e51b81526004016109339061386b565b611816848484846121a4565b50505050565b606061182782611c8b565b600061183283611fc6565b604080516002808252606082018352929350600092909160208301908036833701905050600d5460a084015160409081015190516397155f4f60e01b81529293506001600160a01b03909116916397155f4f91611891916004016136a4565b604080518083038186803b1580156118a857600080fd5b505afa1580156118bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e09190612d1f565b8260008151811061190157634e487b7160e01b600052603260045260246000fd5b602002602001018360018151811061192957634e487b7160e01b600052603260045260246000fd5b602090810291909101019190915252600c546040516319db2b2f60e01b81526001600160a01b03909116906319db2b2f9061196c90879086908690600401613906565b60006040518083038186803b15801561198457600080fd5b505afa158015611998573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f369190810190612c3f565b60608060606119ce84611c8b565b600d546000858152600f60205260408120549091829182916001600160a01b0316906340070627906119ff8a6107e1565b6040518363ffffffff1660e01b8152600401611a1c92919061393a565b60006040518083038186803b158015611a3457600080fd5b505afa158015611a48573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a709190810190612af0565b9199909850909650945050505050565b600c546001600160a01b031681565b6000611a9a82611c8b565b600d546000838152600f602052604081205490916001600160a01b03169063cd7acca690610ec5866107e1565b60125481565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600f6020526000908152604090205481565b611b15611d3a565b6001600160a01b0316611b266112c2565b6001600160a01b031614611b4c5760405162461bcd60e51b81526004016109339061381b565b6001600160a01b038116611b725760405162461bcd60e51b81526004016109339061375b565b611b7b81611f74565b50565b6002600a541415611ba15760405162461bcd60e51b81526004016109339061389b565b6002600a55611bae611d3a565b6001600160a01b0316611bbf6112c2565b6001600160a01b031614611be55760405162461bcd60e51b81526004016109339061381b565b80471015611c055760405162461bcd60e51b8152600401610933906137ab565b6000826001600160a01b031682604051611c1e90613647565b60006040518083038185875af1925050503d8060008114611c5b576040519150601f19603f3d011682016040523d82523d6000602084013e611c60565b606091505b5050905080611c815760405162461bcd60e51b81526004016109339061377b565b50506001600a5550565b600081118015611c9c575061232981105b611cb85760405162461bcd60e51b81526004016109339061382b565b611cc181611d1d565b611b7b5760405162461bcd60e51b81526004016109339061374b565b60006001600160e01b031982166380ac58cd60e01b1480611d0e57506001600160e01b03198216635b5e139f60e01b145b806107db57506107db826121d7565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d73826110e9565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611dc68282604051806020016040528060008152506121f0565b5050565b6000611dd582611d1d565b611df15760405162461bcd60e51b8152600401610933906137bb565b6000611dfc836110e9565b9050806001600160a01b0316846001600160a01b03161480611e375750836001600160a01b0316611e2c8461090c565b6001600160a01b0316145b80610f365750610f368185611acd565b826001600160a01b0316611e5a826110e9565b6001600160a01b031614611e805760405162461bcd60e51b81526004016109339061383b565b6001600160a01b038216611ea65760405162461bcd60e51b81526004016109339061378b565b611eb1838383612223565b611ebc600082611d3e565b6001600160a01b0383166000908152600360205260408120805460019290611ee5908490613a54565b90915550506001600160a01b0382166000908152600360205260408120805460019290611f139084906139f1565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611fce6126aa565b6000806000611fdc856119c0565b600d546000898152600f6020526040812054949750929550909350909182916001600160a01b03169063ff8f8c18906120148a6107e1565b6040518363ffffffff1660e01b815260040161203192919061393a565b60006040518083038186803b15801561204957600080fd5b505afa15801561205d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120859190810190612bf9565b600e5460008a8152600f6020526040808220549051631ae3fd5d60e21b815294965092945092839283926001600160a01b031691636b8ff574916120cb916004016138f8565b60006040518083038186803b1580156120e357600080fd5b505afa1580156120f7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261211f9190810190612c73565b92509250925060405180610100016040528061213a8c6107e1565b60ff16815260200161214b8c6111d3565b60ff1681526020018560ff1681526020018260ff16815260200186815260200160405180606001604052808b81526020018a81526020018981525081526020018381526020018481525098505050505050505050919050565b6121af848484611e47565b6121bb848484846122ac565b6118165760405162461bcd60e51b81526004016109339061373b565b6001600160e01b031981166301ffc9a760e01b14919050565b6121fa83836123c7565b61220760008484846122ac565b6109eb5760405162461bcd60e51b81526004016109339061373b565b61222e8383836109eb565b6001600160a01b03831661224a57612245816124a6565b61226d565b816001600160a01b0316836001600160a01b03161461226d5761226d83826124ea565b6001600160a01b0382166122895761228481612587565b6109eb565b826001600160a01b0316826001600160a01b0316146109eb576109eb8282612660565b60006122c0846001600160a01b03166126a4565b156123bc57836001600160a01b031663150b7a026122dc611d3a565b8786866040518563ffffffff1660e01b81526004016122fe9493929190613660565b602060405180830381600087803b15801561231857600080fd5b505af1925050508015612348575060408051601f3d908101601f1916820190925261234591810190612b95565b60015b6123a2573d808015612376576040519150601f19603f3d011682016040523d82523d6000602084013e61237b565b606091505b50805161239a5760405162461bcd60e51b81526004016109339061373b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610f36565b506001949350505050565b6001600160a01b0382166123ed5760405162461bcd60e51b8152600401610933906137fb565b6123f681611d1d565b156124135760405162461bcd60e51b81526004016109339061376b565b61241f60008383612223565b6001600160a01b03821660009081526003602052604081208054600192906124489084906139f1565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b600060016124f784611224565b6125019190613a54565b600083815260076020526040902054909150808214612554576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061259990600190613a54565b600083815260096020526040812054600880549394509092849081106125cf57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106125fe57634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061264457634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061266b83611224565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b3b151590565b604051806101000160405280600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001606081526020016126ed612701565b815260200160608152602001606081525090565b60405180606001604052806060815260200160608152602001606081525090565b60006127356127308461398c565b613963565b9050808382526020820190508285602086028201111561275457600080fd5b60005b85811015612780578161276a8882612900565b8452506020928301929190910190600101612757565b5050509392505050565b60006127986127308461398c565b905080838252602082019050828560208602820111156127b757600080fd5b60005b8581101561278057816127cd8882612916565b84525060209283019291909101906001016127ba565b60006127f1612730846139af565b90508281526020810184848401111561280957600080fd5b6107ae848285613ac9565b6000612822612730846139af565b90508281526020810184848401111561283a57600080fd5b6107ae848285613ad5565b80356107db81613ba0565b80516107db81613ba0565b600082601f83011261286c57600080fd5b8135610f36848260208601612722565b600082601f83011261288d57600080fd5b8151610f3684826020860161278a565b80356107db81613bb4565b80356107db81613bbd565b80516107db81613bbd565b600082601f8301126128cf57600080fd5b8135610f368482602086016127e3565b600082601f8301126128f057600080fd5b8151610f36848260208601612814565b80356107db81613bc6565b80516107db81613bc6565b80516107db81613bcf565b60006020828403121561293357600080fd5b6000610f368484612845565b60006020828403121561295157600080fd5b6000610f368484612850565b6000806040838503121561297057600080fd5b600061297c8585612845565b925050602061298d85828601612900565b9150509250929050565b600080604083850312156129aa57600080fd5b60006129b68585612845565b925050602061298d85828601612845565b6000806000606084860312156129dc57600080fd5b60006129e88686612845565b93505060206129f986828701612845565b9250506040612a0a86828701612900565b9150509250925092565b60008060008060808587031215612a2a57600080fd5b6000612a368787612845565b9450506020612a4787828801612845565b9350506040612a5887828801612900565b92505060608501356001600160401b03811115612a7457600080fd5b612a80878288016128be565b91505092959194509250565b60008060408385031215612a9f57600080fd5b6000612aab8585612845565b925050602061298d8582860161289d565b600060208284031215612ace57600080fd5b81356001600160401b03811115612ae457600080fd5b610f368482850161285b565b600080600060608486031215612b0557600080fd5b83516001600160401b03811115612b1b57600080fd5b612b278682870161287c565b93505060208401516001600160401b03811115612b4357600080fd5b612b4f8682870161287c565b92505060408401516001600160401b03811115612b6b57600080fd5b612a0a8682870161287c565b600060208284031215612b8957600080fd5b6000610f3684846128a8565b600060208284031215612ba757600080fd5b6000610f3684846128b3565b60008060408385031215612bc657600080fd5b82516001600160401b03811115612bdc57600080fd5b612be8858286016128df565b925050602061298d8582860161290b565b60008060408385031215612c0c57600080fd5b82516001600160401b03811115612c2257600080fd5b612c2e858286016128df565b925050602061298d85828601612916565b600060208284031215612c5157600080fd5b81516001600160401b03811115612c6757600080fd5b610f36848285016128df565b600080600060608486031215612c8857600080fd5b83516001600160401b03811115612c9e57600080fd5b612caa868287016128df565b93505060208401516001600160401b03811115612cc657600080fd5b612cd2868287016128df565b9250506040612a0a86828701612916565b600060208284031215612cf557600080fd5b6000610f368484612900565b600060208284031215612d1357600080fd5b6000610f36848461290b565b60008060408385031215612d3257600080fd5b6000612be8858561290b565b600060208284031215612d5057600080fd5b6000610f368484612916565b6000612d68838361362c565b505060200190565b6000612d68838361363e565b612d8581613a81565b82525050565b6000612d96826139df565b612da081856139e3565b9350612dab836139d9565b8060005b83811015612dd9578151612dc38882612d5c565b9750612dce836139d9565b925050600101612daf565b509495945050505050565b6000612def826139df565b612df981856139e3565b9350612e04836139d9565b8060005b83811015612dd9578151612e1c8882612d70565b9750612e27836139d9565b925050600101612e08565b6000612e3d826139df565b612e4781856139e3565b9350612e52836139d9565b8060005b83811015612dd9578151612e6a8882612d70565b9750612e75836139d9565b925050600101612e56565b612d8581613a8c565b6000612e94826139df565b612e9e81856139e3565b9350612eae818560208601613ad5565b612eb781613b96565b9093019392505050565b612d8581613ab3565b6000612ed76010836139e3565b6f092dce6eaccccd2c6d2cadce8408aa8960831b815260200192915050565b6000612f03602b836139e3565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7581526a74206f6620626f756e647360a81b602082015260400192915050565b6000612f506032836139e3565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581527131b2b4bb32b91034b6b83632b6b2b73a32b960711b602082015260400192915050565b6000612fa46017836139e3565b7f546f6b656e206973206e6f74206d696e74656420796574000000000000000000815260200192915050565b6000612fdd6026836139e3565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015260400192915050565b6000613025601c836139e3565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000815260200192915050565b600061305e600f836139e3565b6e15da5d1a191c985dc819985a5b1959608a1b815260200192915050565b60006130896024836139e3565b7f4552433732313a207472616e7366657220746f20746865207a65726f206164648152637265737360e01b602082015260400192915050565b60006130cf6019836139e3565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000815260200192915050565b60006131086014836139e3565b73496e73756666696369656e742062616c616e636560601b815260200192915050565b6000613138602c836139e3565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657881526b34b9ba32b73a103a37b5b2b760a11b602082015260400192915050565b60006131866038836139e3565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7781527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015260400192915050565b60006131e5602a836139e3565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a65815269726f206164647265737360b01b602082015260400192915050565b60006132316029836139e3565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737481526832b73a103a37b5b2b760b91b602082015260400192915050565b600061327c6020836139e3565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373815260200192915050565b60006132b5602c836139e3565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657881526b34b9ba32b73a103a37b5b2b760a11b602082015260400192915050565b60006133036020836139e3565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b600061333c6010836139e3565b6f151bdad95b881251081a5b9d985b1a5960821b815260200192915050565b60006133686029836139e3565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206981526839903737ba1037bbb760b91b602082015260400192915050565b60006133b36021836139e3565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e658152603960f91b602082015260400192915050565b60006107db6000836139ec565b6000613403600e836139e3565b6d151bdad95b881cdbdb19081bdd5d60921b815260200192915050565b600061342d6031836139e3565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f8152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b602082015260400192915050565b6000613480602c836139e3565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f81526b7574206f6620626f756e647360a01b602082015260400192915050565b60006134ce600d836139e3565b6c139bdd081e5bdd5c881313d3d5609a1b815260200192915050565b60006134f7601f836139e3565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b8051600090610100840190613538858261363e565b50602083015161354b602086018261363e565b50604083015161355e604086018261363e565b506060830151613571606086018261363e565b50608083015184820360808601526135898282612e89565b91505060a083015184820360a08601526135a382826135e0565b91505060c083015184820360c08601526135bd8282612e89565b91505060e083015184820360e08601526135d78282612e89565b95945050505050565b80516060808452600091908401906135f88282612de4565b915050602083015184820360208601526136128282612de4565b915050604083015184820360408601526135d78282612de4565b612d8581613aaa565b612d8581613abe565b612d8581613aad565b60006107db826133e9565b602081016107db8284612d7c565b6080810161366e8287612d7c565b61367b6020830186612d7c565b613688604083018561362c565b818103606083015261369a8184612e89565b9695505050505050565b602080825281016117d68184612e32565b606080825281016136c68186612e32565b905081810360208301526136da8185612e32565b905081810360408301526135d78184612e32565b602081016107db8284612e80565b602080825281016117d68184612e89565b602081016107db8284612ec1565b602080825281016107db81612eca565b602080825281016107db81612ef6565b602080825281016107db81612f43565b602080825281016107db81612f97565b602080825281016107db81612fd0565b602080825281016107db81613018565b602080825281016107db81613051565b602080825281016107db8161307c565b602080825281016107db816130c2565b602080825281016107db816130fb565b602080825281016107db8161312b565b602080825281016107db81613179565b602080825281016107db816131d8565b602080825281016107db81613224565b602080825281016107db8161326f565b602080825281016107db816132a8565b602080825281016107db816132f6565b602080825281016107db8161332f565b602080825281016107db8161335b565b602080825281016107db816133a6565b602080825281016107db816133f6565b602080825281016107db81613420565b602080825281016107db81613473565b602080825281016107db816134c1565b602080825281016107db816134ea565b608080825281016138bc8187613523565b905081810360208301526138d08186612e32565b905081810360408301526138e48185612e32565b9050818103606083015261369a8184612e32565b602081016107db828461362c565b60608101613914828661362c565b81810360208301526139268185613523565b905081810360408301526135d78184612d8b565b60408101613948828561362c565b6117d66020830184613635565b602081016107db828461363e565b6040518181016001600160401b038111828210171561398457613984613b80565b604052919050565b60006001600160401b038211156139a5576139a5613b80565b5060209081020190565b60006001600160401b038211156139c8576139c8613b80565b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b919050565b60006139fc82613aaa565b9150613a0783613aaa565b92508219821115613a1a57613a1a613b54565b500190565b6000613a2a82613aaa565b9150613a3583613aaa565b9250816000190483118215151615613a4f57613a4f613b54565b500290565b6000613a5f82613aaa565b9150613a6a83613aaa565b925082821015613a7c57613a7c613b54565b500390565b60006107db82613a9e565b151590565b6001600160e01b03191690565b6001600160a01b031690565b90565b60ff1690565b60006107db82613a81565b60006107db82613aad565b82818337506000910152565b60005b83811015613af0578181015183820152602001613ad8565b838111156118165750506000910152565b600281046001821680613b1557607f821691505b60208210811415613b2857613b28613b6a565b50919050565b6000613b3982613aaa565b9150600019821415613b4d57613b4d613b54565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b601f01601f191690565b613ba981613a81565b8114611b7b57600080fd5b613ba981613a8c565b613ba981613a91565b613ba981613aaa565b613ba981613aad56fea2646970667358221220c84b527bc1826393e2692b2848974c33ab1626d972cd021ed25139e8e16bf95964736f6c63430008000033000000000000000000000000ff9c1b15b16263c61d017ee9f65c50e4ae0113d7000000000000000000000000f701f9cd49216fa6111ba4c8d41227178592e9b40000000000000000000000007c33284fe491a1212a99c0edc499e282920a265c000000000000000000000000d2806cce4be35ae7b84a25d11b5c2f1a6deeedcb

Deployed Bytecode

0x6080604052600436106102465760003560e01c80636db4080011610139578063b0dc78fa116100b6578063db9ee4451161007a578063db9ee44514610650578063e834a83414610670578063e985e9c514610685578063f0503e80146106a5578063f2fde38b146106c5578063f3fef3a3146106e557610246565b8063b0dc78fa146105ac578063b88d4fde146105cc578063c87b56dd146105ec578063cc6dd9471461060c578063d607497a1461063b57610246565b80638da5cb5b116100fd5780638da5cb5b1461053a578063925489a81461054f57806395d89b4114610562578063a035b1fe14610577578063a22cb4651461058c57610246565b80636db40800146104bb5780637072c6b1146104db57806370a08231146104f0578063715018a6146105105780637afa1eed1461052557610246565b80632f745c59116101c75780634f6ccce71161018b5780634f6ccce714610424578063586fc5b5146104445780636352211e14610459578063684931ed146104795780636b8ff5741461049b57610246565b80632f745c591461039e578063379607f5146103be5780633bb31416146103d157806342842e0e146103f1578063434f48c41461041157610246565b8063095ea7b31161020e578063095ea7b31461031d5780631249c58b1461033f57806318160ddd1461034757806323b872dd14610369578063293cdbf11461038957610246565b8063012921351461024b57806301ffc9a714610281578063023c23db146102ae57806306fdde03146102db578063081812fc146102f0575b600080fd5b34801561025757600080fd5b5061026b610266366004612ce3565b610705565b60405161027891906136fc565b60405180910390f35b34801561028d57600080fd5b506102a161029c366004612b77565b6107b6565b60405161027891906136ee565b3480156102ba57600080fd5b506102ce6102c9366004612ce3565b6107e1565b6040516102789190613955565b3480156102e757600080fd5b5061026b61087a565b3480156102fc57600080fd5b5061031061030b366004612ce3565b61090c565b6040516102789190613652565b34801561032957600080fd5b5061033d61033836600461295d565b610958565b005b61033d6109f0565b34801561035357600080fd5b5061035c610b64565b60405161027891906138f8565b34801561037557600080fd5b5061033d6103843660046129c7565b610b6a565b34801561039557600080fd5b5061033d610ba2565b3480156103aa57600080fd5b5061035c6103b936600461295d565b610c22565b61033d6103cc366004612ce3565b610c74565b3480156103dd57600080fd5b5061035c6103ec366004612ce3565b610e8d565b3480156103fd57600080fd5b5061033d61040c3660046129c7565b610f3e565b61033d61041f366004612ce3565b610f59565b34801561043057600080fd5b5061035c61043f366004612ce3565b611088565b34801561045057600080fd5b5061035c6110e3565b34801561046557600080fd5b50610310610474366004612ce3565b6110e9565b34801561048557600080fd5b5061048e61111e565b604051610278919061370d565b3480156104a757600080fd5b5061026b6104b6366004612ce3565b61112d565b3480156104c757600080fd5b506102ce6104d6366004612ce3565b6111d3565b3480156104e757600080fd5b506102a161121b565b3480156104fc57600080fd5b5061035c61050b366004612921565b611224565b34801561051c57600080fd5b5061033d611268565b34801561053157600080fd5b5061048e6112b3565b34801561054657600080fd5b506103106112c2565b61033d61055d366004612abc565b6112d1565b34801561056e57600080fd5b5061026b61164d565b34801561058357600080fd5b5061035c61165c565b34801561059857600080fd5b5061033d6105a7366004612a8c565b611662565b3480156105b857600080fd5b5061026b6105c7366004612ce3565b611730565b3480156105d857600080fd5b5061033d6105e7366004612a14565b6117dd565b3480156105f857600080fd5b5061026b610607366004612ce3565b61181c565b34801561061857600080fd5b5061062c610627366004612ce3565b6119c0565b604051610278939291906136b5565b34801561064757600080fd5b5061048e611a80565b34801561065c57600080fd5b5061035c61066b366004612ce3565b611a8f565b34801561067c57600080fd5b5061035c611ac7565b34801561069157600080fd5b506102a16106a0366004612997565b611acd565b3480156106b157600080fd5b5061035c6106c0366004612ce3565b611afb565b3480156106d157600080fd5b5061033d6106e0366004612921565b611b0d565b3480156106f157600080fd5b5061033d61070036600461295d565b611b7e565b606061071082611c8b565b600d546000838152600f602052604081205490916001600160a01b03169063ff8f8c189061073d866107e1565b6040518363ffffffff1660e01b815260040161075a92919061393a565b60006040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107ae9190810190612bf9565b509392505050565b60006001600160e01b0319821663780e9d6360e01b14806107db57506107db82611cdd565b92915050565b60006107ec82611c8b565b600e546000838152600f60205260409081902054905163023c23db60e01b81526001600160a01b039092169163023c23db9161082a916004016138f8565b60206040518083038186803b15801561084257600080fd5b505afa158015610856573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190612d3e565b60606000805461088990613b01565b80601f01602080910402602001604051908101604052809291908181526020018280546108b590613b01565b80156109025780601f106108d757610100808354040283529160200191610902565b820191906000526020600020905b8154815290600101906020018083116108e557829003601f168201915b5050505050905090565b600061091782611d1d565b61093c5760405162461bcd60e51b81526004016109339061380b565b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b6000610963826110e9565b9050806001600160a01b0316836001600160a01b031614156109975760405162461bcd60e51b81526004016109339061384b565b806001600160a01b03166109a9611d3a565b6001600160a01b031614806109c557506109c5816106a0611d3a565b6109e15760405162461bcd60e51b8152600401610933906137cb565b6109eb8383611d3e565b505050565b6002600a541415610a135760405162461bcd60e51b81526004016109339061389b565b6002600a5560115461232811610a3b5760405162461bcd60e51b81526004016109339061385b565b601454341015610a5d5760405162461bcd60e51b81526004016109339061371b565b6000601160008154610a6e90613b2e565b9182905550600e5460405163e0d4ea3760e01b81529192506001600160a01b03169063e0d4ea3790610aa49084906004016138f8565b60206040518083038186803b158015610abc57600080fd5b505afa158015610ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af49190612d01565b6000828152600f6020526040902055610b14610b0e611d3a565b82611dac565b610b1c611d3a565b6001600160a01b03167f30385c845b448a36257a6a1716e6ad2e1bc2cbe333cde1e69fe849ad6511adfe82604051610b5491906138f8565b60405180910390a2506001600a55565b60085490565b610b7b610b75611d3a565b82611dca565b610b975760405162461bcd60e51b81526004016109339061386b565b6109eb838383611e47565b6002600a541415610bc55760405162461bcd60e51b81526004016109339061389b565b6002600a55610bd2611d3a565b6001600160a01b0316610be36112c2565b6001600160a01b031614610c095760405162461bcd60e51b81526004016109339061381b565b6013805460ff19811660ff909116151790556001600a55565b6000610c2d83611224565b8210610c4b5760405162461bcd60e51b81526004016109339061372b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b6002600a541415610c975760405162461bcd60e51b81526004016109339061389b565b6002600a558015801590610cac5750611e6281105b610cc85760405162461bcd60e51b81526004016109339061382b565b60135460ff161580610d6057506010546040516331a9108f60e11b815233916001600160a01b031690636352211e90610d059085906004016138f8565b60206040518083038186803b158015610d1d57600080fd5b505afa158015610d31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d55919061293f565b6001600160a01b0316145b610d7c5760405162461bcd60e51b81526004016109339061388b565b346014541115610d9e5760405162461bcd60e51b81526004016109339061371b565b60128054906000610dae83613b2e565b9091555050600e5460405163e0d4ea3760e01b81526001600160a01b039091169063e0d4ea3790610de39084906004016138f8565b60206040518083038186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190612d01565b6000828152600f6020526040902055610e4d610b0e611d3a565b610e55611d3a565b6001600160a01b03167fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a82604051610b5491906138f8565b6000610e9882611c8b565b600d546000838152600f602052604081205490916001600160a01b031690634d4c71a390610ec5866107e1565b6040518363ffffffff1660e01b8152600401610ee292919061393a565b60006040518083038186803b158015610efa57600080fd5b505afa158015610f0e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f369190810190612bb3565b949350505050565b6109eb838383604051806020016040528060008152506117dd565b6002600a541415610f7c5760405162461bcd60e51b81526004016109339061389b565b6002600a55610f89611d3a565b6001600160a01b0316610f9a6112c2565b6001600160a01b031614610fc05760405162461bcd60e51b81526004016109339061381b565b611e6181118015610fd25750611f4181105b610fee5760405162461bcd60e51b81526004016109339061382b565b600e5460405163e0d4ea3760e01b81526001600160a01b039091169063e0d4ea379061101e9084906004016138f8565b60206040518083038186803b15801561103657600080fd5b505afa15801561104a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106e9190612d01565b6000828152600f6020526040902055610e4d610b0e6112c2565b6000611092610b64565b82106110b05760405162461bcd60e51b81526004016109339061387b565b600882815481106110d157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b60115481565b6000818152600260205260408120546001600160a01b0316806107db5760405162461bcd60e51b8152600401610933906137eb565b600e546001600160a01b031681565b606061113882611c8b565b600e546000838152600f6020526040808220549051631ae3fd5d60e21b815291926001600160a01b031691636b8ff57491611175916004016138f8565b60006040518083038186803b15801561118d57600080fd5b505afa1580156111a1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111c99190810190612c73565b5090949350505050565b60006111de82611c8b565b600e546000838152600f602052604090819020549051620db68160eb1b81526001600160a01b0390921691636db408009161082a916004016138f8565b60135460ff1681565b60006001600160a01b03821661124c5760405162461bcd60e51b8152600401610933906137db565b506001600160a01b031660009081526003602052604090205490565b611270611d3a565b6001600160a01b03166112816112c2565b6001600160a01b0316146112a75760405162461bcd60e51b81526004016109339061381b565b6112b16000611f74565b565b600d546001600160a01b031681565b600b546001600160a01b031690565b6002600a5414156112f45760405162461bcd60e51b81526004016109339061389b565b6002600a5560005b815181101561164457600082828151811061132757634e487b7160e01b600052603260045260246000fd5b60200260200101511180156113645750611e6282828151811061135a57634e487b7160e01b600052603260045260246000fd5b6020026020010151105b6113805760405162461bcd60e51b81526004016109339061382b565b60135460ff1615806114435750601054825133916001600160a01b031690636352211e908590859081106113c457634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b81526004016113e891906138f8565b60206040518083038186803b15801561140057600080fd5b505afa158015611414573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611438919061293f565b6001600160a01b0316145b61145f5760405162461bcd60e51b81526004016109339061388b565b34825160145461146f9190613a1f565b111561148d5760405162461bcd60e51b81526004016109339061371b565b6012805490600061149d83613b2e565b9091555050600e5482516001600160a01b039091169063e0d4ea37908490849081106114d957634e487b7160e01b600052603260045260246000fd5b60200260200101516040518263ffffffff1660e01b81526004016114fd91906138f8565b60206040518083038186803b15801561151557600080fd5b505afa158015611529573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154d9190612d01565b600f600084848151811061157157634e487b7160e01b600052603260045260246000fd5b60200260200101518152602001908152602001600020819055506115c3611596611d3a565b8383815181106115b657634e487b7160e01b600052603260045260246000fd5b6020026020010151611dac565b6115cb611d3a565b6001600160a01b03167fd8138f8a3f377c5259ca548e70e4c2de94f129f5a11036a15b69513cba2b426a83838151811061161557634e487b7160e01b600052603260045260246000fd5b602002602001015160405161162a91906138f8565b60405180910390a28061163c81613b2e565b9150506112fc565b50506001600a55565b60606001805461088990613b01565b60145481565b61166a611d3a565b6001600160a01b0316826001600160a01b0316141561169b5760405162461bcd60e51b81526004016109339061379b565b80600560006116a8611d3a565b6001600160a01b03908116825260208083019390935260409182016000908120918716808252919093529120805460ff1916921515929092179091556116ec611d3a565b6001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161172491906136ee565b60405180910390a35050565b6060600061173d83611fc6565b600c5460a08201518051602082015160409283015192516329010f4360e01b81529495506001600160a01b03909316936329010f4393611782938793926004016138ab565b60006040518083038186803b15801561179a57600080fd5b505afa1580156117ae573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117d69190810190612c3f565b9392505050565b6117ee6117e8611d3a565b83611dca565b61180a5760405162461bcd60e51b81526004016109339061386b565b611816848484846121a4565b50505050565b606061182782611c8b565b600061183283611fc6565b604080516002808252606082018352929350600092909160208301908036833701905050600d5460a084015160409081015190516397155f4f60e01b81529293506001600160a01b03909116916397155f4f91611891916004016136a4565b604080518083038186803b1580156118a857600080fd5b505afa1580156118bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e09190612d1f565b8260008151811061190157634e487b7160e01b600052603260045260246000fd5b602002602001018360018151811061192957634e487b7160e01b600052603260045260246000fd5b602090810291909101019190915252600c546040516319db2b2f60e01b81526001600160a01b03909116906319db2b2f9061196c90879086908690600401613906565b60006040518083038186803b15801561198457600080fd5b505afa158015611998573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f369190810190612c3f565b60608060606119ce84611c8b565b600d546000858152600f60205260408120549091829182916001600160a01b0316906340070627906119ff8a6107e1565b6040518363ffffffff1660e01b8152600401611a1c92919061393a565b60006040518083038186803b158015611a3457600080fd5b505afa158015611a48573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a709190810190612af0565b9199909850909650945050505050565b600c546001600160a01b031681565b6000611a9a82611c8b565b600d546000838152600f602052604081205490916001600160a01b03169063cd7acca690610ec5866107e1565b60125481565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b600f6020526000908152604090205481565b611b15611d3a565b6001600160a01b0316611b266112c2565b6001600160a01b031614611b4c5760405162461bcd60e51b81526004016109339061381b565b6001600160a01b038116611b725760405162461bcd60e51b81526004016109339061375b565b611b7b81611f74565b50565b6002600a541415611ba15760405162461bcd60e51b81526004016109339061389b565b6002600a55611bae611d3a565b6001600160a01b0316611bbf6112c2565b6001600160a01b031614611be55760405162461bcd60e51b81526004016109339061381b565b80471015611c055760405162461bcd60e51b8152600401610933906137ab565b6000826001600160a01b031682604051611c1e90613647565b60006040518083038185875af1925050503d8060008114611c5b576040519150601f19603f3d011682016040523d82523d6000602084013e611c60565b606091505b5050905080611c815760405162461bcd60e51b81526004016109339061377b565b50506001600a5550565b600081118015611c9c575061232981105b611cb85760405162461bcd60e51b81526004016109339061382b565b611cc181611d1d565b611b7b5760405162461bcd60e51b81526004016109339061374b565b60006001600160e01b031982166380ac58cd60e01b1480611d0e57506001600160e01b03198216635b5e139f60e01b145b806107db57506107db826121d7565b6000908152600260205260409020546001600160a01b0316151590565b3390565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611d73826110e9565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b611dc68282604051806020016040528060008152506121f0565b5050565b6000611dd582611d1d565b611df15760405162461bcd60e51b8152600401610933906137bb565b6000611dfc836110e9565b9050806001600160a01b0316846001600160a01b03161480611e375750836001600160a01b0316611e2c8461090c565b6001600160a01b0316145b80610f365750610f368185611acd565b826001600160a01b0316611e5a826110e9565b6001600160a01b031614611e805760405162461bcd60e51b81526004016109339061383b565b6001600160a01b038216611ea65760405162461bcd60e51b81526004016109339061378b565b611eb1838383612223565b611ebc600082611d3e565b6001600160a01b0383166000908152600360205260408120805460019290611ee5908490613a54565b90915550506001600160a01b0382166000908152600360205260408120805460019290611f139084906139f1565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b611fce6126aa565b6000806000611fdc856119c0565b600d546000898152600f6020526040812054949750929550909350909182916001600160a01b03169063ff8f8c18906120148a6107e1565b6040518363ffffffff1660e01b815260040161203192919061393a565b60006040518083038186803b15801561204957600080fd5b505afa15801561205d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120859190810190612bf9565b600e5460008a8152600f6020526040808220549051631ae3fd5d60e21b815294965092945092839283926001600160a01b031691636b8ff574916120cb916004016138f8565b60006040518083038186803b1580156120e357600080fd5b505afa1580156120f7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261211f9190810190612c73565b92509250925060405180610100016040528061213a8c6107e1565b60ff16815260200161214b8c6111d3565b60ff1681526020018560ff1681526020018260ff16815260200186815260200160405180606001604052808b81526020018a81526020018981525081526020018381526020018481525098505050505050505050919050565b6121af848484611e47565b6121bb848484846122ac565b6118165760405162461bcd60e51b81526004016109339061373b565b6001600160e01b031981166301ffc9a760e01b14919050565b6121fa83836123c7565b61220760008484846122ac565b6109eb5760405162461bcd60e51b81526004016109339061373b565b61222e8383836109eb565b6001600160a01b03831661224a57612245816124a6565b61226d565b816001600160a01b0316836001600160a01b03161461226d5761226d83826124ea565b6001600160a01b0382166122895761228481612587565b6109eb565b826001600160a01b0316826001600160a01b0316146109eb576109eb8282612660565b60006122c0846001600160a01b03166126a4565b156123bc57836001600160a01b031663150b7a026122dc611d3a565b8786866040518563ffffffff1660e01b81526004016122fe9493929190613660565b602060405180830381600087803b15801561231857600080fd5b505af1925050508015612348575060408051601f3d908101601f1916820190925261234591810190612b95565b60015b6123a2573d808015612376576040519150601f19603f3d011682016040523d82523d6000602084013e61237b565b606091505b50805161239a5760405162461bcd60e51b81526004016109339061373b565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610f36565b506001949350505050565b6001600160a01b0382166123ed5760405162461bcd60e51b8152600401610933906137fb565b6123f681611d1d565b156124135760405162461bcd60e51b81526004016109339061376b565b61241f60008383612223565b6001600160a01b03821660009081526003602052604081208054600192906124489084906139f1565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b600060016124f784611224565b6125019190613a54565b600083815260076020526040902054909150808214612554576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061259990600190613a54565b600083815260096020526040812054600880549394509092849081106125cf57634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600883815481106125fe57634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061264457634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061266b83611224565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b3b151590565b604051806101000160405280600060ff168152602001600060ff168152602001600060ff168152602001600060ff168152602001606081526020016126ed612701565b815260200160608152602001606081525090565b60405180606001604052806060815260200160608152602001606081525090565b60006127356127308461398c565b613963565b9050808382526020820190508285602086028201111561275457600080fd5b60005b85811015612780578161276a8882612900565b8452506020928301929190910190600101612757565b5050509392505050565b60006127986127308461398c565b905080838252602082019050828560208602820111156127b757600080fd5b60005b8581101561278057816127cd8882612916565b84525060209283019291909101906001016127ba565b60006127f1612730846139af565b90508281526020810184848401111561280957600080fd5b6107ae848285613ac9565b6000612822612730846139af565b90508281526020810184848401111561283a57600080fd5b6107ae848285613ad5565b80356107db81613ba0565b80516107db81613ba0565b600082601f83011261286c57600080fd5b8135610f36848260208601612722565b600082601f83011261288d57600080fd5b8151610f3684826020860161278a565b80356107db81613bb4565b80356107db81613bbd565b80516107db81613bbd565b600082601f8301126128cf57600080fd5b8135610f368482602086016127e3565b600082601f8301126128f057600080fd5b8151610f36848260208601612814565b80356107db81613bc6565b80516107db81613bc6565b80516107db81613bcf565b60006020828403121561293357600080fd5b6000610f368484612845565b60006020828403121561295157600080fd5b6000610f368484612850565b6000806040838503121561297057600080fd5b600061297c8585612845565b925050602061298d85828601612900565b9150509250929050565b600080604083850312156129aa57600080fd5b60006129b68585612845565b925050602061298d85828601612845565b6000806000606084860312156129dc57600080fd5b60006129e88686612845565b93505060206129f986828701612845565b9250506040612a0a86828701612900565b9150509250925092565b60008060008060808587031215612a2a57600080fd5b6000612a368787612845565b9450506020612a4787828801612845565b9350506040612a5887828801612900565b92505060608501356001600160401b03811115612a7457600080fd5b612a80878288016128be565b91505092959194509250565b60008060408385031215612a9f57600080fd5b6000612aab8585612845565b925050602061298d8582860161289d565b600060208284031215612ace57600080fd5b81356001600160401b03811115612ae457600080fd5b610f368482850161285b565b600080600060608486031215612b0557600080fd5b83516001600160401b03811115612b1b57600080fd5b612b278682870161287c565b93505060208401516001600160401b03811115612b4357600080fd5b612b4f8682870161287c565b92505060408401516001600160401b03811115612b6b57600080fd5b612a0a8682870161287c565b600060208284031215612b8957600080fd5b6000610f3684846128a8565b600060208284031215612ba757600080fd5b6000610f3684846128b3565b60008060408385031215612bc657600080fd5b82516001600160401b03811115612bdc57600080fd5b612be8858286016128df565b925050602061298d8582860161290b565b60008060408385031215612c0c57600080fd5b82516001600160401b03811115612c2257600080fd5b612c2e858286016128df565b925050602061298d85828601612916565b600060208284031215612c5157600080fd5b81516001600160401b03811115612c6757600080fd5b610f36848285016128df565b600080600060608486031215612c8857600080fd5b83516001600160401b03811115612c9e57600080fd5b612caa868287016128df565b93505060208401516001600160401b03811115612cc657600080fd5b612cd2868287016128df565b9250506040612a0a86828701612916565b600060208284031215612cf557600080fd5b6000610f368484612900565b600060208284031215612d1357600080fd5b6000610f36848461290b565b60008060408385031215612d3257600080fd5b6000612be8858561290b565b600060208284031215612d5057600080fd5b6000610f368484612916565b6000612d68838361362c565b505060200190565b6000612d68838361363e565b612d8581613a81565b82525050565b6000612d96826139df565b612da081856139e3565b9350612dab836139d9565b8060005b83811015612dd9578151612dc38882612d5c565b9750612dce836139d9565b925050600101612daf565b509495945050505050565b6000612def826139df565b612df981856139e3565b9350612e04836139d9565b8060005b83811015612dd9578151612e1c8882612d70565b9750612e27836139d9565b925050600101612e08565b6000612e3d826139df565b612e4781856139e3565b9350612e52836139d9565b8060005b83811015612dd9578151612e6a8882612d70565b9750612e75836139d9565b925050600101612e56565b612d8581613a8c565b6000612e94826139df565b612e9e81856139e3565b9350612eae818560208601613ad5565b612eb781613b96565b9093019392505050565b612d8581613ab3565b6000612ed76010836139e3565b6f092dce6eaccccd2c6d2cadce8408aa8960831b815260200192915050565b6000612f03602b836139e3565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7581526a74206f6620626f756e647360a81b602082015260400192915050565b6000612f506032836139e3565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581527131b2b4bb32b91034b6b83632b6b2b73a32b960711b602082015260400192915050565b6000612fa46017836139e3565b7f546f6b656e206973206e6f74206d696e74656420796574000000000000000000815260200192915050565b6000612fdd6026836139e3565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015260400192915050565b6000613025601c836139e3565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000815260200192915050565b600061305e600f836139e3565b6e15da5d1a191c985dc819985a5b1959608a1b815260200192915050565b60006130896024836139e3565b7f4552433732313a207472616e7366657220746f20746865207a65726f206164648152637265737360e01b602082015260400192915050565b60006130cf6019836139e3565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000815260200192915050565b60006131086014836139e3565b73496e73756666696369656e742062616c616e636560601b815260200192915050565b6000613138602c836139e3565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657881526b34b9ba32b73a103a37b5b2b760a11b602082015260400192915050565b60006131866038836139e3565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7781527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015260400192915050565b60006131e5602a836139e3565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a65815269726f206164647265737360b01b602082015260400192915050565b60006132316029836139e3565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737481526832b73a103a37b5b2b760b91b602082015260400192915050565b600061327c6020836139e3565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373815260200192915050565b60006132b5602c836139e3565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657881526b34b9ba32b73a103a37b5b2b760a11b602082015260400192915050565b60006133036020836139e3565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b600061333c6010836139e3565b6f151bdad95b881251081a5b9d985b1a5960821b815260200192915050565b60006133686029836139e3565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206981526839903737ba1037bbb760b91b602082015260400192915050565b60006133b36021836139e3565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e658152603960f91b602082015260400192915050565b60006107db6000836139ec565b6000613403600e836139e3565b6d151bdad95b881cdbdb19081bdd5d60921b815260200192915050565b600061342d6031836139e3565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f8152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b602082015260400192915050565b6000613480602c836139e3565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f81526b7574206f6620626f756e647360a01b602082015260400192915050565b60006134ce600d836139e3565b6c139bdd081e5bdd5c881313d3d5609a1b815260200192915050565b60006134f7601f836139e3565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815260200192915050565b8051600090610100840190613538858261363e565b50602083015161354b602086018261363e565b50604083015161355e604086018261363e565b506060830151613571606086018261363e565b50608083015184820360808601526135898282612e89565b91505060a083015184820360a08601526135a382826135e0565b91505060c083015184820360c08601526135bd8282612e89565b91505060e083015184820360e08601526135d78282612e89565b95945050505050565b80516060808452600091908401906135f88282612de4565b915050602083015184820360208601526136128282612de4565b915050604083015184820360408601526135d78282612de4565b612d8581613aaa565b612d8581613abe565b612d8581613aad565b60006107db826133e9565b602081016107db8284612d7c565b6080810161366e8287612d7c565b61367b6020830186612d7c565b613688604083018561362c565b818103606083015261369a8184612e89565b9695505050505050565b602080825281016117d68184612e32565b606080825281016136c68186612e32565b905081810360208301526136da8185612e32565b905081810360408301526135d78184612e32565b602081016107db8284612e80565b602080825281016117d68184612e89565b602081016107db8284612ec1565b602080825281016107db81612eca565b602080825281016107db81612ef6565b602080825281016107db81612f43565b602080825281016107db81612f97565b602080825281016107db81612fd0565b602080825281016107db81613018565b602080825281016107db81613051565b602080825281016107db8161307c565b602080825281016107db816130c2565b602080825281016107db816130fb565b602080825281016107db8161312b565b602080825281016107db81613179565b602080825281016107db816131d8565b602080825281016107db81613224565b602080825281016107db8161326f565b602080825281016107db816132a8565b602080825281016107db816132f6565b602080825281016107db8161332f565b602080825281016107db8161335b565b602080825281016107db816133a6565b602080825281016107db816133f6565b602080825281016107db81613420565b602080825281016107db81613473565b602080825281016107db816134c1565b602080825281016107db816134ea565b608080825281016138bc8187613523565b905081810360208301526138d08186612e32565b905081810360408301526138e48185612e32565b9050818103606083015261369a8184612e32565b602081016107db828461362c565b60608101613914828661362c565b81810360208301526139268185613523565b905081810360408301526135d78184612d8b565b60408101613948828561362c565b6117d66020830184613635565b602081016107db828461363e565b6040518181016001600160401b038111828210171561398457613984613b80565b604052919050565b60006001600160401b038211156139a5576139a5613b80565b5060209081020190565b60006001600160401b038211156139c8576139c8613b80565b506020601f91909101601f19160190565b60200190565b5190565b90815260200190565b919050565b60006139fc82613aaa565b9150613a0783613aaa565b92508219821115613a1a57613a1a613b54565b500190565b6000613a2a82613aaa565b9150613a3583613aaa565b9250816000190483118215151615613a4f57613a4f613b54565b500290565b6000613a5f82613aaa565b9150613a6a83613aaa565b925082821015613a7c57613a7c613b54565b500390565b60006107db82613a9e565b151590565b6001600160e01b03191690565b6001600160a01b031690565b90565b60ff1690565b60006107db82613a81565b60006107db82613aad565b82818337506000910152565b60005b83811015613af0578181015183820152602001613ad8565b838111156118165750506000910152565b600281046001821680613b1557607f821691505b60208210811415613b2857613b28613b6a565b50919050565b6000613b3982613aaa565b9150600019821415613b4d57613b4d613b54565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b601f01601f191690565b613ba981613a81565b8114611b7b57600080fd5b613ba981613a8c565b613ba981613a91565b613ba981613aaa565b613ba981613aad56fea2646970667358221220c84b527bc1826393e2692b2848974c33ab1626d972cd021ed25139e8e16bf95964736f6c63430008000033

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

000000000000000000000000ff9c1b15b16263c61d017ee9f65c50e4ae0113d7000000000000000000000000f701f9cd49216fa6111ba4c8d41227178592e9b40000000000000000000000007c33284fe491a1212a99c0edc499e282920a265c000000000000000000000000d2806cce4be35ae7b84a25d11b5c2f1a6deeedcb

-----Decoded View---------------
Arg [0] : _lootContract (address): 0xFF9C1b15B16263C61d017ee9F65C50e4AE0113D7
Arg [1] : _render (address): 0xf701F9cd49216FA6111Ba4c8d41227178592E9B4
Arg [2] : _generator (address): 0x7c33284fe491A1212A99C0eDC499E282920a265c
Arg [3] : _seeder (address): 0xD2806cCE4be35ae7B84a25D11B5c2F1a6deeEdcB

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000ff9c1b15b16263c61d017ee9f65c50e4ae0113d7
Arg [1] : 000000000000000000000000f701f9cd49216fa6111ba4c8d41227178592e9b4
Arg [2] : 0000000000000000000000007c33284fe491a1212a99c0edc499e282920a265c
Arg [3] : 000000000000000000000000d2806cce4be35ae7b84a25d11b5c2f1a6deeedcb


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.