// File: sol/LWMempools.sol



//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;

import './LTNT.sol';
import './lib/Rando.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';



/**

          ___  ___      ___        __   __        __  
|     /\   |  |__  |\ |  |   |  | /  \ |__) |__/ /__` 
|___ /~~\  |  |___ | \|  |  .|/\| \__/ |  \ |  \ .__/ 
                                                      
"mempools", latent.works, 2022


*/


/// @title Mempools
/// @author troels_a
/// @notice latent.works/mempools

contract LWMempools is ERC721, LTNTIssuer, Ownable, ReentrancyGuard {

    /// @dev main bank struct
    struct Bank {
        string _name; // name of bank
        string[4] _parts; // parts of the bank
        string _filter;
        uint[15] _pools;
    }

    uint public constant PRICE = 0.15 ether; // The price of one mempool

    uint private _pool_ids; // Tracks the current pool id
    Bank[15] private _banks; // Holds banks
    mapping(uint => uint) private _pool_timestamps; // Holds the timestamp of when a pool was created
    mapping(uint => uint) private _pool_banks; // Holds the bank id of a pool - id => bank_index
    mapping(uint => uint) private _pool_fixed_epochs; // Holds the fixed epoch of a pool - id => epoch

    LTNT public immutable _ltnt; // The LTNT token contract
    LWMempools_Gen public immutable _generator; // The generator contract
    LWMempools_Meta private _meta; // The meta contract


    //////////////////////////
    /// CONTRACT
    //////////////////////////

    constructor(address ltnt_) ERC721("Mempools", "MMPLS"){
        _ltnt = LTNT(ltnt_); // Set the LTNT token contract
        _generator = new LWMempools_Gen(); // Deploy the generator contract
        _meta = new LWMempools_Meta(); // Deploy the meta contract
    }

    /// @dev declare issuer info for LTNT
    /// @return LTNT.IssuerInfo struct with issuer info
    /// @param param_ the LTNT token params struct
    function issuerInfo(uint, LTNT.Param memory param_) public view override returns(LTNT.IssuerInfo memory){
        return LTNT.IssuerInfo('mempools', getPoolImage(param_._uint, true));
    }


    /// @dev get the address of the _meta contract
    /// @return address of the _meta contract
    function getMeta() public view returns (address){
        return address(_meta);
    }


    /// @dev set the address of the _meta contract
    /// @param meta_ the address of the new _meta contract
    function setMeta(address meta_) public onlyOwner {
        _meta = LWMempools_Meta(meta_);
    }




    /////////////////////////////
    /// MINTING
    /////////////////////////////


    /// @dev mint a new mempool
    /// @param bank_index_ the bank id of the mempool
    /// @param pool_index_ the pool id of the mempool
    function mint(uint bank_index_, uint pool_index_) public payable nonReentrant {
        uint bank_count_ = getBankCount();
        require(msg.value == PRICE, 'INVALID_PRICE'); // Check price
        require(bank_count_ > 0 && bank_index_ < bank_count_, 'INVALID_BANK'); // Check bank index
        require(_banks[bank_index_]._pools[pool_index_] == 0, 'POOL_INDEX_USED'); // Check pool index
        _mintFor(msg.sender, bank_index_, pool_index_); // Mint the mempool
    }


    /// @dev mint a new mempool holding a LTNT token
    /// @param ltnt_id_ the id of the LTNT token to hold
    /// @param bank_index_ the bank id of the mempool
    /// @param pool_index_ the pool id of the mempool
    function mintWithLTNT(uint ltnt_id_, uint bank_index_, uint pool_index_) public payable nonReentrant {
        uint bank_count_ = getBankCount();
        require(msg.value == (PRICE/3)*2, 'INVALID_PRICE'); // Check price
        require(_ltnt.ownerOf(ltnt_id_) == msg.sender, 'NOT_LTNT_HOLDER'); // Check LTNT ownership
        require(!_ltnt.hasStamp(ltnt_id_, address(this)), 'ALREADY_STAMPED'); // Check if LTNT is already stamped
        require(bank_count_ > 0 && bank_index_ < bank_count_, 'INVALID_BANK'); // Check bank index
        require(_banks[bank_index_]._pools[pool_index_] == 0, 'POOL_INDEX_USED'); // Check pool index
        uint id_ = _mintFor(msg.sender, bank_index_, pool_index_); // Mint the mempool
        _ltnt.stamp(ltnt_id_, LTNT.Param(id_, address(0), '', false)); // Stamp the LTNT token
    }


    /// @dev internal mint function
    function _mintFor(address for_, uint bank_, uint index_) private returns(uint) {
        _pool_ids++; // Increment the pool id
        _mint(for_, _pool_ids); // Mint the token
        _pool_timestamps[_pool_ids] = block.timestamp; // Set the timestamp of the pool
        _pool_banks[_pool_ids] = bank_; // Set the bank of the pool
        _banks[bank_]._pools[index_] = _pool_ids; // Set the pool id of the bank
        return _pool_ids;
    }


    /// @dev get the total supply of mempools
    /// @return uint total supply of mempools
    function totalSupply() public view returns (uint) {
        return _pool_ids;
    }


    /////////////////////////////
    /// BANKS
    /////////////////////////////


    /// @dev add a bank to the contract
    /// @param name_ the name of the bank
    /// @param parts_ the parts of the bank
    /// @param filter_ the filter of the bank
    function addBank(string memory name_, string[4] memory parts_, string memory filter_) public onlyOwner {

        uint next_index_ = getBankCount(); // Current count should be equal to next index since we start at 0
        require(next_index_ < _banks.length, "MAX_BANKS"); // Make sure we don't exceed the max banks
        
        _banks[next_index_]._name = name_; // Set the name
        _banks[next_index_]._parts = parts_; // Set the parts
        _banks[next_index_]._filter = filter_; // Set the filter

    }


    /// @dev get a specific bank
    /// @return Bank struct
    /// @param index_ the index of the bank in _banks
    function getBank(uint index_) public view returns(Bank memory){
        return _banks[index_];
    }


    /// @dev get array of added banks
    /// @return array of Bank structs
    function getBanks() public view returns(Bank[] memory){
        
        uint count = getBankCount(); // Get the bank count

        Bank[] memory banks_ = new Bank[](count); // Create a new array of banks with the correct length

        for(uint i = 0; i < count; i++) // Copy the banks to the new array
            banks_[i] = _banks[i];

        return banks_;

    }


    /// @dev get the cuurent count of banks
    /// @return uint the count
    function getBankCount() public view returns(uint) {

        uint count_; // Init the count
        for(uint i = 0; i < _banks.length; i++) // Loop through the banks
            if(bytes(_banks[i]._name).length > 0) // If the name is not empty
                count_++; // Increment the count

        return count_;
    }






    /////////////////////////////
    /// POOLS
    /////////////////////////////


    /// @dev check if a pool exists
    /// @return bool if the pool exists
    /// @param pool_id_ the id of the pool
    function poolExists(uint pool_id_) public view returns(bool) {
        return _exists(pool_id_);
    }


    /// @dev get the filter for a given pool
    /// @return string the name of the filter
    function getPoolFilter(uint pool_id_) public view returns(string memory){
        return _banks[_pool_banks[pool_id_]]._filter;
    }


    /// @dev get the bank index for a given pool
    /// @return uint the index of the bank
    /// @param pool_id_ the id of the pool
    function getPoolBankIndex(uint pool_id_) public view returns(uint){
        return _pool_banks[pool_id_];
    }


    /// @dev get the Bank struct for a given pool
    /// @return Bank the bank struct
    /// @param pool_id_ the id of the pool
    function getPoolBank(uint pool_id_) public view returns(LWMempools.Bank memory){
        return getBank(getPoolBankIndex(pool_id_));
    }


    /// @dev get the part index for a given pool
    /// @return uint the index of the part
    /// @param pool_id_ the id of the pool
    function getPoolPartIndex(uint pool_id_) public view returns(uint){
        Bank memory bank_ = getPoolBank(pool_id_);
        string memory seed_part_ = getPoolSeed(pool_id_, 'part');
        return Rando.number(seed_part_, 0, bank_._parts.length-1);
    }


    /// @dev get the part for a given pool
    /// @return string the part
    /// @param pool_id_ the id of the pool
    function getPoolPart(uint pool_id_) public view returns(string memory){
        LWMempools.Bank memory bank_ = getPoolBank(pool_id_);
        return bank_._parts[getPoolPartIndex(pool_id_)];
    }


    /// @dev get the seed for a given pool
    /// @return string the seed
    /// @param pool_id_ the id of the pool
    /// @param append_ a string to append to the seed
    function getPoolSeed(uint pool_id_, string memory append_) public view returns(string memory){
        return string(abi.encodePacked(Strings.toString(_pool_timestamps[pool_id_]), Strings.toString(pool_id_), append_));
    }





    /////////////////////////////
    /// EPOCHS
    /////////////////////////////

    /// @dev get epoch length for a given pool in seconds
    /// @return uint the epoch length
    /// @param pool_id_ the id of the pool
    function getEpochLength(uint pool_id_) public view returns(uint){
        return Rando.number(getPoolSeed(pool_id_, 'epoch'), 1, 6)*7776000;
    }


    /// @dev get the current epoch for a given pool
    /// @return uint the epoch number
    /// @param pool_id_ the id of the pool
    function getCurrentEpoch(uint pool_id_) public view returns(uint){
        uint epoch = (((block.timestamp - _pool_timestamps[pool_id_]) / getEpochLength(pool_id_))+1);
        return epoch;
    }


    /// @dev get the fixed epoch for a given pool
    /// @return uint the epoch number - 0 means the pool epoch is not fixed
    /// @param pool_id_ the id of the pool
    function getFixedEpoch(uint pool_id_) public view returns(uint){
        return _pool_fixed_epochs[pool_id_];
    }


    /// @dev allow pool owner to fix the epoch for a given pool
    /// @param pool_id_ the id of the pool
    /// @param epoch_ the epoch to fix the pool to
    function fixEpoch(uint pool_id_, uint epoch_) public {
        require(ownerOf(pool_id_) == msg.sender, 'NOT_OWNER');
        require(getCurrentEpoch(pool_id_) <= epoch_, 'EPOCH_NOT_REACHED');
        _pool_fixed_epochs[pool_id_] = epoch_;
    }





    /// @dev get the generated image for a pool
    /// @return string the image
    /// @param pool_id_ the id of the pool
    function getPoolImage(uint pool_id_, bool encode_) public view returns(string memory){

        if(!poolExists(pool_id_)) // If the pool doesn't exist...
            return ''; // ...return empty string

        uint epoch_ = _pool_fixed_epochs[pool_id_]; // Get the fixed epoch
        if(epoch_ < 1) // Fixed epoch is 0, go to current epoch
            epoch_ = getCurrentEpoch(pool_id_); // Get the current epoch

        return _generator.generateImage(pool_id_, epoch_, encode_); // Get the image based on id and epoch

    }


    /// @dev get the metadat data uri for a given pool
    /// @return string the uri
    /// @param pool_id_ the id of the pool
    function tokenURI(uint pool_id_) override public view returns(string memory) {
        return _meta.getJSON(pool_id_, true);
    }


    //////////////////////////
    /// BALANCE
    //////////////////////////

    function withdrawAllTo(address to_) public payable onlyOwner {
      require(payable(to_).send(address(this).balance));
    }

}


/// @title Mempools meta
/// @author troels_a
/// @notice This contract handles the metadata for the mempools contract
contract LWMempools_Meta {

    using Strings for string;

    LWMempools public _pools; // The mempools contract

    constructor() {
        _pools = LWMempools(msg.sender); // Set the mempools contract
    }
    
    /// @dev get the metadata for a given pool
    /// @return string the metadata
    /// @param pool_id_ the id of the pool
    function getJSON(uint pool_id_, bool encode_) public view returns(string memory) {
        
        if(!_pools.poolExists(pool_id_)) // If the pool doesn't exist...
            return ''; // ...return empty string

        LWMempools.Bank memory bank_ = _pools.getPoolBank(pool_id_); // Get the bank for the pool

        // Create the JSON string
        bytes memory json_ = abi.encodePacked(
            '{',
                '"name":"mempool #',Strings.toString(pool_id_),'",',
                '"image": "', _pools.getPoolImage(pool_id_, true),'",',
                '"description": "latent.works",',
                '"attributes": [',
                    '{"trait_type": "bank", "value": "',bank_._name,'"},',
                    '{"trait_type": "bank_index", "value": "',bank_._name,'-',Strings.toString(_pools.getPoolPartIndex(pool_id_)),'"},',
                    '{"trait_type": "epoch", "value": ', Strings.toString(_pools.getCurrentEpoch(pool_id_)), '},',
                    '{"trait_type": "fixed_epoch", "value": ', Strings.toString(_pools.getFixedEpoch(pool_id_)), '},',
                    '{"trait_type": "epoch_length", "value": ', Strings.toString(_pools.getEpochLength(pool_id_)), '}',
                ']',
            '}'
        );

        if(encode_) // If encode_ is true
            return string(abi.encodePacked('data:application/json;base64,', Base64.encode(json_))); // ...encode the json string
        return string(json_); // return the raw JSON

    }


}


/// @title Mempools generator
/// @author troels_a
/// @notice Generates images for mempools
contract LWMempools_Gen {
    
    struct Pool {
        uint id;
        bytes items;
        string base;
        string seed;
        string seed1;
        string seed2;
        string filter;
        uint epoch;
        string shape1_width;
        string shape1_height;
        string shape2_width;
        string shape2_height;
        string shape3_width;
        string shape3_height;
    }

    LWMempools public immutable _pools; // The mempools contract

    constructor(){
        _pools = LWMempools(msg.sender); // Set the mempools contract
    }

    /// @dev generate an image for a given pool
    /// @return string the image
    /// @param pool_id_ the id of the pool
    /// @param epoch_ the epoch to generate the image for
    /// @param encode_ bool indicating if the image should be encoded as base64 or not
    function generateImage(uint pool_id_, uint epoch_, bool encode_) public view returns(string memory){

        if(!_pools.poolExists(pool_id_)) // If the pool doesn't exist...
            return ''; // ...return empty string

        Pool memory pool_; // Create a pool struct
        pool_.epoch = _pools.getCurrentEpoch(pool_id_); // Get the current epoch for pool

        if(epoch_ > pool_.epoch) // If the epoch input is higher than the current epoch...
            return ''; // ...return empty string
        
        pool_.id = pool_id_; // Set the pool id
        pool_.seed = _pools.getPoolSeed(pool_id_, ''); // Get the main seed for this pool
        pool_.base = _pools.getPoolPart(pool_id_); // Get the base part for this pool
        pool_.filter = _pools.getPoolFilter(pool_id_); // Get the filter for this pool


        /**
         * Create the shapes for each pool epoch
         */

        uint i;
        while(i < pool_.epoch){
            pool_.seed1 =_pools.getPoolSeed(pool_id_, string(abi.encodePacked('1x', Strings.toString(i))));
            pool_.seed2 = _pools.getPoolSeed(pool_id_, string(abi.encodePacked('1y', Strings.toString(i))));
            pool_.items = abi.encodePacked(
                pool_.items,
                '<use href="#shape',Strings.toString(Rando.number(pool_.seed1, 1, 3)),'" x="',Strings.toString(Rando.number(pool_.seed1, 1, 990)),'" y="',Strings.toString(Rando.number(pool_.seed2, 1, 900)),'" fill="url(#base',Strings.toString(Rando.number(pool_.seed2, 1, 5)),')"/>'
            );

            ++i;
        }

        i = 0;
        while(i < pool_.epoch){
            pool_.seed1 = _pools.getPoolSeed(pool_id_, string(abi.encodePacked('2x', Strings.toString(i))));
            pool_.seed2 = _pools.getPoolSeed(pool_id_, string(abi.encodePacked('2y', Strings.toString(i))));
            pool_.items = abi.encodePacked(
                pool_.items,
                '<use href="#shape',Strings.toString(Rando.number(pool_.seed1, 1, 3)),'" x="',Strings.toString(Rando.number(pool_.seed1, 1, 990)),'" y="',Strings.toString(Rando.number(pool_.seed2, 1, 900)),'" fill="url(#base',Strings.toString(Rando.number(pool_.seed2, 1, 5)),')"/>'
            );

            ++i;
        }

        i = 0;
        while(i < pool_.epoch){
            pool_.seed1 = _pools.getPoolSeed(pool_id_, string(abi.encodePacked('3x', Strings.toString(i))));
            pool_.seed2 = _pools.getPoolSeed(pool_id_, string(abi.encodePacked('3y', Strings.toString(i))));
            pool_.items = abi.encodePacked(
                pool_.items,
                '<use href="#shape',Strings.toString(Rando.number(pool_.seed1, 1, 3)),'" x="',Strings.toString(Rando.number(pool_.seed1, 1, 990)),'" y="',Strings.toString(Rando.number(pool_.seed2, 1, 900)),'" fill="url(#base',Strings.toString(Rando.number(pool_.seed2, 1, 5)),')"/>'
            );

            ++i;
        }

        /**
         * Create the shape dimensions
         */
        pool_.shape1_width = Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'shape1width'), 1, 50));
        pool_.shape1_height = Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'shape1height'), 20, 300));
        pool_.shape2_width = Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'shape2width'), 20, 30));
        pool_.shape2_height = Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'shape2height'), 20, 200));
        pool_.shape3_width = Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'shape2height'), 10, 30));
        pool_.shape3_height = Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'shape3width'), 20, 100));

        /**
         * Create the svg
         */
        bytes memory svg_ = abi.encodePacked(
            '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" preserveAspectRatio="xMinYMin meet">',
                '<defs>',
                    '<circle cx="500" cy="500" r="500" id="bg"/>',
                    '<filter id="none"><feColorMatrix in="SourceGraphic" type="saturate" values="0"/></filter>',
                    '<filter id="bw"><feColorMatrix type="matrix" values="0.491 1.650 0.166 0.000 -0.464 0.491 1.650 0.166 0.000 -0.464 0.491 1.650 0.166 0.000 -0.464 0.000 0.000 0.000 1.000 0.000"></feColorMatrix></filter>',
                    '<filter id="s1"><feColorMatrix in="SourceGraphic" type="saturate" values="2"/></filter>',
                    '<filter id="s2"><feColorMatrix in="SourceGraphic" type="saturate" values="4"/></filter>',
                    '<filter id="s3"><feColorMatrix in="SourceGraphic" type="saturate" values="6"/></filter>',
                    '<filter id="s4"><feColorMatrix in="SourceGraphic" type="saturate" values="8"/></filter>',
                    '<filter id="s5"><feColorMatrix in="SourceGraphic" type="saturate" values="10"/></filter>',
                    '<filter id="s6"><feColorMatrix in="SourceGraphic" type="saturate" values="12"/></filter>',
                    '<filter id="s7"><feColorMatrix in="SourceGraphic" type="saturate" values="14"/></filter>',
                    '<filter id="s8"><feColorMatrix in="SourceGraphic" type="saturate" values="16"/></filter>',
                    '<filter id="s9"><feColorMatrix in="SourceGraphic" type="saturate" values="18"/></filter>',
                    '<filter id="s10"><feColorMatrix in="SourceGraphic" type="saturate" values="20"/></filter>',
                    '<filter id="r1"><feColorMatrix in="SourceGraphic" type="hueRotate" values="20"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r2"><feColorMatrix in="SourceGraphic" type="hueRotate" values="40"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r3"><feColorMatrix in="SourceGraphic" type="hueRotate" values="60"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r4"><feColorMatrix in="SourceGraphic" type="hueRotate" values="80"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r5"><feColorMatrix in="SourceGraphic" type="hueRotate" values="100"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r6"><feColorMatrix in="SourceGraphic" type="hueRotate" values="120"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r7"><feColorMatrix in="SourceGraphic" type="hueRotate" values="140"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r8"><feColorMatrix in="SourceGraphic" type="hueRotate" values="160"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r9"><feColorMatrix in="SourceGraphic" type="hueRotate" values="180"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="r10"><feColorMatrix in="SourceGraphic" type="hueRotate" values="200"></feColorMatrix><feColorMatrix in="SourceGraphic" type="saturate" values="3"/></filter>',
                    '<filter id="internal-noise"><feTurbulence type="fractalNoise" baseFrequency="0.55" numOctaves="10" stitchTiles="stitch" /></filter>',
                    '<filter id="internal-blur" x="0" y="0"><feGaussianBlur in="SourceGraphic" stdDeviation="4" /></filter>',
                    '<clipPath id="clip"><use href="#bg"/></clipPath>',
                    '<rect id="shape1" width="',pool_.shape1_width,'" height="',pool_.shape1_height,'"/>',
                    '<rect id="shape2" width="30" height="',pool_.shape2_height,'"/>',
                    '<rect id="shape3" width="20" height="',pool_.shape3_height,'"/>',
                    '<image id="base" width="1000" height="1000" href="',pool_.base,'"/>',
                    '<pattern id="base1" x="0" y="0" width="1" height="1" viewBox="0 0 200 200"><use href="#base"/></pattern>',
                    '<pattern id="base2" x="0" y="0" width="1" height="1" viewBox="200 200 200 200" preserveAspectRatio="xMidYMid slice"><use href="#base"/></pattern>',
                    '<pattern id="base3" x="0" y="0" width="1" height="1" viewBox="400 400 200 200" preserveAspectRatio="xMidYMid slice"><use href="#base"/></pattern>',
                    '<pattern id="base4" x="0" y="0" width="1" height="1" viewBox="600 600 200 200" preserveAspectRatio="xMidYMid slice"><use href="#base"/></pattern>',
                    '<pattern id="base5" x="0" y="0" width="1" height="1" viewBox="800 800 200 200" preserveAspectRatio="xMidYMid slice"><use href="#base"/></pattern>',
                '</defs>',
                '<g filter="url(#',pool_.filter,')">',
                    '<rect width="1000" height="1000" fill="black"/>',
                    '<rect width="1000" height="1000" fill-opacity="0.5" fill="url(#base',Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'bg0'), 2, 5)),')" filter="url(#bw)"/>',
                    '<g clip-path="url(#clip)">',
                        '<use href="#bg" fill-opacity="1" fill="url(#base',Strings.toString(Rando.number(_pools.getPoolSeed(pool_.id, 'bg1'), 2, 5)),')"/>',
                    '<g filter="url(#internal-blur)" transform="translate(0, -100)" id="pool">',
                    pool_.items,
                    '</g>',
                    '<use href="#pool" transform="scale(.5, 0.5)"/>',
                    '<use href="#pool" transform="scale(.5, 0.5) translate(',Strings.toString(Rando.number(pool_.seed, 0, 100)),', 1000)"/>'
                    '<use href="#pool" transform="scale(0.8, 0.8) translate(1000, 0)"/>'
                    '<use href="#pool"  transform="scale(1, 1.5) translate(',Strings.toString(Rando.number(pool_.seed, 0, 500)),', ',Strings.toString(Rando.number(pool_.seed, 0, 500)),')"/>',
                    '</g>',
                    '<g filter="url(#bw)">',
                        '<rect width="1000" height="1000" fill="white" filter="url(#internal-noise)" opacity="0.15"/>',
                    '</g>',
                '</g>',
            '</svg>'
        );

        if(encode_) // encode the svg
            return string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(svg_)));

        // return the raw svg
        return string(svg_);

    }


}
// File: sol/LTNT.sol



// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./LTNTFont.sol";
import "base64-sol/base64.sol";


//////////////////////////////////
//
//
// LTNT
// Passport NFTs for Latent Works
//
//
//////////////////////////////////


/// @title LTNT
/// @author troels_a

contract LTNT is ERC721, Ownable {
    
    struct Param {
        uint _uint;
        address _address;
        string _string;
        bool _bool;
    }

    struct IssuerInfo {
        string name;
        string image;
    }

    struct Issuer {
        address location;
        Param param;
    }

    event Issued(uint indexed id, address indexed to);
    event Stamped(uint indexed id, address indexed stamper);

    LTNT_Meta private _ltnt_meta;

    address[] private _issuers; ///@dev array of addresses registered as issuers
    mapping(uint => mapping(address => bool)) private _stamps; ///@dev (ltnt => (issuer => is stamped?))
    mapping(uint => mapping(address => Param)) private _params; ///@dev (ltnt => (issuer => stamp parameters));
    mapping(uint => Issuer) private _issuer_for_id; ///@dev (ltnt => issuer) - the Issuer for a given LTNT
    
    uint private _ids; ///@dev LTNT _id counter

    /// @dev pass address of onchain fonts to the constructor
    constructor(address regular_, address italic_) ERC721("Latents", "LTNT"){

        LTNT_Meta ltnt_meta_ = new LTNT_Meta(address(this), regular_, italic_);
        _ltnt_meta = LTNT_Meta(address(ltnt_meta_));

    }




    /// @notice Require a given address to be a registered issuer
    /// @param caller_ the address to check for issuer privilegies
    function _reqOnlyIssuer(address caller_) private view {
        require(isIssuer(caller_), 'ONLY_ISSUER');
    }



    /// @notice Issue a token to the address
    /// @param to_ the address to issue the LTNT to
    /// @param param_ a Param struct of parameters associated with the token
    /// @param stamp_ boolean determining wether the newly issued LTNT should be stamped by the issuer
    /// @return uint the id of the newly issued LTNT
    function issueTo(address to_, Param memory param_, bool stamp_) public returns(uint){ _reqOnlyIssuer(msg.sender);
        
        _ids++;
        _safeMint(to_, _ids);
        _issuer_for_id[_ids] = Issuer(msg.sender, param_);

        emit Issued(_ids, to_);
        
        if(stamp_)
            _stamp(_ids, msg.sender, param_);

        return _ids;

    }



    /// @dev Lets a registered issuer stamp a given LTNT
    /// @param id_ the ID of the LTNT to stamp
    /// @param param_ a Param struct with any associated params
    function stamp(uint id_, Param memory param_) public { _reqOnlyIssuer(msg.sender);
        _stamp(id_, msg.sender, param_);
    }



    /// @dev internal stamping mechanism
    /// @param id_ the id of the LTNT to stamp
    /// @param issuer_ the address of the issuer stamping the LTNT
    /// @param param_ a Param struct with stamp parameters
    function _stamp(uint id_, address issuer_, Param memory param_) private {
        _stamps[id_][issuer_] = true;
        _params[id_][issuer_] = param_;
        emit Stamped(_ids, issuer_);
    }

    /// @dev checks if a given id_ is stamped by address_
    /// @param id_ the ID of the LTNT to check
    /// @param address_ the address of the stamper
    /// @return bool indicating wether LTNT is stamped
    function hasStamp(uint id_, address address_) public view returns(bool){
        return _stamps[id_][address_];
    }

    /// @dev get params for a given stamp on a LTNT
    /// @param id_ the id of the LTNT
    /// @param address_ the address of the stamper
    /// @return Param the param to return
    function getStampParams(uint id_, address address_) public view returns(Param memory){
        return _params[id_][address_];
    }

    /// @dev Get the addresses of the issuers that have stamped a given LTNT
    /// @param id_ the ID of the LTNT to fetch stamps for
    /// @return addresses an array of issuer addresses that have stamped the LTNT
    function getStamps(uint id_) public view returns(address[] memory){
        
        // First count the stamps
        uint count;
        for(uint i = 0; i < _issuers.length; i++){
            if(_stamps[id_][_issuers[i]])
                ++count;
        }

        // Init a stamps_ array with the right length from count_
        address[] memory stamps_ = new address[](count);

        // Loop over the issuers and save stampers in stamps_
        count = 0;
        for(uint i = 0; i < _issuers.length; i++){
            if(_stamps[id_][_issuers[i]]){
                stamps_[count] = _issuers[i];
                ++count;
            }
        }

        return stamps_;

    }

    /// @dev list all issuer addresses
    /// @return addresses list of all issuers
    function getIssuers() public view returns(address[] memory){
        return _issuers;
    }

    /// @dev get the issuer of a LTNT
    function getIssuerFor(uint id_) public view returns(LTNT.Issuer memory){
        return _issuer_for_id[id_];
    }

    /// @dev set the meta contract
    /// @param address_ the address of the meta contract
    function setMetaContract(address address_) public onlyOwner {
        _ltnt_meta = LTNT_Meta(address_);
    }

    /// @dev get the meta contract
    /// @return LTNT_Meta the meta contract currently in use
    function getMetaContract() public view returns(LTNT_Meta) {
        return _ltnt_meta;
    }

    /// @notice register an issuer address
    /// @param address_ the address of the issuer to add
    function addIssuer(address address_) public onlyOwner {
        _issuers.push(address_);
    }
    

    /// @notice determine if an address is a LW project
    /// @param address_ the address of the issuer
    /// @return bool indicating wether the address is an issuer or not
    function isIssuer(address address_) public view returns(bool){
        for(uint i = 0; i < _issuers.length; i++) {
            if(_issuers[i] == address_)
                return true;
        }
        return false;
    }


    /// @notice the ERC721 tokenURI for a given LTNT
    /// @param id_ the id of the LTNT
    /// @return json_ base64 encoded data URI containing the JSON metadata
    function tokenURI(uint id_) public view override returns(string memory json_){
        return _ltnt_meta.getJSON(id_, true);
    }


}


/// @title A title that should describe the contract/interface
/// @author troels_a
/// @dev Handles meta for this contract
contract LTNT_Meta {

    LTNT public immutable _ltnt;

    ///@dev latent fonts
    XanhMonoRegularLatin public immutable _xanh_regular;
    XanhMonoItalicLatin public immutable _xanh_italic;

    constructor(address ltnt_, address regular_, address italic_){

        _ltnt = LTNT(ltnt_);
        _xanh_regular = XanhMonoRegularLatin(regular_);
        _xanh_italic = XanhMonoItalicLatin(italic_);

    }

    /// @notice return image string for id_
    /// @param id_ the id of the LTNT to retrieve the image for
    /// @param encode_ encode output as base64 uri
    /// @return string the image string
    function getImage(uint id_, bool encode_) public view returns(string memory){

        LTNT.Issuer memory issuer_for_id_ = _ltnt.getIssuerFor(id_);
        LTNT.IssuerInfo memory issuer_info_ = LTNTIssuer(issuer_for_id_.location).issuerInfo(id_, issuer_for_id_.param);
        LTNT.IssuerInfo memory stamper_;
        LTNT.Param memory stamp_param_;
        address[] memory issuers_ = _ltnt.getIssuers();

        bytes memory stamps_svg_;
        string memory delay_;
        uint stamp_count_;
        bool has_stamp_;

        for(uint i = 0; i < issuers_.length; i++) {

            delay_ = Strings.toString(i*150);
            stamp_param_ = _ltnt.getStampParams(id_,issuers_[i]);
            stamper_ = LTNTIssuer(issuers_[i]).issuerInfo(id_, stamp_param_);
            has_stamp_ = _ltnt.hasStamp(id_, issuers_[i]);

            stamps_svg_ = abi.encodePacked(stamps_svg_, '<text class="txt italic" fill-opacity="0" y="',Strings.toString(25*i),'">',stamper_.name,' <animate attributeName="fill-opacity" values="0;',has_stamp_ ? '1' : '0.4','" dur="500ms" repeatCount="1" begin="',delay_,'ms" fill="freeze"/></text>');
            if(has_stamp_)
                ++stamp_count_;

        }

        bytes memory image_;
        image_ = abi.encodePacked(
            '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 1000" preserveAspectRatio="xMinYMin meet">',
                '<defs><style>', _xanh_regular.fontFace(), _xanh_italic.fontFace(),' .txt {font-family: "Xanh Mono"; font-size:20px; font-weight: normal; letter-spacing: 0.01em; fill: white;} .italic {font-style: italic;} .large {font-size: 55px;} .small {font-size: 12px;}</style><rect ry="30" rx="30" id="bg" height="1000" width="600" fill="black"/></defs>',
                '<use href="#bg"/>',
                '<g transform="translate(65, 980) rotate(-90)">',
                    '<text class="txt large italic">Latent Works</text>',
                '</g>',
                '<g transform="translate(537, 21) rotate(90)">',
                    '<text class="txt large italic">LTNT #',Strings.toString(id_),'</text>',
                '</g>',
                '<g transform="translate(517, 22) rotate(90)">',
                    '<text class="txt small">Issued by ',issuer_info_.name,unicode' · ', Strings.toString(stamp_count_) , stamp_count_ > 1 ? ' stamps' : ' stamp', '</text>',
                '</g>'
                '<g transform="translate(25, 25)">',
                    '<image width="300" href="', issuer_info_.image, '"/>',
                '</g>',
                '<g transform="translate(343, 41)">',
                    stamps_svg_,
                '</g>',
                '<g transform="translate(509, 980)">',
                    '<text class="txt small">latent.works</text>',
                '</g>',
            '</svg>'
        );

        if(encode_)
            image_ = abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(image_));

        return string(image_);

    }


    /// @notice return base64 encoded JSON metadata for id_
    /// @param id_ the id of the LTNT to retrieve the image for
    /// @param encode_ encode output as base64 uri
    /// @return string the image string
    function getJSON(uint id_, bool encode_) public view returns(string memory) {
        
        LTNT.Issuer memory issuer_for_id_ = _ltnt.getIssuerFor(id_);
        LTNT.IssuerInfo memory issuer_info_ = LTNTIssuer(issuer_for_id_.location).issuerInfo(id_, issuer_for_id_.param);

        bytes memory json_ = abi.encodePacked(
            '{',
                '"name":"LTNT #',Strings.toString(id_),'", ',
                '"image": "', getImage(id_, true),'", ',
                '"description": "latent.works",',
                '"attributes": [',
                    '{"trait_type": "Stamps", "value": ',Strings.toString(_ltnt.getStamps(id_).length),'},',
                    '{"trait_type": "Issuer", "value": "', issuer_info_.name, '"}',
                ']',
            '}'
        );

        if(encode_)
            json_ = abi.encodePacked('data:application/json;base64,', Base64.encode(json_));
        
        return string(json_);

    }


}


/// @title LTNTIssuer
/// @author troels_a
/// @dev LTNTIssuers implement this contract and use issuerInfo to pass info to LTNT main contract
abstract contract LTNTIssuer {
    function issuerInfo(uint id_, LTNT.Param memory param_) external virtual view returns(LTNT.IssuerInfo memory);
}
// File: sol/lib/Rando.sol



// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

library Rando {

    function number(string memory seed, uint min, uint max) internal pure returns (uint) {
      if (max <= min) return min;
        return (uint256(keccak256(abi.encodePacked(seed))) % (max - min)) + min;
    }

}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

// File: sol/LTNTFont.sol



// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

contract XanhMonoRegularLatin {
    function fontFace() public pure returns(string memory){
        return "@font-face { font-family: 'Xanh Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(data:font/woff2;base64,d09GMgABAAAAACl0AA4AAAAAVSAAACkaAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoEwG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3Ryklz3wlrcX+eor/0fF7twlWe6OlvCo5VENe/Bjuu81FTjbFbllVoAAA==) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }";
    }
}

contract XanhMonoItalicLatin {
    function fontFace() public pure returns(string memory){
        return "@font-face { font-family: 'Xanh Mono'; font-style: italic; font-weight: 400; font-display: swap; src: url(data:font/woff2;base64,d09GMgABAAAAADAoAA4AAAAAXeAAAC/PAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoEwGx4cgiwGYACEXhEICoGXAPkpC4QKAAE2AiQDiAIEIAWELAeHeBsITBVsXIX3OAA53MKIqCYtL4qyxelk/39KoGMMju2gVoEiITCOZnroYNvNjp6ZdCYstu/rQVKZijUPuR+QyVsgQZ6M4i665wqof5RBmSY7QyLzWvyosfyf1KWdB4smLKx73REa+ySXKFiLrJ69B6IguEQxqzggldhIIFAACDM8P7feyCEsWDSLYmNjDWtYFYwxqj4jRiupfQjaKF6UEcGJkViFcWZcG31R/FPc6P2dKUw5g4hib+ZMj/YwrzRF0nRKLeDfAfwB4oG4d/rf3cdvUZ2PDRSFa4usIZRQPKZwGneB9hsQoBP8/9MlrDCfaFJTJ8dVfMw6dtbt1EvkNT9hak2b2nR8+2w0kBEFp1/4MCwcAIR4CYq59V8VDAvrti4IA4PVkr7e/W86y77+P7kZpETeMSkGMmRL75K/EjOlkvd49y39Kl8JOIG0AqS3rT0FwRMU6Nv9/3X6rk+f0K/ljfnszdSyx460LNZ9Uizp2Y4jOyeyHHRIYVn2Jzskf7TLvCWdPk4l028d+wPQVCAeCZapwzDmdAMcxrVb4flv+c7OzfvvnMyndZnSFAchl7pComR2Z1Le3wyl9CUKV1rTGIGQUdTi6QqJ9AhnMFuat0LgK50hygTjJgtS3qWaDma5zoWJMdbvOkII78r7st/6C7xX+RclYhQT5gaM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KUpdgp6KU++AnMUKjLVJ3pNy6ny9Of2G7jcLINl5myJ+U7+d8NEC6m0sWzH9XyJMLBw8AiISMgoqGiS0DEwsbBxcPEgw3fQex98lAglCd1mUVZjW+W4WRBiYGSKl6BClQwm6JLtMsTihJO+s9uwPTba5LAjoo0RmTUi1O+Q2Kxlhi8TQXrltb2YWBg+A1nDnBgcR5zZZppnrvn6VPr5nKlHEmlkkUcRZVRJS7oFrAbcct9tdzwYO1f9efN7w9tCn28X36RB0tx29Xy4vyF0tT50ZKOW0bZ2tKs97etAhzpaNya/9K3MynRAbGu9aWzo7Fmr6GdohUqLZNcamm5s+OXM7mj4D7nEYiP8MrjQmN3a8Br1yzxPJcKkREBEaAWEekBAiVAfQmgFBASEehnLwZZsXmtUMZQKhuXyxjkbHZVFWHPhuycD7VS0+9xIc5St0YND8kdrbrz51y/jBAr9fFeG7KlDOnjCXFxnw/O1s9Fb1xkCAA==) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }";
    }
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: 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 overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

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

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not 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 {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: 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 || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

// File: base64-sol/base64.sol



// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0;

/// @title Base64
/// @author Brecht Devos - <brecht@loopring.org>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
    string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    bytes  internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
                                            hex"00000000000000000000003e0000003f3435363738393a3b3c3d000000000000"
                                            hex"00000102030405060708090a0b0c0d0e0f101112131415161718190000000000"
                                            hex"001a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132330000000000";

    function encode(bytes memory data) internal pure returns (string memory) {
        if (data.length == 0) return '';

        // load the table into memory
        string memory table = TABLE_ENCODE;

        // multiply by 4/3 rounded up
        uint256 encodedLen = 4 * ((data.length + 2) / 3);

        // add some extra buffer at the end required for the writing
        string memory result = new string(encodedLen + 32);

        assembly {
            // set the actual output length
            mstore(result, encodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 3 bytes at a time
            for {} lt(dataPtr, endPtr) {}
            {
                // read 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // write 4 characters
                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(shr( 6, input), 0x3F))))
                resultPtr := add(resultPtr, 1)
                mstore8(resultPtr, mload(add(tablePtr, and(        input,  0x3F))))
                resultPtr := add(resultPtr, 1)
            }

            // padding with '='
            switch mod(mload(data), 3)
            case 1 { mstore(sub(resultPtr, 2), shl(240, 0x3d3d)) }
            case 2 { mstore(sub(resultPtr, 1), shl(248, 0x3d)) }
        }

        return result;
    }

    function decode(string memory _data) internal pure returns (bytes memory) {
        bytes memory data = bytes(_data);

        if (data.length == 0) return new bytes(0);
        require(data.length % 4 == 0, "invalid base64 decoder input");

        // load the table into memory
        bytes memory table = TABLE_DECODE;

        // every 4 characters represent 3 bytes
        uint256 decodedLen = (data.length / 4) * 3;

        // add some extra buffer at the end required for the writing
        bytes memory result = new bytes(decodedLen + 32);

        assembly {
            // padding with '='
            let lastBytes := mload(add(data, mload(data)))
            if eq(and(lastBytes, 0xFF), 0x3d) {
                decodedLen := sub(decodedLen, 1)
                if eq(and(lastBytes, 0xFFFF), 0x3d3d) {
                    decodedLen := sub(decodedLen, 1)
                }
            }

            // set the actual output length
            mstore(result, decodedLen)

            // prepare the lookup table
            let tablePtr := add(table, 1)

            // input ptr
            let dataPtr := data
            let endPtr := add(dataPtr, mload(data))

            // result ptr, jump over length
            let resultPtr := add(result, 32)

            // run over the input, 4 characters at a time
            for {} lt(dataPtr, endPtr) {}
            {
               // read 4 characters
               dataPtr := add(dataPtr, 4)
               let input := mload(dataPtr)

               // write 3 bytes
               let output := add(
                   add(
                       shl(18, and(mload(add(tablePtr, and(shr(24, input), 0xFF))), 0xFF)),
                       shl(12, and(mload(add(tablePtr, and(shr(16, input), 0xFF))), 0xFF))),
                   add(
                       shl( 6, and(mload(add(tablePtr, and(shr( 8, input), 0xFF))), 0xFF)),
                               and(mload(add(tablePtr, and(        input , 0xFF))), 0xFF)
                    )
                )
                mstore(resultPtr, shl(232, output))
                resultPtr := add(resultPtr, 3)
            }
        }

        return result;
    }
}

// File: @openzeppelin/contracts/access/Ownable.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev 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 {
        _transferOwnership(address(0));
    }

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

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

// File: @openzeppelin/contracts/utils/Address.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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 Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol



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

pragma solidity ^0.8.0;

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

// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol



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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

// File: @openzeppelin/contracts/utils/Strings.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

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: @openzeppelin/contracts/utils/Context.sol



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

pragma solidity ^0.8.0;

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

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

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol



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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol



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

pragma solidity ^0.8.0;

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